diff options
author | tragait <rahul.tyagi@est.tech> | 2020-02-14 17:48:50 +0000 |
---|---|---|
committer | tragait <rahul.tyagi@est.tech> | 2020-02-19 10:10:18 +0000 |
commit | 0b6f485d1ba5007056eb71b779bc844b4948de36 (patch) | |
tree | df9a6d2a534e856d331891f156af09b542a34518 /mso-catalog-db/src/main/java | |
parent | 493477ef59ce12d082683f188e0253fe2d34bdff (diff) |
SO API extenstion to retrieve all PNF workflow
This commit implements SO request handler API
onap/so/infra/workflowSpecifications/v[x]/pnfWorkFlows.
It is used to get all the pnf workflows exist in
catalogdb.
Issue-ID: SO-2660
Change-Id: Ieeca8a6afef917b6e3ba927d38ed5509dcaf253c
Signed-off-by: tragait <rahul.tyagi@est.tech>
Diffstat (limited to 'mso-catalog-db/src/main/java')
-rw-r--r-- | mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java | 12 | ||||
-rw-r--r-- | mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/WorkflowRepository.java | 6 |
2 files changed, 14 insertions, 4 deletions
diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java index cf066f9721..26c33941ed 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/client/CatalogDbClient.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -158,6 +158,7 @@ public class CatalogDbClient { protected static final String HOMING_INSTANCE = "/homingInstance"; protected static final String ARTIFACT_UUID = "artifactUUID"; protected static final String SOURCE = "source"; + protected static final String RESOURCE_TARGET = "resource_target"; private static final String TARGET_ENTITY = "SO:CatalogDB"; private static final String ASTERISK = "*"; @@ -209,6 +210,7 @@ public class CatalogDbClient { private String findVnfResourceCustomizationByModelUuid = "/findVnfResourceCustomizationByModelUuid"; private String findBBNameSelectionReferenceByControllerActorAndScopeAndAction = "/findBBNameSelectionReferenceByControllerActorAndScopeAndAction"; + private String findWorkflowByResourceTarget = "/findByResourceTarget"; private String serviceURI; private String vfModuleURI; @@ -348,6 +350,7 @@ public class CatalogDbClient { findWorkflowByVnfModelUUID = endpoint + WORKFLOW + SEARCH + findWorkflowByVnfModelUUID; findWorkflowByPnfModelUUID = endpoint + WORKFLOW + SEARCH + findWorkflowByPnfModelUUID; findWorkflowBySource = endpoint + WORKFLOW + SEARCH + findWorkflowBySource; + findWorkflowByResourceTarget = endpoint + WORKFLOW + SEARCH + findWorkflowByResourceTarget; findVnfResourceCustomizationByModelUuid = endpoint + VNF_RESOURCE_CUSTOMIZATION + SEARCH + findVnfResourceCustomizationByModelUuid; @@ -1084,6 +1087,11 @@ public class CatalogDbClient { getUri(UriBuilder.fromUri(findWorkflowBySource).queryParam(SOURCE, source).build().toString())); } + public List<Workflow> findWorkflowByResourceTarget(String resourceTarget) { + return this.getMultipleResources(workflowClient, getUri(UriBuilder.fromUri(findWorkflowByResourceTarget) + .queryParam(RESOURCE_TARGET, resourceTarget).build().toString())); + } + public String getEndpoint() { return endpoint; } diff --git a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/WorkflowRepository.java b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/WorkflowRepository.java index 91c6940e95..93ec54a2eb 100644 --- a/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/WorkflowRepository.java +++ b/mso-catalog-db/src/main/java/org/onap/so/db/catalog/data/repository/WorkflowRepository.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -33,6 +33,8 @@ public interface WorkflowRepository extends JpaRepository<Workflow, Integer> { List<Workflow> findBySource(String source); + List<Workflow> findByResourceTarget(String resourceTarget); + /** * Used to fetch the @{link Workflow} by the Model UUID. * |