From 7861185045a47e86ea34afb22038cce3ab4196b7 Mon Sep 17 00:00:00 2001 From: Jozsef Csongvai Date: Fri, 26 Nov 2021 15:31:40 -0500 Subject: Add REST client for Api-handler This enables calling api-handler from bpmn-infra Issue-ID: SO-3811 Signed-off-by: Jozsef Csongvai Change-Id: I59a6c7859505f9fca4729089914f43834ceb6323 --- .../src/test/resources/application-test.yaml | 4 +- .../so/client/orchestration/ApiHandlerClient.java | 73 +++++++++++++ .../orchestration/ApiHandlerClientException.java | 8 ++ .../orchestration/RestTemplateApiClientConfig.java | 23 ++++ .../client/orchestration/ApiHandlerClientTest.java | 121 +++++++++++++++++++++ 5 files changed, 228 insertions(+), 1 deletion(-) create mode 100644 bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/ApiHandlerClient.java create mode 100644 bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/ApiHandlerClientException.java create mode 100644 bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/RestTemplateApiClientConfig.java create mode 100644 bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/ApiHandlerClientTest.java diff --git a/bpmn/so-bpmn-building-blocks/src/test/resources/application-test.yaml b/bpmn/so-bpmn-building-blocks/src/test/resources/application-test.yaml index c36172c3bf..14640f4eec 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/resources/application-test.yaml +++ b/bpmn/so-bpmn-building-blocks/src/test/resources/application-test.yaml @@ -75,7 +75,9 @@ mso: requestDb: auth: Basic YnBlbDptc28tZGItMTUwNyE= endpoint: http://localhost:8081 - + apihandler: + endpoint: http://localhost:8080 + auth: Basic dGVzdDp0ZXN0Cg== async: core-pool-size: 50 max-pool-size: 50 diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/ApiHandlerClient.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/ApiHandlerClient.java new file mode 100644 index 0000000000..132e618ba5 --- /dev/null +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/ApiHandlerClient.java @@ -0,0 +1,73 @@ +package org.onap.so.client.orchestration; + +import org.onap.so.serviceinstancebeans.ServiceInstancesRequest; +import org.onap.so.serviceinstancebeans.ServiceInstancesResponse; +import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.MediaType; +import org.springframework.stereotype.Component; +import org.springframework.web.client.HttpStatusCodeException; +import org.springframework.web.client.RestClientException; +import org.springframework.web.client.RestTemplate; +import static org.onap.so.client.orchestration.RestTemplateApiClientConfig.REST_TEMPLATE_API_HANDLER; + +@Component +public class ApiHandlerClient { + + @Value("${mso.adapters.apihandler.serviceInstantiationEndpoint:/onap/so/infra/serviceInstantiation/v7/serviceInstances}") + private String serviceInstantiationEndpoint; + @Value("${mso.adapters.apihandler.endpoint}") + private String baseUri; + @Value("${mso.adapters.apihandler.auth}") + private String auth; + + private RestTemplate restTemplate; + + public ApiHandlerClient(@Qualifier(REST_TEMPLATE_API_HANDLER) RestTemplate restTemplate) { + this.restTemplate = restTemplate; + } + + public ServiceInstancesResponse createServiceInstance(ServiceInstancesRequest serviceInstancesRequest) + throws ApiHandlerClientException { + try { + HttpEntity request = createRequest(serviceInstancesRequest); + return restTemplate.exchange(baseUri + serviceInstantiationEndpoint, HttpMethod.POST, request, + ServiceInstancesResponse.class).getBody(); + } catch (HttpStatusCodeException e) { + throw new ApiHandlerClientException("Failed sending service createInstance request to api-handler." + + " Error: " + e.getResponseBodyAsString()); + } catch (RestClientException e) { + throw new ApiHandlerClientException( + "Failed sending service createInstance request to api-handler." + " Error: " + e.getMessage()); + } + } + + public ServiceInstancesResponse deleteServiceInstance(ServiceInstancesRequest serviceInstancesRequest) + throws ApiHandlerClientException { + try { + HttpEntity request = createRequest(serviceInstancesRequest); + return restTemplate.exchange( + baseUri + serviceInstantiationEndpoint + + String.format("/%s", serviceInstancesRequest.getServiceInstanceId()), + HttpMethod.DELETE, request, ServiceInstancesResponse.class).getBody(); + } catch (HttpStatusCodeException e) { + throw new ApiHandlerClientException("Failed sending service deleteInstance request to api-handler." + + " Error: " + e.getResponseBodyAsString()); + } catch (RestClientException e) { + throw new ApiHandlerClientException( + "Failed sending service deleteInstance request to api-handler." + " Error: " + e.getMessage()); + } + } + + private HttpEntity createRequest(ServiceInstancesRequest serviceInstancesRequest) { + HttpHeaders headers = new HttpHeaders(); + headers.add(HttpHeaders.AUTHORIZATION, auth); + headers.set(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE); + headers.set(HttpHeaders.ACCEPT, String.valueOf(MediaType.APPLICATION_JSON)); + + return new HttpEntity<>(serviceInstancesRequest, headers); + } +} diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/ApiHandlerClientException.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/ApiHandlerClientException.java new file mode 100644 index 0000000000..0a4c60cdf7 --- /dev/null +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/ApiHandlerClientException.java @@ -0,0 +1,8 @@ +package org.onap.so.client.orchestration; + +public class ApiHandlerClientException extends Exception { + + public ApiHandlerClientException(String errorMessage) { + super(errorMessage); + } +} diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/RestTemplateApiClientConfig.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/RestTemplateApiClientConfig.java new file mode 100644 index 0000000000..a01fbe18f8 --- /dev/null +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/orchestration/RestTemplateApiClientConfig.java @@ -0,0 +1,23 @@ +package org.onap.so.client.orchestration; + +import org.onap.logging.filter.spring.SpringClientPayloadFilter; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.http.client.BufferingClientHttpRequestFactory; +import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; +import org.springframework.web.client.RestTemplate; + +@Configuration +public class RestTemplateApiClientConfig { + public static final String REST_TEMPLATE_API_HANDLER = "restTemplateApiHandler"; + + @Bean(REST_TEMPLATE_API_HANDLER) + public RestTemplate restTemplate() { + final RestTemplate restTemplate = new RestTemplate(); + restTemplate + .setRequestFactory(new BufferingClientHttpRequestFactory(new HttpComponentsClientHttpRequestFactory())); + restTemplate.getInterceptors().add((new SpringClientPayloadFilter())); + return restTemplate; + } + +} diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/ApiHandlerClientTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/ApiHandlerClientTest.java new file mode 100644 index 0000000000..f3a04e6f54 --- /dev/null +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/client/orchestration/ApiHandlerClientTest.java @@ -0,0 +1,121 @@ +package org.onap.so.client.orchestration; + +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.ArgumentMatchers; +import org.mockito.InjectMocks; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.onap.so.serviceinstancebeans.ServiceInstancesRequest; +import org.onap.so.serviceinstancebeans.ServiceInstancesResponse; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.test.context.TestPropertySource; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.web.client.HttpClientErrorException; +import org.springframework.web.client.RestTemplate; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThat; +import static org.hamcrest.CoreMatchers.instanceOf; + + +@TestPropertySource(properties = {"mso.adapters.apihandler.endpoint=http://localhost:", + "mso.adapters.apihandler.auth=Basic dGVzdDp0ZXN0Cg=="}) +@RunWith(SpringJUnit4ClassRunner.class) +public class ApiHandlerClientTest { + + @InjectMocks + private ApiHandlerClient client; + + @Mock + protected RestTemplate restTemplate; + + private ServiceInstancesRequest buildRequest(String incomingRequest) { + ObjectMapper mapper = new ObjectMapper(); + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + ServiceInstancesRequest request = null; + try { + request = mapper.readValue(incomingRequest, ServiceInstancesRequest.class); + System.out.println("Java Object: " + request); + } catch (Exception e) { + System.out.println("Caught Exception " + e.getMessage()); + Assert.fail("Could not build ServiceInstancesRequest object"); + } + return request; + } + + @Test + public void createServiceInstanceTest() { + String incomingRequest = + "{\"requestDetails\":{\"modelInfo\":{\"modelType\":\"service\",\"modelInvariantId\":\"5d48acb5-097d-4982-aeb2-f4a3bd87d31b\",\"modelVersionId\":\"3c40d244-808e-42ca-b09a-256d83d19d0a\",\"modelName\":\"MOWvMXBV1Service\",\"modelVersion\":\"10.0\"},\"cloudConfiguration\":{\"lcpCloudRegionId\":\"mdt1\",\"tenantId\":\"88a6ca3ee0394ade9403f075db23167e\"},\"owningEntity\":{\"owningEntityId\":\"038d99af-0427-42c2-9d15-971b99b9b489\",\"owningEntityName\":\"PACKETCORE\"},\"project\":{\"projectName\":\"{someprojectname}\"},\"subscriberInfo\":{\"globalSubscriberId\":\"{somesubscriberid}\"},\"requestInfo\":{\"productFamilyId\":\"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\",\"source\":\"VID\",\"suppressRollback\":true,\"requestorId\":\"xxxxxx\"},\"requestParameters\":{\"subscriptionServiceType\":\"VMX\",\"aLaCarte\":false,\"userParams\":[{\"service\":{\"modelInfo\":{\"modelType\":\"service\",\"modelInvariantId\":\"5d48acb5-097d-4982-aeb2-f4a3bd87d31b\",\"modelVersionId\":\"3c40d244-808e-42ca-b09a-256d83d19d0a\",\"modelName\":\"MOWvMXBV1Service\",\"modelVersion\":\"10.0\"},\"instanceParams\":[],\"resources\":{\"vnfs\":[{\"modelInfo\":{\"modelType\":\"vnf\",\"modelName\":\"2016-73_MOW\",\"modelVersionId\":\"7f40c192-f63c-463e-ba94-286933b895f8\",\"modelCustomizationName\":\"2016-73_MOW\",\"modelCustomizationId\":\"ab153b6e-c364-44c0-bef6-1f2982117f04\"},\"cloudConfiguration\":{\"lcpCloudRegionId\":\"mdt1\",\"tenantId\":\"88a6ca3ee0394ade9403f075db23167e\"},\"platform\":{\"platformName\":\"test\"},\"lineOfBusiness\":{\"lineOfBusinessName\":\"someValue\"},\"productFamilyId\":\"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\",\"instanceParams\":[],\"vfModules\":[{\"modelInfo\":{\"modelType\":\"vfModule\",\"modelName\":\"201673MowtestBvL\",\"modelVersionId\":\"4c75f813-fa91-45a4-89d0-790ff5f1ae79\",\"modelCustomizationId\":\"a25e8e8c-58b8-4eec-810c-97dcc1f5cb7f\"},\"instanceName\":\"vfModule1\",\"instanceParams\":[{\"vmx_int_net_len\":\"24\"}]}]}]}}}]}}}"; + ServiceInstancesRequest request = buildRequest(incomingRequest); + ResponseEntity responseEntity = + new ResponseEntity(new ServiceInstancesResponse(), HttpStatus.ACCEPTED); + Mockito.when(restTemplate.exchange(ArgumentMatchers.anyString(), ArgumentMatchers.any(HttpMethod.class), + ArgumentMatchers.any(), ArgumentMatchers.>any())) + .thenReturn(responseEntity); + + try { + ServiceInstancesResponse response = client.createServiceInstance(request); + assertThat(response, instanceOf(ServiceInstancesResponse.class)); + } catch (ApiHandlerClientException e) { + Assert.fail(e.getMessage()); + } + } + + @Test + public void createServiceInstanceErrorTest() { + String incomingRequest = + "{\"requestDetails\":{\"modelInfo\":{\"modelType\":\"service\",\"modelInvariantId\":\"5d48acb5-097d-4982-aeb2-f4a3bd87d31b\",\"modelVersionId\":\"3c40d244-808e-42ca-b09a-256d83d19d0a\",\"modelName\":\"MOWvMXBV1Service\",\"modelVersion\":\"10.0\"},\"cloudConfiguration\":{\"lcpCloudRegionId\":\"mdt1\",\"tenantId\":\"88a6ca3ee0394ade9403f075db23167e\"},\"owningEntity\":{\"owningEntityId\":\"038d99af-0427-42c2-9d15-971b99b9b489\",\"owningEntityName\":\"PACKETCORE\"},\"project\":{\"projectName\":\"{someprojectname}\"},\"subscriberInfo\":{\"globalSubscriberId\":\"{somesubscriberid}\"},\"requestInfo\":{\"productFamilyId\":\"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\",\"source\":\"VID\",\"suppressRollback\":true,\"requestorId\":\"xxxxxx\"},\"requestParameters\":{\"subscriptionServiceType\":\"VMX\",\"aLaCarte\":false,\"userParams\":[{\"service\":{\"modelInfo\":{\"modelType\":\"service\",\"modelInvariantId\":\"5d48acb5-097d-4982-aeb2-f4a3bd87d31b\",\"modelVersionId\":\"3c40d244-808e-42ca-b09a-256d83d19d0a\",\"modelName\":\"MOWvMXBV1Service\",\"modelVersion\":\"10.0\"},\"instanceParams\":[],\"resources\":{\"vnfs\":[{\"modelInfo\":{\"modelType\":\"vnf\",\"modelName\":\"2016-73_MOW\",\"modelVersionId\":\"7f40c192-f63c-463e-ba94-286933b895f8\",\"modelCustomizationName\":\"2016-73_MOW\",\"modelCustomizationId\":\"ab153b6e-c364-44c0-bef6-1f2982117f04\"},\"cloudConfiguration\":{\"lcpCloudRegionId\":\"mdt1\",\"tenantId\":\"88a6ca3ee0394ade9403f075db23167e\"},\"platform\":{\"platformName\":\"test\"},\"lineOfBusiness\":{\"lineOfBusinessName\":\"someValue\"},\"productFamilyId\":\"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\",\"instanceParams\":[],\"vfModules\":[{\"modelInfo\":{\"modelType\":\"vfModule\",\"modelName\":\"201673MowtestBvL\",\"modelVersionId\":\"4c75f813-fa91-45a4-89d0-790ff5f1ae79\",\"modelCustomizationId\":\"a25e8e8c-58b8-4eec-810c-97dcc1f5cb7f\"},\"instanceName\":\"vfModule1\",\"instanceParams\":[{\"vmx_int_net_len\":\"24\"}]}]}]}}}]}}}"; + ServiceInstancesRequest request = buildRequest(incomingRequest); + Mockito.when(restTemplate.exchange(ArgumentMatchers.anyString(), ArgumentMatchers.any(HttpMethod.class), + ArgumentMatchers.any(), ArgumentMatchers.>any())) + .thenThrow(new HttpClientErrorException(HttpStatus.NOT_FOUND)); + try { + client.createServiceInstance(request); + Assert.fail("ApiHandlerClientException exception was not thrown"); + } catch (ApiHandlerClientException e) { + assertEquals("Failed sending service createInstance request to api-handler. Error: ", e.getMessage()); + } + } + + @Test + public void deleteServiceInstanceTest() { + String incomingRequest = + "{\"requestDetails\":{\"modelInfo\":{\"modelType\":\"service\",\"modelInvariantId\":\"5d48acb5-097d-4982-aeb2-f4a3bd87d31b\",\"modelVersionId\":\"3c40d244-808e-42ca-b09a-256d83d19d0a\",\"modelName\":\"MOWvMXBV1Service\",\"modelVersion\":\"10.0\"},\"cloudConfiguration\":{\"lcpCloudRegionId\":\"mdt1\",\"tenantId\":\"88a6ca3ee0394ade9403f075db23167e\"},\"owningEntity\":{\"owningEntityId\":\"038d99af-0427-42c2-9d15-971b99b9b489\",\"owningEntityName\":\"PACKETCORE\"},\"project\":{\"projectName\":\"{someprojectname}\"},\"subscriberInfo\":{\"globalSubscriberId\":\"{somesubscriberid}\"},\"requestInfo\":{\"productFamilyId\":\"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\",\"source\":\"VID\",\"suppressRollback\":true,\"requestorId\":\"xxxxxx\"},\"requestParameters\":{\"subscriptionServiceType\":\"VMX\",\"aLaCarte\":false,\"userParams\":[{\"service\":{\"modelInfo\":{\"modelType\":\"service\",\"modelInvariantId\":\"5d48acb5-097d-4982-aeb2-f4a3bd87d31b\",\"modelVersionId\":\"3c40d244-808e-42ca-b09a-256d83d19d0a\",\"modelName\":\"MOWvMXBV1Service\",\"modelVersion\":\"10.0\"},\"instanceParams\":[],\"resources\":{\"vnfs\":[{\"modelInfo\":{\"modelType\":\"vnf\",\"modelName\":\"2016-73_MOW\",\"modelVersionId\":\"7f40c192-f63c-463e-ba94-286933b895f8\",\"modelCustomizationName\":\"2016-73_MOW\",\"modelCustomizationId\":\"ab153b6e-c364-44c0-bef6-1f2982117f04\"},\"cloudConfiguration\":{\"lcpCloudRegionId\":\"mdt1\",\"tenantId\":\"88a6ca3ee0394ade9403f075db23167e\"},\"platform\":{\"platformName\":\"test\"},\"lineOfBusiness\":{\"lineOfBusinessName\":\"someValue\"},\"productFamilyId\":\"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\",\"instanceParams\":[],\"vfModules\":[{\"modelInfo\":{\"modelType\":\"vfModule\",\"modelName\":\"201673MowtestBvL\",\"modelVersionId\":\"4c75f813-fa91-45a4-89d0-790ff5f1ae79\",\"modelCustomizationId\":\"a25e8e8c-58b8-4eec-810c-97dcc1f5cb7f\"},\"instanceName\":\"vfModule1\",\"instanceParams\":[{\"vmx_int_net_len\":\"24\"}]}]}]}}}]}}}"; + ServiceInstancesRequest request = buildRequest(incomingRequest); + ResponseEntity responseEntity = + new ResponseEntity(new ServiceInstancesResponse(), HttpStatus.ACCEPTED); + Mockito.when(restTemplate.exchange(ArgumentMatchers.anyString(), ArgumentMatchers.any(HttpMethod.class), + ArgumentMatchers.any(), ArgumentMatchers.>any())) + .thenReturn(responseEntity); + + try { + ServiceInstancesResponse response = client.deleteServiceInstance(request); + assertThat(response, instanceOf(ServiceInstancesResponse.class)); + } catch (ApiHandlerClientException e) { + Assert.fail(e.getMessage()); + } + } + + @Test + public void deleteServiceInstanceErrorTest() { + String incomingRequest = + "{\"requestDetails\":{\"modelInfo\":{\"modelType\":\"service\",\"modelInvariantId\":\"5d48acb5-097d-4982-aeb2-f4a3bd87d31b\",\"modelVersionId\":\"3c40d244-808e-42ca-b09a-256d83d19d0a\",\"modelName\":\"MOWvMXBV1Service\",\"modelVersion\":\"10.0\"},\"cloudConfiguration\":{\"lcpCloudRegionId\":\"mdt1\",\"tenantId\":\"88a6ca3ee0394ade9403f075db23167e\"},\"owningEntity\":{\"owningEntityId\":\"038d99af-0427-42c2-9d15-971b99b9b489\",\"owningEntityName\":\"PACKETCORE\"},\"project\":{\"projectName\":\"{someprojectname}\"},\"subscriberInfo\":{\"globalSubscriberId\":\"{somesubscriberid}\"},\"requestInfo\":{\"productFamilyId\":\"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\",\"source\":\"VID\",\"suppressRollback\":true,\"requestorId\":\"xxxxxx\"},\"requestParameters\":{\"subscriptionServiceType\":\"VMX\",\"aLaCarte\":false,\"userParams\":[{\"service\":{\"modelInfo\":{\"modelType\":\"service\",\"modelInvariantId\":\"5d48acb5-097d-4982-aeb2-f4a3bd87d31b\",\"modelVersionId\":\"3c40d244-808e-42ca-b09a-256d83d19d0a\",\"modelName\":\"MOWvMXBV1Service\",\"modelVersion\":\"10.0\"},\"instanceParams\":[],\"resources\":{\"vnfs\":[{\"modelInfo\":{\"modelType\":\"vnf\",\"modelName\":\"2016-73_MOW\",\"modelVersionId\":\"7f40c192-f63c-463e-ba94-286933b895f8\",\"modelCustomizationName\":\"2016-73_MOW\",\"modelCustomizationId\":\"ab153b6e-c364-44c0-bef6-1f2982117f04\"},\"cloudConfiguration\":{\"lcpCloudRegionId\":\"mdt1\",\"tenantId\":\"88a6ca3ee0394ade9403f075db23167e\"},\"platform\":{\"platformName\":\"test\"},\"lineOfBusiness\":{\"lineOfBusinessName\":\"someValue\"},\"productFamilyId\":\"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\",\"instanceParams\":[],\"vfModules\":[{\"modelInfo\":{\"modelType\":\"vfModule\",\"modelName\":\"201673MowtestBvL\",\"modelVersionId\":\"4c75f813-fa91-45a4-89d0-790ff5f1ae79\",\"modelCustomizationId\":\"a25e8e8c-58b8-4eec-810c-97dcc1f5cb7f\"},\"instanceName\":\"vfModule1\",\"instanceParams\":[{\"vmx_int_net_len\":\"24\"}]}]}]}}}]}}}"; + ServiceInstancesRequest request = buildRequest(incomingRequest); + Mockito.when(restTemplate.exchange(ArgumentMatchers.anyString(), ArgumentMatchers.any(HttpMethod.class), + ArgumentMatchers.any(), ArgumentMatchers.>any())) + .thenThrow(new HttpClientErrorException(HttpStatus.NOT_FOUND)); + try { + client.deleteServiceInstance(request); + Assert.fail("ApiHandlerClientException exception was not thrown"); + } catch (ApiHandlerClientException e) { + assertEquals("Failed sending service deleteInstance request to api-handler. Error: ", e.getMessage()); + } + } + +} -- cgit 1.2.3-korg From 65386bb78fb5afe2ccab967e35bd40f65720dd60 Mon Sep 17 00:00:00 2001 From: Jozsef Csongvai Date: Fri, 26 Nov 2021 15:49:36 -0500 Subject: Enable recursive model by adding services to resources Issue-ID: SO-3811 Signed-off-by: Jozsef Csongvai Change-Id: I13ea0986b9c81971432626163d323991b57f9545 --- .../onap/so/bpmn/infrastructure/workflow/tasks/Resource.java | 4 ++++ .../java/org/onap/so/serviceinstancebeans/Resources.java | 12 +++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/Resource.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/Resource.java index 2a8852a4bd..0214a3f998 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/Resource.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/Resource.java @@ -156,4 +156,8 @@ public class Resource implements Serializable { public List getChildren() { return this.children; } + + public Boolean hasParent() { + return parent != null; + } } diff --git a/common/src/main/java/org/onap/so/serviceinstancebeans/Resources.java b/common/src/main/java/org/onap/so/serviceinstancebeans/Resources.java index acac8c4033..9cb5b33251 100644 --- a/common/src/main/java/org/onap/so/serviceinstancebeans/Resources.java +++ b/common/src/main/java/org/onap/so/serviceinstancebeans/Resources.java @@ -42,6 +42,8 @@ public class Resources implements Serializable { private List pnfs = new ArrayList<>(); @JsonProperty("networks") private List networks = new ArrayList<>(); + @JsonProperty("services") + private List services = new ArrayList<>(); public List getVnfs() { return vnfs; @@ -67,8 +69,16 @@ public class Resources implements Serializable { this.networks = networks; } + public List getServices() { + return services; + } + + public void setServices(List services) { + this.services = services; + } + @Override public String toString() { - return "Resources [vnfs=" + vnfs + ", networks=" + networks + "]"; + return "Resources [vnfs=" + vnfs + ", networks=" + networks + ", services=" + services + "]"; } } -- cgit 1.2.3-korg From 4bfbdba3c1c9554b45c2a5c4f221853e7b572577 Mon Sep 17 00:00:00 2001 From: Jozsef Csongvai Date: Fri, 26 Nov 2021 16:08:11 -0500 Subject: Add request builder for child services The builder parses a child service request from the so request payload. Issue-ID: SO-3811 Signed-off-by: Jozsef Csongvai Change-Id: I2db54160ae44e229f97190f66dd5b5cd89cc4598 --- .../composition/ChildServiceRequestBuilder.java | 198 +++++++++++++++++ .../ChildServiceRequestBuilderTest.java | 236 +++++++++++++++++++++ 2 files changed, 434 insertions(+) create mode 100644 bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/service/composition/ChildServiceRequestBuilder.java create mode 100644 bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/service/composition/ChildServiceRequestBuilderTest.java diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/service/composition/ChildServiceRequestBuilder.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/service/composition/ChildServiceRequestBuilder.java new file mode 100644 index 0000000000..135b3d6ec4 --- /dev/null +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/service/composition/ChildServiceRequestBuilder.java @@ -0,0 +1,198 @@ +package org.onap.so.bpmn.infrastructure.service.composition; + +import com.fasterxml.jackson.databind.ObjectMapper; +import org.onap.so.bpmn.common.BuildingBlockExecution; +import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion; +import org.onap.so.bpmn.servicedecomposition.bbobjects.Customer; +import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext; +import org.onap.so.serviceinstancebeans.CloudConfiguration; +import org.onap.so.serviceinstancebeans.InstanceDirection; +import org.onap.so.serviceinstancebeans.OwningEntity; +import org.onap.so.serviceinstancebeans.Project; +import org.onap.so.serviceinstancebeans.RelatedInstance; +import org.onap.so.serviceinstancebeans.RelatedInstanceList; +import org.onap.so.serviceinstancebeans.RequestDetails; +import org.onap.so.serviceinstancebeans.RequestInfo; +import org.onap.so.serviceinstancebeans.Service; +import org.onap.so.serviceinstancebeans.ServiceInstancesRequest; +import org.onap.so.serviceinstancebeans.RequestParameters; +import org.onap.so.serviceinstancebeans.SubscriberInfo; +import java.io.IOException; +import java.util.Map; + +public class ChildServiceRequestBuilder { + + private final BuildingBlockExecution buildingBlockExecution; + private Service parent; + private Service child; + private ServiceInstancesRequest sir; + + private ChildServiceRequestBuilder(final BuildingBlockExecution buildingBlockExecution, Service parent, + Service child) { + this.buildingBlockExecution = buildingBlockExecution; + this.child = child; + this.parent = parent; + + this.sir = new ServiceInstancesRequest(); + RequestDetails requestDetails = new RequestDetails(); + requestDetails.setRequestInfo(new RequestInfo()); + this.sir.setRequestDetails(requestDetails); + } + + public static ChildServiceRequestBuilder getInstance(final BuildingBlockExecution buildingBlockExecution, + String childSvcInstanceName) { + Service child = null; + Service parent = null; + try { + String USERPARAMSERVICE = "service"; + for (Map params : buildingBlockExecution.getGeneralBuildingBlock().getRequestContext() + .getRequestParameters().getUserParams()) { + if (params.containsKey(USERPARAMSERVICE)) { + ObjectMapper obj = new ObjectMapper(); + String input = obj.writeValueAsString(params.get(USERPARAMSERVICE)); + parent = obj.readValue(input, Service.class); + if (parent.getResources().getServices() != null) { + for (Service service : parent.getResources().getServices()) { + if (service.getInstanceName().equals(childSvcInstanceName)) { + child = service; + } + } + } + } + } + } catch (IOException e) { + throw new RuntimeException("Failed parsing context user parameters for parent or child service", e); + } + return new ChildServiceRequestBuilder(buildingBlockExecution, parent, child); + } + + public ChildServiceRequestBuilder setParentRequestId(String parentRequestId) { + sir.getRequestDetails().getRequestInfo().setRequestorId(parentRequestId); + return this; + } + + public ChildServiceRequestBuilder setCorrelationId(String correlationId) { + sir.getRequestDetails().getRequestInfo().setCorrelator(correlationId); + return this; + } + + public ChildServiceRequestBuilder setChildSvcInstanceId(String childSvcInstanceId) { + sir.setServiceInstanceId(childSvcInstanceId); + return this; + } + + public ServiceInstancesRequest build() { + RequestContext context = buildingBlockExecution.getGeneralBuildingBlock().getRequestContext(); + sir.setRequestDetails(createRequestDetails(context)); + return sir; + } + + private RequestDetails createRequestDetails(RequestContext context) { + RequestDetails details = sir.getRequestDetails(); + + details.setRequestParameters(createRequestParameters(context, child)); + details.setRequestInfo(createRequestInfo(context)); + details.setCloudConfiguration(createCloudConfiguration()); + details.setModelInfo(child.getModelInfo()); + details.setSubscriberInfo(createSubscriberInfo()); + details.setOwningEntity(createOwningEntity()); + details.setProject(createProject()); + details.setRelatedInstanceList(createRelatedInstanceList()); + + return details; + } + + private RequestParameters createRequestParameters(RequestContext context, Service childService) { + RequestParameters requestParameters = new RequestParameters(); + requestParameters.getUserParams().add(context.getRequestParameters().getUserParams().get(0)); + requestParameters.getUserParams().add(Map.of("service", childService)); + requestParameters.setSubscriptionServiceType(context.getRequestParameters().getSubscriptionServiceType()); + requestParameters.setaLaCarte(context.getRequestParameters().getALaCarte()); + requestParameters.setPayload(context.getRequestParameters().getPayload()); + requestParameters.setUsePreload(context.getRequestParameters().getUsePreload()); + + return requestParameters; + } + + private RequestInfo createRequestInfo(RequestContext context) { + RequestInfo info = sir.getRequestDetails().getRequestInfo(); + if (info != null) { + info.setProductFamilyId(context.getProductFamilyId()); + info.setSource(context.getSource()); + info.setRequestorId(context.getRequestorId()); + info.setInstanceName(child.getInstanceName()); + info.setSuppressRollback(false); + } + return info; + } + + private CloudConfiguration createCloudConfiguration() { + if (child.getCloudConfiguration() != null) { + return child.getCloudConfiguration(); + } + + CloudConfiguration cloudConfiguration = null; + CloudRegion requestCloudConfiguration = buildingBlockExecution.getGeneralBuildingBlock().getCloudRegion(); + if (requestCloudConfiguration != null) { + cloudConfiguration = new CloudConfiguration(); + cloudConfiguration.setLcpCloudRegionId(requestCloudConfiguration.getLcpCloudRegionId()); + cloudConfiguration.setTenantId(requestCloudConfiguration.getTenantId()); + cloudConfiguration.setCloudOwner(requestCloudConfiguration.getCloudOwner()); + } + return cloudConfiguration; + } + + private SubscriberInfo createSubscriberInfo() { + Customer requestCustomer = buildingBlockExecution.getGeneralBuildingBlock().getCustomer(); + + SubscriberInfo subscriberInfo = null; + if (requestCustomer != null) { + subscriberInfo = new SubscriberInfo(); + subscriberInfo.setGlobalSubscriberId(requestCustomer.getGlobalCustomerId()); + subscriberInfo.setSubscriberName(requestCustomer.getSubscriberName()); + } + + return subscriberInfo; + } + + private OwningEntity createOwningEntity() { + org.onap.so.bpmn.servicedecomposition.bbobjects.OwningEntity requestOwningEntity = + buildingBlockExecution.getGeneralBuildingBlock().getServiceInstance().getOwningEntity(); + OwningEntity owningEntity = null; + if (requestOwningEntity != null) { + owningEntity = new OwningEntity(); + owningEntity.setOwningEntityId(requestOwningEntity.getOwningEntityId()); + owningEntity.setOwningEntityName(requestOwningEntity.getOwningEntityName()); + } + + return owningEntity; + } + + private Project createProject() { + org.onap.so.bpmn.servicedecomposition.bbobjects.Project requestProject = + buildingBlockExecution.getGeneralBuildingBlock().getServiceInstance().getProject(); + Project project = null; + + if (requestProject != null) { + project = new Project(); + project.setProjectName(requestProject.getProjectName()); + } + return project; + } + + private RelatedInstanceList[] createRelatedInstanceList() { + RelatedInstance relatedInstance = new RelatedInstance(); + relatedInstance.setModelInfo(parent.getModelInfo()); + relatedInstance.setInstanceId( + buildingBlockExecution.getGeneralBuildingBlock().getServiceInstance().getServiceInstanceId()); + relatedInstance.setInstanceDirection(InstanceDirection.source); + + RelatedInstanceList relatedInstanceList = new RelatedInstanceList(); + relatedInstanceList.setRelatedInstance(relatedInstance); + + RelatedInstanceList[] relatedInstanceListsArray = new RelatedInstanceList[1]; + relatedInstanceListsArray[0] = relatedInstanceList; + + return relatedInstanceListsArray; + } +} diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/service/composition/ChildServiceRequestBuilderTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/service/composition/ChildServiceRequestBuilderTest.java new file mode 100644 index 0000000000..d1db3aadcd --- /dev/null +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/service/composition/ChildServiceRequestBuilderTest.java @@ -0,0 +1,236 @@ +package org.onap.so.bpmn.infrastructure.service.composition; + +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.onap.so.bpmn.common.BuildingBlockExecution; +import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion; +import org.onap.so.bpmn.servicedecomposition.bbobjects.Customer; +import org.onap.so.bpmn.servicedecomposition.bbobjects.OwningEntity; +import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance; +import org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock; +import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext; +import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestParameters; +import org.onap.so.bpmn.servicedecomposition.bbobjects.Project; +import org.onap.so.serviceinstancebeans.CloudConfiguration; +import org.onap.so.serviceinstancebeans.InstanceDirection; +import org.onap.so.serviceinstancebeans.ModelInfo; +import org.onap.so.serviceinstancebeans.ModelType; +import org.onap.so.serviceinstancebeans.RelatedInstance; +import org.onap.so.serviceinstancebeans.RelatedInstanceList; +import org.onap.so.serviceinstancebeans.RequestInfo; +import org.onap.so.serviceinstancebeans.Service; +import org.onap.so.serviceinstancebeans.ServiceInstancesRequest; +import org.onap.so.serviceinstancebeans.SubscriberInfo; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.mock; + +public class ChildServiceRequestBuilderTest { + + private BuildingBlockExecution mockExecution; + private List> userParamsExpected; + + @Before + public void setUp() throws IOException { + String incomingRequest = + "{\"requestDetails\":{\"subscriberInfo\":{\"globalSubscriberId\":\"ubuntu-customer\"},\"requestInfo\":{\"suppressRollback\":false,\"instanceName\":\"LcmDemo\",\"productFamilyId\":\"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\",\"requestorId\":\"portal\",\"source\":\"postman\"},\"cloudConfiguration\":{\"lcpCloudRegionId\":\"123\",\"tenantId\":\"e2710e84063b421fab08189818761d55\",\"cloudOwner\":\"cloudOwner\"},\"requestParameters\":{\"subscriptionServiceType\":\"ubuntu\",\"userParams\":[{\"Homing_Solution\":\"none\"},{\"service\":{\"instanceParams\":[],\"resources\":{\"vnfs\":[{\"modelInfo\":{\"modelName\":\"UbuntuSriovVF\",\"modelVersionId\":\"5b5d07f0-7449-4eec-95eb-531ddef18240\",\"modelInvariantUuid\":\"9ed17b82-11f3-44cc-a86f-32739360617e\",\"modelVersion\":\"1.0\",\"modelCustomizationId\":\"ae139d3d-b2ae-462c-b09d-c85bdc2e3073\",\"modelInstanceName\":\"UbuntuSriovVF0\"},\"cloudConfiguration\":{\"lcpCloudRegionId\":\"123\",\"tenantId\":\"e2710e84063b421fab08189818761d55\",\"cloudOwner\":\"cloudOwner\"},\"platform\":{\"platformName\":\"openstack\"},\"lineOfBusiness\":{\"lineOfBusinessName\":\"wireless\"},\"productFamilyId\":\"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\",\"instanceName\":\"vnf-instanceName\",\"instanceParams\":[{\"vnf-name\":\"vnf-vnf-name\",\"vnf_name\":\"UbuntuVNFName\"}],\"vfModules\":[{\"modelInfo\":{\"modelName\":\"Ubuntusriovvf..base..module-0\",\"modelVersionId\":\"f4ef24dd-7a4e-4eef-83b7-c58f2f3e36e4\",\"modelInvariantUuid\":\"719aab1e-c551-46e0-87e8-a78dcd7891da\",\"modelVersion\":\"1\",\"modelCustomizationId\":\"dea421a8-c1b8-4044-8ca1-58c30de3b315\"},\"instanceName\":\"lcm-demo-network-1\",\"instanceParams\":[{\"name\":\"lcm-demo-network-1\",\"cidr\":\"10.10.10.0/24\"}]},{\"modelInfo\":{\"modelName\":\"Ubuntusriovvf..ubuntu-vf-module..module-1\",\"modelVersionId\":\"112f2de4-4f09-4567-9de1-2d271cb6e164\",\"modelInvariantUuid\":\"ba6d2e11-4e82-4bb8-9d52-a2962a263a09\",\"modelVersion\":\"1\",\"modelCustomizationId\":\"7bc2649e-b96b-44ec-adfe-4a6167f3034e\"},\"instanceName\":\"lcm-demo-ubuntu-1\",\"instanceParams\":[{\"name\":\"lcm-demo-ubuntu-1\",\"network_mgmt\":\"networkMgmt\",\"key_name\":\"demo\",\"network_name\":\"lcm-demo-network-1\",\"image_name\":\"imageName\",\"flavor_name\":\"m1.small\"}]}]}],\"services\":[{\"instanceParams\":[],\"resources\":{\"vnfs\":[{\"modelInfo\":{\"modelName\":\"UbuntuSriovVF\",\"modelVersionId\":\"5b5d07f0-7449-4eec-95eb-531ddef18240\",\"modelInvariantUuid\":\"9ed17b82-11f3-44cc-a86f-32739360617e\",\"modelVersion\":\"1.0\",\"modelCustomizationId\":\"ae139d3d-b2ae-462c-b09d-c85bdc2e3073\",\"modelInstanceName\":\"UbuntuSriovVF0\"},\"cloudConfiguration\":{\"lcpCloudRegionId\":\"123\",\"tenantId\":\"e2710e84063b421fab08189818761d55\",\"cloudOwner\":\"cloudOwner\"},\"platform\":{\"platformName\":\"openstack\"},\"lineOfBusiness\":{\"lineOfBusinessName\":\"wireless\"},\"productFamilyId\":\"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\",\"instanceName\":\"vnf-instanceName\",\"instanceParams\":[{\"vnf-name\":\"vnf-vnf-name\",\"vnf_name\":\"UbuntuVNFName\"}],\"vfModules\":[{\"modelInfo\":{\"modelName\":\"Ubuntusriovvf..base..module-0\",\"modelVersionId\":\"f4ef24dd-7a4e-4eef-83b7-c58f2f3e36e4\",\"modelInvariantUuid\":\"719aab1e-c551-46e0-87e8-a78dcd7891da\",\"modelVersion\":\"1\",\"modelCustomizationId\":\"dea421a8-c1b8-4044-8ca1-58c30de3b315\"},\"instanceName\":\"lcm-demo-network-1\",\"instanceParams\":[{\"name\":\"lcm-demo-network-1\",\"cidr\":\"10.10.10.0/24\"}]},{\"modelInfo\":{\"modelName\":\"Ubuntusriovvf..ubuntu-vf-module..module-1\",\"modelVersionId\":\"112f2de4-4f09-4567-9de1-2d271cb6e164\",\"modelInvariantUuid\":\"ba6d2e11-4e82-4bb8-9d52-a2962a263a09\",\"modelVersion\":\"1\",\"modelCustomizationId\":\"7bc2649e-b96b-44ec-adfe-4a6167f3034e\"},\"instanceName\":\"lcm-demo-ubuntu-1\",\"instanceParams\":[{\"name\":\"lcm-demo-ubuntu-1\",\"network_mgmt\":\"networkMgmt\",\"key_name\":\"demo\",\"network_name\":\"lcm-demo-network-1\",\"image_name\":\"imageName\",\"flavor_name\":\"m1.small\"}]}]}]},\"modelInfo\":{\"modelVersion\":\"2.0\",\"modelVersionId\":\"5bc2b6b3-c9bb-49a1-89c8-4dac5b236d52\",\"modelInvariantId\":\"a316f8fa-c886-483f-801b-6663e35b836c\",\"modelCustomizationId\":\"cs1-svc-modelCustomizationId\",\"modelName\":\"GuilinLcmSVC\",\"modelType\":\"service\"},\"instanceName\":\"service1-instanceName\"},{\"instanceParams\":[],\"resources\":{\"vnfs\":[{\"modelInfo\":{\"modelName\":\"UbuntuSriovVF\",\"modelVersionId\":\"5b5d07f0-7449-4eec-95eb-531ddef18240\",\"modelInvariantUuid\":\"9ed17b82-11f3-44cc-a86f-32739360617e\",\"modelVersion\":\"1.0\",\"modelCustomizationId\":\"ae139d3d-b2ae-462c-b09d-c85bdc2e3073\",\"modelInstanceName\":\"UbuntuSriovVF0\"},\"cloudConfiguration\":{\"lcpCloudRegionId\":\"123\",\"tenantId\":\"e2710e84063b421fab08189818761d55\",\"cloudOwner\":\"cloudOwner\"},\"platform\":{\"platformName\":\"openstack\"},\"lineOfBusiness\":{\"lineOfBusinessName\":\"wireless\"},\"productFamilyId\":\"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\",\"instanceName\":\"vnf-instanceName\",\"instanceParams\":[{\"vnf-name\":\"vnf-vnf-name\",\"vnf_name\":\"UbuntuVNFName\"}],\"vfModules\":[{\"modelInfo\":{\"modelName\":\"Ubuntusriovvf..base..module-0\",\"modelVersionId\":\"f4ef24dd-7a4e-4eef-83b7-c58f2f3e36e4\",\"modelInvariantUuid\":\"719aab1e-c551-46e0-87e8-a78dcd7891da\",\"modelVersion\":\"1\",\"modelCustomizationId\":\"dea421a8-c1b8-4044-8ca1-58c30de3b315\"},\"instanceName\":\"lcm-demo-network-1\",\"instanceParams\":[{\"name\":\"lcm-demo-network-1\",\"cidr\":\"10.10.10.0/24\"}]},{\"modelInfo\":{\"modelName\":\"Ubuntusriovvf..ubuntu-vf-module..module-1\",\"modelVersionId\":\"112f2de4-4f09-4567-9de1-2d271cb6e164\",\"modelInvariantUuid\":\"ba6d2e11-4e82-4bb8-9d52-a2962a263a09\",\"modelVersion\":\"1\",\"modelCustomizationId\":\"7bc2649e-b96b-44ec-adfe-4a6167f3034e\"},\"instanceName\":\"lcm-demo-ubuntu-1\",\"instanceParams\":[{\"name\":\"lcm-demo-ubuntu-1\",\"network_mgmt\":\"networkMgmt\",\"key_name\":\"demo\",\"network_name\":\"lcm-demo-network-1\",\"image_name\":\"imageName\",\"flavor_name\":\"m1.small\"}]}]}]},\"modelInfo\":{\"modelVersion\":\"2.0\",\"modelVersionId\":\"5bc2b6b3-c9bb-49a1-89c8-4dac5b236d52\",\"modelInvariantId\":\"a316f8fa-c886-483f-801b-6663e35b836c\",\"modelCustomizationId\":\"cs1-svc-modelCustomizationId\",\"modelName\":\"GuilinLcmSVC\",\"modelType\":\"service\"},\"instanceName\":\"service2-instanceName\"}]},\"modelInfo\":{\"modelVersion\":\"2.0\",\"modelVersionId\":\"5bc2b6b3-c9bb-49a1-89c8-4dac5b236d52\",\"modelInvariantId\":\"a316f8fa-c886-483f-801b-6663e35b836c\",\"modelName\":\"GuilinLcmSVC\",\"modelType\":\"service\"}}}],\"aLaCarte\":false},\"project\":{\"projectName\":\"Project-UbuntuDemo\"},\"owningEntity\":{\"owningEntityId\":\"33a8b609-1cfe-4d19-8dc2-5b95b921de1e\",\"owningEntityName\":\"demo\"},\"modelInfo\":{\"modelVersion\":\"2.0\",\"modelVersionId\":\"5bc2b6b3-c9bb-49a1-89c8-4dac5b236d52\",\"modelInvariantId\":\"a316f8fa-c886-483f-801b-6663e35b836c\",\"modelName\":\"GuilinLcmSVC\",\"modelType\":\"service\"}}}"; + + ObjectMapper mapper = new ObjectMapper(); + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + + ServiceInstancesRequest request = mapper.readValue(incomingRequest, ServiceInstancesRequest.class); + userParamsExpected = request.getRequestDetails().getRequestParameters().getUserParams(); + RequestContext context = new RequestContext(); + RequestParameters parameters = new RequestParameters(); + parameters.setUserParams(request.getRequestDetails().getRequestParameters().getUserParams()); + context.setRequestParameters(parameters); + context.setProductFamilyId("FamilyId"); + context.setSource("source"); + context.setRequestorId("RequestOrId"); + + CloudRegion cloudRegion = new CloudRegion(); + cloudRegion.setCloudOwner("CloudOwner"); + cloudRegion.setLcpCloudRegionId("my-region-id"); + cloudRegion.setTenantId("tenant-id"); + + Customer customer = new Customer(); + customer.setGlobalCustomerId("GlobalCustomerId"); + customer.setSubscriberName("SubscriberName"); + + ServiceInstance serviceInstance = new ServiceInstance(); + OwningEntity owningEntity = new OwningEntity(); + owningEntity.setOwningEntityId("owningEntityId"); + owningEntity.setOwningEntityName("owningEntityName"); + serviceInstance.setOwningEntity(owningEntity); + + Project project = new Project(); + project.setProjectName("projectName"); + serviceInstance.setProject(project); + + serviceInstance.setServiceInstanceId("serviceInstanceId"); + + GeneralBuildingBlock gbb = new GeneralBuildingBlock(); + gbb.setCloudRegion(cloudRegion); + gbb.setCustomer(customer); + gbb.setRequestContext(context); + gbb.setServiceInstance(serviceInstance); + mockExecution = mock(BuildingBlockExecution.class); + doReturn(gbb).when(mockExecution).getGeneralBuildingBlock(); + } + + @Test + public void childServiceRequestBuilderTest() { + + ServiceInstancesRequest sir = ChildServiceRequestBuilder.getInstance(mockExecution, "service1-instanceName") + .setParentRequestId(mockExecution.getGeneralBuildingBlock().getRequestContext().getMsoRequestId()) + .setCorrelationId(UUID.randomUUID().toString()).setChildSvcInstanceId("childInstanceId").build(); + + Assert.assertEquals("childInstanceId", sir.getServiceInstanceId()); + + // modelInfo + ModelInfo modelInfo = sir.getRequestDetails().getModelInfo(); + Assert.assertEquals("a316f8fa-c886-483f-801b-6663e35b836c", modelInfo.getModelInvariantId()); + Assert.assertEquals(ModelType.service, modelInfo.getModelType()); + Assert.assertEquals("GuilinLcmSVC", modelInfo.getModelName()); + Assert.assertEquals("2.0", modelInfo.getModelVersion()); + Assert.assertEquals("cs1-svc-modelCustomizationId", modelInfo.getModelCustomizationId()); + Assert.assertEquals("5bc2b6b3-c9bb-49a1-89c8-4dac5b236d52", modelInfo.getModelVersionId()); + Assert.assertEquals("5bc2b6b3-c9bb-49a1-89c8-4dac5b236d52", modelInfo.getModelUuid()); + Assert.assertEquals("a316f8fa-c886-483f-801b-6663e35b836c", modelInfo.getModelInvariantUuid()); + + // requestInfo + RequestInfo requestInfo = sir.getRequestDetails().getRequestInfo(); + Assert.assertNotNull(requestInfo.getCorrelator()); + Assert.assertEquals("FamilyId", requestInfo.getProductFamilyId()); + Assert.assertEquals("source", requestInfo.getSource()); + Assert.assertEquals("service1-instanceName", requestInfo.getInstanceName()); + Assert.assertEquals(false, requestInfo.getSuppressRollback()); + Assert.assertEquals("RequestOrId", requestInfo.getRequestorId()); + + RelatedInstanceList[] relatedInstanceList = sir.getRequestDetails().getRelatedInstanceList(); + Assert.assertEquals(1, relatedInstanceList.length); + RelatedInstance relatedInstance = relatedInstanceList[0].getRelatedInstance(); + Assert.assertEquals("serviceInstanceId", relatedInstance.getInstanceId()); + Assert.assertEquals(InstanceDirection.source, relatedInstance.getInstanceDirection()); + + ModelInfo parentModel = relatedInstance.getModelInfo(); + Assert.assertEquals("a316f8fa-c886-483f-801b-6663e35b836c", parentModel.getModelInvariantId()); + Assert.assertEquals(ModelType.service, parentModel.getModelType()); + Assert.assertEquals("GuilinLcmSVC", parentModel.getModelName()); + Assert.assertEquals("2.0", parentModel.getModelVersion()); + Assert.assertEquals("5bc2b6b3-c9bb-49a1-89c8-4dac5b236d52", parentModel.getModelVersionId()); + Assert.assertEquals("5bc2b6b3-c9bb-49a1-89c8-4dac5b236d52", parentModel.getModelUuid()); + Assert.assertEquals("a316f8fa-c886-483f-801b-6663e35b836c", parentModel.getModelInvariantUuid()); + + SubscriberInfo subsciberInfo = sir.getRequestDetails().getSubscriberInfo(); + Assert.assertEquals("GlobalCustomerId", subsciberInfo.getGlobalSubscriberId()); + Assert.assertEquals("SubscriberName", subsciberInfo.getSubscriberName()); + + CloudConfiguration cloudConfiguration = sir.getRequestDetails().getCloudConfiguration(); + Assert.assertEquals("tenant-id", cloudConfiguration.getTenantId()); + Assert.assertEquals("CloudOwner", cloudConfiguration.getCloudOwner()); + Assert.assertEquals("my-region-id", cloudConfiguration.getLcpCloudRegionId()); + + org.onap.so.serviceinstancebeans.RequestParameters requestParameters = + sir.getRequestDetails().getRequestParameters(); + Assert.assertEquals(2, requestParameters.getUserParams().size()); + Assert.assertEquals(userParamsExpected.get(0), requestParameters.getUserParams().get(0)); + + ObjectMapper mapper = new ObjectMapper(); + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + + try { + String expectedChildService = + mapper.writeValueAsString(getChildService(userParamsExpected, "service1-instanceName")); + String actualChildService = + mapper.writeValueAsString(requestParameters.getUserParams().get(1).get("service")); + Assert.assertEquals(expectedChildService, actualChildService); + } catch (Exception e) { + Assert.fail(); + } + + org.onap.so.serviceinstancebeans.Project project = sir.getRequestDetails().getProject(); + Assert.assertEquals("projectName", project.getProjectName()); + + org.onap.so.serviceinstancebeans.OwningEntity owningEntity = sir.getRequestDetails().getOwningEntity(); + Assert.assertEquals("owningEntityId", owningEntity.getOwningEntityId()); + Assert.assertEquals("owningEntityName", owningEntity.getOwningEntityName()); + } + + @Test + public void childServiceCloudConfigurationRequestBuilderTest() throws IOException { + String incomingRequest = + "{\"requestDetails\":{\"subscriberInfo\":{\"globalSubscriberId\":\"ubuntu-customer\"},\"requestInfo\":{\"suppressRollback\":false,\"instanceName\":\"onap-test-parent-child-service\",\"productFamilyId\":\"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\",\"requestorId\":\"portal\",\"source\":\"postman\"},\"cloudConfiguration\":{\"lcpCloudRegionId\":\"215\",\"tenantId\":\"e2710e84063b421fab08189818761d55\",\"cloudOwner\":\"iaas\"},\"requestParameters\":{\"subscriptionServiceType\":\"ubuntu\",\"userParams\":[{\"Homing_Solution\":\"none\"},{\"service\":{\"instanceParams\":[],\"resources\":{\"services\":[{\"instanceParams\":[],\"resources\":{},\"modelInfo\":{\"modelVersion\":\"3.0\",\"modelVersionId\":\"872efe6d-c787-4caf-b6f8-3234a7bfc5cf\",\"modelInvariantId\":\"a316f8fa-c886-483f-801b-6663e35b836c\",\"modelName\":\"GuilinLcmSVC\",\"modelType\":\"service\"},\"instanceName\":\"service1-instanceName-child\",\"cloudConfiguration\":{\"lcpCloudRegionId\":\"test\",\"tenantId\":\"1234567890\",\"cloudOwner\":\"demo\"}},{\"instanceParams\":[],\"resources\":{},\"modelInfo\":{\"modelVersion\":\"3.0\",\"modelVersionId\":\"872efe6d-c787-4caf-b6f8-3234a7bfc5cf\",\"modelInvariantId\":\"a316f8fa-c886-483f-801b-6663e35b836c\",\"modelName\":\"GuilinLcmSVC\",\"modelType\":\"service\"},\"instanceName\":\"service2-instanceName-child\"}]},\"modelInfo\":{\"modelVersion\":\"3.0\",\"modelVersionId\":\"872efe6d-c787-4caf-b6f8-3234a7bfc5cf\",\"modelInvariantId\":\"a316f8fa-c886-483f-801b-6663e35b836c\",\"modelName\":\"GuilinLcmSVC\",\"modelType\":\"service\"}}}],\"aLaCarte\":false},\"project\":{\"projectName\":\"Project-UbuntuDemo\"},\"owningEntity\":{\"owningEntityId\":\"33a8b609-1cfe-4d19-8dc2-5b95b921de1e\",\"owningEntityName\":\"seb\"},\"modelInfo\":{\"modelVersion\":\"3.0\",\"modelVersionId\":\"872efe6d-c787-4caf-b6f8-3234a7bfc5cf\",\"modelInvariantId\":\"a316f8fa-c886-483f-801b-6663e35b836c\",\"modelName\":\"GuilinLcmSVC\",\"modelType\":\"service\"}}}"; + + ObjectMapper mapper = new ObjectMapper(); + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + + ServiceInstancesRequest request = mapper.readValue(incomingRequest, ServiceInstancesRequest.class); + + RequestContext context = new RequestContext(); + RequestParameters parameters = new RequestParameters(); + parameters.setUserParams(request.getRequestDetails().getRequestParameters().getUserParams()); + context.setRequestParameters(parameters); + context.setProductFamilyId("FamilyId"); + context.setSource("source"); + context.setRequestorId("RequestOrId"); + + CloudRegion cloudRegion = new CloudRegion(); + cloudRegion.setCloudOwner("CloudOwner"); + cloudRegion.setLcpCloudRegionId("my-region-id"); + cloudRegion.setTenantId("tenant-id"); + + ServiceInstance serviceInstance = new ServiceInstance(); + OwningEntity owningEntity = new OwningEntity(); + owningEntity.setOwningEntityId("owningEntityId"); + owningEntity.setOwningEntityName("owningEntityName"); + serviceInstance.setOwningEntity(owningEntity); + + GeneralBuildingBlock gbb = new GeneralBuildingBlock(); + gbb.setCloudRegion(cloudRegion); + gbb.setRequestContext(context); + gbb.setServiceInstance(serviceInstance); + mockExecution = mock(BuildingBlockExecution.class); + doReturn(gbb).when(mockExecution).getGeneralBuildingBlock(); + + ServiceInstancesRequest sir = ChildServiceRequestBuilder + .getInstance(mockExecution, "service1-instanceName-child") + .setParentRequestId(mockExecution.getGeneralBuildingBlock().getRequestContext().getMsoRequestId()) + .setCorrelationId(UUID.randomUUID().toString()).setChildSvcInstanceId("childInstanceId").build(); + + Assert.assertEquals("childInstanceId", sir.getServiceInstanceId()); + + CloudConfiguration cloudConfiguration = sir.getRequestDetails().getCloudConfiguration(); + Assert.assertEquals("1234567890", cloudConfiguration.getTenantId()); + Assert.assertEquals("demo", cloudConfiguration.getCloudOwner()); + Assert.assertEquals("test", cloudConfiguration.getLcpCloudRegionId()); + } + + private Service getChildService(List> userParams, String serviceInstanceName) + throws IOException { + String USERPARAMSERVICE = "service"; + for (Map params : userParams) { + if (params.containsKey(USERPARAMSERVICE)) { + ObjectMapper obj = new ObjectMapper(); + String input = obj.writeValueAsString(params.get(USERPARAMSERVICE)); + Service validate = obj.readValue(input, Service.class); + if (validate.getResources().getServices() != null) { + for (Service service : validate.getResources().getServices()) { + if (serviceInstanceName.equals(service.getInstanceName())) { + return service; + } + } + } + } + } + return null; + } + + +} -- cgit 1.2.3-korg From 63947de885b4736461e8810faaad0ee15899fd8b Mon Sep 17 00:00:00 2001 From: Jozsef Csongvai Date: Fri, 26 Nov 2021 16:19:01 -0500 Subject: Adjust RelatedInstancesValidation to enable child service requests Issue-ID: SO-3811 Signed-off-by: Jozsef Csongvai Change-Id: I135353f99896f1c64529adac1aa2b096388fd6e6 --- .../validation/RelatedInstancesValidation.java | 5 +- .../validation/RelatedInstancesValidationTest.java | 18 +++ .../RelatedInstanceInstanceId.json | 138 +++++++++++++++++++++ 3 files changed, 160 insertions(+), 1 deletion(-) create mode 100644 mso-api-handlers/mso-api-handler-infra/src/test/resources/Validation/UserParamsValidation/RelatedInstanceInstanceId.json diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/RelatedInstancesValidation.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/RelatedInstancesValidation.java index 3b87d91d3f..801065fdde 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/RelatedInstancesValidation.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/validation/RelatedInstancesValidation.java @@ -185,7 +185,10 @@ public class RelatedInstancesValidation implements ValidationRule { && !(requestScope.equalsIgnoreCase(ModelType.instanceGroup.toString()) && action == Action.createInstance)) { isRelatedServiceInstancePresent = true; - if (!relatedInstance.getInstanceId().equals(sir.getServiceInstanceId())) { + // InstanceDirection.source indicates child service and this validation is for all + // except child services. + if (!InstanceDirection.source.equals(relatedInstance.getInstanceDirection()) + && !relatedInstance.getInstanceId().equals(sir.getServiceInstanceId())) { throw new ValidationException( "serviceInstanceId matching the serviceInstanceId in request URI"); } diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/validation/RelatedInstancesValidationTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/validation/RelatedInstancesValidationTest.java index 93a19a9531..ef160e9c4c 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/validation/RelatedInstancesValidationTest.java +++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/validation/RelatedInstancesValidationTest.java @@ -31,6 +31,7 @@ import org.junit.rules.ExpectedException; import org.onap.so.apihandlerinfra.Action; import org.onap.so.apihandlerinfra.BaseTest; import org.onap.so.exceptions.ValidationException; +import org.onap.so.serviceinstancebeans.InstanceDirection; import org.onap.so.serviceinstancebeans.RelatedInstanceList; import org.onap.so.serviceinstancebeans.ServiceInstancesRequest; import com.fasterxml.jackson.databind.ObjectMapper; @@ -133,4 +134,21 @@ public class RelatedInstancesValidationTest extends BaseTest { validation.validate(setupValidationInformation( "src/test/resources/Validation/VpnBondingValidation/NoModelInvariantId.json")); } + + @Test + public void validateRelatedInstanceInstanceIdTest() throws IOException, ValidationException { + validation.validate(setupValidationInformation( + "src/test/resources/Validation/UserParamsValidation/RelatedInstanceInstanceId.json")); + } + + @Test + public void validateRelatedInstanceInstanceIdExceptionTest() throws IOException, ValidationException { + thrown.expect(ValidationException.class); + thrown.expectMessage("serviceInstanceId matching the serviceInstanceId in request URI"); + ValidationInformation info = setupValidationInformation( + "src/test/resources/Validation/UserParamsValidation/RelatedInstanceInstanceId.json"); + RelatedInstanceList[] instanceList = info.sir.getRequestDetails().getRelatedInstanceList(); + instanceList[0].getRelatedInstance().setInstanceDirection(InstanceDirection.fromValue("destination")); + validation.validate(info); + } } diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/resources/Validation/UserParamsValidation/RelatedInstanceInstanceId.json b/mso-api-handlers/mso-api-handler-infra/src/test/resources/Validation/UserParamsValidation/RelatedInstanceInstanceId.json new file mode 100644 index 0000000000..156eedf2b4 --- /dev/null +++ b/mso-api-handlers/mso-api-handler-infra/src/test/resources/Validation/UserParamsValidation/RelatedInstanceInstanceId.json @@ -0,0 +1,138 @@ +{ + "requestDetails": { + "subscriberInfo": { + "globalSubscriberId": "ubuntu-customer" + }, + "requestInfo": { + "suppressRollback": false, + "instanceName": "Onap-Unit-Test", + "productFamilyId": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", + "requestorId": "portal", + "source": "postman" + }, + "cloudConfiguration": { + "lcpCloudRegionId": "Onap215", + "tenantId": "e2710e84063b421fab08189818761d55", + "cloudOwner": "Onap" + }, + "requestParameters": { + "subscriptionServiceType": "ubuntu", + "userParams": [ + { + "Homing_Solution": "none" + }, + { + "service": { + "instanceParams": [], + "resources": { + "vnfs": [ + { + "modelInfo": { + "modelName": "UbuntuVF", + "modelVersionId": "3b6cb925-b583-4c5d-8200-62212258dd03", + "modelInvariantUuid": "dcbd2b4f-86a9-48f2-9149-9fbd506cb0f5", + "modelVersion": "1.0", + "modelCustomizationId": "1aa2ae52-f3c8-4c52-91eb-54a23104cff8", + "modelInstanceName": "UbuntuVF 0" + }, + "cloudConfiguration": { + "lcpCloudRegionId": "lcp", + "tenantId": "e2710e84063b421fab08189818761d55", + "cloudOwner": "Onap" + }, + "platform": { + "platformName": "openstack" + }, + "lineOfBusiness": { + "lineOfBusinessName": "wireless" + }, + "productFamilyId": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", + "instanceName": "vnf-instanceName", + "instanceParams": [ + { + "vnf-name": "vnf-vnf-name", + "vnf_name": "UbuntuVNFName" + } + ], + "vfModules": [ + { + "modelInfo": { + "modelName": "UbuntuVF..base..module-0", + "modelVersionId": "2bb60c6b-2bfb-4162-b95b-74d81916aa25", + "modelInvariantUuid": "fb8af74c-83a6-4c27-b2db-b414bf70062a", + "modelVersion": "1", + "modelCustomizationId": "cd530d5b-b24b-4d2c-9987-5179075c9381" + }, + "instanceName": "Openstack-fail-network-1", + "instanceParams": [ + { + "name": "Openstack-fail-network-1", + "cidr": "10.10.10.0/24" + } + ] + }, + { + "modelInfo": { + "modelName": "UbuntuVF..ubuntu-vf-module..module-1", + "modelVersionId": "73fb74e8-f7cc-4927-9cc2-bb5c7b36c109", + "modelInvariantUuid": "51d1c820-7578-4c5d-8fc7-fcf975800059", + "modelVersion": "1", + "modelCustomizationId": "67b4547c-b059-4a45-8b0b-12ce6bb3cf2f" + }, + "instanceName": "Openstack-fail-ubuntu-1", + "instanceParams": [ + { + "name": "Openstack-fail-ubuntu-1", + "network_mgmt": "vlan666_net", + "key_name": "mykey", + "network_name": "Openstack-fail-network-1" + } + ] + } + ] + } + ] + }, + "modelInfo": { + "modelVersion": "1.0", + "modelVersionId": "b0dce97c-e320-4dea-bd4a-7e398b4f5199", + "modelInvariantId": "577d7107-53ab-4f3d-a5a4-f4e9295312d8", + "modelName": "UbuntuSVC", + "modelType": "service" + } + } + } + ], + "aLaCarte": false + }, + "project": { + "projectName": "Project-UbuntuDemo" + }, + "owningEntity": { + "owningEntityId": "33a8b609-1cfe-4d19-8dc2-5b95b921de1e", + "owningEntityName": "owner" + }, + "modelInfo": { + "modelVersion": "1.0", + "modelVersionId": "b0dce97c-e320-4dea-bd4a-7e398b4f5199", + "modelInvariantId": "577d7107-53ab-4f3d-a5a4-f4e9295312d8", + "modelName": "UbuntuSVC", + "modelType": "service" + }, + "relatedInstanceList": [ + { + "relatedInstance": { + "instanceId": "351262fb-4a32-4c43-b600-c6514f6ff808", + "modelInfo": { + "modelVersion": "1.0", + "modelVersionId": "b0dce97c-e320-4dea-bd4a-7e398b4f5199", + "modelInvariantId": "577d7107-53ab-4f3d-a5a4-f4e9295312d8", + "modelName": "UbuntuSVC", + "modelType": "service" + }, + "instanceDirection": "source" + } + } + ] + } +} \ No newline at end of file -- cgit 1.2.3-korg From 18cc4f0fb16e1f03072222268eb2c5661d29bc23 Mon Sep 17 00:00:00 2001 From: Jozsef Csongvai Date: Fri, 26 Nov 2021 16:28:01 -0500 Subject: Add service composition building blocks Issue-ID: SO-3811 Signed-off-by: Jozsef Csongvai Change-Id: I1f3eb0b6ae0e6ac1ce90dbd10d3737bb195c673b --- .../servicedecomposition/entities/ResourceKey.java | 4 +- .../BuildingBlock/CreateChildServiceBB.bpmn | 135 +++++++++++++++++++ .../BuildingBlock/DeleteChildServiceBB.bpmn | 135 +++++++++++++++++++ .../service/composition/CreateChildServiceBB.java | 95 ++++++++++++++ .../service/composition/DeleteChildServiceBB.java | 42 ++++++ .../composition/ServiceCompositionConstants.java | 32 +++++ .../composition/CreateChildServiceBBTest.java | 145 +++++++++++++++++++++ 7 files changed, 587 insertions(+), 1 deletion(-) create mode 100644 bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/CreateChildServiceBB.bpmn create mode 100644 bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/DeleteChildServiceBB.bpmn create mode 100644 bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/service/composition/CreateChildServiceBB.java create mode 100644 bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/service/composition/DeleteChildServiceBB.java create mode 100644 bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/service/composition/ServiceCompositionConstants.java create mode 100644 bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/service/composition/CreateChildServiceBBTest.java diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/ResourceKey.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/ResourceKey.java index 641cd35027..cb4bd81918 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/ResourceKey.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/ResourceKey.java @@ -36,5 +36,7 @@ public enum ResourceKey { INSTANCE_GROUP_ID, PNF, VNF_INSTANCE_NAME, - VF_MODULE_INSTANCE_NAME + VF_MODULE_INSTANCE_NAME, + CHILD_SERVICE_INSTANCE_ID, + CHILD_SERVICE_INSTANCE_NAME } diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/CreateChildServiceBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/CreateChildServiceBB.bpmn new file mode 100644 index 0000000000..b681b999b1 --- /dev/null +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/CreateChildServiceBB.bpmn @@ -0,0 +1,135 @@ + + + + + SequenceFlow_14q7e7i + + + SequenceFlow_143mdyp + + + + + + + + SequenceFlow_0x6xxb8 + SequenceFlow_0jahgui + + + SequenceFlow_0hmy1qr + + PT5H + + + + SequenceFlow_0hmy1qr + + + + + SequenceFlow_0jahgui + SequenceFlow_0zfixj7 + SequenceFlow_052tga4 + + + ${execution.getVariable("CHILD_SVC_REQ_STATUS")=="COMPLETED"} + + + + SequenceFlow_14q7e7i + SequenceFlow_0n5pwwk + + + SequenceFlow_0n5pwwk + SequenceFlow_0x6xxb8 + + + SequenceFlow_052tga4 + + + SequenceFlow_0zfixj7 + SequenceFlow_143mdyp + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/DeleteChildServiceBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/DeleteChildServiceBB.bpmn new file mode 100644 index 0000000000..cfa55d2101 --- /dev/null +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/DeleteChildServiceBB.bpmn @@ -0,0 +1,135 @@ + + + + + SequenceFlow_01wirq3 + + + SequenceFlow_14d89qf + SequenceFlow_1ufwh0a + + + SequenceFlow_0o2ukb9 + + + + SequenceFlow_0o2ukb9 + + PT5H + + + + + + + + SequenceFlow_1ufwh0a + SequenceFlow_0v4loyx + SequenceFlow_12rysg7 + + + SequenceFlow_0v4loyx + SequenceFlow_096kfnj + + + SequenceFlow_096kfnj + + + ${execution.getVariable("CHILD_SVC_REQ_STATUS")=="COMPLETED"} + + + + + + SequenceFlow_01wirq3 + SequenceFlow_0q6aqsk + + + SequenceFlow_0q6aqsk + SequenceFlow_14d89qf + + + SequenceFlow_12rysg7 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/service/composition/CreateChildServiceBB.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/service/composition/CreateChildServiceBB.java new file mode 100644 index 0000000000..3672df4dba --- /dev/null +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/service/composition/CreateChildServiceBB.java @@ -0,0 +1,95 @@ +/*- + * Copyright (C) 2021 Bell Canada. All rights reserved. + * + * 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. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.onap.so.bpmn.infrastructure.service.composition; + +import static org.onap.so.bpmn.infrastructure.service.composition.ServiceCompositionConstants.CHILD_SVC_REQ_ERROR; +import static org.onap.so.bpmn.infrastructure.service.composition.ServiceCompositionConstants.CHILD_SVC_REQ_PAYLOAD; +import static org.onap.so.bpmn.infrastructure.service.composition.ServiceCompositionConstants.CHILD_SVC_REQ_ID; +import static org.onap.so.bpmn.infrastructure.service.composition.ServiceCompositionConstants.CHILD_SVC_INSTANCE_ID; +import static org.onap.so.bpmn.infrastructure.service.composition.ServiceCompositionConstants.CHILD_SVC_REQ_CORRELATION_ID; +import java.util.Map; +import java.util.Objects; +import java.util.UUID; +import org.onap.logging.filter.base.ONAPComponents; +import org.onap.so.bpmn.common.BuildingBlockExecution; +import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey; +import org.onap.so.client.exception.ExceptionBuilder; +import org.onap.so.client.orchestration.ApiHandlerClient; +import org.onap.so.serviceinstancebeans.ServiceInstancesRequest; +import org.onap.so.serviceinstancebeans.ServiceInstancesResponse; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +@Component +public class CreateChildServiceBB { + + private final Logger log = LoggerFactory.getLogger(this.getClass()); + + @Autowired + protected ExceptionBuilder exceptionBuilder; + + @Autowired + private ApiHandlerClient apiHandlerClient; + + public void buildRequest(final BuildingBlockExecution buildingBlockExecution) { + try { + log.info("Building Create Service Request"); + Map lookupMap = buildingBlockExecution.getLookupMap(); + String childSvcInstanceName = lookupMap.get(ResourceKey.CHILD_SERVICE_INSTANCE_NAME); + Objects.requireNonNull(childSvcInstanceName, "Child service instance name is required"); + + ServiceInstancesRequest sir = ChildServiceRequestBuilder + .getInstance(buildingBlockExecution, childSvcInstanceName) + .setParentRequestId( + buildingBlockExecution.getGeneralBuildingBlock().getRequestContext().getMsoRequestId()) + .setCorrelationId(UUID.randomUUID().toString()).build(); + buildingBlockExecution.setVariable(CHILD_SVC_REQ_PAYLOAD, sir); + } catch (Exception e) { + exceptionBuilder.buildAndThrowWorkflowException(buildingBlockExecution, 10002, e.getMessage(), + ONAPComponents.SO); + } + } + + public void sendRequest(final BuildingBlockExecution buildingBlockExecution) throws Exception { + try { + buildingBlockExecution.getLookupMap(); + ServiceInstancesRequest sir = buildingBlockExecution.getVariable(CHILD_SVC_REQ_PAYLOAD); + log.info("Sending Create Service Request: \n{}", sir.toString()); + buildingBlockExecution.setVariable(CHILD_SVC_REQ_CORRELATION_ID, + sir.getRequestDetails().getRequestInfo().getCorrelator()); + + ServiceInstancesResponse response = apiHandlerClient.createServiceInstance(sir); + buildingBlockExecution.setVariable(CHILD_SVC_REQ_ID, response.getRequestReferences().getRequestId()); + buildingBlockExecution.setVariable(CHILD_SVC_INSTANCE_ID, response.getRequestReferences().getInstanceId()); + } catch (Exception e) { + exceptionBuilder.buildAndThrowWorkflowException(buildingBlockExecution, 10003, e.getMessage(), + ONAPComponents.SO); + } + } + + public void handleFailure(final BuildingBlockExecution buildingBlockExecution) { + Map lookupMap = buildingBlockExecution.getLookupMap(); + String childSvcInstanceName = lookupMap.get(ResourceKey.CHILD_SERVICE_INSTANCE_NAME); + String childErrorMessage = buildingBlockExecution.getVariable(CHILD_SVC_REQ_ERROR); + String errorMessage = + String.format("Failed creating child service %s %s", childSvcInstanceName, childErrorMessage); + exceptionBuilder.buildAndThrowWorkflowException(buildingBlockExecution, 10001, errorMessage, ONAPComponents.SO); + } + +} diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/service/composition/DeleteChildServiceBB.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/service/composition/DeleteChildServiceBB.java new file mode 100644 index 0000000000..a3f70c8f5b --- /dev/null +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/service/composition/DeleteChildServiceBB.java @@ -0,0 +1,42 @@ +/*- + * Copyright (C) 2021 Bell Canada. All rights reserved. + * + * 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. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.onap.so.bpmn.infrastructure.service.composition; + +import org.onap.so.bpmn.common.BuildingBlockExecution; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Component; + +@Component +public class DeleteChildServiceBB { + + private final Logger log = LoggerFactory.getLogger(this.getClass()); + + public void buildRequest(final BuildingBlockExecution buildingBlockExecution) { + log.info("Building Delete Service Request"); + } + + public void sendRequest(final BuildingBlockExecution buildingBlockExecution) { + log.info("Sending Delete Service Request"); + } + + public void handleFailure(final BuildingBlockExecution buildingBlockExecution, final String responsePayload) { + // log error + // build workflowException with proper message + } + +} diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/service/composition/ServiceCompositionConstants.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/service/composition/ServiceCompositionConstants.java new file mode 100644 index 0000000000..6b209bdcef --- /dev/null +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/service/composition/ServiceCompositionConstants.java @@ -0,0 +1,32 @@ +/*- + * Copyright (C) 2021 Bell Canada. All rights reserved. + * + * 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. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.onap.so.bpmn.infrastructure.service.composition; + +public class ServiceCompositionConstants { + + public static final String CHILD_SVC_REQ_PAYLOAD = "childServiceRequestPayload"; + public static final String CHILD_SVC_REQ_ID = "childServiceRequestId"; + public static final String CHILD_SVC_INSTANCE_ID = "childServiceInstanceId"; + public static final String IS_CHILD_PROCESS = "isChildProcess"; + public static final String CHILD_SVC_REQ_CORRELATION_ID = "childServiceRequestCorrelationId"; + public static final String CHILD_SVC_REQ_TIMEOUT = "childServiceRequestTimeout"; + public static final String CHILD_SVC_REQ_STATUS = "CHILD_SVC_REQ_STATUS"; + public static final String CHILD_SVC_REQ_ERROR = "CHILD_SVC_REQ_ERROR"; + public static final String CHILD_SVC_REQ_MESSAGE_NAME = "ChildServiceRequest"; + public static final String PARENT_CORRELATION_ID = "parentCorrelationId"; + +} diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/service/composition/CreateChildServiceBBTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/service/composition/CreateChildServiceBBTest.java new file mode 100644 index 0000000000..6392d25998 --- /dev/null +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/service/composition/CreateChildServiceBBTest.java @@ -0,0 +1,145 @@ +package org.onap.so.bpmn.infrastructure.service.composition; + +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.onap.logging.filter.base.ONAPComponentsList; +import org.onap.so.bpmn.common.BuildingBlockExecution; +import org.onap.so.bpmn.infrastructure.decisionpoint.impl.buildingblock.MockControllerBB; +import org.onap.so.bpmn.servicedecomposition.bbobjects.CloudRegion; +import org.onap.so.bpmn.servicedecomposition.bbobjects.Customer; +import org.onap.so.bpmn.servicedecomposition.bbobjects.OwningEntity; +import org.onap.so.bpmn.servicedecomposition.bbobjects.Project; +import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance; +import org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock; +import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey; +import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestContext; +import org.onap.so.bpmn.servicedecomposition.generalobjects.RequestParameters; +import org.onap.so.client.exception.ExceptionBuilder; +import org.onap.so.client.orchestration.ApiHandlerClient; +import org.onap.so.client.orchestration.ApiHandlerClientException; +import org.onap.so.serviceinstancebeans.RequestDetails; +import org.onap.so.serviceinstancebeans.RequestInfo; +import org.onap.so.serviceinstancebeans.RequestReferences; +import org.onap.so.serviceinstancebeans.ServiceInstancesRequest; +import org.onap.so.serviceinstancebeans.ServiceInstancesResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import java.io.IOException; +import java.util.HashMap; +import java.util.Map; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyInt; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import static org.onap.so.bpmn.infrastructure.service.composition.ServiceCompositionConstants.CHILD_SVC_INSTANCE_ID; +import static org.onap.so.bpmn.infrastructure.service.composition.ServiceCompositionConstants.CHILD_SVC_REQ_CORRELATION_ID; +import static org.onap.so.bpmn.infrastructure.service.composition.ServiceCompositionConstants.CHILD_SVC_REQ_ID; +import static org.onap.so.bpmn.infrastructure.service.composition.ServiceCompositionConstants.CHILD_SVC_REQ_PAYLOAD; + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration(classes = {CreateChildServiceBB.class, MockControllerBB.class, ExceptionBuilder.class}) +public class CreateChildServiceBBTest { + + @Autowired + private CreateChildServiceBB createChildServiceBB; + + @MockBean + private BuildingBlockExecution execution; + + @MockBean + private ApiHandlerClient apiHandlerClient; + + @MockBean + private ExceptionBuilder exceptionBuilder; + + @Before + public void setUp() throws IOException, ApiHandlerClientException { + String incomingRequest = + "{\"requestDetails\":{\"subscriberInfo\":{\"globalSubscriberId\":\"ubuntu-customer\"},\"requestInfo\":{\"suppressRollback\":false,\"instanceName\":\"LcmDemo\",\"productFamilyId\":\"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\",\"requestorId\":\"portal\",\"source\":\"postman\"},\"cloudConfiguration\":{\"lcpCloudRegionId\":\"123\",\"tenantId\":\"e2710e84063b421fab08189818761d55\",\"cloudOwner\":\"cloudOwner\"},\"requestParameters\":{\"subscriptionServiceType\":\"ubuntu\",\"userParams\":[{\"Homing_Solution\":\"none\"},{\"service\":{\"instanceParams\":[],\"resources\":{\"vnfs\":[{\"modelInfo\":{\"modelName\":\"UbuntuSriovVF\",\"modelVersionId\":\"5b5d07f0-7449-4eec-95eb-531ddef18240\",\"modelInvariantUuid\":\"9ed17b82-11f3-44cc-a86f-32739360617e\",\"modelVersion\":\"1.0\",\"modelCustomizationId\":\"ae139d3d-b2ae-462c-b09d-c85bdc2e3073\",\"modelInstanceName\":\"UbuntuSriovVF0\"},\"cloudConfiguration\":{\"lcpCloudRegionId\":\"123\",\"tenantId\":\"e2710e84063b421fab08189818761d55\",\"cloudOwner\":\"cloudOwner\"},\"platform\":{\"platformName\":\"openstack\"},\"lineOfBusiness\":{\"lineOfBusinessName\":\"wireless\"},\"productFamilyId\":\"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\",\"instanceName\":\"vnf-instanceName\",\"instanceParams\":[{\"vnf-name\":\"vnf-vnf-name\",\"vnf_name\":\"UbuntuVNFName\"}],\"vfModules\":[{\"modelInfo\":{\"modelName\":\"Ubuntusriovvf..base..module-0\",\"modelVersionId\":\"f4ef24dd-7a4e-4eef-83b7-c58f2f3e36e4\",\"modelInvariantUuid\":\"719aab1e-c551-46e0-87e8-a78dcd7891da\",\"modelVersion\":\"1\",\"modelCustomizationId\":\"dea421a8-c1b8-4044-8ca1-58c30de3b315\"},\"instanceName\":\"lcm-demo-network-1\",\"instanceParams\":[{\"name\":\"lcm-demo-network-1\",\"cidr\":\"10.10.10.0/24\"}]},{\"modelInfo\":{\"modelName\":\"Ubuntusriovvf..ubuntu-vf-module..module-1\",\"modelVersionId\":\"112f2de4-4f09-4567-9de1-2d271cb6e164\",\"modelInvariantUuid\":\"ba6d2e11-4e82-4bb8-9d52-a2962a263a09\",\"modelVersion\":\"1\",\"modelCustomizationId\":\"7bc2649e-b96b-44ec-adfe-4a6167f3034e\"},\"instanceName\":\"lcm-demo-ubuntu-1\",\"instanceParams\":[{\"name\":\"lcm-demo-ubuntu-1\",\"network_mgmt\":\"networkMgmt\",\"key_name\":\"demo\",\"network_name\":\"lcm-demo-network-1\",\"image_name\":\"imageName\",\"flavor_name\":\"m1.small\"}]}]}],\"services\":[{\"instanceParams\":[],\"resources\":{\"vnfs\":[{\"modelInfo\":{\"modelName\":\"UbuntuSriovVF\",\"modelVersionId\":\"5b5d07f0-7449-4eec-95eb-531ddef18240\",\"modelInvariantUuid\":\"9ed17b82-11f3-44cc-a86f-32739360617e\",\"modelVersion\":\"1.0\",\"modelCustomizationId\":\"ae139d3d-b2ae-462c-b09d-c85bdc2e3073\",\"modelInstanceName\":\"UbuntuSriovVF0\"},\"cloudConfiguration\":{\"lcpCloudRegionId\":\"123\",\"tenantId\":\"e2710e84063b421fab08189818761d55\",\"cloudOwner\":\"cloudOwner\"},\"platform\":{\"platformName\":\"openstack\"},\"lineOfBusiness\":{\"lineOfBusinessName\":\"wireless\"},\"productFamilyId\":\"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\",\"instanceName\":\"vnf-instanceName\",\"instanceParams\":[{\"vnf-name\":\"vnf-vnf-name\",\"vnf_name\":\"UbuntuVNFName\"}],\"vfModules\":[{\"modelInfo\":{\"modelName\":\"Ubuntusriovvf..base..module-0\",\"modelVersionId\":\"f4ef24dd-7a4e-4eef-83b7-c58f2f3e36e4\",\"modelInvariantUuid\":\"719aab1e-c551-46e0-87e8-a78dcd7891da\",\"modelVersion\":\"1\",\"modelCustomizationId\":\"dea421a8-c1b8-4044-8ca1-58c30de3b315\"},\"instanceName\":\"lcm-demo-network-1\",\"instanceParams\":[{\"name\":\"lcm-demo-network-1\",\"cidr\":\"10.10.10.0/24\"}]},{\"modelInfo\":{\"modelName\":\"Ubuntusriovvf..ubuntu-vf-module..module-1\",\"modelVersionId\":\"112f2de4-4f09-4567-9de1-2d271cb6e164\",\"modelInvariantUuid\":\"ba6d2e11-4e82-4bb8-9d52-a2962a263a09\",\"modelVersion\":\"1\",\"modelCustomizationId\":\"7bc2649e-b96b-44ec-adfe-4a6167f3034e\"},\"instanceName\":\"lcm-demo-ubuntu-1\",\"instanceParams\":[{\"name\":\"lcm-demo-ubuntu-1\",\"network_mgmt\":\"networkMgmt\",\"key_name\":\"demo\",\"network_name\":\"lcm-demo-network-1\",\"image_name\":\"imageName\",\"flavor_name\":\"m1.small\"}]}]}]},\"modelInfo\":{\"modelVersion\":\"2.0\",\"modelVersionId\":\"5bc2b6b3-c9bb-49a1-89c8-4dac5b236d52\",\"modelInvariantId\":\"a316f8fa-c886-483f-801b-6663e35b836c\",\"modelCustomizationId\":\"cs1-svc-modelCustomizationId\",\"modelName\":\"GuilinLcmSVC\",\"modelType\":\"service\"},\"instanceName\":\"service1-instanceName\"},{\"instanceParams\":[],\"resources\":{\"vnfs\":[{\"modelInfo\":{\"modelName\":\"UbuntuSriovVF\",\"modelVersionId\":\"5b5d07f0-7449-4eec-95eb-531ddef18240\",\"modelInvariantUuid\":\"9ed17b82-11f3-44cc-a86f-32739360617e\",\"modelVersion\":\"1.0\",\"modelCustomizationId\":\"ae139d3d-b2ae-462c-b09d-c85bdc2e3073\",\"modelInstanceName\":\"UbuntuSriovVF0\"},\"cloudConfiguration\":{\"lcpCloudRegionId\":\"123\",\"tenantId\":\"e2710e84063b421fab08189818761d55\",\"cloudOwner\":\"cloudOwner\"},\"platform\":{\"platformName\":\"openstack\"},\"lineOfBusiness\":{\"lineOfBusinessName\":\"wireless\"},\"productFamilyId\":\"a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb\",\"instanceName\":\"vnf-instanceName\",\"instanceParams\":[{\"vnf-name\":\"vnf-vnf-name\",\"vnf_name\":\"UbuntuVNFName\"}],\"vfModules\":[{\"modelInfo\":{\"modelName\":\"Ubuntusriovvf..base..module-0\",\"modelVersionId\":\"f4ef24dd-7a4e-4eef-83b7-c58f2f3e36e4\",\"modelInvariantUuid\":\"719aab1e-c551-46e0-87e8-a78dcd7891da\",\"modelVersion\":\"1\",\"modelCustomizationId\":\"dea421a8-c1b8-4044-8ca1-58c30de3b315\"},\"instanceName\":\"lcm-demo-network-1\",\"instanceParams\":[{\"name\":\"lcm-demo-network-1\",\"cidr\":\"10.10.10.0/24\"}]},{\"modelInfo\":{\"modelName\":\"Ubuntusriovvf..ubuntu-vf-module..module-1\",\"modelVersionId\":\"112f2de4-4f09-4567-9de1-2d271cb6e164\",\"modelInvariantUuid\":\"ba6d2e11-4e82-4bb8-9d52-a2962a263a09\",\"modelVersion\":\"1\",\"modelCustomizationId\":\"7bc2649e-b96b-44ec-adfe-4a6167f3034e\"},\"instanceName\":\"lcm-demo-ubuntu-1\",\"instanceParams\":[{\"name\":\"lcm-demo-ubuntu-1\",\"network_mgmt\":\"networkMgmt\",\"key_name\":\"demo\",\"network_name\":\"lcm-demo-network-1\",\"image_name\":\"imageName\",\"flavor_name\":\"m1.small\"}]}]}]},\"modelInfo\":{\"modelVersion\":\"2.0\",\"modelVersionId\":\"5bc2b6b3-c9bb-49a1-89c8-4dac5b236d52\",\"modelInvariantId\":\"a316f8fa-c886-483f-801b-6663e35b836c\",\"modelCustomizationId\":\"cs1-svc-modelCustomizationId\",\"modelName\":\"GuilinLcmSVC\",\"modelType\":\"service\"},\"instanceName\":\"service2-instanceName\"}]},\"modelInfo\":{\"modelVersion\":\"2.0\",\"modelVersionId\":\"5bc2b6b3-c9bb-49a1-89c8-4dac5b236d52\",\"modelInvariantId\":\"a316f8fa-c886-483f-801b-6663e35b836c\",\"modelName\":\"GuilinLcmSVC\",\"modelType\":\"service\"}}}],\"aLaCarte\":false},\"project\":{\"projectName\":\"Project-UbuntuDemo\"},\"owningEntity\":{\"owningEntityId\":\"33a8b609-1cfe-4d19-8dc2-5b95b921de1e\",\"owningEntityName\":\"demo\"},\"modelInfo\":{\"modelVersion\":\"2.0\",\"modelVersionId\":\"5bc2b6b3-c9bb-49a1-89c8-4dac5b236d52\",\"modelInvariantId\":\"a316f8fa-c886-483f-801b-6663e35b836c\",\"modelName\":\"GuilinLcmSVC\",\"modelType\":\"service\"}}}"; + + ObjectMapper mapper = new ObjectMapper(); + mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + + ServiceInstancesRequest request = mapper.readValue(incomingRequest, ServiceInstancesRequest.class); + RequestContext context = new RequestContext(); + RequestParameters parameters = new RequestParameters(); + parameters.setUserParams(request.getRequestDetails().getRequestParameters().getUserParams()); + context.setRequestParameters(parameters); + context.setProductFamilyId("FamilyId"); + context.setSource("source"); + context.setRequestorId("RequestOrId"); + + CloudRegion cloudRegion = new CloudRegion(); + cloudRegion.setCloudOwner("CloudOwner"); + cloudRegion.setLcpCloudRegionId("my-region-id"); + cloudRegion.setTenantId("tenant-id"); + + Customer customer = new Customer(); + customer.setGlobalCustomerId("GlobalCustomerId"); + customer.setSubscriberName("SubscriberName"); + + ServiceInstance serviceInstance = new ServiceInstance(); + OwningEntity owningEntity = new OwningEntity(); + owningEntity.setOwningEntityId("owningEntityId"); + owningEntity.setOwningEntityName("owningEntityName"); + serviceInstance.setOwningEntity(owningEntity); + + Project project = new Project(); + project.setProjectName("projectName"); + serviceInstance.setProject(project); + + serviceInstance.setServiceInstanceId("serviceInstanceId"); + + GeneralBuildingBlock gbb = new GeneralBuildingBlock(); + gbb.setCloudRegion(cloudRegion); + gbb.setCustomer(customer); + gbb.setRequestContext(context); + gbb.setServiceInstance(serviceInstance); + + Map map = new HashMap<>(); + map.put(ResourceKey.CHILD_SERVICE_INSTANCE_NAME, "service1-instanceName"); + + when(execution.getGeneralBuildingBlock()).thenReturn(gbb); + when(execution.getLookupMap()).thenReturn(map); + + ServiceInstancesResponse response = new ServiceInstancesResponse(); + response.setRequestReferences(new RequestReferences()); + response.getRequestReferences().setInstanceId("instanceId"); + response.getRequestReferences().setRequestId("requestId"); + + when(apiHandlerClient.createServiceInstance(any())).thenReturn(response); + } + + @Test + public void buildRequestTest() { + createChildServiceBB.buildRequest(execution); + } + + @Test + public void sendRequestTest() throws Exception { + ServiceInstancesRequest sir = new ServiceInstancesRequest(); + RequestDetails details = new RequestDetails(); + details.setRequestInfo(new RequestInfo()); + details.getRequestInfo().setCorrelator("correlator"); + sir.setRequestDetails(details); + + when(execution.getVariable(CHILD_SVC_REQ_PAYLOAD)).thenReturn(sir); + createChildServiceBB.sendRequest(execution); + verify(execution).setVariable(CHILD_SVC_REQ_ID, "requestId"); + verify(execution).setVariable(CHILD_SVC_INSTANCE_ID, "instanceId"); + verify(execution).setVariable(CHILD_SVC_REQ_CORRELATION_ID, "correlator"); + } + + @Test + public void handleFailureTest() { + createChildServiceBB.handleFailure(execution); + verify(exceptionBuilder).buildAndThrowWorkflowException(any(BuildingBlockExecution.class), anyInt(), + anyString(), any(ONAPComponentsList.class)); + } +} -- cgit 1.2.3-korg From 1e3c281b0ae601b3c1bed4ba52fc5cb9ae0b0f7a Mon Sep 17 00:00:00 2001 From: Jozsef Csongvai Date: Fri, 26 Nov 2021 17:24:42 -0500 Subject: Enable CreateChildServiceBB for Service-Macro-Create Issue-ID: SO-3811 Signed-off-by: Jozsef Csongvai Change-Id: I7979082a9f145a84f6f03cf2c44e9ccbca198c5a --- .../main/resources/db/migration/R__MacroData.sql | 48 ++++---- .../entities/WorkflowResourceIds.java | 21 ++++ .../servicedecomposition/tasks/BBInputSetup.java | 2 + .../bpmn/process/WorkflowActionBBTest.java | 1 + .../tasks/ExecuteBuildingBlockBuilder.java | 15 ++- .../workflow/tasks/WorkflowAction.java | 39 ++++-- .../workflow/tasks/WorkflowActionBBFailure.java | 21 ++++ .../workflow/tasks/WorkflowActionBBTasks.java | 17 +++ .../workflow/tasks/WorkflowActionConstants.java | 1 + .../tasks/ebb/loader/ServiceEBBLoader.java | 6 +- .../ebb/loader/UserParamsServiceTraversal.java | 13 ++ .../tasks/WorkflowActionBBFailureTest.java | 133 +++++++++++++++++++++ 12 files changed, 284 insertions(+), 33 deletions(-) diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql index 3b95ffef0a..6b552b3fdd 100644 --- a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql @@ -69,27 +69,28 @@ INSERT INTO orchestration_flow_reference(COMPOSITE_ACTION, SEQ_NO, FLOW_NAME, SC ('Service-Macro-Unassign', '4', 'UnassignNetworkBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Unassign' and CLOUD_OWNER = 'DEFAULT')), ('Service-Macro-Unassign', '5', 'UnassignServiceInstanceBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Unassign' and CLOUD_OWNER = 'DEFAULT')), ('Service-Macro-Create', '1', 'AssignServiceInstanceBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')), -('Service-Macro-Create', '2', 'CreateNetworkCollectionBB', NULL, NULL,1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')), -('Service-Macro-Create', '3', 'AssignNetworkBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')), -('Service-Macro-Create', '4', 'AssignVnfBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')), -('Service-Macro-Create', '5', 'AssignVolumeGroupBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')), -('Service-Macro-Create', '6', 'AssignVfModuleBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')), -('Service-Macro-Create', '7', 'ControllerExecutionBB', 'vnf', 'config-assign', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')), -('Service-Macro-Create', '8', 'AssignPnfBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')), -('Service-Macro-Create', '9', 'WaitForPnfReadyBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')), -('Service-Macro-Create', '10', 'ControllerExecutionBB', 'pnf', 'config-assign', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')), -('Service-Macro-Create', '11', 'ControllerExecutionBB', 'pnf', 'config-deploy', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')), -('Service-Macro-Create', '12', 'ActivatePnfBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')), -('Service-Macro-Create', '13', 'CreateNetworkBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')), -('Service-Macro-Create', '14', 'ActivateNetworkBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')), -('Service-Macro-Create', '15', 'CreateVolumeGroupBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')), -('Service-Macro-Create', '16', 'ActivateVolumeGroupBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')), -('Service-Macro-Create', '17', 'CreateVfModuleBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')), -('Service-Macro-Create', '18', 'ActivateVfModuleBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')), -('Service-Macro-Create', '19', 'ControllerExecutionBB', 'vnf', 'config-deploy', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')), -('Service-Macro-Create', '20', 'ActivateVnfBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')), -('Service-Macro-Create', '21', 'ActivateNetworkCollectionBB', NULL, NULL,1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')), -('Service-Macro-Create', '22', 'ActivateServiceInstanceBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')), +('Service-Macro-Create', '2', 'CreateChildServiceBB', NULL, NULL,1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')), +('Service-Macro-Create', '3', 'CreateNetworkCollectionBB', NULL, NULL,1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')), +('Service-Macro-Create', '4', 'AssignNetworkBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')), +('Service-Macro-Create', '5', 'AssignVnfBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')), +('Service-Macro-Create', '6', 'AssignVolumeGroupBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')), +('Service-Macro-Create', '7', 'AssignVfModuleBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')), +('Service-Macro-Create', '8', 'ControllerExecutionBB', 'vnf', 'config-assign', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')), +('Service-Macro-Create', '9', 'AssignPnfBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')), +('Service-Macro-Create', '10', 'WaitForPnfReadyBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')), +('Service-Macro-Create', '11', 'ControllerExecutionBB', 'pnf', 'config-assign', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')), +('Service-Macro-Create', '12', 'ControllerExecutionBB', 'pnf', 'config-deploy', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')), +('Service-Macro-Create', '13', 'ActivatePnfBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')), +('Service-Macro-Create', '14', 'CreateNetworkBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')), +('Service-Macro-Create', '15', 'ActivateNetworkBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')), +('Service-Macro-Create', '16', 'CreateVolumeGroupBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')), +('Service-Macro-Create', '17', 'ActivateVolumeGroupBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')), +('Service-Macro-Create', '18', 'CreateVfModuleBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')), +('Service-Macro-Create', '19', 'ActivateVfModuleBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')), +('Service-Macro-Create', '20', 'ControllerExecutionBB', 'vnf', 'config-deploy', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')), +('Service-Macro-Create', '21', 'ActivateVnfBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')), +('Service-Macro-Create', '22', 'ActivateNetworkCollectionBB', NULL, NULL,1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')), +('Service-Macro-Create', '23', 'ActivateServiceInstanceBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')), ('Service-Macro-Delete', '1', 'DeactivateVfModuleBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'DEFAULT')), ('Service-Macro-Delete', '2', 'DeleteVfModuleBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'DEFAULT')), ('Service-Macro-Delete', '3', 'DeactivateVolumeGroupBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'DEFAULT')), @@ -320,7 +321,8 @@ VALUES ('VNFHealthCheckActivity','*','*','*','*','Manual','Abort','*', '*'), ('VNFConfigModifyActivity','*','*','*','*','Manual','Abort','*', '*'), ('VNFUnsetInMaintFlagActivity','*','*','*','*','Manual','Abort','*', '*'), -('VNFUnsetClosedLoopDisabledActivity','*','*','*','*','Manual','Abort','*', '*'); +('VNFUnsetClosedLoopDisabledActivity','*','*','*','*','Manual','Abort','*', '*'), +('CreateChildServiceBB', '*', '*', '*', '*', 'Rollback', 'Abort', '*', '*'); INSERT INTO building_block_detail (building_block_name, resource_type, target_action) VALUES @@ -361,6 +363,8 @@ VALUES ('CreateVfModuleBB', 'VF_MODULE', 'CREATE'), ('CreateNetworkBB', 'NETWORK', 'CREATE'), ('CreateNetworkCollectionBB', 'NETWORK_COLLECTION', 'CREATE'), +('CreateChildServiceBB', 'NO_VALIDATE', 'CUSTOM'), +('DeleteChildServiceBB', 'NO_VALIDATE', 'CUSTOM'), ('DeleteVolumeGroupBB', 'VOLUME_GROUP', 'DELETE'), ('DeleteVfModuleBB', 'VF_MODULE', 'DELETE'), diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/WorkflowResourceIds.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/WorkflowResourceIds.java index 5df7c60f74..cfcc1f9f3b 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/WorkflowResourceIds.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/entities/WorkflowResourceIds.java @@ -42,6 +42,9 @@ public class WorkflowResourceIds implements Serializable { private String instanceGroupId; private String vnfInstanceName; private String vfModuleInstanceName; + private String childServiceInstanceId; + private String childServiceInstanceName; + public WorkflowResourceIds() { @@ -58,6 +61,8 @@ public class WorkflowResourceIds implements Serializable { this.networkCollectionId = workflowResourceIds.networkCollectionId; this.configurationId = workflowResourceIds.configurationId; this.instanceGroupId = workflowResourceIds.instanceGroupId; + this.childServiceInstanceId = workflowResourceIds.childServiceInstanceId; + this.childServiceInstanceName = workflowResourceIds.childServiceInstanceName; } @@ -157,4 +162,20 @@ public class WorkflowResourceIds implements Serializable { public void setVfModuleInstanceName(String vfModuleInstanceName) { this.vfModuleInstanceName = vfModuleInstanceName; } + + public String getChildServiceInstanceId() { + return childServiceInstanceId; + } + + public void setChildServiceInstanceId(String childServiceInstanceId) { + this.childServiceInstanceId = childServiceInstanceId; + } + + public String getChildServiceInstanceName() { + return childServiceInstanceName; + } + + public void setChildServiceInstanceName(String childServiceInstanceName) { + this.childServiceInstanceName = childServiceInstanceName; + } } diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java index d39da5ee37..a38eb8c3a7 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java @@ -262,6 +262,8 @@ public class BBInputSetup implements JavaDelegate { lookupKeyMap.put(ResourceKey.INSTANCE_GROUP_ID, workflowResourceIds.getInstanceGroupId()); lookupKeyMap.put(ResourceKey.VNF_INSTANCE_NAME, workflowResourceIds.getVnfInstanceName()); lookupKeyMap.put(ResourceKey.VF_MODULE_INSTANCE_NAME, workflowResourceIds.getVfModuleInstanceName()); + lookupKeyMap.put(ResourceKey.CHILD_SERVICE_INSTANCE_ID, workflowResourceIds.getChildServiceInstanceId()); + lookupKeyMap.put(ResourceKey.CHILD_SERVICE_INSTANCE_NAME, workflowResourceIds.getChildServiceInstanceName()); } protected GeneralBuildingBlock getGBBALaCarteNonService(ExecuteBuildingBlock executeBB, diff --git a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/process/WorkflowActionBBTest.java b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/process/WorkflowActionBBTest.java index f492326b0c..6c732a1edb 100644 --- a/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/process/WorkflowActionBBTest.java +++ b/bpmn/so-bpmn-building-blocks/src/test/java/org/onap/so/bpmn/infrastructure/bpmn/process/WorkflowActionBBTest.java @@ -106,6 +106,7 @@ public class WorkflowActionBBTest extends BaseBPMNTest { } + @Test public void retrieveBBExecutionListerrorHandling() throws Exception { variables.put("isTopLevelFlow", true); diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ExecuteBuildingBlockBuilder.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ExecuteBuildingBlockBuilder.java index 920369784e..b0182c1b00 100755 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ExecuteBuildingBlockBuilder.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ExecuteBuildingBlockBuilder.java @@ -109,13 +109,22 @@ public class ExecuteBuildingBlockBuilder { String requestId, String apiVersion, String resourceId, String requestAction, String vnfType, WorkflowResourceIds workflowResourceIds, RequestDetails requestDetails, boolean replaceVnf) { List flowsToExecute = new ArrayList<>(); - if (orchFlow.getFlowName().contains(SERVICE) || (orchFlow.getFlowName().contains(CONTROLLER) + if (orchFlow.getFlowName().contains(CHILD_SERVICE)) { + if (WorkflowType.SERVICE.equals(resource.getResourceType()) && resource.hasParent()) { + addBuildingBlockToExecuteBBList(flowsToExecute, resource, WorkflowType.SERVICE, orchFlow, requestId, + apiVersion, resourceId, requestAction, vnfType, workflowResourceIds, requestDetails, false, + false); + } + } else if (orchFlow.getFlowName().contains(SERVICE) || (orchFlow.getFlowName().contains(CONTROLLER) && (SERVICE).equalsIgnoreCase(orchFlow.getBpmnScope()))) { if (!replaceVnf) { workflowResourceIds.setServiceInstanceId(resourceId); } - addBuildingBlockToExecuteBBList(flowsToExecute, resource, WorkflowType.SERVICE, orchFlow, requestId, - apiVersion, resourceId, requestAction, vnfType, workflowResourceIds, requestDetails, false, false); + if (!resource.hasParent()) { + addBuildingBlockToExecuteBBList(flowsToExecute, resource, WorkflowType.SERVICE, orchFlow, requestId, + apiVersion, resourceId, requestAction, vnfType, workflowResourceIds, requestDetails, false, + false); + } } else if (orchFlow.getFlowName().contains(VNF) || (orchFlow.getFlowName().contains(CONTROLLER) && (VNF).equalsIgnoreCase(orchFlow.getBpmnScope()))) { addBuildingBlockToExecuteBBList(flowsToExecute, resource, WorkflowType.VNF, orchFlow, requestId, apiVersion, diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java index 10cea171ce..ef0fbc850e 100755 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java @@ -28,6 +28,8 @@ package org.onap.so.bpmn.infrastructure.workflow.tasks; +import static org.onap.so.bpmn.infrastructure.service.composition.ServiceCompositionConstants.IS_CHILD_PROCESS; +import static org.onap.so.bpmn.infrastructure.service.composition.ServiceCompositionConstants.PARENT_CORRELATION_ID; import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.ASSIGN_INSTANCE; import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.CONTROLLER; import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.CREATE_INSTANCE; @@ -96,6 +98,7 @@ import org.springframework.core.env.Environment; import org.springframework.stereotype.Component; import org.springframework.util.CollectionUtils; import com.fasterxml.jackson.databind.ObjectMapper; +import org.onap.so.serviceinstancebeans.InstanceDirection; @Component public class WorkflowAction { @@ -347,6 +350,19 @@ public class WorkflowAction { log += ", Action: " + block.getBuildingBlock().getBpmnAction(); logger.info(log); } + + RelatedInstanceList[] instanceList = sIRequest.getRequestDetails().getRelatedInstanceList(); + execution.setVariable(IS_CHILD_PROCESS, Boolean.FALSE); + if (instanceList != null) { + for (RelatedInstanceList relatedInstanceList : instanceList) { + RelatedInstance relatedInstance = relatedInstanceList.getRelatedInstance(); + if (InstanceDirection.source.equals(relatedInstance.getInstanceDirection())) { + execution.setVariable(IS_CHILD_PROCESS, Boolean.TRUE); + execution.setVariable(PARENT_CORRELATION_ID, requestDetails.getRequestInfo().getCorrelator()); + } + } + } + // By default, enable homing at VNF level for CREATE_INSTANCE and ASSIGNINSTANCE if (resourceType == WorkflowType.SERVICE && (requestAction.equals(CREATE_INSTANCE) || requestAction.equals(ASSIGN_INSTANCE)) @@ -698,8 +714,9 @@ public class WorkflowAction { private void generateResourceIds(List flowsToExecute, List resourceList, String serviceInstanceId) { Map resourceInstanceIds = new HashMap<>(); - Arrays.stream(WorkflowType.values()).filter(type -> !type.equals(WorkflowType.SERVICE)) - .forEach(type -> resourceList.stream().filter(resource -> type.equals(resource.getResourceType())) + Arrays.stream(WorkflowType.values()) + .forEach(type -> resourceList.stream() + .filter(resource -> resource.hasParent() && type.equals(resource.getResourceType())) .forEach(resource -> updateWorkflowResourceIds(flowsToExecute, type, resource, null, resource.getVirtualLinkKey(), serviceInstanceId, resourceInstanceIds))); } @@ -727,13 +744,19 @@ public class WorkflowAction { WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds(); workflowResourceIds.setServiceInstanceId(serviceInstanceId); Resource parent = resource.getParent(); - if (parent != null && resourceInstanceIds.containsKey(parent)) { + if (resource.hasParent() && resourceInstanceIds.containsKey(parent)) { WorkflowResourceIdsUtils.setResourceIdByWorkflowType(workflowResourceIds, parent.getResourceType(), resourceInstanceIds.get(parent)); } - WorkflowResourceIdsUtils.setInstanceNameByWorkflowType(workflowResourceIds, resourceType, - resource.getInstanceName()); - WorkflowResourceIdsUtils.setResourceIdByWorkflowType(workflowResourceIds, resourceType, resourceId); + if (resource.hasParent() && WorkflowType.SERVICE.equals(resourceType) + && WorkflowType.SERVICE.equals(parent.getResourceType())) { + workflowResourceIds.setChildServiceInstanceId(resourceId); + workflowResourceIds.setChildServiceInstanceName(resource.getInstanceName()); + } else { + WorkflowResourceIdsUtils.setInstanceNameByWorkflowType(workflowResourceIds, resourceType, + resource.getInstanceName()); + WorkflowResourceIdsUtils.setResourceIdByWorkflowType(workflowResourceIds, resourceType, resourceId); + } ebb.setWorkflowResourceIds(workflowResourceIds); assignedFlows.add(flowName + action); } @@ -749,7 +772,9 @@ public class WorkflowAction { private boolean isFlowAssignable(Set assignedFlows, ExecuteBuildingBlock ebb, WorkflowType resourceType, String assignedFlowName) { - String id = WorkflowResourceIdsUtils.getResourceIdByWorkflowType(ebb.getWorkflowResourceIds(), resourceType); + String id = WorkflowType.SERVICE.equals(resourceType) + ? StringUtils.defaultString(ebb.getWorkflowResourceIds().getChildServiceInstanceId()) + : WorkflowResourceIdsUtils.getResourceIdByWorkflowType(ebb.getWorkflowResourceIds(), resourceType); return !assignedFlows.contains(assignedFlowName) && id.isEmpty(); } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBFailure.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBFailure.java index 8d9e020f67..38fe6a3157 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBFailure.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBFailure.java @@ -35,6 +35,12 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import static org.onap.so.bpmn.infrastructure.service.composition.ServiceCompositionConstants.CHILD_SVC_REQ_CORRELATION_ID; +import static org.onap.so.bpmn.infrastructure.service.composition.ServiceCompositionConstants.CHILD_SVC_REQ_ERROR; +import static org.onap.so.bpmn.infrastructure.service.composition.ServiceCompositionConstants.CHILD_SVC_REQ_MESSAGE_NAME; +import static org.onap.so.bpmn.infrastructure.service.composition.ServiceCompositionConstants.CHILD_SVC_REQ_STATUS; +import static org.onap.so.bpmn.infrastructure.service.composition.ServiceCompositionConstants.IS_CHILD_PROCESS; +import static org.onap.so.bpmn.infrastructure.service.composition.ServiceCompositionConstants.PARENT_CORRELATION_ID; @Component public class WorkflowActionBBFailure { @@ -44,6 +50,7 @@ public class WorkflowActionBBFailure { private static final String DELETE_FABRIC_CONFIGURATION_FLOW = "DeleteFabricConfigurationBB"; private static final Logger logger = LoggerFactory.getLogger(WorkflowActionBBFailure.class); public static final String ROLLBACK_TARGET_STATE = "rollbackTargetState"; + @Autowired private RequestsDbClient requestDbclient; @Autowired @@ -83,6 +90,7 @@ public class WorkflowActionBBFailure { InfraActiveRequests request = requestDbclient.getInfraActiveRequestbyRequestId(requestId); String rollbackErrorMsg = ""; String errorMsg = ""; + String childErrorMessage = ""; Boolean rollbackCompletedSuccessfully = (Boolean) execution.getVariable("isRollbackComplete"); Boolean isRollbackFailure = (Boolean) execution.getVariable("isRollback"); ExecuteBuildingBlock ebb = (ExecuteBuildingBlock) execution.getVariable("buildingBlock"); @@ -94,6 +102,7 @@ public class WorkflowActionBBFailure { if (rollbackCompletedSuccessfully) { rollbackErrorMsg = "Rollback has been completed successfully."; + childErrorMessage = rollbackErrorMsg; request.setRollbackStatusMessage(rollbackErrorMsg); execution.setVariable("RollbackErrorMessage", rollbackErrorMsg); String rollbackTargetState = (String) execution.getVariable(ROLLBACK_TARGET_STATE); @@ -116,6 +125,7 @@ public class WorkflowActionBBFailure { } else { rollbackErrorMsg = "Failed to determine rollback error message."; } + childErrorMessage = rollbackErrorMsg; request.setRollbackStatusMessage(rollbackErrorMsg); execution.setVariable("RollbackErrorMessage", rollbackErrorMsg); request.setRequestStatus(Status.FAILED.toString()); @@ -126,6 +136,7 @@ public class WorkflowActionBBFailure { } else { errorMsg = "Failed to determine error message"; } + childErrorMessage = errorMsg; request.setStatusMessage(errorMsg); execution.setVariable("ErrorMessage", errorMsg); String handlingCode = (String) execution.getVariable("handlingCode"); @@ -146,6 +157,16 @@ public class WorkflowActionBBFailure { execution.setVariable("flowStatus", flowStatus); } + if (Boolean.TRUE.equals(execution.getVariable(IS_CHILD_PROCESS))) { + String parentCorrelationId = (String) execution.getVariable(PARENT_CORRELATION_ID); + logger.info("Child service creation failed. Sending message to parent with correlationId: " + + parentCorrelationId); + execution.getProcessEngineServices().getRuntimeService() + .createMessageCorrelation(CHILD_SVC_REQ_MESSAGE_NAME) + .setVariable(CHILD_SVC_REQ_STATUS, "FAILED").setVariable(CHILD_SVC_REQ_ERROR, childErrorMessage) + .processInstanceVariableEquals(CHILD_SVC_REQ_CORRELATION_ID, parentCorrelationId).correlate(); + } + request.setProgress(Long.valueOf(100)); request.setLastModifiedBy("CamundaBPMN"); request.setEndTime(new Timestamp(System.currentTimeMillis())); diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java index b76cf1eb5f..dda217fc79 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java @@ -65,6 +65,12 @@ import org.springframework.core.env.Environment; import org.springframework.stereotype.Component; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.ObjectMapper; +import static org.onap.so.bpmn.infrastructure.service.composition.ServiceCompositionConstants.CHILD_SVC_REQ_ERROR; +import static org.onap.so.bpmn.infrastructure.service.composition.ServiceCompositionConstants.CHILD_SVC_REQ_MESSAGE_NAME; +import static org.onap.so.bpmn.infrastructure.service.composition.ServiceCompositionConstants.CHILD_SVC_REQ_STATUS; +import static org.onap.so.bpmn.infrastructure.service.composition.ServiceCompositionConstants.IS_CHILD_PROCESS; +import static org.onap.so.bpmn.infrastructure.service.composition.ServiceCompositionConstants.CHILD_SVC_REQ_CORRELATION_ID; +import static org.onap.so.bpmn.infrastructure.service.composition.ServiceCompositionConstants.PARENT_CORRELATION_ID; @Component public class WorkflowActionBBTasks { @@ -231,6 +237,17 @@ public class WorkflowActionBBTasks { final boolean aLaCarte = (boolean) execution.getVariable(BBConstants.G_ALACARTE); final String resourceName = (String) execution.getVariable("resourceName"); String statusMessage = (String) execution.getVariable("StatusMessage"); + + if (Boolean.TRUE.equals(execution.getVariable(IS_CHILD_PROCESS))) { + String parentCorrelationId = (String) execution.getVariable(PARENT_CORRELATION_ID); + logger.info("Child service request completed. Sending message to parent process with correlationId: " + + parentCorrelationId); + execution.getProcessEngineServices().getRuntimeService() + .createMessageCorrelation(CHILD_SVC_REQ_MESSAGE_NAME) + .setVariable(CHILD_SVC_REQ_STATUS, "COMPLETED").setVariable(CHILD_SVC_REQ_ERROR, "") + .processInstanceVariableEquals(CHILD_SVC_REQ_CORRELATION_ID, parentCorrelationId).correlate(); + } + String macroAction; if (statusMessage == null) { if (aLaCarte) { diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionConstants.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionConstants.java index a41613982d..7bbc9f3739 100755 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionConstants.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionConstants.java @@ -34,6 +34,7 @@ public final class WorkflowActionConstants { public static final String ACTIVATE_INSTANCE = "activateInstance"; public static final String ASSIGN_INSTANCE = "assignInstance"; + public static final String CHILD_SERVICE = "ChildService"; public static final String CONFIGURATION = "Configuration"; public static final String CONTROLLER = "Controller"; public static final String CREATE_INSTANCE = "createInstance"; diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/ServiceEBBLoader.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/ServiceEBBLoader.java index b5ad8d8c03..79e801b740 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/ServiceEBBLoader.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/ServiceEBBLoader.java @@ -133,7 +133,7 @@ public class ServiceEBBLoader { resourceList = userParamsServiceTraversal.getResourceListFromUserParams(execution, userParams, serviceInstanceId, requestAction); } - if (!foundRelated(resourceList)) { + if (!isComposedService(resourceList) && !foundRelated(resourceList)) { traverseCatalogDbService(execution, sIRequest, resourceList, aaiResourceIds); } } else if ((ACTIVATE_INSTANCE.equalsIgnoreCase(requestAction) @@ -190,6 +190,10 @@ public class ServiceEBBLoader { || containsWorkflowType(resourceList, WorkflowType.NETWORKCOLLECTION)); } + public boolean isComposedService(List resourceList) { + return resourceList.stream().anyMatch(s -> s.getResourceType() == WorkflowType.SERVICE && s.hasParent()); + } + public void traverseAAIService(DelegateExecution execution, List resourceList, String resourceId, List> aaiResourceIds) { try { diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/UserParamsServiceTraversal.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/UserParamsServiceTraversal.java index c383b4a73a..074aa9e5a1 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/UserParamsServiceTraversal.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/UserParamsServiceTraversal.java @@ -94,6 +94,9 @@ public class UserParamsServiceTraversal { Resource serviceResource = new Resource(WorkflowType.SERVICE, validate.getModelInfo().getModelVersionId(), false, null); resourceList.add(serviceResource); + if (validate.getResources().getServices() != null) { + setResourceListForChildServices(execution, resourceList, serviceResource, validate); + } if (validate.getResources().getVnfs() != null) { setResourceListForVnfs(execution, resourceList, serviceResource, validate); } @@ -107,6 +110,16 @@ public class UserParamsServiceTraversal { return resourceList; } + private void setResourceListForChildServices(DelegateExecution execution, List resourceList, + Resource serviceResource, Service validate) { + for (Service childService : validate.getResources().getServices()) { + Resource childServiceResource = new Resource(WorkflowType.SERVICE, + childService.getModelInfo().getModelVersionId(), false, serviceResource); + childServiceResource.setInstanceName(childService.getInstanceName()); + resourceList.add(childServiceResource); + } + } + private void setResourceListForVnfs(DelegateExecution execution, List resourceList, Resource serviceResource, Service validate) { for (Vnfs vnf : validate.getResources().getVnfs()) { diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBFailureTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBFailureTest.java index 7f44c97f59..cedaef0bfd 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBFailureTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBFailureTest.java @@ -26,9 +26,20 @@ import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.isA; import static org.mockito.Mockito.doNothing; import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; +import static org.onap.so.bpmn.infrastructure.service.composition.ServiceCompositionConstants.CHILD_SVC_REQ_CORRELATION_ID; +import static org.onap.so.bpmn.infrastructure.service.composition.ServiceCompositionConstants.CHILD_SVC_REQ_ERROR; +import static org.onap.so.bpmn.infrastructure.service.composition.ServiceCompositionConstants.CHILD_SVC_REQ_STATUS; +import static org.onap.so.bpmn.infrastructure.service.composition.ServiceCompositionConstants.IS_CHILD_PROCESS; +import static org.onap.so.bpmn.infrastructure.service.composition.ServiceCompositionConstants.PARENT_CORRELATION_ID; + import java.sql.Timestamp; +import org.camunda.bpm.engine.ProcessEngineServices; +import org.camunda.bpm.engine.RuntimeService; import org.camunda.bpm.engine.delegate.DelegateExecution; +import org.camunda.bpm.engine.runtime.MessageCorrelationBuilder; import org.camunda.bpm.extension.mockito.delegate.DelegateExecutionFake; import org.junit.Before; import org.junit.Rule; @@ -271,4 +282,126 @@ public class WorkflowActionBBFailureTest extends BaseTaskTest { Mockito.verify(reqMock, Mockito.times(1)).setLastModifiedBy("CamundaBPMN"); Mockito.verify(reqMock, Mockito.times(1)).setEndTime(any(Timestamp.class)); } + + @Test + public void invokeSendMessageForChildServiceRollBackCompletedSuccessfully() { + String parentCorrelationId = "parentCorrelationId"; + DelegateExecution mockExecution = Mockito.mock(DelegateExecution.class); + ProcessEngineServices processEngineServices = mock(ProcessEngineServices.class); + RuntimeService runtimeService = mock(RuntimeService.class); + MessageCorrelationBuilder messageCorrelationBuilder = mock(MessageCorrelationBuilder.class); + when(processEngineServices.getRuntimeService()).thenReturn(runtimeService); + when(runtimeService.createMessageCorrelation(anyString())).thenReturn(messageCorrelationBuilder); + when(messageCorrelationBuilder.setVariable(CHILD_SVC_REQ_STATUS, "FAILED")) + .thenReturn(messageCorrelationBuilder); + when(messageCorrelationBuilder.setVariable(CHILD_SVC_REQ_ERROR, "Rollback has been completed successfully.")) + .thenReturn(messageCorrelationBuilder); + when(messageCorrelationBuilder.processInstanceVariableEquals(CHILD_SVC_REQ_CORRELATION_ID, parentCorrelationId)) + .thenReturn(messageCorrelationBuilder); + + when(mockExecution.getVariable(PARENT_CORRELATION_ID)).thenReturn(parentCorrelationId); + when(mockExecution.getVariable("mso-request-id")).thenReturn("123"); + when(mockExecution.getVariable("isRollbackComplete")).thenReturn(true); + when(mockExecution.getVariable("isRollback")).thenReturn(true); + when(mockExecution.getVariable(IS_CHILD_PROCESS)).thenReturn(true); + + when(mockExecution.getProcessEngineServices()).thenReturn(processEngineServices); + + InfraActiveRequests req = new InfraActiveRequests(); + WorkflowException wfe = new WorkflowException("processKey123", 1, "error in rollback"); + when(mockExecution.getVariable("WorkflowException")).thenReturn(wfe); + doReturn(req).when(requestsDbClient).getInfraActiveRequestbyRequestId("123"); + doNothing().when(requestsDbClient).updateInfraActiveRequests(isA(InfraActiveRequests.class)); + workflowActionBBFailure.updateRequestStatusToFailed(mockExecution); + + verify(messageCorrelationBuilder).setVariable(CHILD_SVC_REQ_STATUS, "FAILED"); + verify(messageCorrelationBuilder).setVariable(CHILD_SVC_REQ_ERROR, + "Rollback has been completed successfully."); + verify(messageCorrelationBuilder).processInstanceVariableEquals(CHILD_SVC_REQ_CORRELATION_ID, + parentCorrelationId); + } + + @Test + public void invokeSendMessageForChildServiceRollBackFailure() { + String parentCorrelationId = "parentCorrelationId"; + DelegateExecution mockExecution = Mockito.mock(DelegateExecution.class); + ProcessEngineServices processEngineServices = mock(ProcessEngineServices.class); + RuntimeService runtimeService = mock(RuntimeService.class); + MessageCorrelationBuilder messageCorrelationBuilder = mock(MessageCorrelationBuilder.class); + when(processEngineServices.getRuntimeService()).thenReturn(runtimeService); + when(runtimeService.createMessageCorrelation(anyString())).thenReturn(messageCorrelationBuilder); + when(messageCorrelationBuilder.setVariable(CHILD_SVC_REQ_STATUS, "FAILED")) + .thenReturn(messageCorrelationBuilder); + when(messageCorrelationBuilder.setVariable(CHILD_SVC_REQ_ERROR, "error in rollback")) + .thenReturn(messageCorrelationBuilder); + when(messageCorrelationBuilder.processInstanceVariableEquals(PARENT_CORRELATION_ID, parentCorrelationId)) + .thenReturn(messageCorrelationBuilder); + + when(mockExecution.getVariable(PARENT_CORRELATION_ID)).thenReturn(parentCorrelationId); + when(mockExecution.getVariable("mso-request-id")).thenReturn("123"); + when(mockExecution.getVariable("isRollbackComplete")).thenReturn(false); + when(mockExecution.getVariable("isRollback")).thenReturn(true); + when(mockExecution.getVariable(IS_CHILD_PROCESS)).thenReturn(true); + + when(mockExecution.getProcessEngineServices()).thenReturn(processEngineServices); + + InfraActiveRequests req = new InfraActiveRequests(); + doReturn(req).when(requestsDbClient).getInfraActiveRequestbyRequestId("123"); + doNothing().when(requestsDbClient).updateInfraActiveRequests(isA(InfraActiveRequests.class)); + workflowActionBBFailure.updateRequestStatusToFailed(mockExecution); + + verify(messageCorrelationBuilder).setVariable(CHILD_SVC_REQ_STATUS, "FAILED"); + verify(messageCorrelationBuilder).setVariable(CHILD_SVC_REQ_ERROR, + "Failed to determine rollback error message."); + + WorkflowException wfe = new WorkflowException("processKey123", 1, "error in rollback"); + when(mockExecution.getVariable("WorkflowException")).thenReturn(wfe); + workflowActionBBFailure.updateRequestStatusToFailed(mockExecution); + verify(messageCorrelationBuilder).setVariable(CHILD_SVC_REQ_ERROR, "error in rollback"); + verify(messageCorrelationBuilder).processInstanceVariableEquals(CHILD_SVC_REQ_CORRELATION_ID, + parentCorrelationId); + } + + @Test + public void invokeSendMessageForChildServiceNoRollBack() { + String parentCorrelationId = "parentCorrelationId"; + DelegateExecution mockExecution = Mockito.mock(DelegateExecution.class); + ProcessEngineServices processEngineServices = mock(ProcessEngineServices.class); + RuntimeService runtimeService = mock(RuntimeService.class); + MessageCorrelationBuilder messageCorrelationBuilder = mock(MessageCorrelationBuilder.class); + when(processEngineServices.getRuntimeService()).thenReturn(runtimeService); + when(runtimeService.createMessageCorrelation(anyString())).thenReturn(messageCorrelationBuilder); + when(messageCorrelationBuilder.setVariable(CHILD_SVC_REQ_STATUS, "FAILED")) + .thenReturn(messageCorrelationBuilder); + when(messageCorrelationBuilder.setVariable(CHILD_SVC_REQ_ERROR, "error in rollback")) + .thenReturn(messageCorrelationBuilder); + when(messageCorrelationBuilder.processInstanceVariableEquals(PARENT_CORRELATION_ID, parentCorrelationId)) + .thenReturn(messageCorrelationBuilder); + + when(mockExecution.getVariable(PARENT_CORRELATION_ID)).thenReturn(parentCorrelationId); + when(mockExecution.getVariable("mso-request-id")).thenReturn("123"); + when(mockExecution.getVariable("isRollbackComplete")).thenReturn(false); + when(mockExecution.getVariable("isRollback")).thenReturn(false); + when(mockExecution.getVariable(IS_CHILD_PROCESS)).thenReturn(true); + + when(mockExecution.getProcessEngineServices()).thenReturn(processEngineServices); + + InfraActiveRequests req = new InfraActiveRequests(); + doReturn(req).when(requestsDbClient).getInfraActiveRequestbyRequestId("123"); + doNothing().when(requestsDbClient).updateInfraActiveRequests(isA(InfraActiveRequests.class)); + workflowActionBBFailure.updateRequestStatusToFailed(mockExecution); + + verify(messageCorrelationBuilder).setVariable(CHILD_SVC_REQ_STATUS, "FAILED"); + verify(messageCorrelationBuilder).setVariable(CHILD_SVC_REQ_ERROR, "Failed to determine error message"); + + WorkflowException wfe = new WorkflowException("processKey123", 1, "error in rollback"); + when(mockExecution.getVariable("WorkflowException")).thenReturn(wfe); + workflowActionBBFailure.updateRequestStatusToFailed(mockExecution); + verify(messageCorrelationBuilder).setVariable(CHILD_SVC_REQ_ERROR, "error in rollback"); + verify(messageCorrelationBuilder).processInstanceVariableEquals(CHILD_SVC_REQ_CORRELATION_ID, + parentCorrelationId); + } + + + } -- cgit 1.2.3-korg From f2f6144f8600f87b8dce092574c0541eb17389b8 Mon Sep 17 00:00:00 2001 From: sanket12345 Date: Wed, 9 Mar 2022 21:37:49 +0530 Subject: AAI Relationship for Parent - Child Services with Composed Resource Node -Code to add Relation between Parent & it's Child Services -Node used to connect parent and child in AAI is ComposedResource -Parent Service can be related with multiple Child Services via composedResource Node. Issue-ID: SO-3832 Change-ID: I73f97f986a817d423f92f8d922dcd9647b8a6adc Signed-off-by: sanket12345 Signed-off-by: Lukasz Rajewski --- .../tasks/BBInputSetupTest.java | 6 ++++ .../src/test/resources/application-test.yaml | 3 ++ .../BuildingBlock/CreateChildServiceBB.bpmn | 12 +++---- .../src/test/resources/application-test.yaml | 4 ++- .../service/composition/CreateChildServiceBB.java | 41 +++++++++++++++++++++- .../tasks/WorkflowActionBBFailureTest.java | 4 +-- .../src/test/resources/application-test.yaml | 4 ++- 7 files changed, 62 insertions(+), 12 deletions(-) diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java index b561055468..61a920ead8 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java @@ -2121,6 +2121,8 @@ public class BBInputSetupTest { String instanceGroupId = "instancegroupId"; String vnfInstanceName = "vnfInstanceName"; String vfModuleInstanceName = "vfModuleInstanceName"; + String childServiceInstanceId = "childServiceInstanceId"; + String childServiceInstanceName = "childServiceInstanceName"; expected.put(ResourceKey.SERVICE_INSTANCE_ID, serviceInstanceId); expected.put(ResourceKey.NETWORK_ID, networkId); @@ -2132,6 +2134,8 @@ public class BBInputSetupTest { expected.put(ResourceKey.INSTANCE_GROUP_ID, instanceGroupId); expected.put(ResourceKey.VNF_INSTANCE_NAME, vnfInstanceName); expected.put(ResourceKey.VF_MODULE_INSTANCE_NAME, vfModuleInstanceName); + expected.put(ResourceKey.CHILD_SERVICE_INSTANCE_ID, childServiceInstanceId); + expected.put(ResourceKey.CHILD_SERVICE_INSTANCE_NAME, childServiceInstanceName); WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds(); workflowResourceIds.setServiceInstanceId(serviceInstanceId); @@ -2144,6 +2148,8 @@ public class BBInputSetupTest { workflowResourceIds.setInstanceGroupId(instanceGroupId); workflowResourceIds.setVnfInstanceName(vnfInstanceName); workflowResourceIds.setVfModuleInstanceName(vfModuleInstanceName); + workflowResourceIds.setChildServiceInstanceId(childServiceInstanceId); + workflowResourceIds.setChildServiceInstanceName(childServiceInstanceName); SPY_bbInputSetup.populateLookupKeyMapWithIds(workflowResourceIds, actual); diff --git a/bpmn/mso-infrastructure-bpmn/src/test/resources/application-test.yaml b/bpmn/mso-infrastructure-bpmn/src/test/resources/application-test.yaml index 56a92cbd01..07c90bf529 100644 --- a/bpmn/mso-infrastructure-bpmn/src/test/resources/application-test.yaml +++ b/bpmn/mso-infrastructure-bpmn/src/test/resources/application-test.yaml @@ -59,6 +59,9 @@ mso: requestDb: auth: Basic YnBlbDptc28tZGItMTUwNyE= endpoint: http://localhost:8081 + apihandler: + endpoint: http://localhost:8080 + auth: Basic dGVzdDp0ZXN0Cg== async: core-pool-size: 50 max-pool-size: 50 diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/CreateChildServiceBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/CreateChildServiceBB.bpmn index b681b999b1..9d361bf101 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/CreateChildServiceBB.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/CreateChildServiceBB.bpmn @@ -1,5 +1,5 @@ - + SequenceFlow_14q7e7i @@ -47,10 +47,10 @@ SequenceFlow_052tga4 - + SequenceFlow_0zfixj7 SequenceFlow_143mdyp - + @@ -121,15 +121,15 @@ + + + - - - diff --git a/bpmn/so-bpmn-infrastructure-flows/src/test/resources/application-test.yaml b/bpmn/so-bpmn-infrastructure-flows/src/test/resources/application-test.yaml index fa753396cf..7a9c4ba914 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/test/resources/application-test.yaml +++ b/bpmn/so-bpmn-infrastructure-flows/src/test/resources/application-test.yaml @@ -64,7 +64,9 @@ mso: #${mso.adapters.requestDb.auth}: BBInputSetup auth: Basic YnBlbDptc28tZGItMTUwNyE= endpoint: http://localhost:${wiremock.server.port} - + apihandler: + endpoint: http://localhost:8080 + auth: Basic dGVzdDp0ZXN0Cg== async: core-pool-size: 50 max-pool-size: 50 diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/service/composition/CreateChildServiceBB.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/service/composition/CreateChildServiceBB.java index 3672df4dba..0486c529c6 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/service/composition/CreateChildServiceBB.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/service/composition/CreateChildServiceBB.java @@ -35,6 +35,14 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import org.onap.aai.domain.yang.ComposedResource; +import org.onap.aai.domain.yang.Relationship; +import org.onap.aaiclient.client.aai.AAIResourcesClient; +import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri; +import org.onap.aaiclient.client.aai.entities.uri.AAIUriFactory; +import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder; +import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder.Types; + @Component public class CreateChildServiceBB { @@ -73,7 +81,6 @@ public class CreateChildServiceBB { log.info("Sending Create Service Request: \n{}", sir.toString()); buildingBlockExecution.setVariable(CHILD_SVC_REQ_CORRELATION_ID, sir.getRequestDetails().getRequestInfo().getCorrelator()); - ServiceInstancesResponse response = apiHandlerClient.createServiceInstance(sir); buildingBlockExecution.setVariable(CHILD_SVC_REQ_ID, response.getRequestReferences().getRequestId()); buildingBlockExecution.setVariable(CHILD_SVC_INSTANCE_ID, response.getRequestReferences().getInstanceId()); @@ -83,6 +90,38 @@ public class CreateChildServiceBB { } } + /* + * This method is to create Relation between Parent & Child Services with Node as Composed Resource. + * + */ + + public void updateRelations(BuildingBlockExecution buildingBlockExecution) throws Exception { + + Map lookupMap = buildingBlockExecution.getLookupMap(); + + String childSvcInstanceId = buildingBlockExecution.getVariable(CHILD_SVC_INSTANCE_ID); + String parentSvcInstanceId = lookupMap.get(ResourceKey.SERVICE_INSTANCE_ID); + + ComposedResource composedResource = new ComposedResource(); + composedResource.setId(UUID.randomUUID().toString()); + + AAIResourcesClient client = new AAIResourcesClient(); + + AAIResourceUri composedResourceURI = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.business() + .customer(buildingBlockExecution.getGeneralBuildingBlock().getCustomer().getGlobalCustomerId()) + .serviceSubscription(buildingBlockExecution.getGeneralBuildingBlock().getRequestContext() + .getSubscriptionServiceType()) + .serviceInstance(parentSvcInstanceId).composedResource(composedResource.getId())); + + client.create(composedResourceURI, composedResource); + + AAIResourceUri childURI = + AAIUriFactory.createResourceUri(Types.SERVICE_INSTANCE.getFragment(childSvcInstanceId)); + + client.connect(composedResourceURI, childURI); + + } + public void handleFailure(final BuildingBlockExecution buildingBlockExecution) { Map lookupMap = buildingBlockExecution.getLookupMap(); String childSvcInstanceName = lookupMap.get(ResourceKey.CHILD_SERVICE_INSTANCE_NAME); diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBFailureTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBFailureTest.java index cedaef0bfd..aeef976fb4 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBFailureTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBFailureTest.java @@ -34,7 +34,6 @@ import static org.onap.so.bpmn.infrastructure.service.composition.ServiceComposi import static org.onap.so.bpmn.infrastructure.service.composition.ServiceCompositionConstants.CHILD_SVC_REQ_STATUS; import static org.onap.so.bpmn.infrastructure.service.composition.ServiceCompositionConstants.IS_CHILD_PROCESS; import static org.onap.so.bpmn.infrastructure.service.composition.ServiceCompositionConstants.PARENT_CORRELATION_ID; - import java.sql.Timestamp; import org.camunda.bpm.engine.ProcessEngineServices; import org.camunda.bpm.engine.RuntimeService; @@ -315,8 +314,7 @@ public class WorkflowActionBBFailureTest extends BaseTaskTest { workflowActionBBFailure.updateRequestStatusToFailed(mockExecution); verify(messageCorrelationBuilder).setVariable(CHILD_SVC_REQ_STATUS, "FAILED"); - verify(messageCorrelationBuilder).setVariable(CHILD_SVC_REQ_ERROR, - "Rollback has been completed successfully."); + verify(messageCorrelationBuilder).setVariable(CHILD_SVC_REQ_ERROR, "Rollback has been completed successfully."); verify(messageCorrelationBuilder).processInstanceVariableEquals(CHILD_SVC_REQ_CORRELATION_ID, parentCorrelationId); } diff --git a/bpmn/so-bpmn-tasks/src/test/resources/application-test.yaml b/bpmn/so-bpmn-tasks/src/test/resources/application-test.yaml index b64fc3318b..d3f5696c16 100644 --- a/bpmn/so-bpmn-tasks/src/test/resources/application-test.yaml +++ b/bpmn/so-bpmn-tasks/src/test/resources/application-test.yaml @@ -84,7 +84,9 @@ mso: workflow: message: endpoint: http://localhost:${wiremock.server.port}/workflows/messages/message - + apihandler: + endpoint: http://localhost:8080 + auth: Basic dGVzdDp0ZXN0Cg== async: core-pool-size: 50 max-pool-size: 50 -- cgit 1.2.3-korg From ec8cb1f5f9160027f20d99104bd8b285d97f7ec6 Mon Sep 17 00:00:00 2001 From: "alexey.aleynikov" Date: Tue, 15 Feb 2022 10:27:57 +0300 Subject: added new swagger (OPENAPI 3.0.1) files with changes in SO service Instantiation Issue-ID: SO-3811 Signed-off-by: alexey.aleynikov Change-Id: I90cdd6eb25ba5a4f680740057aeda9c99ce75337 --- docs/api/swagger/swagger.json | 3934 ++++++++++++++++++++++++----------------- docs/api/swagger/swagger.yaml | 2923 +++++++++++++++++------------- 2 files changed, 4024 insertions(+), 2833 deletions(-) diff --git a/docs/api/swagger/swagger.json b/docs/api/swagger/swagger.json index 0f2bd535b6..7421a400de 100644 --- a/docs/api/swagger/swagger.json +++ b/docs/api/swagger/swagger.json @@ -1,9 +1,14 @@ { - "swagger": "2.0", + "openapi": "3.0.1", "info": { - "version": "3.1.2", - "title": "SO Guilin APIs" + "title": "SO Guilin APIs", + "version": "3.1.2" }, + "servers": [ + { + "url": "/" + } + ], "tags": [ { "name": "e2eServiceInstances" @@ -45,9 +50,6 @@ "name": "onapsoinfrainstanceManagement" } ], - "schemes": [ - "http" - ], "paths": { "/onap/so/infra/e2eServiceInstances/{version}": { "post": { @@ -55,36 +57,35 @@ "e2eServiceInstances" ], "summary": "Create an E2E Service Instance on a version provided", - "description": "", "operationId": "createE2EServiceInstance", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][3-5]" + "schema": { + "pattern": "[vV][3-5]", + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } - } + }, + "x-codegen-request-body-name": "body" } }, "/onap/so/infra/e2eServiceInstances/{version}/{serviceId}": { @@ -93,84 +94,86 @@ "e2eServiceInstances" ], "summary": "Update an E2E Service Instance on a version provided and serviceId", - "description": "", "operationId": "updateE2EServiceInstance", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][3-5]" + "schema": { + "pattern": "[vV][3-5]", + "type": "string" + } }, { "name": "serviceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } - } + }, + "x-codegen-request-body-name": "body" }, "delete": { "tags": [ "e2eServiceInstances" ], "summary": "Delete E2E Service Instance on a specified version and serviceId", - "description": "", "operationId": "deleteE2EServiceInstance", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][3-5]" + "schema": { + "pattern": "[vV][3-5]", + "type": "string" + } }, { "name": "serviceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } - } + }, + "x-codegen-request-body-name": "body" } }, "/onap/so/infra/e2eServiceInstances/{version}/{serviceId}/{operationType}": { @@ -179,49 +182,52 @@ "e2eServiceInstances" ], "summary": "Activate/Deactivate 5G slice Service on a specified version and serviceId", - "description": "", "operationId": "activateE2EServiceInstances", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][3-5]" + "schema": { + "pattern": "[vV][3-5]", + "type": "string" + } }, { "name": "serviceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "operationType", "in": "path", "required": true, - "type": "string", - "pattern": "activate/deactivate" + "schema": { + "pattern": "activate/deactivate", + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } - } + }, + "x-codegen-request-body-name": "body" } }, "/onap/so/infra/e2eServiceInstances/{version}/{serviceId}/operations/{operationId}": { @@ -230,35 +236,38 @@ "e2eServiceInstances" ], "summary": "Find e2eServiceInstances Requests for a given serviceId and operationId", - "description": "", "operationId": "getE2EServiceInstances", - "produces": [ - "application/json" - ], "parameters": [ { "name": "serviceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][3-5]" + "schema": { + "pattern": "[vV][3-5]", + "type": "string" + } }, { "name": "operationId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } } ], "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } } } @@ -269,42 +278,43 @@ "e2eServiceInstances" ], "summary": "Scale E2E Service Instance on a specified version", - "description": "", "operationId": "scaleE2EServiceInstance", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][3-5]" + "schema": { + "pattern": "[vV][3-5]", + "type": "string" + } }, { "name": "serviceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } - } + }, + "x-codegen-request-body-name": "body" } }, "/onap/so/infra/e2eServiceInstances/{version}/{serviceId}/modeldifferences": { @@ -312,43 +322,44 @@ "tags": [ "e2eServiceInstances" ], - "summary": "Find added and deleted resources of target model for the e2eserviceInstance on a given serviceId ", - "description": "", + "summary": "Find added and deleted resources of target model for the e2eserviceInstance on a given serviceId", "operationId": "compareModelwithTargetVersion", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - }, { "name": "serviceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][3-5]" + "schema": { + "pattern": "[vV][3-5]", + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } - } + }, + "x-codegen-request-body-name": "body" } }, "/onap/so/infra/3gppservices/{version}/allocate": { @@ -357,39 +368,41 @@ "Onap3gppServiceInstances" ], "summary": "Create a 3GPP Service Instance on a version provided", - "description": "", "operationId": "allocate3gppService", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Allocate3gppService" - } - }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][1]" + "schema": { + "pattern": "[vV][1]", + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Allocate3gppService" + } + } + }, + "required": true + }, "responses": { "default": { "description": "successful operation", - "schema": { - "$ref": "#/definitions/3gppServiceResponse" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/3gppServiceResponse" + } + } } } - } + }, + "x-codegen-request-body-name": "body" } }, "/onap/so/infra/3gppservices/{version}/deAllocate": { @@ -398,39 +411,41 @@ "Onap3gppServiceInstances" ], "summary": "Terminate/Deallocate a 3GPP Service Instance on a version provided", - "description": "", "operationId": "deallocate3gppService", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": true, - "schema": { - "$ref": "#/definitions/DeAllocate3gppService" - } - }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][1]" + "schema": { + "pattern": "[vV][1]", + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeAllocate3gppService" + } + } + }, + "required": true + }, "responses": { "default": { "description": "successful operation", - "schema": { - "$ref": "#/definitions/3gppServiceResponse" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/3gppServiceResponse" + } + } } } - } + }, + "x-codegen-request-body-name": "body" } }, "/onap/so/infra/3gppservices/{version}/modify": { @@ -439,39 +454,41 @@ "Onap3gppServiceInstances" ], "summary": "Modify a 3GPP Service Instance on a version provided", - "description": "", "operationId": "modify3gppService", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Modify3gppService" - } - }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][1]" + "schema": { + "pattern": "[vV][1]", + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Modify3gppService" + } + } + }, + "required": true + }, "responses": { "default": { "description": "successful operation", - "schema": { - "$ref": "#/definitions/3gppServiceResponse" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/3gppServiceResponse" + } + } } } - } + }, + "x-codegen-request-body-name": "body" } }, "/onap/so/infra/3gppservices/{version}/activate": { @@ -480,39 +497,41 @@ "Onap3gppServiceInstances" ], "summary": "Activate a 3GPP Service Instance on a version provided", - "description": "", "operationId": "activate3gppService", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": true, - "schema": { - "$ref": "#/definitions/3gppServiceActivation" - } - }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][1]" + "schema": { + "pattern": "[vV][1]", + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/3gppServiceActivation" + } + } + }, + "required": true + }, "responses": { "default": { "description": "successful operation", - "schema": { - "$ref": "#/definitions/3gppServiceResponse" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/3gppServiceResponse" + } + } } } - } + }, + "x-codegen-request-body-name": "body" } }, "/onap/so/infra/3gppservices/{version}/deActivate": { @@ -521,39 +540,41 @@ "Onap3gppServiceInstances" ], "summary": "Deactivate a 3GPP Service Instance on a version provided", - "description": "", "operationId": "deactivate3gppService", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": true, - "schema": { - "$ref": "#/definitions/3gppServiceActivation" - } - }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][1]" + "schema": { + "pattern": "[vV][1]", + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/3gppServiceActivation" + } + } + }, + "required": true + }, "responses": { "default": { "description": "successful operation", - "schema": { - "$ref": "#/definitions/3gppServiceResponse" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/3gppServiceResponse" + } + } } } - } + }, + "x-codegen-request-body-name": "body" } }, "/onap/so/infra/3gppservices/{version}/subnetCapabilityQuery": { @@ -562,39 +583,41 @@ "Onap3gppServiceInstances" ], "summary": "Provides subnet capability based on subnet types", - "description": "", "operationId": "querySubnetCapability", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": true, - "schema": { - "$ref": "#/definitions/QuerySubnetCapability" - } - }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][1]" + "schema": { + "pattern": "[vV][1]", + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/QuerySubnetCapability" + } + } + }, + "required": true + }, "responses": { "default": { "description": "successful operation with capabilities for the queried subnetTypes", - "schema": { - "type": "object" + "content": { + "application/json": { + "schema": { + "type": "object" + } + } } } - } + }, + "x-codegen-request-body-name": "body" } }, "/globalhealthcheck": { @@ -603,23 +626,21 @@ "globalhealthcheck" ], "summary": "Performing global health check", - "description": "", "operationId": "globalHealthcheck", - "produces": [ - "text/html" - ], "parameters": [ { "name": "enableBpmn", "in": "query", - "required": false, - "type": "boolean", - "default": true + "schema": { + "type": "boolean", + "default": true + } } ], "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } } } @@ -630,15 +651,11 @@ "nodehealthcheck" ], "summary": "Performing node health check", - "description": "", "operationId": "nodeHealthcheck", - "produces": [ - "text/html" - ], - "parameters": [], "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } } } @@ -649,23 +666,22 @@ "onapsoinfraorchestrationRequests" ], "summary": "Find Orchestrated Requests for a URI Information", - "description": "", "operationId": "getOrchestrationRequest", - "produces": [ - "application/json" - ], "parameters": [ { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][4-7]" - } - ], + "schema": { + "pattern": "[vV][4-7]", + "type": "string" + } + } + ], "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } } } @@ -676,29 +692,30 @@ "onapsoinfraorchestrationRequests" ], "summary": "Find Orchestrated Requests for a given requestId", - "description": "", "operationId": "getOrchestrationRequestForReqId", - "produces": [ - "application/json" - ], "parameters": [ { "name": "requestId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][4-7]" + "schema": { + "pattern": "[vV][4-7]", + "type": "string" + } } ], "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } } } @@ -709,42 +726,43 @@ "onapsoinfraorchestrationRequests" ], "summary": "Unlock Orchestrated Requests for a given requestId", - "description": "", "operationId": "unlockOrchestrationRequest", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - }, { "name": "requestId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][4-7]" + "schema": { + "pattern": "[vV][4-7]", + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } - } + }, + "x-codegen-request-body-name": "body" } }, "/onap/so/infra/orchestrationTasks/{version}": { @@ -753,23 +771,22 @@ "onapsoinfraorchestrationTasks" ], "summary": "Get all orchestrationTasks", - "description": "", "operationId": "getAllOrchestrationTasks", - "produces": [ - "application/json" - ], "parameters": [ { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][4-7]" + "schema": { + "pattern": "[vV][4-7]", + "type": "string" + } } ], "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } } }, @@ -778,33 +795,35 @@ "onapsoinfraorchestrationTasks" ], "summary": "Create an orchestrationTask", - "description": "", "operationId": "createOrchestrationTask", - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][4-7]" + "schema": { + "pattern": "[vV][4-7]", + "type": "string" + } } ], + "requestBody": { + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } - } + }, + "x-codegen-request-body-name": "body" } }, "/onap/so/infra/orchestrationTasks/{version}/{taskId}": { @@ -813,29 +832,30 @@ "onapsoinfraorchestrationTasks" ], "summary": "Get orchestrationTask for a given taskId", - "description": "", "operationId": "getOrchestrationTask", - "produces": [ - "application/json" - ], "parameters": [ { "name": "taskId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][4-7]" + "schema": { + "pattern": "[vV][4-7]", + "type": "string" + } } ], "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } } }, @@ -844,68 +864,73 @@ "onapsoinfraorchestrationTasks" ], "summary": "update orchestrationTask for a given taskId", - "description": "", "operationId": "updateOrchestrationTask", - "produces": [ - "application/json" - ], "parameters": [ { "name": "taskId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][4-7]" - }, - { - "in": "body", - "name": "body", - "required": false, "schema": { + "pattern": "[vV][4-7]", "type": "string" } } ], + "requestBody": { + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } - } + }, + "x-codegen-request-body-name": "body" }, "delete": { "tags": [ "onapsoinfraorchestrationTasks" ], "summary": "delete orchestrationTask for a given taskId", - "description": "", "operationId": "deleteOrchestrationTask", - "produces": [ - "application/json" - ], "parameters": [ { "name": "taskId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][4-7]" + "schema": { + "pattern": "[vV][4-7]", + "type": "string" + } } ], "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } } } @@ -916,39 +941,43 @@ "onapsoinfraorchestrationTasks" ], "summary": "commit orchestrationTask for a given taskId", - "description": "", "operationId": "commitOrchestrationTask", - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - }, { "name": "taskId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][4-7]" + "schema": { + "pattern": "[vV][4-7]", + "type": "string" + } } ], + "requestBody": { + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } - } + }, + "x-codegen-request-body-name": "body" } }, "/onap/so/infra/orchestrationTasks/{version}/{taskId}/abort": { @@ -957,39 +986,43 @@ "onapsoinfraorchestrationTasks" ], "summary": "abort orchestrationTask for a given taskId", - "description": "", "operationId": "abortOrchestrationTask", - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - }, { "name": "taskId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][4-7]" + "schema": { + "pattern": "[vV][4-7]", + "type": "string" + } } ], + "requestBody": { + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } - } + }, + "x-codegen-request-body-name": "body" } }, "/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/{vfmoduleInstanceId}/deactivateAndCloudDelete": { @@ -998,54 +1031,59 @@ "onapsoinfraserviceInstantiation" ], "summary": "Deactivate and Cloud Delete VfModule instance", - "description": "", "operationId": "deactivateAndCloudDeleteVfModuleInstance", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][7]" + "schema": { + "pattern": "[vV][7]", + "type": "string" + } }, { "name": "serviceInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "vnfInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "vfmoduleInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } - } + }, + "x-codegen-request-body-name": "body" } }, "/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/configurations/{configurationInstanceId}/enablePort": { @@ -1054,48 +1092,51 @@ "onapsoinfraserviceInstantiation" ], "summary": "Enable Port Mirroring", - "description": "", "operationId": "enablePort", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][5-7]" + "schema": { + "pattern": "[vV][5-7]", + "type": "string" + } }, { "name": "serviceInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "configurationInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } - } + }, + "x-codegen-request-body-name": "body" } }, "/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/configurations/{configurationInstanceId}/disablePort": { @@ -1104,48 +1145,51 @@ "onapsoinfraserviceInstantiation" ], "summary": "Disable Port Mirroring", - "description": "", "operationId": "disablePort", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][5-7]" + "schema": { + "pattern": "[vV][5-7]", + "type": "string" + } }, { "name": "serviceInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "configurationInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } - } + }, + "x-codegen-request-body-name": "body" } }, "/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/configurations/{configurationInstanceId}/activate": { @@ -1154,48 +1198,51 @@ "onapsoinfraserviceInstantiation" ], "summary": "Activate Port Mirroring", - "description": "", "operationId": "activatePort", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][5-7]" + "schema": { + "pattern": "[vV][5-7]", + "type": "string" + } }, { "name": "serviceInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "configurationInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } - } + }, + "x-codegen-request-body-name": "body" } }, "/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/configurations/{configurationInstanceId}/deactivate": { @@ -1204,48 +1251,51 @@ "onapsoinfraserviceInstantiation" ], "summary": "Deactivate Port Mirroring", - "description": "", "operationId": "deactivatePort", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][5-7]" + "schema": { + "pattern": "[vV][5-7]", + "type": "string" + } }, { "name": "serviceInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "configurationInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } - } + }, + "x-codegen-request-body-name": "body" } }, "/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/addRelationships": { @@ -1254,42 +1304,43 @@ "onapsoinfraserviceInstantiation" ], "summary": "Add Relationships to a Service Instance", - "description": "", "operationId": "addRelationships", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][6-7]" + "schema": { + "pattern": "[vV][6-7]", + "type": "string" + } }, { "name": "serviceInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } - } + }, + "x-codegen-request-body-name": "body" } }, "/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/scaleOut": { @@ -1298,48 +1349,51 @@ "onapsoinfraserviceInstantiation" ], "summary": "VF Auto Scale Out", - "description": "", "operationId": "scaleOutVfModule", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][7]" + "schema": { + "pattern": "[vV][7]", + "type": "string" + } }, { "name": "serviceInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "vnfInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } - } + }, + "x-codegen-request-body-name": "body" } }, "/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/inPlaceSoftwareUpdate": { @@ -1348,48 +1402,51 @@ "onapsoinfraserviceInstantiation" ], "summary": "Perform VNF software update", - "description": "", "operationId": "inPlaceSoftwareUpdate", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][6-7]" + "schema": { + "pattern": "[vV][6-7]", + "type": "string" + } }, { "name": "serviceInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "vnfInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } - } + }, + "x-codegen-request-body-name": "body" } }, "/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/applyUpdatedConfig": { @@ -1398,86 +1455,275 @@ "onapsoinfraserviceInstantiation" ], "summary": "Apply updated configuration", - "description": "", "operationId": "applyUpdatedConfig", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][6-7]" + "schema": { + "pattern": "[vV][6-7]", + "type": "string" + } }, { "name": "serviceInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "vnfInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } - } + }, + "x-codegen-request-body-name": "body" } }, "/onap/so/infra/serviceInstantiation/{version}/serviceInstances": { "post": { "tags": [ - "onapsoinfraserviceInstantiation" + "SO service Instantiation" ], "summary": "Create a Service Instance on a version provided", - "description": "", "operationId": "createServiceInstance", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][5-7]" + "schema": { + "pattern": "[vV][5-7]", + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CreateServiceInstanceParamaters" + } + }, + "examples": { + "cnf": { + "summary": "CNF", + "value": { + "requestDetails": { + "modelInfo": { + "modelInvariantId": "0b1f4362-fed9-45fc-a2e1-6fd3e52f4c1a", + "modelType": "service", + "modelName": "service_test_1", + "modelVersion": "2.0", + "modelVersionId": "beb1259e-dad8-4ee0-a40e-1af20f775d54", + "modelUuid": "beb1259e-dad8-4ee0-a40e-1af20f775d54", + "modelInvariantUuid": "0b1f4362-fed9-45fc-a2e1-6fd3e52f4c1a" + }, + "subscriberInfo": { + "globalSubscriberId": "basicnf-customer" + }, + "requestInfo": { + "suppressRollback": false, + "productFamilyId": "bb0838ec-2ef7-4382-820f-0d34efdb1ccd", + "requestorId": "Portal", + "instanceName": "ORAN_CU_3", + "source": "VID" + }, + "project": { + "projectName": "Project-5GCustomer" + }, + "owningEntity": { + "owningEntityId": "67f2e84c-734d-4e90-a1e4-d2ffa2e75849", + "owningEntityName": "OE-5GCustomer" + }, + "requestParameters": { + "subscriptionServiceType": "5G", + "aLaCarte": false, + "usePreload": false, + "userParams": [ + { + "Homing_Solution": false + }, + { + "service": { + "instanceParams": [ + {} + ], + "instanceName": "service_test_1", + "resources": { + "vnfs": [ + { + "modelInfo": { + "modelName": "cu_sim_1901", + "modelVersionId": "40f11fb2-931d-408d-a949-99e9289d3c02", + "modelInvariantUuid": "f6c202d8-94bd-496e-878e-448da0ed0a6a", + "modelVersion": "1.0", + "modelCustomizationId": "5a2eec30-80c5-47cc-9117-3d8659c38202", + "modelInstanceName": "cu_sim_2022 0" + }, + "cloudConfiguration": { + "cloudOwner": "k8scloudowner4", + "lcpCloudRegionId": "k8sregionfour", + "tenantId": "6bbd2981b210461dbc8fe846df1a7808" + }, + "platform": { + "platformName": "test" + }, + "lineOfBusiness": { + "lineOfBusinessName": "LOB-5G" + }, + "productFamilyId": "productFamilyId123", + "instanceName": "CUCP_1", + "instanceParams": [ + {} + ], + "vfModules": [ + { + "modelInfo": { + "modelName": "CuSim1901..helm_cucp..module-1", + "modelVersionId": "9b7723ff-25ac-44af-a7ac-9cfbf2d4285f", + "modelInvariantUuid": "63af164d-9276-4e08-98fb-059d1c5b80e4", + "modelVersion": 1, + "modelCustomizationId": "b7a0bd1d-4832-4ad3-9199-6e1eab543a45" + }, + "instanceName": "module-1", + "instanceParams": [ + {} + ] + } + ] + } + ] + }, + "modelInfo": { + "modelVersion": "2.0", + "modelVersionId": "77bea973-570b-4f73-9049-87c37d3de8ca", + "modelInvariantId": "b7a3f00b-8fb2-4791-b0ff-71d83f97ab0b", + "modelName": "service_model", + "modelType": "service" + } + } + } + ] + } + } + } + }, + "pnf": { + "summary": "PNF", + "value": { + "requestDetails": { + "modelInfo": { + "modelInvariantId": "040a21d5-b208-490b-9c69-c12ae2b2b958", + "modelName": "ORAN_RU_SIM_Service", + "modelType": "service", + "modelVersion": "2.0", + "modelVersionId": "2f40ddbd-0acc-4e59-8fb3-77a6f84ae28c" + }, + "owningEntity": { + "owningEntityId": "3804b4ac-4d9c-482a-ad0b-5806f8849907", + "owningEntityName": "oran_owner" + }, + "project": { + "projectName": "oran_project" + }, + "requestInfo": { + "instanceName": "ORAN_RU_SIM", + "productFamilyId": "oran-service", + "requestorId": "PORTAL", + "source": "PORTAL", + "suppressRollback": false + }, + "requestParameters": { + "aLaCarte": false, + "subscriptionServiceType": "oran_service", + "userParams": [ + { + "Homing_Solution": "none" + }, + { + "service": { + "instanceName": "ORAN_RU_SIM_Service_1", + "instanceParams": [], + "modelInfo": { + "modelInvariantId": "040a21d5-b208-490b-9c69-c12ae2b2b958", + "modelName": "ORAN_RU_SIM_Service", + "modelType": "service", + "modelVersion": "2.0", + "modelVersionId": "2f40ddbd-0acc-4e59-8fb3-77a6f84ae28c" + }, + "resources": { + "pnfs": [ + { + "instanceName": "ORAN_RU_PNF_1", + "instanceParams": [], + "lineOfBusiness": { + "lineOfBusinessName": "oran_lob" + }, + "modelInfo": { + "modelCustomizationId": "5e3a18ce-8bbd-40fc-a197-becca92ac05b", + "modelCustomizationName": "ORAN_RU_PNF_1", + "modelInstanceName": "ORAN_RU_PNF_ORAN_RU_SIM_Service", + "modelInvariantId": "486f38e8-1710-4875-b732-a8b3301a7786", + "modelName": "ORAN_RU_PNF", + "modelType": "pnf", + "modelVersion": "1.0", + "modelVersionId": "e95310e1-e1d2-471f-aa26-d24849a7e61a" + }, + "platform": { + "platformName": "oran_platform" + }, + "productFamilyId": "oran-service" + } + ], + "vnfs": [] + } + } + } + ] + }, + "subscriberInfo": { + "globalSubscriberId": "ORANTownCustomer" + } + } + } + } + } + } + }, + "required": false + }, "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } - } + }, + "x-codegen-request-body-name": "requestBody" } }, "/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/activate": { @@ -1486,42 +1732,43 @@ "onapsoinfraserviceInstantiation" ], "summary": "Activate provided Service Instance", - "description": "", "operationId": "activateServiceInstance", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][5-7]" + "schema": { + "pattern": "[vV][5-7]", + "type": "string" + } }, { "name": "serviceInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } - } + }, + "x-codegen-request-body-name": "body" } }, "/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/deactivate": { @@ -1530,42 +1777,43 @@ "onapsoinfraserviceInstantiation" ], "summary": "Deactivate provided Service Instance", - "description": "", "operationId": "deactivateServiceInstance", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][5-7]" + "schema": { + "pattern": "[vV][5-7]", + "type": "string" + } }, { "name": "serviceInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } - } + }, + "x-codegen-request-body-name": "body" } }, "/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}": { @@ -1574,42 +1822,43 @@ "onapsoinfraserviceInstantiation" ], "summary": "Delete provided Service Instance", - "description": "", "operationId": "deleteServiceInstance", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][5-7]" + "schema": { + "pattern": "[vV][5-7]", + "type": "string" + } }, { "name": "serviceInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } - } + }, + "x-codegen-request-body-name": "body" } }, "/onap/so/infra/serviceInstantiation/{version}/serviceInstances/assign": { @@ -1618,36 +1867,35 @@ "onapsoinfraserviceInstantiation" ], "summary": "Assign Service Instance", - "description": "", "operationId": "assignServiceInstance", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][7]" + "schema": { + "pattern": "[vV][7]", + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } - } + }, + "x-codegen-request-body-name": "body" } }, "/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/unassign": { @@ -1656,42 +1904,43 @@ "onapsoinfraserviceInstantiation" ], "summary": "Unassign Service Instance", - "description": "", "operationId": "unassignServiceInstance", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][7]" + "schema": { + "pattern": "[vV][7]", + "type": "string" + } }, { "name": "serviceInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } - } + }, + "x-codegen-request-body-name": "body" } }, "/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/configurations": { @@ -1700,42 +1949,43 @@ "onapsoinfraserviceInstantiation" ], "summary": "Create Port Mirroring Configuration", - "description": "", "operationId": "createPortConfiguration", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][5-7]" + "schema": { + "pattern": "[vV][5-7]", + "type": "string" + } }, { "name": "serviceInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } - } + }, + "x-codegen-request-body-name": "body" } }, "/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/configurations/{configurationInstanceId}": { @@ -1744,48 +1994,51 @@ "onapsoinfraserviceInstantiation" ], "summary": "Delete provided Port", - "description": "", "operationId": "deletePortConfiguration", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ { - "in": "body", - "name": "body", - "required": false, + "name": "version", + "in": "path", + "required": true, "schema": { + "pattern": "[vV][5-7]", "type": "string" } }, { - "name": "version", + "name": "serviceInstanceId", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][5-7]" + "schema": { + "type": "string" + } }, { - "name": "serviceInstanceId", + "name": "configurationInstanceId", "in": "path", "required": true, - "type": "string" - }, - { - "name": "configurationInstanceId", - "in": "path", - "required": true, - "type": "string" + "schema": { + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } - } + }, + "x-codegen-request-body-name": "body" } }, "/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/removeRelationships": { @@ -1794,42 +2047,43 @@ "onapsoinfraserviceInstantiation" ], "summary": "Remove Relationships from Service Instance", - "description": "", "operationId": "removeRelationships", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][6-7]" + "schema": { + "pattern": "[vV][6-7]", + "type": "string" + } }, { "name": "serviceInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } - } + }, + "x-codegen-request-body-name": "body" } }, "/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs": { @@ -1838,42 +2092,43 @@ "onapsoinfraserviceInstantiation" ], "summary": "Create VNF on a specified version and serviceInstance", - "description": "", "operationId": "createVnfInstance", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][5-7]" + "schema": { + "pattern": "[vV][5-7]", + "type": "string" + } }, { "name": "serviceInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } - } + }, + "x-codegen-request-body-name": "body" } }, "/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/replace": { @@ -1882,48 +2137,51 @@ "onapsoinfraserviceInstantiation" ], "summary": "Replace provided VNF instance", - "description": "", "operationId": "replaceVnfInstance", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][5-7]" + "schema": { + "pattern": "[vV][5-7]", + "type": "string" + } }, { "name": "serviceInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "vnfInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } - } + }, + "x-codegen-request-body-name": "body" } }, "/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}": { @@ -1932,96 +2190,102 @@ "onapsoinfraserviceInstantiation" ], "summary": "Update VNF on a specified version, serviceInstance and vnfInstance", - "description": "", "operationId": "updateVnfInstance", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][5-7]" + "schema": { + "pattern": "[vV][5-7]", + "type": "string" + } }, { "name": "serviceInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "vnfInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } - } + }, + "x-codegen-request-body-name": "body" }, "delete": { "tags": [ "onapsoinfraserviceInstantiation" ], "summary": "Delete provided VNF instance", - "description": "", "operationId": "deleteVnfInstance", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][5-7]" + "schema": { + "pattern": "[vV][5-7]", + "type": "string" + } }, { "name": "serviceInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "vnfInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } - } + }, + "x-codegen-request-body-name": "body" } }, "/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules": { @@ -2030,48 +2294,51 @@ "onapsoinfraserviceInstantiation" ], "summary": "Create VfModule on a specified version, serviceInstance and vnfInstance", - "description": "", "operationId": "createVfModuleInstance", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][5-7]" + "schema": { + "pattern": "[vV][5-7]", + "type": "string" + } }, { "name": "serviceInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "vnfInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } - } + }, + "x-codegen-request-body-name": "body" } }, "/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/{vfmoduleInstanceId}/replace": { @@ -2080,54 +2347,59 @@ "onapsoinfraserviceInstantiation" ], "summary": "Create VfModule on a specified version, serviceInstance and vnfInstance", - "description": "", "operationId": "replaceVfModuleInstance", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][5-7]" + "schema": { + "pattern": "[vV][5-7]", + "type": "string" + } }, { "name": "serviceInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "vnfInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "vfmoduleInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } - } + }, + "x-codegen-request-body-name": "body" } }, "/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/{vfmoduleInstanceId}": { @@ -2136,108 +2408,118 @@ "onapsoinfraserviceInstantiation" ], "summary": "Update VfModule on a specified version, serviceInstance, vnfInstance and vfModule", - "description": "", "operationId": "updateVfModuleInstance", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][5-7]" + "schema": { + "pattern": "[vV][5-7]", + "type": "string" + } }, { "name": "serviceInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "vnfInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "vfmoduleInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } - } + }, + "x-codegen-request-body-name": "body" }, "delete": { "tags": [ "onapsoinfraserviceInstantiation" ], "summary": "Delete provided VfModule instance", - "description": "", "operationId": "deleteVfModuleInstance", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][5-7]" + "schema": { + "pattern": "[vV][5-7]", + "type": "string" + } }, { "name": "serviceInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "vnfInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "vfmoduleInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } - } + }, + "x-codegen-request-body-name": "body" } }, "/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/volumeGroups": { @@ -2246,48 +2528,51 @@ "onapsoinfraserviceInstantiation" ], "summary": "Create VolumeGroup on a specified version, serviceInstance, vnfInstance", - "description": "", "operationId": "createVolumeGroupInstance", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ { - "in": "body", - "name": "body", - "required": false, + "name": "version", + "in": "path", + "required": true, "schema": { + "pattern": "[vV][5-7]", "type": "string" } }, { - "name": "version", + "name": "serviceInstanceId", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][5-7]" - }, - { - "name": "serviceInstanceId", - "in": "path", - "required": true, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "vnfInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } - } + }, + "x-codegen-request-body-name": "body" } }, "/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/volumeGroups/{volumeGroupInstanceId}": { @@ -2296,108 +2581,118 @@ "onapsoinfraserviceInstantiation" ], "summary": "Update VolumeGroup on a specified version, serviceInstance, vnfInstance and volumeGroup", - "description": "", "operationId": "updateVolumeGroupInstance", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][5-7]" + "schema": { + "pattern": "[vV][5-7]", + "type": "string" + } }, { "name": "serviceInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "vnfInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "volumeGroupInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } - } + }, + "x-codegen-request-body-name": "body" }, "delete": { "tags": [ "onapsoinfraserviceInstantiation" ], "summary": "Delete provided VolumeGroup instance", - "description": "", "operationId": "deleteVolumeGroupInstance", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][5-7]" + "schema": { + "pattern": "[vV][5-7]", + "type": "string" + } }, { "name": "serviceInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "vnfInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "volumeGroupInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } - } + }, + "x-codegen-request-body-name": "body" } }, "/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/networks": { @@ -2406,42 +2701,43 @@ "onapsoinfraserviceInstantiation" ], "summary": "Create NetworkInstance on a specified version and serviceInstance ", - "description": "", "operationId": "createNetworkInstance", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][5-7]" + "schema": { + "pattern": "[vV][5-7]", + "type": "string" + } }, { "name": "serviceInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } - } + }, + "x-codegen-request-body-name": "body" } }, "/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/networks/{networkInstanceId}": { @@ -2450,96 +2746,102 @@ "onapsoinfraserviceInstantiation" ], "summary": "Update VolumeGroup on a specified version, serviceInstance, networkInstance", - "description": "", "operationId": "updateNetworkInstance", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][5-7]" + "schema": { + "pattern": "[vV][5-7]", + "type": "string" + } }, { "name": "serviceInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "networkInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } - } + }, + "x-codegen-request-body-name": "body" }, "delete": { "tags": [ "onapsoinfraserviceInstantiation" ], "summary": "Delete provided Network instance", - "description": "", "operationId": "deleteNetworkInstance", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][5-7]" + "schema": { + "pattern": "[vV][5-7]", + "type": "string" + } }, { "name": "serviceInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "networkInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } - } + }, + "x-codegen-request-body-name": "body" } }, "/onap/so/infra/tasks/{version}": { @@ -2548,62 +2850,71 @@ "onapsoinfratasks" ], "summary": "Finds Manual Tasks", - "description": "", "operationId": "queryFilters", "parameters": [ { "name": "taskId", "in": "query", - "required": false, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "originalRequestId", "in": "query", - "required": false, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "subscriptionServiceType", "in": "query", - "required": false, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "nfRole", "in": "query", - "required": false, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "buildingBlockName", "in": "query", - "required": false, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "originalRequestDate", "in": "query", - "required": false, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "originalRequestorId", "in": "query", - "required": false, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV]1" + "schema": { + "pattern": "[vV]1", + "type": "string" + } } ], "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } } } @@ -2614,36 +2925,35 @@ "onapsoinfracloudResources" ], "summary": "Create an Operational Environment", - "description": "", "operationId": "createOperationEnvironment", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][1]" + "schema": { + "pattern": "[vV][1]", + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } - } + }, + "x-codegen-request-body-name": "body" } }, "/onap/so/infra/cloudResources/{version}/operationalEnvironments/{operationalEnvironmentId}/activate": { @@ -2652,42 +2962,43 @@ "onapsoinfracloudResources" ], "summary": "Activate an Operational Environment", - "description": "", "operationId": "activateOperationEnvironment", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][1]" + "schema": { + "pattern": "[vV][1]", + "type": "string" + } }, { "name": "operationalEnvironmentId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } - } + }, + "x-codegen-request-body-name": "body" } }, "/onap/so/infra/cloudResources/{version}/operationalEnvironments/{operationalEnvironmentId}/deactivate": { @@ -2696,42 +3007,43 @@ "onapsoinfracloudResources" ], "summary": "Deactivate an Operational Environment", - "description": "", "operationId": "deactivateOperationEnvironment", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][1]" + "schema": { + "pattern": "[vV][1]", + "type": "string" + } }, { "name": "operationalEnvironmentId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } - } + }, + "x-codegen-request-body-name": "body" } }, "/onap/so/infra/cloudResourcesRequests/{version}/{requestId}/unlock": { @@ -2740,42 +3052,43 @@ "onapsoinfracloudResourcesRequests" ], "summary": "Unlock CloudOrchestration requests for a specified requestId", - "description": "", "operationId": "unlockOrchestrationRequestForReqId", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - }, { "name": "requestId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][1]" + "schema": { + "pattern": "[vV][1]", + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } - } + }, + "x-codegen-request-body-name": "body" } }, "/onap/so/infra/cloudResourcesRequests/{version}": { @@ -2784,26 +3097,22 @@ "onapsoinfracloudResourcesRequests" ], "summary": "Get status of an Operational Environment based on filter criteria", - "description": "", "operationId": "getOperationEnvironmentStatusFilter", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][1]" + "schema": { + "pattern": "[vV][1]", + "type": "string" + } } ], "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } } } @@ -2814,42 +3123,43 @@ "onapsoinframodelDistributions" ], "summary": "Update model distribution status", - "description": "", "operationId": "updateModelDistributionStatus", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "type": "string" - } - }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][1]" + "schema": { + "pattern": "[vV][1]", + "type": "string" + } }, { "name": "distributionId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "required": false + }, "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } - } + }, + "x-codegen-request-body-name": "body" } }, "/onap/so/infra/workflowSpecifications/{version}/workflows": { @@ -2858,34 +3168,34 @@ "onapsoinfraworkflowSpecifications" ], "summary": "Retrieve Workflow details based on the filter criteria", - "description": "", "operationId": "queryWorkflowSpecifications", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ { "name": "resourceTarget", "in": "query", - "required": false, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][1]" + "schema": { + "pattern": "[vV][1]", + "type": "string" + } } ], "responses": { "default": { "description": "List of workflow specifications on successful operation", - "schema": { - "$ref": "#/definitions/RetrievingWorkflowResponse" + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RetrievingWorkflowResponse" + } + } } } } @@ -2897,48 +3207,51 @@ "onapsoinfrainstanceManagement" ], "summary": "Executing service level custom workflow", - "description": "", "operationId": "executeServiceLevelCustomWorkflow", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "$ref": "#/definitions/ServiceLevelWorkflowExecution" - } - }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][1]" + "schema": { + "pattern": "[vV][1]", + "type": "string" + } }, { "name": "serviceInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "workflow_UUID", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ServiceLevelWorkflowExecution" + } + } + }, + "required": false + }, "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } - } + }, + "x-codegen-request-body-name": "body" } }, "/onap/so/infra/instanceManagement/{version}/serviceInstances/{serviceInstanceId}/pnfs/${pnfName}/workflows/${workflow_UUID}": { @@ -2947,469 +3260,838 @@ "onapsoinfrainstanceManagement" ], "summary": "Executing download/activate custom workflow", - "description": "", "operationId": "executePNFCustomWorkflow", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], "parameters": [ - { - "in": "body", - "name": "body", - "required": false, - "schema": { - "$ref": "#/definitions/PNFCustomWorkflowExecution" - } - }, { "name": "version", "in": "path", "required": true, - "type": "string", - "pattern": "[vV][1]" + "schema": { + "pattern": "[vV][1]", + "type": "string" + } }, { "name": "serviceInstanceId", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "pnfName", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } }, { "name": "workflow_UUID", "in": "path", "required": true, - "type": "string" + "schema": { + "type": "string" + } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/PNFCustomWorkflowExecution" + } + } + }, + "required": false + }, "responses": { "default": { - "description": "successful operation" + "description": "successful operation", + "content": {} } - } + }, + "x-codegen-request-body-name": "body" } } }, - "definitions": { - "Allocate3gppService": { - "description": "This describes the request body for 3gpp service allocation", - "type": "object", - "properties": { - "name": { - "description": "Name of the service to allocate", - "type": "string" - }, - "modelInvariantUuid": { - "description": "Model Invariant UUID corresponding to the service. For E.g : NSST Model invariant uuid in case of NSSI creation", - "type": "string" - }, - "modelUuid": { - "description": "Model UUID corresponding to the service. For E.g : NSST Model uuid in case of NSSI creation", - "type": "string" - }, - "globalSubscriberId": { - "type": "string" - }, - "subscriptionServiceType": { - "description": "Service type for the subscription. For E.G :5G", - "type": "string" - }, - "networkType": { - "description": "Network type. For E.G :AN/CN/TN", - "type": "string" - }, - "additionalProperties": { - "description": "Map of additional properties required for service allocation", - "type": "object" - } - } - }, - "DeAllocate3gppService": { - "description": "This describes the request body for 3gpp service Termination/Deallocation", - "type": "object", - "properties": { - "serviceInstanceID": { - "description": "ID of the service to terminate", - "type": "string" - }, - "globalSubscriberId": { - "type": "string" - }, - "subscriptionServiceType": { - "description": "Service type for the subscription. For E.G :5G", - "type": "string" - }, - "networkType": { - "description": "Network type. For E.G :AN/CN/TN", - "type": "string" - }, - "additionalProperties": { - "description": "Map of additional properties required for service deallocation", - "type": "object" - } - } - }, - "Modify3gppService": { - "description": "This describes the request body for 3gpp service modification", - "type": "object", - "properties": { - "name": { - "description": "Name of the service to modify", - "type": "string" - }, - "serviceInstanceID": { - "description": "ID of the service to modify", - "type": "string" - }, - "globalSubscriberId": { - "type": "string" - }, - "subscriptionServiceType": { - "description": "Service type for the subscription. For E.G :5G", - "type": "string" - }, - "networkType": { - "description": "Network type. For E.G :AN/CN/TN", - "type": "string" - }, - "additionalProperties": { - "description": "Map of additional properties required for service modification", - "type": "object" - } - } - }, - "3gppServiceActivation": { - "description": "This describes the request body for 3gpp service activation/deactivation", - "type": "object", - "properties": { - "serviceInstanceID": { - "description": "ID of the service to be activated/deactivated", - "type": "string" - }, - "globalSubscriberId": { - "type": "string" - }, - "subscriptionServiceType": { - "description": "Service type for the subscription. For E.G :5G", - "type": "string" - }, - "networkType": { - "description": "Network type. For E.G :AN/CN/TN", - "type": "string" - }, - "additionalProperties": { - "description": "Map of additional properties required for service activation/deactivation", - "type": "object" - } - } - }, - "QuerySubnetCapability": { - "description": "This describes the subnet capabilities that can be queried", - "type": "object", - "properties": { - "subnetTypes": { - "type": "array", - "items": { - "$ref": "#/definitions/SubnetTypes" - } - } - } - }, - "SubnetTypes": { - "description": "This describes allowed subnet types", - "type": "string", - "enum": [ - "AN", - "AN_NF", - "CN", - "TN_FH", - "TN_MH", - "TN_BH" - ] - }, - "3gppServiceResponse": { - "description": "This describes the response for 3gpp services", - "type": "object", - "properties": { - "jobId": { - "description": "Job ID to be used to identify the status of the job", - "type": "string" - }, - "status": { - "description": "status of the job", - "type": "string" - }, - "statusDescription": { - "description": "Description on status in case of erroneous response", - "type": "object" - } - } - }, - "RetrievingWorkflowResponse": { - "description": "Response body of fetching workflows using resource target", - "type": "object", - "properties": { - "workflowSpecificationList":{ - "description": "List of Workflow specification data", - "type": "array", - "items": { - "$ref": "#/definitions/WorkflowSpecification" + "components": { + "schemas": { + "Allocate3gppService": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the service to allocate" + }, + "modelInvariantUuid": { + "type": "string", + "description": "Model Invariant UUID corresponding to the service. For E.g : NSST Model invariant uuid in case of NSSI creation" + }, + "modelUuid": { + "type": "string", + "description": "Model UUID corresponding to the service. For E.g : NSST Model uuid in case of NSSI creation" + }, + "globalSubscriberId": { + "type": "string" + }, + "subscriptionServiceType": { + "type": "string", + "description": "Service type for the subscription. For E.G :5G" + }, + "networkType": { + "type": "string", + "description": "Network type. For E.G :AN/CN/TN" + }, + "additionalProperties": { + "type": "object", + "properties": {}, + "description": "Map of additional properties required for service allocation" } - } - } - }, - "WorkflowSpecification": { - "description": "This describes workflow specification object", - "type": "object", - "properties": { - "artifactInfo": { - "description": "Attributes related to artifact information ", - "type": "object", - "properties": { - "artifactType": { - "description": "Type of the artifact to be queried", - "type": "string" - }, - "artifactUuid": { - "description": "UUID of the artifact", - "type": "string" - }, - "artifactName": { - "description": "Name of the artifact", - "type": "string" - }, - "artifactVersion": { - "description": "Artifact's Version", - "type": "string" - }, - "artifactDescription": { - "description": "", - "type": "string" - }, - "workflowName": { - "description": "Name of the workflow fetched for the resource type", - "type": "string" - }, - "operationName": { - "description": "Mapped operation name of the corresponding workflow", - "type": "string" - }, - "workflowSource": { - "description": "", - "type": "string" - }, - "workflowResourceTarget": { - "description": "Type of Resource mapped against the workflow", - "type": "string" - } + }, + "description": "This describes the request body for 3gpp service allocation" + }, + "DeAllocate3gppService": { + "type": "object", + "properties": { + "serviceInstanceID": { + "type": "string", + "description": "ID of the service to terminate" + }, + "globalSubscriberId": { + "type": "string" + }, + "subscriptionServiceType": { + "type": "string", + "description": "Service type for the subscription. For E.G :5G" + }, + "networkType": { + "type": "string", + "description": "Network type. For E.G :AN/CN/TN" + }, + "additionalProperties": { + "type": "object", + "properties": {}, + "description": "Map of additional properties required for service deallocation" } - } - } - }, - "ServiceLevelWorkflowExecution": { - "description": "This describes the request body of service level custom workflow execution", - "type": "object", - "properties": { - "requestInfo": { - "description": "Request object contains source information", - "type": "object", - "properties": { - "source": { - "description": "Name of the sender", - "type": "string" - }, - "suppressRollback": { - "description": "Enable/disable rollback suppression", - "type": "boolean" - }, - "requestorId": { - "description": "Id of the sender", - "type": "string" - } + }, + "description": "This describes the request body for 3gpp service Termination/Deallocation" + }, + "Modify3gppService": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the service to modify" + }, + "serviceInstanceID": { + "type": "string", + "description": "ID of the service to modify" + }, + "globalSubscriberId": { + "type": "string" + }, + "subscriptionServiceType": { + "type": "string", + "description": "Service type for the subscription. For E.G :5G" + }, + "networkType": { + "type": "string", + "description": "Network type. For E.G :AN/CN/TN" + }, + "additionalProperties": { + "type": "object", + "properties": {}, + "description": "Map of additional properties required for service modification" } }, - "modelInfo": { - "description": "Parameters related to the service model", - "type": "object", - "properties": { - "modelType": { - "description": "Type of the model to be executed", - "type": "string" - }, - "modelInvariantUuid": { - "description": "Model invariant id corresponding to the service", - "type": "string" - }, - "modelUuid": { - "description": "Model uuid corresponding to the service", - "type": "string" - }, - "modelVersionId": { - "description": "Model version of the service instance", - "type": "string" - }, - "modelName": { - "description": "Name of the service", - "type": "string" - }, - "modelVersion": { - "description": "Version of the service instance", - "type": "string" - } + "description": "This describes the request body for 3gpp service modification" + }, + "3gppServiceActivation": { + "type": "object", + "properties": { + "serviceInstanceID": { + "type": "string", + "description": "ID of the service to be activated/deactivated" + }, + "globalSubscriberId": { + "type": "string" + }, + "subscriptionServiceType": { + "type": "string", + "description": "Service type for the subscription. For E.G :5G" + }, + "networkType": { + "type": "string", + "description": "Network type. For E.G :AN/CN/TN" + }, + "additionalProperties": { + "type": "object", + "properties": {}, + "description": "Map of additional properties required for service activation/deactivation" } }, - "requestParameters": { - "description": "User parameter object", - "type": "object", - "properties": { - "subscriptionServiceType": { - "description": "Type of service subscription", - "type": "string" + "description": "This describes the request body for 3gpp service activation/deactivation" + }, + "QuerySubnetCapability": { + "type": "object", + "properties": { + "subnetTypes": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SubnetTypes" } } }, - "subscriberInfo": { - "description": "Subscriber id information", - "type": "object", - "properties": { - "globalSubscriberId": { - "description": "Id of the subscriber sending the request", - "type": "string" - } + "description": "This describes the subnet capabilities that can be queried" + }, + "SubnetTypes": { + "type": "string", + "description": "This describes allowed subnet types", + "enum": [ + "AN", + "AN_NF", + "CN", + "TN_FH", + "TN_MH", + "TN_BH" + ] + }, + "3gppServiceResponse": { + "type": "object", + "properties": { + "jobId": { + "type": "string", + "description": "Job ID to be used to identify the status of the job" + }, + "status": { + "type": "string", + "description": "status of the job" + }, + "statusDescription": { + "type": "object", + "properties": {}, + "description": "Description on status in case of erroneous response" } }, - "project": { - "description": "Information about the target project name", - "type": "object", - "properties": { - "projectName":{ - "description": "Name of the target project", - "type": "string" + "description": "This describes the response for 3gpp services" + }, + "RetrievingWorkflowResponse": { + "type": "object", + "properties": { + "workflowSpecificationList": { + "type": "array", + "description": "List of Workflow specification data", + "items": { + "$ref": "#/components/schemas/WorkflowSpecification" } } }, - "owningEntity": { - "description": "Object describes the entity details", - "type": "object", - "properties": { - "owningEntityId": { - "description": "Id of the owning Entity", - "type": "string" + "description": "Response body of fetching workflows using resource target" + }, + "WorkflowSpecification": { + "type": "object", + "properties": { + "artifactInfo": { + "type": "object", + "properties": { + "artifactType": { + "type": "string", + "description": "Type of the artifact to be queried" + }, + "artifactUuid": { + "type": "string", + "description": "UUID of the artifact" + }, + "artifactName": { + "type": "string", + "description": "Name of the artifact" + }, + "artifactVersion": { + "type": "string", + "description": "Artifact's Version" + }, + "artifactDescription": { + "type": "string", + "description": "" + }, + "workflowName": { + "type": "string", + "description": "Name of the workflow fetched for the resource type" + }, + "operationName": { + "type": "string", + "description": "Mapped operation name of the corresponding workflow" + }, + "workflowSource": { + "type": "string", + "description": "" + }, + "workflowResourceTarget": { + "type": "string", + "description": "Type of Resource mapped against the workflow" + } }, - "owningEntityName": { - "description": "Name of the owning Entity", - "type": "string" - } + "description": "Attributes related to artifact information " } - } - - } - }, - "PNFCustomWorkflowExecution": { - "description": "This describes the request body of PNF custom workflow execution", - "type": "object", - "properties": { - "requestInfo": { - "description": "Request object contains source information", - "type": "object", - "properties": { - "source": { - "description": "Name of the sender", - "type": "string" + }, + "description": "This describes workflow specification object" + }, + "ServiceLevelWorkflowExecution": { + "type": "object", + "properties": { + "requestInfo": { + "type": "object", + "properties": { + "source": { + "type": "string", + "description": "Name of the sender" + }, + "suppressRollback": { + "type": "boolean", + "description": "Enable/disable rollback suppression" + }, + "requestorId": { + "type": "string", + "description": "Id of the sender" + } }, - "suppressRollback": { - "description": "Enable/disable rollback suppression", - "type": "boolean" + "description": "Request object contains source information" + }, + "modelInfo": { + "type": "object", + "properties": { + "modelType": { + "type": "string", + "description": "Type of the model to be executed" + }, + "modelInvariantUuid": { + "type": "string", + "description": "Model invariant id corresponding to the service" + }, + "modelUuid": { + "type": "string", + "description": "Model uuid corresponding to the service" + }, + "modelVersionId": { + "type": "string", + "description": "Model version of the service instance" + }, + "modelName": { + "type": "string", + "description": "Name of the service" + }, + "modelVersion": { + "type": "string", + "description": "Version of the service instance" + } }, - "requestorId": { - "description": "Id of the sender", - "type": "string" - } + "description": "Parameters related to the service model" + }, + "requestParameters": { + "type": "object", + "properties": { + "subscriptionServiceType": { + "type": "string", + "description": "Type of service subscription" + } + }, + "description": "User parameter object" + }, + "subscriberInfo": { + "type": "object", + "properties": { + "globalSubscriberId": { + "type": "string", + "description": "Id of the subscriber sending the request" + } + }, + "description": "Subscriber id information" + }, + "project": { + "type": "object", + "properties": { + "projectName": { + "type": "string", + "description": "Name of the target project" + } + }, + "description": "Information about the target project name" + }, + "owningEntity": { + "type": "object", + "properties": { + "owningEntityId": { + "type": "string", + "description": "Id of the owning Entity" + }, + "owningEntityName": { + "type": "string", + "description": "Name of the owning Entity" + } + }, + "description": "Object describes the entity details" } }, - "modelInfo": { - "description": "Parameters related to the service model", - "type": "object", - "properties": { - "modelType": { - "description": "Type of the model to be executed", - "type": "string" + "description": "This describes the request body of service level custom workflow execution" + }, + "PNFCustomWorkflowExecution": { + "type": "object", + "properties": { + "requestInfo": { + "type": "object", + "properties": { + "source": { + "type": "string", + "description": "Name of the sender" + }, + "suppressRollback": { + "type": "boolean", + "description": "Enable/disable rollback suppression" + }, + "requestorId": { + "type": "string", + "description": "Id of the sender" + } }, - "modelInvariantUuid": { - "description": "Model invariant id corresponding to the service", - "type": "string" + "description": "Request object contains source information" + }, + "modelInfo": { + "type": "object", + "properties": { + "modelType": { + "type": "string", + "description": "Type of the model to be executed" + }, + "modelInvariantUuid": { + "type": "string", + "description": "Model invariant id corresponding to the service" + }, + "modelUuid": { + "type": "string", + "description": "Model uuid corresponding to the service" + }, + "modelVersionId": { + "type": "string", + "description": "Model version of the service instance" + }, + "modelName": { + "type": "string", + "description": "Name of the service" + }, + "modelVersion": { + "type": "string", + "description": "Version of the service instance" + } }, - "modelUuid": { - "description": "Model uuid corresponding to the service", - "type": "string" + "description": "Parameters related to the service model" + }, + "requestParameters": { + "type": "object", + "properties": { + "subscriptionServiceType": { + "type": "string", + "description": "Type of service subscription" + } }, - "modelVersionId": { - "description": "Model version of the service instance", - "type": "string" + "description": "User parameter object" + }, + "subscriberInfo": { + "type": "object", + "properties": { + "globalSubscriberId": { + "type": "string", + "description": "Id of the subscriber sending the request" + } }, - "modelName": { - "description": "Name of the service", - "type": "string" + "description": "Subscriber id information" + }, + "project": { + "type": "object", + "properties": { + "projectName": { + "type": "string", + "description": "Name of the target project" + } }, - "modelVersion": { - "description": "Version of the service instance", - "type": "string" - } - } - }, - "requestParameters": { - "description": "User parameter object", - "type": "object", - "properties": { - "subscriptionServiceType": { - "description": "Type of service subscription", - "type": "string" - } + "description": "Information about the target project name" + }, + "owningEntity": { + "type": "object", + "properties": { + "owningEntityId": { + "type": "string", + "description": "Id of the owning Entity" + }, + "owningEntityName": { + "type": "string", + "description": "Name of the owning Entity" + } + }, + "description": "Object describes the entity details" } }, - "subscriberInfo": { - "description": "Subscriber id information", - "type": "object", - "properties": { - "globalSubscriberId": { - "description": "Id of the subscriber sending the request", - "type": "string" + "description": "This describes the request body of PNF custom workflow execution" + }, + "CreateServiceInstanceParamaters": { + "type": "object", + "properties": { + "requestDetails": { + "type": "object", + "description": "Contains data associated with a request", + "properties": { + "requestParameters": { + "type": "object", + "description": "Contains all the parameters, associated with this request", + "properties": { + "subscriptionServiceType": { + "type": "string", + "description": "Type of service subscriptions of customer resource" + }, + "userParams": { + "type": "array", + "description": "Array of data that contains information about Service", + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/CreateServiceInstParamsUserParamsHoming" + }, + { + "$ref": "#/components/schemas/CreateServiceInstParamsUserParamsService" + } + ] + } + }, + "aLaCarte": { + "type": "boolean", + "description": "Enable “A La Carte” mode. In this mode, the user creates and submits operations for each object to be created." + }, + "usePreload": { + "type": "boolean", + "description": "Special value required to use additional Policy settings" + } + } + }, + "modelInfo": { + "type": "object", + "description": "Contains information about the currently used Service Model model", + "properties": { + "modelInvariantId": { + "type": "string", + "description": "Unique identifier corresponding to the main definition of a model in SDC" + }, + "modelType": { + "type": "string", + "description": "Type of service model, created in SDC" + }, + "modelName": { + "type": "string", + "description": "Name of the model, which can change from version to version." + }, + "modelVersion": { + "type": "string", + "description": "Unique identifier corresponding to one version of a model in SDC" + }, + "modelVersionId": { + "type": "string", + "description": "The SDC model version for this resource or service model." + }, + "modelUuid": { + "type": "string", + "description": "Unique identifier corresponding to the main definition of a model in SDC" + }, + "modelInvariantUuid": { + "type": "string", + "description": "Unique identifier corresponding to the main definition of a model in SDC" + } + } + }, + "requestInfo": { + "type": "object", + "description": "Represents some information for the request", + "properties": { + "productFamilyId": { + "type": "string", + "description": "SDC catalog service type" + }, + "source": { + "type": "string", + "description": "Determines only the source from whom the request came" + }, + "instanceName": { + "type": "string", + "description": "Defines the name of the instance to be created" + }, + "suppressRollback": { + "type": "boolean", + "description": "If false – the rollback process will not start if something goes wrong in execution BB. If true - QueryRainyDayTable task will start and make querying policy in table rainy_day_handler_macro" + }, + "requestorId": { + "type": "string", + "description": "User Id or Application Id, initiating the Assessment" + } + } + }, + "subscriberInfo": { + "type": "object", + "description": "Represents the object that groups service instances used by a customer", + "properties": { + "globalSubscriberId": { + "type": "string", + "description": "Global Subscriber Id used across ONAP to uniquely identify subscriber." + } + } + }, + "project": { + "type": "object", + "description": "Represents the project, which will own the service instance", + "properties": { + "projectName": { + "type": "string", + "description": "Name of the project deploying a service" + } + } + }, + "owningEntity": { + "type": "object", + "description": "Represents the entity, which will own the service instance", + "properties": { + "owningEntityId": { + "type": "string", + "description": "UUID of an owning entity" + }, + "owningEntityName": { + "type": "string", + "description": "Owning entity name" + } + } + } } } - }, - "project": { - "description": "Information about the target project name", - "type": "object", - "properties": { - "projectName":{ - "description": "Name of the target project", - "type": "string" + } + }, + "CreateServiceInstParamsUserParamsHoming": { + "allOf": [ + { + "type": "object", + "properties": { + "Homing_Solution": { + "type": "string", + "description": "Switches on an optimization service to deploy services automatically across multiple sites and multiple clouds" + } } } - }, - "owningEntity": { - "description": "Object describes the entity details", - "type": "object", - "properties": { - "owningEntityId": { - "description": "Id of the owning Entity", - "type": "string" - }, - "owningEntityName": { - "description": "Name of the owning Entity", - "type": "string" + ] + }, + "CreateServiceInstParamsUserParamsService": { + "allOf": [ + { + "type": "object", + "properties": { + "service": { + "type": "object", + "description": "Includes information about all created instances", + "properties": { + "instanceParams": { + "type": "array", + "description": "Includes a set of specific parameters", + "items": { + "type": "object", + "properties": {} + } + }, + "instanceName": { + "type": "string", + "description": "Defines the name of the instance to be created" + }, + "resources": { + "type": "object", + "properties": { + "vnfs": { + "type": "array", + "description": "Contains information about VNF parameters", + "items": { + "type": "object", + "properties": { + "modelInfo": { + "type": "object", + "description": "Contains information about the currently used Service Model model", + "properties": { + "modelInvariantId": { + "type": "string", + "description": "Unique identifier corresponding to the main definition of a model in SDC" + }, + "modelType": { + "type": "string", + "description": "Type of Service Model, created in SDC" + }, + "modelName": { + "type": "string", + "description": "Name of the model, which can change from version to version." + }, + "modelVersion": { + "type": "string", + "description": "Unique identifier corresponding to one version of a model in SDC" + }, + "modelVersionId": { + "type": "string", + "description": "The SDC model version for this resource or service model." + }, + "modelUuid": { + "type": "string", + "description": "Unique identifier corresponding to the main definition of a model in SDC" + }, + "modelInvariantUuid": { + "type": "string", + "description": "Unique identifier corresponding to the main definition of a model in SDC" + } + } + }, + "cloudConfiguration": { + "type": "object", + "properties": { + "cloudOwner": { + "type": "string", + "description": "Identifies the vendor and cloud name. First part of composite key should be formatted as vendor-cloudname" + }, + "lcpCloudRegionId": { + "type": "string", + "description": "Cloud-owner defined type indicator (Openstack region)" + }, + "tenantId": { + "type": "string", + "description": "Unique id relative to the cloud-region." + } + } + }, + "platform": { + "type": "object", + "description": "Represents the platform, on which the VNFs/CNFs will run", + "properties": { + "platformName": { + "type": "string", + "description": "Name of the platform" + } + } + }, + "lineOfBusiness": { + "type": "object", + "description": "Represents the business line, owns the VNFs/CNFs instances", + "properties": { + "lineOfBusinessName": { + "type": "string", + "description": "Name of the line-of-business (product)" + } + } + }, + "productFamilyId": { + "type": "string", + "description": "Define SDC catalog service type" + }, + "instanceName": { + "type": "string", + "description": "Defines the name of the instance to be created" + }, + "instanceParams": { + "type": "array", + "description": "Includes a set of specific parameters of instance", + "items": { + "type": "object", + "properties": {} + } + }, + "vfModules": { + "type": "array", + "description": "Сontains a set of parameters of VF Modules", + "items": { + "type": "object", + "properties": { + "modelInfo": { + "type": "object", + "description": "Contains information about the currently used Service Model model", + "properties": { + "modelInvariantId": { + "type": "string", + "description": "Unique identifier corresponding to the main definition of a model in SDC" + }, + "modelType": { + "type": "string", + "description": "Type of service model, created in SDC" + }, + "modelName": { + "type": "string", + "description": "Name of the model, which can change from version to version." + }, + "modelVersion": { + "type": "string", + "description": "Unique identifier corresponding to one version of a model in SDC" + }, + "modelVersionId": { + "type": "string", + "description": "The SDC model version for this resource or service model." + }, + "modelUuid": { + "type": "string", + "description": "Unique identifier corresponding to the main definition of a model in SDC" + }, + "modelInvariantUuid": { + "type": "string", + "description": "Unique identifier corresponding to the main definition of a model in SDC" + } + } + }, + "instanceName": { + "type": "string", + "description": "Defines the name of the instance to be created" + }, + "instanceParams": { + "type": "array", + "description": "Includes a set of specific parameters", + "items": { + "type": "object", + "properties": {} + } + } + } + } + } + } + } + } + } + }, + "modelInfo": { + "type": "object", + "description": "Contains information about the currently used Service Model model", + "properties": { + "modelName": { + "type": "string", + "description": "Name of the model, which can change from version to version." + }, + "modelVersionId": { + "type": "string", + "description": "Unique identifier corresponding to one version of a model in SDC" + }, + "modelInvariantUuid": { + "type": "string", + "description": "Unique identifier corresponding to the main definition of a model in SDC" + }, + "modelVersion": { + "type": "string", + "description": "The SDC model version for this resource or service model." + }, + "modelCustomizationId": { + "type": "string", + "description": "Unique generated identifier of a model in SDC" + } + } + } + } + } } } - } - + ] } } } diff --git a/docs/api/swagger/swagger.yaml b/docs/api/swagger/swagger.yaml index 585a4f4ac0..d73a8309bd 100644 --- a/docs/api/swagger/swagger.yaml +++ b/docs/api/swagger/swagger.yaml @@ -1,7 +1,9 @@ -swagger: '2.0' +openapi: 3.0.1 info: - version: 3.1.2 title: SO Guilin APIs + version: 3.1.2 +servers: + - url: / tags: - name: e2eServiceInstances - name: Onap3gppServiceInstances @@ -16,2269 +18,2776 @@ tags: - name: onapsoinframodelDistributions - name: onapsoinfraworkflowSpecifications - name: onapsoinfrainstanceManagement -schemes: - - http paths: - '/onap/so/infra/e2eServiceInstances/{version}': + /onap/so/infra/e2eServiceInstances/{version}: post: tags: - e2eServiceInstances summary: Create an E2E Service Instance on a version provided - description: '' operationId: createE2EServiceInstance - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: false - schema: - type: string - name: version in: path required: true - type: string - pattern: '[vV][3-5]' + schema: + pattern: '[vV][3-5]' + type: string + requestBody: + content: + application/json: + schema: + type: string + required: false responses: default: description: successful operation - '/onap/so/infra/e2eServiceInstances/{version}/{serviceId}': + content: {} + x-codegen-request-body-name: body + /onap/so/infra/e2eServiceInstances/{version}/{serviceId}: put: tags: - e2eServiceInstances summary: Update an E2E Service Instance on a version provided and serviceId - description: '' operationId: updateE2EServiceInstance - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: false - schema: - type: string - name: version in: path required: true - type: string - pattern: '[vV][3-5]' + schema: + pattern: '[vV][3-5]' + type: string - name: serviceId in: path required: true - type: string + schema: + type: string + requestBody: + content: + application/json: + schema: + type: string + required: false responses: default: description: successful operation + content: {} + x-codegen-request-body-name: body delete: tags: - e2eServiceInstances summary: Delete E2E Service Instance on a specified version and serviceId - description: '' operationId: deleteE2EServiceInstance - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: false - schema: - type: string - name: version in: path required: true - type: string - pattern: '[vV][3-5]' + schema: + pattern: '[vV][3-5]' + type: string - name: serviceId in: path required: true - type: string + schema: + type: string + requestBody: + content: + application/json: + schema: + type: string + required: false responses: default: description: successful operation - '/onap/so/infra/e2eServiceInstances/{version}/{serviceId}/{operationType}': + content: {} + x-codegen-request-body-name: body + /onap/so/infra/e2eServiceInstances/{version}/{serviceId}/{operationType}: post: tags: - e2eServiceInstances summary: >- Activate/Deactivate 5G slice Service on a specified version and serviceId - description: '' operationId: activateE2EServiceInstances - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: false - schema: - type: string - name: version in: path required: true - type: string - pattern: '[vV][3-5]' + schema: + pattern: '[vV][3-5]' + type: string - name: serviceId in: path required: true - type: string + schema: + type: string - name: operationType in: path required: true - type: string - pattern: activate/deactivate + schema: + pattern: activate/deactivate + type: string + requestBody: + content: + application/json: + schema: + type: string + required: false responses: default: description: successful operation - '/onap/so/infra/e2eServiceInstances/{version}/{serviceId}/operations/{operationId}': + content: {} + x-codegen-request-body-name: body + /onap/so/infra/e2eServiceInstances/{version}/{serviceId}/operations/{operationId}: get: tags: - e2eServiceInstances summary: Find e2eServiceInstances Requests for a given serviceId and operationId - description: '' operationId: getE2EServiceInstances - produces: - - application/json parameters: - name: serviceId in: path required: true - type: string + schema: + type: string - name: version in: path required: true - type: string - pattern: '[vV][3-5]' + schema: + pattern: '[vV][3-5]' + type: string - name: operationId in: path required: true - type: string + schema: + type: string responses: default: description: successful operation - '/onap/so/infra/e2eServiceInstances/{version}/{serviceId}/scale': + content: {} + /onap/so/infra/e2eServiceInstances/{version}/{serviceId}/scale: post: tags: - e2eServiceInstances summary: Scale E2E Service Instance on a specified version - description: '' operationId: scaleE2EServiceInstance - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: false - schema: - type: string - name: version in: path required: true - type: string - pattern: '[vV][3-5]' + schema: + pattern: '[vV][3-5]' + type: string - name: serviceId in: path required: true - type: string + schema: + type: string + requestBody: + content: + application/json: + schema: + type: string + required: false responses: default: description: successful operation - '/onap/so/infra/e2eServiceInstances/{version}/{serviceId}/modeldifferences': + content: {} + x-codegen-request-body-name: body + /onap/so/infra/e2eServiceInstances/{version}/{serviceId}/modeldifferences: post: tags: - e2eServiceInstances summary: >- Find added and deleted resources of target model for the e2eserviceInstance on a given serviceId - description: '' operationId: compareModelwithTargetVersion - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: false - schema: - type: string - name: serviceId in: path required: true - type: string + schema: + type: string - name: version in: path required: true - type: string - pattern: '[vV][3-5]' + schema: + pattern: '[vV][3-5]' + type: string + requestBody: + content: + application/json: + schema: + type: string + required: false responses: default: description: successful operation - '/onap/so/infra/3gppservices/{version}/allocate': + content: {} + x-codegen-request-body-name: body + /onap/so/infra/3gppservices/{version}/allocate: post: tags: - Onap3gppServiceInstances summary: Create a 3GPP Service Instance on a version provided - description: '' operationId: allocate3gppService - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: true - schema: - $ref: '#/definitions/Allocate3gppService' - name: version in: path required: true - type: string - pattern: '[vV][1]' + schema: + pattern: '[vV][1]' + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Allocate3gppService' + required: true responses: default: description: successful operation - schema: - $ref: '#/definitions/3gppServiceResponse' - '/onap/so/infra/3gppservices/{version}/deAllocate': + content: + application/json: + schema: + $ref: '#/components/schemas/3gppServiceResponse' + x-codegen-request-body-name: body + /onap/so/infra/3gppservices/{version}/deAllocate: delete: tags: - Onap3gppServiceInstances summary: Terminate/Deallocate a 3GPP Service Instance on a version provided - description: '' operationId: deallocate3gppService - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: true - schema: - $ref: '#/definitions/DeAllocate3gppService' - name: version in: path required: true - type: string - pattern: '[vV][1]' + schema: + pattern: '[vV][1]' + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeAllocate3gppService' + required: true responses: default: description: successful operation - schema: - $ref: '#/definitions/3gppServiceResponse' - '/onap/so/infra/3gppservices/{version}/modify': + content: + application/json: + schema: + $ref: '#/components/schemas/3gppServiceResponse' + x-codegen-request-body-name: body + /onap/so/infra/3gppservices/{version}/modify: put: tags: - Onap3gppServiceInstances summary: Modify a 3GPP Service Instance on a version provided - description: '' operationId: modify3gppService - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: true - schema: - $ref: '#/definitions/Modify3gppService' - name: version in: path required: true - type: string - pattern: '[vV][1]' + schema: + pattern: '[vV][1]' + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Modify3gppService' + required: true responses: default: description: successful operation - schema: - $ref: '#/definitions/3gppServiceResponse' - '/onap/so/infra/3gppservices/{version}/activate': + content: + application/json: + schema: + $ref: '#/components/schemas/3gppServiceResponse' + x-codegen-request-body-name: body + /onap/so/infra/3gppservices/{version}/activate: post: tags: - Onap3gppServiceInstances summary: Activate a 3GPP Service Instance on a version provided - description: '' operationId: activate3gppService - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: true - schema: - $ref: '#/definitions/3gppServiceActivation' - name: version in: path required: true - type: string - pattern: '[vV][1]' + schema: + pattern: '[vV][1]' + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/3gppServiceActivation' + required: true responses: default: description: successful operation - schema: - $ref: '#/definitions/3gppServiceResponse' - '/onap/so/infra/3gppservices/{version}/deActivate': + content: + application/json: + schema: + $ref: '#/components/schemas/3gppServiceResponse' + x-codegen-request-body-name: body + /onap/so/infra/3gppservices/{version}/deActivate: post: tags: - Onap3gppServiceInstances summary: Deactivate a 3GPP Service Instance on a version provided - description: '' operationId: deactivate3gppService - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: true - schema: - $ref: '#/definitions/3gppServiceActivation' - name: version in: path required: true - type: string - pattern: '[vV][1]' + schema: + pattern: '[vV][1]' + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/3gppServiceActivation' + required: true responses: default: description: successful operation - schema: - $ref: '#/definitions/3gppServiceResponse' - '/onap/so/infra/3gppservices/{version}/subnetCapabilityQuery': + content: + application/json: + schema: + $ref: '#/components/schemas/3gppServiceResponse' + x-codegen-request-body-name: body + /onap/so/infra/3gppservices/{version}/subnetCapabilityQuery: get: tags: - Onap3gppServiceInstances summary: Provides subnet capability based on subnet types - description: '' operationId: querySubnetCapability - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: true - schema: - $ref: '#/definitions/QuerySubnetCapability' - name: version in: path required: true - type: string - pattern: '[vV][1]' + schema: + pattern: '[vV][1]' + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/QuerySubnetCapability' + required: true responses: default: description: successful operation with capabilities for the queried subnetTypes - schema: - type: object + content: + application/json: + schema: + type: object + x-codegen-request-body-name: body /globalhealthcheck: get: tags: - globalhealthcheck summary: Performing global health check - description: '' operationId: globalHealthcheck - produces: - - text/html parameters: - name: enableBpmn in: query - required: false - type: boolean - default: true + schema: + type: boolean + default: true responses: default: description: successful operation + content: {} /nodehealthcheck: get: tags: - nodehealthcheck summary: Performing node health check - description: '' operationId: nodeHealthcheck - produces: - - text/html - parameters: [] responses: default: description: successful operation - '/onap/so/infra/orchestrationRequests/{version}': + content: {} + /onap/so/infra/orchestrationRequests/{version}: get: tags: - onapsoinfraorchestrationRequests summary: Find Orchestrated Requests for a URI Information - description: '' operationId: getOrchestrationRequest - produces: - - application/json parameters: - name: version in: path required: true - type: string - pattern: '[vV][4-7]' + schema: + pattern: '[vV][4-7]' + type: string responses: default: description: successful operation - '/onap/so/infra/orchestrationRequests/{version}/{requestId}': + content: {} + /onap/so/infra/orchestrationRequests/{version}/{requestId}: get: tags: - onapsoinfraorchestrationRequests summary: Find Orchestrated Requests for a given requestId - description: '' operationId: getOrchestrationRequestForReqId - produces: - - application/json parameters: - name: requestId in: path required: true - type: string + schema: + type: string - name: version in: path required: true - type: string - pattern: '[vV][4-7]' + schema: + pattern: '[vV][4-7]' + type: string responses: default: description: successful operation - '/onap/so/infra/orchestrationRequests/{version}/{requestId}/unlock': + content: {} + /onap/so/infra/orchestrationRequests/{version}/{requestId}/unlock: post: tags: - onapsoinfraorchestrationRequests summary: Unlock Orchestrated Requests for a given requestId - description: '' operationId: unlockOrchestrationRequest - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: false - schema: - type: string - name: requestId in: path required: true - type: string + schema: + type: string - name: version in: path required: true - type: string - pattern: '[vV][4-7]' + schema: + pattern: '[vV][4-7]' + type: string + requestBody: + content: + application/json: + schema: + type: string + required: false responses: default: description: successful operation - '/onap/so/infra/orchestrationTasks/{version}': + content: {} + x-codegen-request-body-name: body + /onap/so/infra/orchestrationTasks/{version}: get: tags: - onapsoinfraorchestrationTasks summary: Get all orchestrationTasks - description: '' operationId: getAllOrchestrationTasks - produces: - - application/json parameters: - name: version in: path required: true - type: string - pattern: '[vV][4-7]' + schema: + pattern: '[vV][4-7]' + type: string responses: default: description: successful operation + content: {} post: tags: - onapsoinfraorchestrationTasks summary: Create an orchestrationTask - description: '' operationId: createOrchestrationTask - produces: - - application/json parameters: - - in: body - name: body - required: false - schema: - type: string - name: version in: path required: true - type: string - pattern: '[vV][4-7]' + schema: + pattern: '[vV][4-7]' + type: string + requestBody: + content: + '*/*': + schema: + type: string + required: false responses: default: description: successful operation - '/onap/so/infra/orchestrationTasks/{version}/{taskId}': + content: {} + x-codegen-request-body-name: body + /onap/so/infra/orchestrationTasks/{version}/{taskId}: get: tags: - onapsoinfraorchestrationTasks summary: Get orchestrationTask for a given taskId - description: '' operationId: getOrchestrationTask - produces: - - application/json parameters: - name: taskId in: path required: true - type: string + schema: + type: string - name: version in: path required: true - type: string - pattern: '[vV][4-7]' + schema: + pattern: '[vV][4-7]' + type: string responses: default: description: successful operation + content: {} put: tags: - onapsoinfraorchestrationTasks summary: update orchestrationTask for a given taskId - description: '' operationId: updateOrchestrationTask - produces: - - application/json parameters: - name: taskId in: path required: true - type: string + schema: + type: string - name: version in: path required: true - type: string - pattern: '[vV][4-7]' - - in: body - name: body - required: false schema: + pattern: '[vV][4-7]' type: string + requestBody: + content: + '*/*': + schema: + type: string + required: false responses: default: description: successful operation + content: {} + x-codegen-request-body-name: body delete: tags: - onapsoinfraorchestrationTasks summary: delete orchestrationTask for a given taskId - description: '' operationId: deleteOrchestrationTask - produces: - - application/json parameters: - name: taskId in: path required: true - type: string + schema: + type: string - name: version in: path required: true - type: string - pattern: '[vV][4-7]' + schema: + pattern: '[vV][4-7]' + type: string responses: default: description: successful operation - '/onap/so/infra/orchestrationTasks/{version}/{taskId}/commit': + content: {} + /onap/so/infra/orchestrationTasks/{version}/{taskId}/commit: post: tags: - onapsoinfraorchestrationTasks summary: commit orchestrationTask for a given taskId - description: '' operationId: commitOrchestrationTask - produces: - - application/json parameters: - - in: body - name: body - required: false - schema: - type: string - name: taskId in: path required: true - type: string + schema: + type: string - name: version in: path required: true - type: string - pattern: '[vV][4-7]' + schema: + pattern: '[vV][4-7]' + type: string + requestBody: + content: + '*/*': + schema: + type: string + required: false responses: default: description: successful operation - '/onap/so/infra/orchestrationTasks/{version}/{taskId}/abort': + content: {} + x-codegen-request-body-name: body + /onap/so/infra/orchestrationTasks/{version}/{taskId}/abort: post: tags: - onapsoinfraorchestrationTasks summary: abort orchestrationTask for a given taskId - description: '' operationId: abortOrchestrationTask - produces: - - application/json parameters: - - in: body - name: body - required: false - schema: - type: string - name: taskId in: path required: true - type: string + schema: + type: string - name: version in: path required: true - type: string - pattern: '[vV][4-7]' + schema: + pattern: '[vV][4-7]' + type: string + requestBody: + content: + '*/*': + schema: + type: string + required: false responses: default: description: successful operation - '/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/{vfmoduleInstanceId}/deactivateAndCloudDelete': + content: {} + x-codegen-request-body-name: body + /onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/{vfmoduleInstanceId}/deactivateAndCloudDelete: post: tags: - onapsoinfraserviceInstantiation summary: Deactivate and Cloud Delete VfModule instance - description: '' operationId: deactivateAndCloudDeleteVfModuleInstance - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: false - schema: - type: string - name: version in: path required: true - type: string - pattern: '[vV][7]' + schema: + pattern: '[vV][7]' + type: string - name: serviceInstanceId in: path required: true - type: string + schema: + type: string - name: vnfInstanceId in: path required: true - type: string + schema: + type: string - name: vfmoduleInstanceId in: path required: true - type: string + schema: + type: string + requestBody: + content: + application/json: + schema: + type: string + required: false responses: default: description: successful operation - '/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/configurations/{configurationInstanceId}/enablePort': + content: {} + x-codegen-request-body-name: body + /onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/configurations/{configurationInstanceId}/enablePort: post: tags: - onapsoinfraserviceInstantiation summary: Enable Port Mirroring - description: '' operationId: enablePort - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: false - schema: - type: string - name: version in: path required: true - type: string - pattern: '[vV][5-7]' + schema: + pattern: '[vV][5-7]' + type: string - name: serviceInstanceId in: path required: true - type: string + schema: + type: string - name: configurationInstanceId in: path required: true - type: string + schema: + type: string + requestBody: + content: + application/json: + schema: + type: string + required: false responses: default: description: successful operation - '/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/configurations/{configurationInstanceId}/disablePort': + content: {} + x-codegen-request-body-name: body + /onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/configurations/{configurationInstanceId}/disablePort: post: tags: - onapsoinfraserviceInstantiation summary: Disable Port Mirroring - description: '' operationId: disablePort - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: false - schema: - type: string - name: version in: path required: true - type: string - pattern: '[vV][5-7]' + schema: + pattern: '[vV][5-7]' + type: string - name: serviceInstanceId in: path required: true - type: string + schema: + type: string - name: configurationInstanceId in: path required: true - type: string + schema: + type: string + requestBody: + content: + application/json: + schema: + type: string + required: false responses: default: description: successful operation - '/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/configurations/{configurationInstanceId}/activate': + content: {} + x-codegen-request-body-name: body + /onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/configurations/{configurationInstanceId}/activate: post: tags: - onapsoinfraserviceInstantiation summary: Activate Port Mirroring - description: '' operationId: activatePort - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: false - schema: - type: string - name: version in: path required: true - type: string - pattern: '[vV][5-7]' + schema: + pattern: '[vV][5-7]' + type: string - name: serviceInstanceId in: path required: true - type: string + schema: + type: string - name: configurationInstanceId in: path required: true - type: string + schema: + type: string + requestBody: + content: + application/json: + schema: + type: string + required: false responses: default: description: successful operation - '/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/configurations/{configurationInstanceId}/deactivate': + content: {} + x-codegen-request-body-name: body + /onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/configurations/{configurationInstanceId}/deactivate: post: tags: - onapsoinfraserviceInstantiation summary: Deactivate Port Mirroring - description: '' operationId: deactivatePort - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: false - schema: - type: string - name: version in: path required: true - type: string - pattern: '[vV][5-7]' + schema: + pattern: '[vV][5-7]' + type: string - name: serviceInstanceId in: path required: true - type: string + schema: + type: string - name: configurationInstanceId in: path required: true - type: string + schema: + type: string + requestBody: + content: + application/json: + schema: + type: string + required: false responses: default: description: successful operation - '/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/addRelationships': + content: {} + x-codegen-request-body-name: body + /onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/addRelationships: post: tags: - onapsoinfraserviceInstantiation summary: Add Relationships to a Service Instance - description: '' operationId: addRelationships - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: false - schema: - type: string - name: version in: path required: true - type: string - pattern: '[vV][6-7]' + schema: + pattern: '[vV][6-7]' + type: string - name: serviceInstanceId in: path required: true - type: string + schema: + type: string + requestBody: + content: + application/json: + schema: + type: string + required: false responses: default: description: successful operation - '/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/scaleOut': + content: {} + x-codegen-request-body-name: body + /onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/scaleOut: post: tags: - onapsoinfraserviceInstantiation summary: VF Auto Scale Out - description: '' operationId: scaleOutVfModule - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: false - schema: - type: string - name: version in: path required: true - type: string - pattern: '[vV][7]' + schema: + pattern: '[vV][7]' + type: string - name: serviceInstanceId in: path required: true - type: string + schema: + type: string - name: vnfInstanceId in: path required: true - type: string + schema: + type: string + requestBody: + content: + application/json: + schema: + type: string + required: false responses: default: description: successful operation - '/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/inPlaceSoftwareUpdate': + content: {} + x-codegen-request-body-name: body + /onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/inPlaceSoftwareUpdate: post: tags: - onapsoinfraserviceInstantiation summary: Perform VNF software update - description: '' operationId: inPlaceSoftwareUpdate - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: false - schema: - type: string - name: version in: path required: true - type: string - pattern: '[vV][6-7]' + schema: + pattern: '[vV][6-7]' + type: string - name: serviceInstanceId in: path required: true - type: string + schema: + type: string - name: vnfInstanceId in: path required: true - type: string + schema: + type: string + requestBody: + content: + application/json: + schema: + type: string + required: false responses: default: description: successful operation - '/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/applyUpdatedConfig': + content: {} + x-codegen-request-body-name: body + /onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/applyUpdatedConfig: post: tags: - onapsoinfraserviceInstantiation summary: Apply updated configuration - description: '' operationId: applyUpdatedConfig - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: false - schema: - type: string - name: version in: path required: true - type: string - pattern: '[vV][6-7]' + schema: + pattern: '[vV][6-7]' + type: string - name: serviceInstanceId in: path required: true - type: string + schema: + type: string - name: vnfInstanceId in: path required: true - type: string + schema: + type: string + requestBody: + content: + application/json: + schema: + type: string + required: false responses: default: description: successful operation - '/onap/so/infra/serviceInstantiation/{version}/serviceInstances': + content: {} + x-codegen-request-body-name: body + /onap/so/infra/serviceInstantiation/{version}/serviceInstances: post: tags: - - onapsoinfraserviceInstantiation + - SO service Instantiation summary: Create a Service Instance on a version provided - description: '' operationId: createServiceInstance - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: false - schema: - type: string - name: version in: path required: true - type: string - pattern: '[vV][5-7]' - responses: - default: - description: successful operation - '/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/activate': + schema: + pattern: '[vV][5-7]' + type: string + requestBody: + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/CreateServiceInstanceParamaters' + examples: + cnf: + summary: CNF + value: + requestDetails: + modelInfo: + modelInvariantId: 0b1f4362-fed9-45fc-a2e1-6fd3e52f4c1a + modelType: service + modelName: service_test_1 + modelVersion: "2.0" + modelVersionId: beb1259e-dad8-4ee0-a40e-1af20f775d54 + modelUuid: beb1259e-dad8-4ee0-a40e-1af20f775d54 + modelInvariantUuid: 0b1f4362-fed9-45fc-a2e1-6fd3e52f4c1a + subscriberInfo: + globalSubscriberId: basicnf-customer + requestInfo: + suppressRollback: false + productFamilyId : bb0838ec-2ef7-4382-820f-0d34efdb1ccd + requestorId: Portal + instanceName: ORAN_CU_3 + source: VID + project: + projectName: Project-5GCustomer + owningEntity: + owningEntityId: 67f2e84c-734d-4e90-a1e4-d2ffa2e75849 + owningEntityName: OE-5GCustomer + requestParameters: + subscriptionServiceType: 5G + aLaCarte: false + usePreload: false + userParams: + [ + {Homing_Solution: false}, + { + service: + { + instanceParams: [{}], + instanceName: service_test_1, + resources: + { + vnfs: + [ + { + modelInfo: + { + modelName: cu_sim_1901, + modelVersionId: 40f11fb2-931d-408d-a949-99e9289d3c02, + modelInvariantUuid: f6c202d8-94bd-496e-878e-448da0ed0a6a, + modelVersion: "1.0", + modelCustomizationId: 5a2eec30-80c5-47cc-9117-3d8659c38202, + modelInstanceName: cu_sim_2022 0 + }, + cloudConfiguration: + { + cloudOwner: k8scloudowner4, + lcpCloudRegionId: k8sregionfour, + tenantId: 6bbd2981b210461dbc8fe846df1a7808 + }, + platform: + { + platformName: test + }, + lineOfBusiness: + { + lineOfBusinessName: LOB-5G + }, + productFamilyId: productFamilyId123, + instanceName: CUCP_1, + instanceParams: [{}], + vfModules: + [ + { + modelInfo: + { + modelName: CuSim1901..helm_cucp..module-1, + modelVersionId: 9b7723ff-25ac-44af-a7ac-9cfbf2d4285f, + modelInvariantUuid: 63af164d-9276-4e08-98fb-059d1c5b80e4, + modelVersion: 1, + modelCustomizationId: b7a0bd1d-4832-4ad3-9199-6e1eab543a45 + }, + instanceName: module-1, + instanceParams: [{}] + } + ] + } + ] + }, + modelInfo: + { + modelVersion: "2.0", + modelVersionId: "77bea973-570b-4f73-9049-87c37d3de8ca", + modelInvariantId: "b7a3f00b-8fb2-4791-b0ff-71d83f97ab0b", + modelName: "service_model", + modelType: "service" + } + } + } + ] + + pnf: + summary: PNF + value: + requestDetails: + modelInfo: + modelInvariantId: 040a21d5-b208-490b-9c69-c12ae2b2b958 + modelName: ORAN_RU_SIM_Service + modelType: service + modelVersion: '2.0' + modelVersionId: 2f40ddbd-0acc-4e59-8fb3-77a6f84ae28c + owningEntity: + owningEntityId: 3804b4ac-4d9c-482a-ad0b-5806f8849907 + owningEntityName: oran_owner + project: + projectName: oran_project + requestInfo: + instanceName: ORAN_RU_SIM + productFamilyId: oran-service + requestorId: PORTAL + source: PORTAL + suppressRollback: false + requestParameters: + aLaCarte: false + subscriptionServiceType: oran_service + userParams: + - Homing_Solution: none + - service: + instanceName: ORAN_RU_SIM_Service_1 + instanceParams: [] + modelInfo: + modelInvariantId: 040a21d5-b208-490b-9c69-c12ae2b2b958 + modelName: ORAN_RU_SIM_Service + modelType: service + modelVersion: '2.0' + modelVersionId: 2f40ddbd-0acc-4e59-8fb3-77a6f84ae28c + resources: + pnfs: + - instanceName: ORAN_RU_PNF_1 + instanceParams: [] + lineOfBusiness: + lineOfBusinessName: oran_lob + modelInfo: + modelCustomizationId: 5e3a18ce-8bbd-40fc-a197-becca92ac05b + modelCustomizationName: ORAN_RU_PNF_1 + modelInstanceName: ORAN_RU_PNF_ORAN_RU_SIM_Service + modelInvariantId: 486f38e8-1710-4875-b732-a8b3301a7786 + modelName: ORAN_RU_PNF + modelType: pnf + modelVersion: '1.0' + modelVersionId: e95310e1-e1d2-471f-aa26-d24849a7e61a + platform: + platformName: oran_platform + productFamilyId: oran-service + vnfs: [] + subscriberInfo: + globalSubscriberId: ORANTownCustomer + + + required: false + responses: + default: + description: successful operation + content: {} + x-codegen-request-body-name: requestBody + /onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/activate: post: tags: - onapsoinfraserviceInstantiation summary: Activate provided Service Instance - description: '' operationId: activateServiceInstance - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: false - schema: - type: string - name: version in: path required: true - type: string - pattern: '[vV][5-7]' + schema: + pattern: '[vV][5-7]' + type: string - name: serviceInstanceId in: path required: true - type: string + schema: + type: string + requestBody: + content: + application/json: + schema: + type: string + required: false responses: default: description: successful operation - '/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/deactivate': + content: {} + x-codegen-request-body-name: body + /onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/deactivate: post: tags: - onapsoinfraserviceInstantiation summary: Deactivate provided Service Instance - description: '' operationId: deactivateServiceInstance - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: false - schema: - type: string - name: version in: path required: true - type: string - pattern: '[vV][5-7]' + schema: + pattern: '[vV][5-7]' + type: string - name: serviceInstanceId in: path required: true - type: string + schema: + type: string + requestBody: + content: + application/json: + schema: + type: string + required: false responses: default: description: successful operation - '/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}': + content: {} + x-codegen-request-body-name: body + /onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}: delete: tags: - onapsoinfraserviceInstantiation summary: Delete provided Service Instance - description: '' operationId: deleteServiceInstance - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: false - schema: - type: string - name: version in: path required: true - type: string - pattern: '[vV][5-7]' + schema: + pattern: '[vV][5-7]' + type: string - name: serviceInstanceId in: path required: true - type: string + schema: + type: string + requestBody: + content: + application/json: + schema: + type: string + required: false responses: default: description: successful operation - '/onap/so/infra/serviceInstantiation/{version}/serviceInstances/assign': + content: {} + x-codegen-request-body-name: body + /onap/so/infra/serviceInstantiation/{version}/serviceInstances/assign: post: tags: - onapsoinfraserviceInstantiation summary: Assign Service Instance - description: '' operationId: assignServiceInstance - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: false - schema: - type: string - name: version in: path required: true - type: string - pattern: '[vV][7]' + schema: + pattern: '[vV][7]' + type: string + requestBody: + content: + application/json: + schema: + type: string + required: false responses: default: description: successful operation - '/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/unassign': + content: {} + x-codegen-request-body-name: body + /onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/unassign: post: tags: - onapsoinfraserviceInstantiation summary: Unassign Service Instance - description: '' operationId: unassignServiceInstance - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: false - schema: - type: string - name: version in: path required: true - type: string - pattern: '[vV][7]' + schema: + pattern: '[vV][7]' + type: string - name: serviceInstanceId in: path required: true - type: string + schema: + type: string + requestBody: + content: + application/json: + schema: + type: string + required: false responses: default: description: successful operation - '/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/configurations': + content: {} + x-codegen-request-body-name: body + /onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/configurations: post: tags: - onapsoinfraserviceInstantiation summary: Create Port Mirroring Configuration - description: '' operationId: createPortConfiguration - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: false - schema: - type: string - name: version in: path required: true - type: string - pattern: '[vV][5-7]' + schema: + pattern: '[vV][5-7]' + type: string - name: serviceInstanceId in: path required: true - type: string + schema: + type: string + requestBody: + content: + application/json: + schema: + type: string + required: false responses: default: description: successful operation - '/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/configurations/{configurationInstanceId}': + content: {} + x-codegen-request-body-name: body + /onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/configurations/{configurationInstanceId}: delete: tags: - onapsoinfraserviceInstantiation summary: Delete provided Port - description: '' operationId: deletePortConfiguration - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: false - schema: - type: string - name: version in: path required: true - type: string - pattern: '[vV][5-7]' + schema: + pattern: '[vV][5-7]' + type: string - name: serviceInstanceId in: path required: true - type: string + schema: + type: string - name: configurationInstanceId in: path required: true - type: string + schema: + type: string + requestBody: + content: + application/json: + schema: + type: string + required: false responses: default: description: successful operation - '/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/removeRelationships': + content: {} + x-codegen-request-body-name: body + /onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/removeRelationships: post: tags: - onapsoinfraserviceInstantiation summary: Remove Relationships from Service Instance - description: '' operationId: removeRelationships - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: false - schema: - type: string - name: version in: path required: true - type: string - pattern: '[vV][6-7]' + schema: + pattern: '[vV][6-7]' + type: string - name: serviceInstanceId in: path required: true - type: string + schema: + type: string + requestBody: + content: + application/json: + schema: + type: string + required: false responses: default: description: successful operation - '/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs': + content: {} + x-codegen-request-body-name: body + /onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs: post: tags: - onapsoinfraserviceInstantiation summary: Create VNF on a specified version and serviceInstance - description: '' operationId: createVnfInstance - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: false - schema: - type: string - name: version in: path required: true - type: string - pattern: '[vV][5-7]' + schema: + pattern: '[vV][5-7]' + type: string - name: serviceInstanceId in: path required: true - type: string + schema: + type: string + requestBody: + content: + application/json: + schema: + type: string + required: false responses: default: description: successful operation - '/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/replace': + content: {} + x-codegen-request-body-name: body + /onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/replace: post: tags: - onapsoinfraserviceInstantiation summary: Replace provided VNF instance - description: '' operationId: replaceVnfInstance - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: false - schema: - type: string - name: version in: path required: true - type: string - pattern: '[vV][5-7]' + schema: + pattern: '[vV][5-7]' + type: string - name: serviceInstanceId in: path required: true - type: string + schema: + type: string - name: vnfInstanceId in: path required: true - type: string + schema: + type: string + requestBody: + content: + application/json: + schema: + type: string + required: false responses: default: description: successful operation - '/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}': + content: {} + x-codegen-request-body-name: body + /onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}: put: tags: - onapsoinfraserviceInstantiation - summary: 'Update VNF on a specified version, serviceInstance and vnfInstance' - description: '' + summary: Update VNF on a specified version, serviceInstance and vnfInstance operationId: updateVnfInstance - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: false - schema: - type: string - name: version in: path required: true - type: string - pattern: '[vV][5-7]' + schema: + pattern: '[vV][5-7]' + type: string - name: serviceInstanceId in: path required: true - type: string + schema: + type: string - name: vnfInstanceId in: path required: true - type: string + schema: + type: string + requestBody: + content: + application/json: + schema: + type: string + required: false responses: default: description: successful operation + content: {} + x-codegen-request-body-name: body delete: tags: - onapsoinfraserviceInstantiation summary: Delete provided VNF instance - description: '' operationId: deleteVnfInstance - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: false - schema: - type: string - name: version in: path required: true - type: string - pattern: '[vV][5-7]' + schema: + pattern: '[vV][5-7]' + type: string - name: serviceInstanceId in: path required: true - type: string + schema: + type: string - name: vnfInstanceId in: path required: true - type: string + schema: + type: string + requestBody: + content: + application/json: + schema: + type: string + required: false responses: default: description: successful operation - '/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules': + content: {} + x-codegen-request-body-name: body + /onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules: post: tags: - onapsoinfraserviceInstantiation - summary: 'Create VfModule on a specified version, serviceInstance and vnfInstance' - description: '' + summary: Create VfModule on a specified version, serviceInstance and vnfInstance operationId: createVfModuleInstance - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: false - schema: - type: string - name: version in: path required: true - type: string - pattern: '[vV][5-7]' + schema: + pattern: '[vV][5-7]' + type: string - name: serviceInstanceId in: path required: true - type: string + schema: + type: string - name: vnfInstanceId in: path required: true - type: string + schema: + type: string + requestBody: + content: + application/json: + schema: + type: string + required: false responses: default: description: successful operation - '/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/{vfmoduleInstanceId}/replace': + content: {} + x-codegen-request-body-name: body + /onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/{vfmoduleInstanceId}/replace: post: tags: - onapsoinfraserviceInstantiation - summary: 'Create VfModule on a specified version, serviceInstance and vnfInstance' - description: '' + summary: Create VfModule on a specified version, serviceInstance and vnfInstance operationId: replaceVfModuleInstance - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: false - schema: - type: string - name: version in: path required: true - type: string - pattern: '[vV][5-7]' + schema: + pattern: '[vV][5-7]' + type: string - name: serviceInstanceId in: path required: true - type: string + schema: + type: string - name: vnfInstanceId in: path required: true - type: string + schema: + type: string - name: vfmoduleInstanceId in: path required: true - type: string + schema: + type: string + requestBody: + content: + application/json: + schema: + type: string + required: false responses: default: description: successful operation - '/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/{vfmoduleInstanceId}': + content: {} + x-codegen-request-body-name: body + /onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/{vfmoduleInstanceId}: put: tags: - onapsoinfraserviceInstantiation summary: >- Update VfModule on a specified version, serviceInstance, vnfInstance and vfModule - description: '' operationId: updateVfModuleInstance - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: false - schema: - type: string - name: version in: path required: true - type: string - pattern: '[vV][5-7]' + schema: + pattern: '[vV][5-7]' + type: string - name: serviceInstanceId in: path required: true - type: string + schema: + type: string - name: vnfInstanceId in: path required: true - type: string + schema: + type: string - name: vfmoduleInstanceId in: path required: true - type: string + schema: + type: string + requestBody: + content: + application/json: + schema: + type: string + required: false responses: default: description: successful operation + content: {} + x-codegen-request-body-name: body delete: tags: - onapsoinfraserviceInstantiation summary: Delete provided VfModule instance - description: '' operationId: deleteVfModuleInstance - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: false - schema: - type: string - name: version in: path required: true - type: string - pattern: '[vV][5-7]' + schema: + pattern: '[vV][5-7]' + type: string - name: serviceInstanceId in: path required: true - type: string + schema: + type: string - name: vnfInstanceId in: path required: true - type: string + schema: + type: string - name: vfmoduleInstanceId in: path required: true - type: string + schema: + type: string + requestBody: + content: + application/json: + schema: + type: string + required: false responses: default: description: successful operation - '/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/volumeGroups': + content: {} + x-codegen-request-body-name: body + /onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/volumeGroups: post: tags: - onapsoinfraserviceInstantiation - summary: 'Create VolumeGroup on a specified version, serviceInstance, vnfInstance' - description: '' + summary: Create VolumeGroup on a specified version, serviceInstance, vnfInstance operationId: createVolumeGroupInstance - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: false - schema: - type: string - name: version in: path required: true - type: string - pattern: '[vV][5-7]' + schema: + pattern: '[vV][5-7]' + type: string - name: serviceInstanceId in: path required: true - type: string + schema: + type: string - name: vnfInstanceId in: path required: true - type: string + schema: + type: string + requestBody: + content: + application/json: + schema: + type: string + required: false responses: default: description: successful operation - '/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/volumeGroups/{volumeGroupInstanceId}': + content: {} + x-codegen-request-body-name: body + /onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/volumeGroups/{volumeGroupInstanceId}: put: tags: - onapsoinfraserviceInstantiation summary: >- Update VolumeGroup on a specified version, serviceInstance, vnfInstance and volumeGroup - description: '' operationId: updateVolumeGroupInstance - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: false - schema: - type: string - name: version in: path required: true - type: string - pattern: '[vV][5-7]' + schema: + pattern: '[vV][5-7]' + type: string - name: serviceInstanceId in: path required: true - type: string + schema: + type: string - name: vnfInstanceId in: path required: true - type: string + schema: + type: string - name: volumeGroupInstanceId in: path required: true - type: string + schema: + type: string + requestBody: + content: + application/json: + schema: + type: string + required: false responses: default: description: successful operation + content: {} + x-codegen-request-body-name: body delete: tags: - onapsoinfraserviceInstantiation summary: Delete provided VolumeGroup instance - description: '' operationId: deleteVolumeGroupInstance - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: false - schema: - type: string - name: version in: path required: true - type: string - pattern: '[vV][5-7]' + schema: + pattern: '[vV][5-7]' + type: string - name: serviceInstanceId in: path required: true - type: string + schema: + type: string - name: vnfInstanceId in: path required: true - type: string + schema: + type: string - name: volumeGroupInstanceId in: path required: true - type: string + schema: + type: string + requestBody: + content: + application/json: + schema: + type: string + required: false responses: default: description: successful operation - '/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/networks': + content: {} + x-codegen-request-body-name: body + /onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/networks: post: tags: - onapsoinfraserviceInstantiation summary: 'Create NetworkInstance on a specified version and serviceInstance ' - description: '' operationId: createNetworkInstance - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: false - schema: - type: string - name: version in: path required: true - type: string - pattern: '[vV][5-7]' + schema: + pattern: '[vV][5-7]' + type: string - name: serviceInstanceId in: path required: true - type: string + schema: + type: string + requestBody: + content: + application/json: + schema: + type: string + required: false responses: default: description: successful operation - '/onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/networks/{networkInstanceId}': + content: {} + x-codegen-request-body-name: body + /onap/so/infra/serviceInstantiation/{version}/serviceInstances/{serviceInstanceId}/networks/{networkInstanceId}: put: tags: - onapsoinfraserviceInstantiation summary: >- Update VolumeGroup on a specified version, serviceInstance, networkInstance - description: '' operationId: updateNetworkInstance - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: false - schema: - type: string - name: version in: path required: true - type: string - pattern: '[vV][5-7]' + schema: + pattern: '[vV][5-7]' + type: string - name: serviceInstanceId in: path required: true - type: string + schema: + type: string - name: networkInstanceId in: path required: true - type: string + schema: + type: string + requestBody: + content: + application/json: + schema: + type: string + required: false responses: default: description: successful operation + content: {} + x-codegen-request-body-name: body delete: tags: - onapsoinfraserviceInstantiation summary: Delete provided Network instance - description: '' operationId: deleteNetworkInstance - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: false - schema: - type: string - name: version in: path required: true - type: string - pattern: '[vV][5-7]' + schema: + pattern: '[vV][5-7]' + type: string - name: serviceInstanceId in: path required: true - type: string + schema: + type: string - name: networkInstanceId in: path required: true - type: string + schema: + type: string + requestBody: + content: + application/json: + schema: + type: string + required: false responses: default: description: successful operation - '/onap/so/infra/tasks/{version}': + content: {} + x-codegen-request-body-name: body + /onap/so/infra/tasks/{version}: get: tags: - onapsoinfratasks summary: Finds Manual Tasks - description: '' operationId: queryFilters parameters: - name: taskId in: query - required: false - type: string + schema: + type: string - name: originalRequestId in: query - required: false - type: string + schema: + type: string - name: subscriptionServiceType in: query - required: false - type: string + schema: + type: string - name: nfRole in: query - required: false - type: string + schema: + type: string - name: buildingBlockName in: query - required: false - type: string + schema: + type: string - name: originalRequestDate in: query - required: false - type: string + schema: + type: string - name: originalRequestorId in: query - required: false - type: string + schema: + type: string - name: version in: path required: true - type: string - pattern: '[vV]1' + schema: + pattern: '[vV]1' + type: string responses: default: description: successful operation - '/onap/so/infra/cloudResources/{version}/operationalEnvironments': + content: {} + /onap/so/infra/cloudResources/{version}/operationalEnvironments: post: tags: - onapsoinfracloudResources summary: Create an Operational Environment - description: '' operationId: createOperationEnvironment - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: false - schema: - type: string - name: version in: path required: true - type: string - pattern: '[vV][1]' + schema: + pattern: '[vV][1]' + type: string + requestBody: + content: + application/json: + schema: + type: string + required: false responses: default: description: successful operation - '/onap/so/infra/cloudResources/{version}/operationalEnvironments/{operationalEnvironmentId}/activate': + content: {} + x-codegen-request-body-name: body + /onap/so/infra/cloudResources/{version}/operationalEnvironments/{operationalEnvironmentId}/activate: post: tags: - onapsoinfracloudResources summary: Activate an Operational Environment - description: '' operationId: activateOperationEnvironment - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: false - schema: - type: string - name: version in: path required: true - type: string - pattern: '[vV][1]' + schema: + pattern: '[vV][1]' + type: string - name: operationalEnvironmentId in: path required: true - type: string + schema: + type: string + requestBody: + content: + application/json: + schema: + type: string + required: false responses: default: description: successful operation - '/onap/so/infra/cloudResources/{version}/operationalEnvironments/{operationalEnvironmentId}/deactivate': + content: {} + x-codegen-request-body-name: body + /onap/so/infra/cloudResources/{version}/operationalEnvironments/{operationalEnvironmentId}/deactivate: post: tags: - onapsoinfracloudResources summary: Deactivate an Operational Environment - description: '' operationId: deactivateOperationEnvironment - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: false - schema: - type: string - name: version in: path required: true - type: string - pattern: '[vV][1]' + schema: + pattern: '[vV][1]' + type: string - name: operationalEnvironmentId in: path required: true - type: string + schema: + type: string + requestBody: + content: + application/json: + schema: + type: string + required: false responses: default: description: successful operation - '/onap/so/infra/cloudResourcesRequests/{version}/{requestId}/unlock': + content: {} + x-codegen-request-body-name: body + /onap/so/infra/cloudResourcesRequests/{version}/{requestId}/unlock: post: tags: - onapsoinfracloudResourcesRequests summary: Unlock CloudOrchestration requests for a specified requestId - description: '' operationId: unlockOrchestrationRequestForReqId - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: false - schema: - type: string - name: requestId in: path required: true - type: string + schema: + type: string - name: version in: path required: true - type: string - pattern: '[vV][1]' + schema: + pattern: '[vV][1]' + type: string + requestBody: + content: + application/json: + schema: + type: string + required: false responses: default: description: successful operation - '/onap/so/infra/cloudResourcesRequests/{version}': + content: {} + x-codegen-request-body-name: body + /onap/so/infra/cloudResourcesRequests/{version}: get: tags: - onapsoinfracloudResourcesRequests summary: Get status of an Operational Environment based on filter criteria - description: '' operationId: getOperationEnvironmentStatusFilter - consumes: - - application/json - produces: - - application/json parameters: - name: version in: path required: true - type: string - pattern: '[vV][1]' + schema: + pattern: '[vV][1]' + type: string responses: default: description: successful operation - '/onap/so/infra/modelDistributions/{version}/distributions/{distributionId}': + content: {} + /onap/so/infra/modelDistributions/{version}/distributions/{distributionId}: post: tags: - onapsoinframodelDistributions summary: Update model distribution status - description: '' operationId: updateModelDistributionStatus - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: false - schema: - type: string - name: version in: path required: true - type: string - pattern: '[vV][1]' + schema: + pattern: '[vV][1]' + type: string - name: distributionId in: path required: true - type: string + schema: + type: string + requestBody: + content: + application/json: + schema: + type: string + required: false responses: default: description: successful operation - '/onap/so/infra/workflowSpecifications/{version}/workflows': + content: {} + x-codegen-request-body-name: body + /onap/so/infra/workflowSpecifications/{version}/workflows: get: tags: - onapsoinfraworkflowSpecifications summary: Retrieve Workflow details based on the filter criteria - description: '' operationId: queryWorkflowSpecifications - consumes: - - application/json - produces: - - application/json parameters: - name: resourceTarget in: query - required: false - type: string + schema: + type: string - name: version in: path required: true - type: string - pattern: '[vV][1]' + schema: + pattern: '[vV][1]' + type: string responses: default: description: List of workflow specifications on successful operation - schema: - $ref: '#/definitions/RetrievingWorkflowResponse' - '/onap/so/infra/instanceManagement/{version}/serviceInstances/{serviceInstanceId}/workflows/{workflow_UUID}': + content: + application/json: + schema: + $ref: '#/components/schemas/RetrievingWorkflowResponse' + /onap/so/infra/instanceManagement/{version}/serviceInstances/{serviceInstanceId}/workflows/{workflow_UUID}: post: tags: - onapsoinfrainstanceManagement summary: Executing service level custom workflow - description: '' operationId: executeServiceLevelCustomWorkflow - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: false - schema: - $ref: '#/definitions/ServiceLevelWorkflowExecution' - name: version in: path required: true - type: string - pattern: '[vV][1]' + schema: + pattern: '[vV][1]' + type: string - name: serviceInstanceId in: path required: true - type: string + schema: + type: string - name: workflow_UUID in: path required: true - type: string + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceLevelWorkflowExecution' + required: false responses: default: description: successful operation - '/onap/so/infra/instanceManagement/{version}/serviceInstances/{serviceInstanceId}/pnfs/${pnfName}/workflows/${workflow_UUID}': + content: {} + x-codegen-request-body-name: body + /onap/so/infra/instanceManagement/{version}/serviceInstances/{serviceInstanceId}/pnfs/${pnfName}/workflows/${workflow_UUID}: post: tags: - onapsoinfrainstanceManagement summary: Executing download/activate custom workflow - description: '' operationId: executePNFCustomWorkflow - consumes: - - application/json - produces: - - application/json parameters: - - in: body - name: body - required: false - schema: - $ref: '#/definitions/PNFCustomWorkflowExecution' - name: version in: path required: true - type: string - pattern: '[vV][1]' + schema: + pattern: '[vV][1]' + type: string - name: serviceInstanceId in: path required: true - type: string + schema: + type: string - name: pnfName - in: path - required: true + in: path + required: true + schema: type: string - name: workflow_UUID in: path required: true - type: string - responses: - default: - description: successful operation -definitions: - Allocate3gppService: - description: This describes the request body for 3gpp service allocation - type: object - properties: - name: - description: Name of the service to allocate - type: string - modelInvariantUuid: - description: >- - Model Invariant UUID corresponding to the service. For E.g : NSST - Model invariant uuid in case of NSSI creation - type: string - modelUuid: - description: >- - Model UUID corresponding to the service. For E.g : NSST Model uuid in - case of NSSI creation - type: string - globalSubscriberId: - type: string - subscriptionServiceType: - description: 'Service type for the subscription. For E.G :5G' - type: string - networkType: - description: 'Network type. For E.G :AN/CN/TN' - type: string - additionalProperties: - description: Map of additional properties required for service allocation - type: object - DeAllocate3gppService: - description: This describes the request body for 3gpp service Termination/Deallocation - type: object - properties: - serviceInstanceID: - description: ID of the service to terminate - type: string - globalSubscriberId: - type: string - subscriptionServiceType: - description: 'Service type for the subscription. For E.G :5G' - type: string - networkType: - description: 'Network type. For E.G :AN/CN/TN' - type: string - additionalProperties: - description: Map of additional properties required for service deallocation - type: object - Modify3gppService: - description: This describes the request body for 3gpp service modification - type: object - properties: - name: - description: Name of the service to modify - type: string - serviceInstanceID: - description: ID of the service to modify - type: string - globalSubscriberId: - type: string - subscriptionServiceType: - description: 'Service type for the subscription. For E.G :5G' - type: string - networkType: - description: 'Network type. For E.G :AN/CN/TN' - type: string - additionalProperties: - description: Map of additional properties required for service modification - type: object - 3gppServiceActivation: - description: This describes the request body for 3gpp service activation/deactivation - type: object - properties: - serviceInstanceID: - description: ID of the service to be activated/deactivated - type: string - globalSubscriberId: - type: string - subscriptionServiceType: - description: 'Service type for the subscription. For E.G :5G' - type: string - networkType: - description: 'Network type. For E.G :AN/CN/TN' - type: string - additionalProperties: - description: >- - Map of additional properties required for service - activation/deactivation - type: object - QuerySubnetCapability: - description: This describes the subnet capabilities that can be queried - type: object - properties: - subnetTypes: - type: array - items: - $ref: '#/definitions/SubnetTypes' - SubnetTypes: - description: This describes allowed subnet types - type: string - enum: - - AN - - AN_NF - - CN - - TN_FH - - TN_MH - - TN_BH - 3gppServiceResponse: - description: This describes the response for 3gpp services - type: object - properties: - jobId: - description: Job ID to be used to identify the status of the job - type: string - status: - description: status of the job - type: string - statusDescription: - description: Description on status in case of erroneous response - type: object - RetrievingWorkflowResponse: - description: Response body of fetching workflows using resource target - type: object - properties: - workflowSpecificationList: - description: List of Workflow specification data - type: array - items: - $ref: '#/definitions/WorkflowSpecification' - WorkflowSpecification: - description: This describes workflow specification object - type: object - properties: - artifactInfo: - description: 'Attributes related to artifact information ' - type: object - properties: - artifactType: - description: Type of the artifact to be queried - type: string - artifactUuid: - description: UUID of the artifact - type: string - artifactName: - description: Name of the artifact - type: string - artifactVersion: - description: Artifact's Version - type: string - artifactDescription: - description: '' - type: string - workflowName: - description: Name of the workflow fetched for the resource type - type: string - operationName: - description: Mapped operation name of the corresponding workflow - type: string - workflowSource: - description: '' - type: string - workflowResourceTarget: - description: Type of Resource mapped against the workflow - type: string - ServiceLevelWorkflowExecution: - description: This describes the request body of service level custom workflow execution - type: object - properties: - requestInfo: - description: Request object contains source information - type: object - properties: - source: - description: Name of the sender - type: string - suppressRollback: - description: Enable/disable rollback suppression - type: boolean - requestorId: - description: Id of the sender - type: string - modelInfo: - description: Parameters related to the service model - type: object - properties: - modelType: - description: Type of the model to be executed - type: string - modelInvariantUuid: - description: Model invariant id corresponding to the service - type: string - modelUuid: - description: Model uuid corresponding to the service - type: string - modelVersionId: - description: Model version of the service instance - type: string - modelName: - description: Name of the service - type: string - modelVersion: - description: Version of the service instance - type: string - requestParameters: - description: User parameter object - type: object - properties: - subscriptionServiceType: - description: Type of service subscription - type: string - subscriberInfo: - description: Subscriber id information - type: object - properties: - globalSubscriberId: - description: Id of the subscriber sending the request - type: string - project: - description: Information about the target project name - type: object - properties: - projectName: - description: Name of the target project - type: string - owningEntity: - description: Object describes the entity details - type: object - properties: - owningEntityId: - description: Id of the owning Entity - type: string - owningEntityName: - description: Name of the owning Entity - type: string - PNFCustomWorkflowExecution: - description: This describes the request body of PNF custom workflow execution - type: object - properties: - requestInfo: - description: Request object contains source information - type: object - properties: - source: - description: Name of the sender - type: string - suppressRollback: - description: Enable/disable rollback suppression - type: boolean - requestorId: - description: Id of the sender - type: string - modelInfo: - description: Parameters related to the service model - type: object - properties: - modelType: - description: Type of the model to be executed - type: string - modelInvariantUuid: - description: Model invariant id corresponding to the service - type: string - modelUuid: - description: Model uuid corresponding to the service - type: string - modelVersionId: - description: Model version of the service instance - type: string - modelName: - description: Name of the service - type: string - modelVersion: - description: Version of the service instance - type: string - requestParameters: - description: User parameter object - type: object - properties: - subscriptionServiceType: - description: Type of service subscription - type: string - subscriberInfo: - description: Subscriber id information - type: object - properties: - globalSubscriberId: - description: Id of the subscriber sending the request - type: string - project: - description: Information about the target project name - type: object - properties: - projectName: - description: Name of the target project - type: string - owningEntity: - description: Object describes the entity details - type: object - properties: - owningEntityId: - description: Id of the owning Entity - type: string - owningEntityName: - description: Name of the owning Entity - type: string \ No newline at end of file + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PNFCustomWorkflowExecution' + required: false + responses: + default: + description: successful operation + content: {} + x-codegen-request-body-name: body +components: + schemas: + Allocate3gppService: + type: object + properties: + name: + type: string + description: Name of the service to allocate + modelInvariantUuid: + type: string + description: >- + Model Invariant UUID corresponding to the service. For E.g : NSST + Model invariant uuid in case of NSSI creation + modelUuid: + type: string + description: >- + Model UUID corresponding to the service. For E.g : NSST Model uuid + in case of NSSI creation + globalSubscriberId: + type: string + subscriptionServiceType: + type: string + description: Service type for the subscription. For E.G :5G + networkType: + type: string + description: Network type. For E.G :AN/CN/TN + additionalProperties: + type: object + properties: {} + description: Map of additional properties required for service allocation + description: This describes the request body for 3gpp service allocation + DeAllocate3gppService: + type: object + properties: + serviceInstanceID: + type: string + description: ID of the service to terminate + globalSubscriberId: + type: string + subscriptionServiceType: + type: string + description: Service type for the subscription. For E.G :5G + networkType: + type: string + description: Network type. For E.G :AN/CN/TN + additionalProperties: + type: object + properties: {} + description: Map of additional properties required for service deallocation + description: >- + This describes the request body for 3gpp service + Termination/Deallocation + Modify3gppService: + type: object + properties: + name: + type: string + description: Name of the service to modify + serviceInstanceID: + type: string + description: ID of the service to modify + globalSubscriberId: + type: string + subscriptionServiceType: + type: string + description: Service type for the subscription. For E.G :5G + networkType: + type: string + description: Network type. For E.G :AN/CN/TN + additionalProperties: + type: object + properties: {} + description: Map of additional properties required for service modification + description: This describes the request body for 3gpp service modification + 3gppServiceActivation: + type: object + properties: + serviceInstanceID: + type: string + description: ID of the service to be activated/deactivated + globalSubscriberId: + type: string + subscriptionServiceType: + type: string + description: Service type for the subscription. For E.G :5G + networkType: + type: string + description: Network type. For E.G :AN/CN/TN + additionalProperties: + type: object + properties: {} + description: >- + Map of additional properties required for service + activation/deactivation + description: This describes the request body for 3gpp service activation/deactivation + QuerySubnetCapability: + type: object + properties: + subnetTypes: + type: array + items: + $ref: '#/components/schemas/SubnetTypes' + description: This describes the subnet capabilities that can be queried + SubnetTypes: + type: string + description: This describes allowed subnet types + enum: + - AN + - AN_NF + - CN + - TN_FH + - TN_MH + - TN_BH + 3gppServiceResponse: + type: object + properties: + jobId: + type: string + description: Job ID to be used to identify the status of the job + status: + type: string + description: status of the job + statusDescription: + type: object + properties: {} + description: Description on status in case of erroneous response + description: This describes the response for 3gpp services + RetrievingWorkflowResponse: + type: object + properties: + workflowSpecificationList: + type: array + description: List of Workflow specification data + items: + $ref: '#/components/schemas/WorkflowSpecification' + description: Response body of fetching workflows using resource target + WorkflowSpecification: + type: object + properties: + artifactInfo: + type: object + properties: + artifactType: + type: string + description: Type of the artifact to be queried + artifactUuid: + type: string + description: UUID of the artifact + artifactName: + type: string + description: Name of the artifact + artifactVersion: + type: string + description: Artifact's Version + artifactDescription: + type: string + description: '' + workflowName: + type: string + description: Name of the workflow fetched for the resource type + operationName: + type: string + description: Mapped operation name of the corresponding workflow + workflowSource: + type: string + description: '' + workflowResourceTarget: + type: string + description: Type of Resource mapped against the workflow + description: 'Attributes related to artifact information ' + description: This describes workflow specification object + ServiceLevelWorkflowExecution: + type: object + properties: + requestInfo: + type: object + properties: + source: + type: string + description: Name of the sender + suppressRollback: + type: boolean + description: Enable/disable rollback suppression + requestorId: + type: string + description: Id of the sender + description: Request object contains source information + modelInfo: + type: object + properties: + modelType: + type: string + description: Type of the model to be executed + modelInvariantUuid: + type: string + description: Model invariant id corresponding to the service + modelUuid: + type: string + description: Model uuid corresponding to the service + modelVersionId: + type: string + description: Model version of the service instance + modelName: + type: string + description: Name of the service + modelVersion: + type: string + description: Version of the service instance + description: Parameters related to the service model + requestParameters: + type: object + properties: + subscriptionServiceType: + type: string + description: Type of service subscription + description: User parameter object + subscriberInfo: + type: object + properties: + globalSubscriberId: + type: string + description: Id of the subscriber sending the request + description: Subscriber id information + project: + type: object + properties: + projectName: + type: string + description: Name of the target project + description: Information about the target project name + owningEntity: + type: object + properties: + owningEntityId: + type: string + description: Id of the owning Entity + owningEntityName: + type: string + description: Name of the owning Entity + description: Object describes the entity details + description: >- + This describes the request body of service level custom workflow + execution + PNFCustomWorkflowExecution: + type: object + properties: + requestInfo: + type: object + properties: + source: + type: string + description: Name of the sender + suppressRollback: + type: boolean + description: Enable/disable rollback suppression + requestorId: + type: string + description: Id of the sender + description: Request object contains source information + modelInfo: + type: object + properties: + modelType: + type: string + description: Type of the model to be executed + modelInvariantUuid: + type: string + description: Model invariant id corresponding to the service + modelUuid: + type: string + description: Model uuid corresponding to the service + modelVersionId: + type: string + description: Model version of the service instance + modelName: + type: string + description: Name of the service + modelVersion: + type: string + description: Version of the service instance + description: Parameters related to the service model + requestParameters: + type: object + properties: + subscriptionServiceType: + type: string + description: Type of service subscription + description: User parameter object + subscriberInfo: + type: object + properties: + globalSubscriberId: + type: string + description: Id of the subscriber sending the request + description: Subscriber id information + project: + type: object + properties: + projectName: + type: string + description: Name of the target project + description: Information about the target project name + owningEntity: + type: object + properties: + owningEntityId: + type: string + description: Id of the owning Entity + owningEntityName: + type: string + description: Name of the owning Entity + description: Object describes the entity details + description: This describes the request body of PNF custom workflow execution + CreateServiceInstanceParamaters: + type: object + properties: + requestDetails: + type: object + description: Contains data associated with a request + properties: + requestParameters: + type: object + description: Contains all the parameters, associated with this request + properties: + subscriptionServiceType: + type: string + description: Type of service subscriptions of customer resource + userParams: + type: array + description: Array of data that contains information about Service + items: + oneOf: + - $ref: >- + #/components/schemas/CreateServiceInstParamsUserParamsHoming + - $ref: >- + #/components/schemas/CreateServiceInstParamsUserParamsService + aLaCarte: + type: boolean + description: >- + Enable “A La Carte” mode. In this mode, the user creates and + submits operations for each object to be created. + usePreload: + type: boolean + description: Special value required to use additional Policy settings + modelInfo: + type: object + description: Contains information about the currently used Service Model model + properties: + modelInvariantId: + type: string + description: >- + Unique identifier corresponding to the main definition of a + model in SDC + modelType: + type: string + description: Type of service model, created in SDC + modelName: + type: string + description: Name of the model, which can change from version to version. + modelVersion: + type: string + description: >- + Unique identifier corresponding to one version of a model in + SDC + modelVersionId: + type: string + description: The SDC model version for this resource or service model. + modelUuid: + type: string + description: >- + Unique identifier corresponding to the main definition of a + model in SDC + modelInvariantUuid: + type: string + description: >- + Unique identifier corresponding to the main definition of a + model in SDC + requestInfo: + type: object + description: Represents some information for the request + properties: + productFamilyId: + type: string + description: SDC catalog service type + source: + type: string + description: Determines only the source from whom the request came + instanceName: + type: string + description: Defines the name of the instance to be created + suppressRollback: + type: boolean + description: >- + If false – the rollback process will not start if something + goes wrong in execution BB. If true - QueryRainyDayTable + task will start and make querying policy in table + rainy_day_handler_macro + requestorId: + type: string + description: User Id or Application Id, initiating the Assessment + subscriberInfo: + type: object + description: >- + Represents the object that groups service instances used by a + customer + properties: + globalSubscriberId: + type: string + description: >- + Global Subscriber Id used across ONAP to uniquely identify + subscriber. + project: + type: object + description: Represents the project, which will own the service instance + properties: + projectName: + type: string + description: Name of the project deploying a service + owningEntity: + type: object + description: Represents the entity, which will own the service instance + properties: + owningEntityId: + type: string + description: UUID of an owning entity + owningEntityName: + type: string + description: Owning entity name + CreateServiceInstParamsUserParamsHoming: + allOf: + - type: object + properties: + Homing_Solution: + type: string + description: >- + Switches on an optimization service to deploy services + automatically across multiple sites and multiple clouds + CreateServiceInstParamsUserParamsService: + allOf: + - type: object + properties: + service: + type: object + description: Includes information about all created instances + properties: + instanceParams: + type: array + description: Includes a set of specific parameters + items: + type: object + properties: {} + instanceName: + type: string + description: Defines the name of the instance to be created + resources: + type: object + properties: + vnfs: + type: array + description: Contains information about VNF parameters + items: + type: object + properties: + modelInfo: + type: object + description: Contains information about the currently used Service Model model + properties: + modelInvariantId: + type: string + description: >- + Unique identifier corresponding to the main + definition of a model in SDC + modelType: + type: string + description: Type of Service Model, created in SDC + modelName: + type: string + description: >- + Name of the model, which can change from + version to version. + modelVersion: + type: string + description: >- + Unique identifier corresponding to one version + of a model in SDC + modelVersionId: + type: string + description: >- + The SDC model version for this resource or + service model. + modelUuid: + type: string + description: >- + Unique identifier corresponding to the main + definition of a model in SDC + modelInvariantUuid: + type: string + description: >- + Unique identifier corresponding to the main + definition of a model in SDC + cloudConfiguration: + type: object + properties: + cloudOwner: + type: string + description: >- + Identifies the vendor and cloud name. First + part of composite key should be formatted as + vendor-cloudname + lcpCloudRegionId: + type: string + description: >- + Cloud-owner defined type indicator (Openstack + region) + tenantId: + type: string + description: Unique id relative to the cloud-region. + platform: + type: object + description: >- + Represents the platform, on which the VNFs/CNFs + will run + properties: + platformName: + type: string + description: Name of the platform + lineOfBusiness: + type: object + description: >- + Represents the business line, owns the VNFs/CNFs + instances + properties: + lineOfBusinessName: + type: string + description: Name of the line-of-business (product) + productFamilyId: + type: string + description: Define SDC catalog service type + instanceName: + type: string + description: Defines the name of the instance to be created + instanceParams: + type: array + description: Includes a set of specific parameters of instance + items: + type: object + properties: {} + vfModules: + type: array + description: Сontains a set of parameters of VF Modules + items: + type: object + properties: + modelInfo: + type: object + description: Contains information about the currently used Service Model model + properties: + modelInvariantId: + type: string + description: >- + Unique identifier corresponding to the + main definition of a model in SDC + modelType: + type: string + description: Type of service model, created in SDC + modelName: + type: string + description: >- + Name of the model, which can change from + version to version. + modelVersion: + type: string + description: >- + Unique identifier corresponding to one + version of a model in SDC + modelVersionId: + type: string + description: >- + The SDC model version for this resource + or service model. + modelUuid: + type: string + description: >- + Unique identifier corresponding to the + main definition of a model in SDC + modelInvariantUuid: + type: string + description: >- + Unique identifier corresponding to the + main definition of a model in SDC + instanceName: + type: string + description: >- + Defines the name of the instance to be + created + instanceParams: + type: array + description: Includes a set of specific parameters + items: + type: object + properties: {} + modelInfo: + type: object + description: Contains information about the currently used Service Model model + properties: + modelName: + type: string + description: >- + Name of the model, which can change from + version to version. + modelVersionId: + type: string + description: >- + Unique identifier corresponding to one + version of a model in SDC + modelInvariantUuid: + type: string + description: >- + Unique identifier corresponding to the + main definition of a model in SDC + modelVersion: + type: string + description: >- + The SDC model version for this resource + or service model. + modelCustomizationId: + type: string + description: >- + Unique generated identifier of a model in SDC -- cgit 1.2.3-korg From 71f82aa2d92c235e8efa2cbaa26188afd3f1bb29 Mon Sep 17 00:00:00 2001 From: "alexey.aleynikov" Date: Thu, 17 Feb 2022 16:46:46 +0300 Subject: added new swagger (OPENAPI 3.0.1) files with changes in SO service Instantiation (added example of Complex model) Issue-ID: SO-3811 Signed-off-by: alexey.aleynikov Change-Id: Icaf8b2c171f14c16c153c523aa904b3e68d860a3 --- docs/api/swagger/swagger.json | 178 ++++++++++++++++++++++++++++++++++++++++++ docs/api/swagger/swagger.yaml | 125 ++++++++++++++++++++++++++++- 2 files changed, 301 insertions(+), 2 deletions(-) diff --git a/docs/api/swagger/swagger.json b/docs/api/swagger/swagger.json index 7421a400de..ac0e523d45 100644 --- a/docs/api/swagger/swagger.json +++ b/docs/api/swagger/swagger.json @@ -1711,6 +1711,184 @@ } } } + }, + "Composed service in two clouds": { + "summary": "Composed service in two clouds", + "value": { + "requestDetails": { + "modelInfo": { + "modelInvariantId": "0592b699-3f7b-424f-857b-d956f15c9447", + "modelInvariantUuid": "0592b699-3f7b-424f-857b-d956f15c9447", + "modelName": "parent_svc_2912", + "modelType": "service", + "modelUuid": "1c889525-46c5-4b22-8f26-17913dd3172a", + "modelVersion": "2.0", + "modelVersionId": "1c889525-46c5-4b22-8f26-17913dd3172a" + }, + "owningEntity": { + "owningEntityId": "67f2e84c-734d-4e90-a1e4-d2ffa2e75849", + "owningEntityName": "OE-5GCustomer" + }, + "project": { + "projectName": "Project-5GCustomer" + }, + "requestInfo": { + "instanceName": "parent_two_k8s", + "productFamilyId": "productFamilyId123", + "requestorId": "a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb", + "source": "Postman", + "suppressRollback": false + }, + "requestParameters": { + "aLaCarte": false, + "subscriptionServiceType": "5G", + "usePreload": false, + "userParams": [ + { + "Homing_Solution": "none" + }, + { + "service": { + "instanceName": "parent_two_k8s", + "instanceParams": [ + {} + ], + "modelInfo": { + "modelInvariantId": "0592b699-3f7b-424f-857b-d956f15c9447", + "modelName": "parent_svc_2912", + "modelType": "service", + "modelVersion": "2.0", + "modelVersionId": "1c889525-46c5-4b22-8f26-17913dd3172a" + }, + "resources": { + "services": [ + { + "instanceName": "childsvc_1201_01", + "instanceParams": [ + {} + ], + "modelInfo": { + "modelInvariantId": "19d8f134-8bdb-46ed-84a9-046c9314d9a9", + "modelName": "childsvc_2912", + "modelType": "service", + "modelVersion": "2.0", + "modelVersionId": "b2ae12eb-3854-4405-a125-c63c16e6fa23" + }, + "resources": { + "vnfs": [ + { + "cloudConfiguration": { + "cloudOwner": "k8scloudowner4", + "lcpCloudRegionId": "k8sregionfour", + "tenantId": "6bbd2981b210461dbc8fe846df1a7808" + }, + "instanceName": "CUCP_1", + "instanceParams": [ + {} + ], + "lineOfBusiness": { + "lineOfBusinessName": "LOB-5GCustomer" + }, + "modelInfo": { + "modelCustomizationId": "26be9ecc-43b2-47e4-9666-915701b87cbc", + "modelInstanceName": "CUCP_2912 0", + "modelInvariantUuid": "a3c9fa51-ff3c-4b6e-a1bd-73eb1ffb06c0", + "modelName": "CUCP_2912", + "modelVersion": "1.0", + "modelVersionId": "4a7aa841-09a5-493b-a52f-26aaa1f62c20" + }, + "platform": { + "platformName": "test" + }, + "productFamilyId": "productFamilyId123", + "vfModules": [ + { + "instanceName": "module-1", + "instanceParams": [ + {} + ], + "modelInfo": { + "modelCustomizationId": "fe39f295-253c-41ef-b07c-607aec86ea52", + "modelInvariantUuid": "051d1f8a-d5bd-4509-9457-0ef756dc5a33", + "modelName": "Cucp2912..helm_cucp..module-1", + "modelVersion": "1", + "modelVersionId": "3f70da13-e246-4abd-8fe5-90d3f8fbc212" + } + } + ] + } + ] + } + }, + { + "instanceName": "childsvc_1201_02", + "instanceParams": [ + {} + ], + "modelInfo": { + "modelInvariantId": "19d8f134-8bdb-46ed-84a9-046c9314d9a9", + "modelName": "childsvc_2912", + "modelType": "service", + "modelVersion": "2.0", + "modelVersionId": "b2ae12eb-3854-4405-a125-c63c16e6fa23" + }, + "resources": { + "vnfs": [ + { + "cloudConfiguration": { + "cloudOwner": "k8scloudowner4", + "lcpCloudRegionId": "k8sregionone", + "tenantId": "3fd21203fd274e10a30f1fd4c355d80b" + }, + "instanceName": "CUCP_2", + "instanceParams": [ + {} + ], + "lineOfBusiness": { + "lineOfBusinessName": "LOB-5GCustomer" + }, + "modelInfo": { + "modelCustomizationId": "26be9ecc-43b2-47e4-9666-915701b87cbc", + "modelInstanceName": "CUCP_2912 0", + "modelInvariantUuid": "a3c9fa51-ff3c-4b6e-a1bd-73eb1ffb06c0", + "modelName": "CUCP_2912", + "modelVersion": "1.0", + "modelVersionId": "4a7aa841-09a5-493b-a52f-26aaa1f62c20" + }, + "platform": { + "platformName": "test" + }, + "productFamilyId": "productFamilyId123", + "vfModules": [ + { + "instanceName": "module-2", + "instanceParams": [ + {} + ], + "modelInfo": { + "modelCustomizationId": "fe39f295-253c-41ef-b07c-607aec86ea52", + "modelInvariantUuid": "051d1f8a-d5bd-4509-9457-0ef756dc5a33", + "modelName": "Cucp2912..helm_cucp..module-1", + "modelVersion": "1", + "modelVersionId": "3f70da13-e246-4abd-8fe5-90d3f8fbc212" + } + } + ] + } + ] + } + } + ] + } + } + } + ] + }, + "subscriberInfo": { + "globalSubscriberId": "5GCustomer" + } + } + } } } } diff --git a/docs/api/swagger/swagger.yaml b/docs/api/swagger/swagger.yaml index d73a8309bd..166ad067de 100644 --- a/docs/api/swagger/swagger.yaml +++ b/docs/api/swagger/swagger.yaml @@ -1073,7 +1073,6 @@ paths: } } ] - pnf: summary: PNF value: @@ -1130,8 +1129,130 @@ paths: vnfs: [] subscriberInfo: globalSubscriberId: ORANTownCustomer + Composed service in two clouds: + summary: Composed service in two clouds + value: + requestDetails: + modelInfo: + modelInvariantId: 0592b699-3f7b-424f-857b-d956f15c9447 + modelInvariantUuid: 0592b699-3f7b-424f-857b-d956f15c9447 + modelName: parent_svc_2912 + modelType: service + modelUuid: 1c889525-46c5-4b22-8f26-17913dd3172a + modelVersion: '2.0' + modelVersionId: 1c889525-46c5-4b22-8f26-17913dd3172a + owningEntity: + owningEntityId: 67f2e84c-734d-4e90-a1e4-d2ffa2e75849 + owningEntityName: OE-5GCustomer + project: + projectName: Project-5GCustomer + requestInfo: + instanceName: parent_two_k8s + productFamilyId: productFamilyId123 + requestorId: a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb + source: Postman + suppressRollback: false + requestParameters: + aLaCarte: false + subscriptionServiceType: 5G + usePreload: false + userParams: + - Homing_Solution: none + - service: + instanceName: parent_two_k8s + instanceParams: + - {} + modelInfo: + modelInvariantId: 0592b699-3f7b-424f-857b-d956f15c9447 + modelName: parent_svc_2912 + modelType: service + modelVersion: '2.0' + modelVersionId: 1c889525-46c5-4b22-8f26-17913dd3172a + resources: + services: + - instanceName: childsvc_1201_01 + instanceParams: + - {} + modelInfo: + modelInvariantId: 19d8f134-8bdb-46ed-84a9-046c9314d9a9 + modelName: childsvc_2912 + modelType: service + modelVersion: '2.0' + modelVersionId: b2ae12eb-3854-4405-a125-c63c16e6fa23 + resources: + vnfs: + - cloudConfiguration: + cloudOwner: k8scloudowner4 + lcpCloudRegionId: k8sregionfour + tenantId: 6bbd2981b210461dbc8fe846df1a7808 + instanceName: CUCP_1 + instanceParams: + - {} + lineOfBusiness: + lineOfBusinessName: LOB-5GCustomer + modelInfo: + modelCustomizationId: 26be9ecc-43b2-47e4-9666-915701b87cbc + modelInstanceName: CUCP_2912 0 + modelInvariantUuid: a3c9fa51-ff3c-4b6e-a1bd-73eb1ffb06c0 + modelName: CUCP_2912 + modelVersion: '1.0' + modelVersionId: 4a7aa841-09a5-493b-a52f-26aaa1f62c20 + platform: + platformName: test + productFamilyId: productFamilyId123 + vfModules: + - instanceName: module-1 + instanceParams: + - {} + modelInfo: + modelCustomizationId: fe39f295-253c-41ef-b07c-607aec86ea52 + modelInvariantUuid: 051d1f8a-d5bd-4509-9457-0ef756dc5a33 + modelName: Cucp2912..helm_cucp..module-1 + modelVersion: '1' + modelVersionId: 3f70da13-e246-4abd-8fe5-90d3f8fbc212 + - instanceName: childsvc_1201_02 + instanceParams: + - {} + modelInfo: + modelInvariantId: 19d8f134-8bdb-46ed-84a9-046c9314d9a9 + modelName: childsvc_2912 + modelType: service + modelVersion: '2.0' + modelVersionId: b2ae12eb-3854-4405-a125-c63c16e6fa23 + resources: + vnfs: + - cloudConfiguration: + cloudOwner: k8scloudowner4 + lcpCloudRegionId: k8sregionone + tenantId: 3fd21203fd274e10a30f1fd4c355d80b + instanceName: CUCP_2 + instanceParams: + - {} + lineOfBusiness: + lineOfBusinessName: LOB-5GCustomer + modelInfo: + modelCustomizationId: 26be9ecc-43b2-47e4-9666-915701b87cbc + modelInstanceName: CUCP_2912 0 + modelInvariantUuid: a3c9fa51-ff3c-4b6e-a1bd-73eb1ffb06c0 + modelName: CUCP_2912 + modelVersion: '1.0' + modelVersionId: 4a7aa841-09a5-493b-a52f-26aaa1f62c20 + platform: + platformName: test + productFamilyId: productFamilyId123 + vfModules: + - instanceName: module-2 + instanceParams: + - {} + modelInfo: + modelCustomizationId: fe39f295-253c-41ef-b07c-607aec86ea52 + modelInvariantUuid: 051d1f8a-d5bd-4509-9457-0ef756dc5a33 + modelName: Cucp2912..helm_cucp..module-1 + modelVersion: '1' + modelVersionId: 3f70da13-e246-4abd-8fe5-90d3f8fbc212 + subscriberInfo: + globalSubscriberId: 5GCustomer - required: false responses: default: -- cgit 1.2.3-korg From fb7e0b5f8b13a0cd8b01011445c27cf47a415954 Mon Sep 17 00:00:00 2001 From: sreeja gattagouni Date: Thu, 21 Apr 2022 15:24:22 +0530 Subject: Processing Priority for Nested Services - Processing Priority For Nested Services. - Prioritising services by mentioning priority number while triggering requests will allow the Services to be instantiated as per the priority in a Nested-Services having Parent-Child Services Relationships. Issue-ID: SO-3855 Change-Id: I66d83f324c122d842f52f0b808dab5640b8c9abf Signed-off-by: sreeja gattagouni --- .../tasks/ebb/loader/UserParamsServiceTraversal.java | 1 + .../java/org/onap/so/serviceinstancebeans/Service.java | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/UserParamsServiceTraversal.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/UserParamsServiceTraversal.java index 074aa9e5a1..b8b9c458fa 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/UserParamsServiceTraversal.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/UserParamsServiceTraversal.java @@ -115,6 +115,7 @@ public class UserParamsServiceTraversal { for (Service childService : validate.getResources().getServices()) { Resource childServiceResource = new Resource(WorkflowType.SERVICE, childService.getModelInfo().getModelVersionId(), false, serviceResource); + childServiceResource.setProcessingPriority(childService.getProcessingPriority()); childServiceResource.setInstanceName(childService.getInstanceName()); resourceList.add(childServiceResource); } diff --git a/common/src/main/java/org/onap/so/serviceinstancebeans/Service.java b/common/src/main/java/org/onap/so/serviceinstancebeans/Service.java index c368f67907..14b1ab5974 100644 --- a/common/src/main/java/org/onap/so/serviceinstancebeans/Service.java +++ b/common/src/main/java/org/onap/so/serviceinstancebeans/Service.java @@ -45,6 +45,9 @@ public class Service implements Serializable { private List> instanceParams = new ArrayList<>(); @JsonProperty("resources") protected Resources resources; + @JsonProperty("processingPriority") + protected Integer processingPriority = 0; + public ModelInfo getModelInfo() { return modelInfo; @@ -86,9 +89,19 @@ public class Service implements Serializable { this.resources = resources; } + public Integer getProcessingPriority() { + return processingPriority; + } + + public void setProcessingPriority(Integer processingPriority) { + this.processingPriority = processingPriority; + } + + @Override public String toString() { return "Service [modelInfo=" + modelInfo + ", cloudConfiguration=" + cloudConfiguration + ", instanceName=" - + instanceName + ", instanceParams=" + instanceParams + ", resources=" + resources + "]"; + + instanceName + ", instanceParams=" + instanceParams + ", resources=" + resources + + ", processingPriority=" + processingPriority + "]"; } } -- cgit 1.2.3-korg From 7afa4fdaecb5df4e6e67f94a46825ebbe6050110 Mon Sep 17 00:00:00 2001 From: "mamed.mamedov" Date: Mon, 30 May 2022 17:37:24 +0300 Subject: Enable DeleteChildService functionality Issue-ID: SO-3830 Change-Id: I5cf8b1a998839813fd59576eb70eb79c72f2c2fe Signed-off-by: mamed.mamedov --- .../main/resources/db/migration/R__MacroData.sql | 34 ++++---- .../BuildingBlock/DeleteChildServiceBB.bpmn | 98 ++++++++++------------ .../composition/ChildServiceRequestBuilder.java | 43 ++++++++-- .../service/composition/DeleteChildServiceBB.java | 95 ++++++++++++++++++++- .../workflow/tasks/WorkflowAction.java | 13 +-- .../tasks/ebb/loader/ServiceEBBLoader.java | 53 ++++++++++++ .../ChildServiceRequestBuilderTest.java | 23 ++++- .../tasks/ebb/loader/ServiceEBBLoaderTest.java | 56 +++++++++++++ 8 files changed, 326 insertions(+), 89 deletions(-) diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql index 6b552b3fdd..9b21dcd2d2 100644 --- a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/R__MacroData.sql @@ -91,21 +91,22 @@ INSERT INTO orchestration_flow_reference(COMPOSITE_ACTION, SEQ_NO, FLOW_NAME, SC ('Service-Macro-Create', '21', 'ActivateVnfBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')), ('Service-Macro-Create', '22', 'ActivateNetworkCollectionBB', NULL, NULL,1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')), ('Service-Macro-Create', '23', 'ActivateServiceInstanceBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Create' and CLOUD_OWNER = 'DEFAULT')), -('Service-Macro-Delete', '1', 'DeactivateVfModuleBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'DEFAULT')), -('Service-Macro-Delete', '2', 'DeleteVfModuleBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'DEFAULT')), -('Service-Macro-Delete', '3', 'DeactivateVolumeGroupBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'DEFAULT')), -('Service-Macro-Delete', '4', 'DeleteVolumeGroupBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'DEFAULT')), -('Service-Macro-Delete', '5', 'DeactivateVnfBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'DEFAULT')), -('Service-Macro-Delete', '6', 'DeactivatePnfBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'DEFAULT')), -('Service-Macro-Delete', '7', 'DeactivateNetworkBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'DEFAULT')), -('Service-Macro-Delete', '8', 'DeleteNetworkBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'DEFAULT')), -('Service-Macro-Delete', '9', 'DeleteNetworkCollectionBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'DEFAULT')), -('Service-Macro-Delete', '10', 'DeactivateServiceInstanceBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'DEFAULT')), -('Service-Macro-Delete', '11', 'UnassignVfModuleBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'DEFAULT')), -('Service-Macro-Delete', '12', 'UnassignVolumeGroupBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'DEFAULT')), -('Service-Macro-Delete', '13', 'UnassignVnfBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'DEFAULT')), -('Service-Macro-Delete', '14', 'UnassignNetworkBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'DEFAULT')), -('Service-Macro-Delete', '15', 'UnassignServiceInstanceBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'DEFAULT')), +('Service-Macro-Delete', '1', 'DeleteChildServiceBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'DEFAULT')), +('Service-Macro-Delete', '2', 'DeactivateVfModuleBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'DEFAULT')), +('Service-Macro-Delete', '3', 'DeleteVfModuleBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'DEFAULT')), +('Service-Macro-Delete', '4', 'DeactivateVolumeGroupBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'DEFAULT')), +('Service-Macro-Delete', '5', 'DeleteVolumeGroupBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'DEFAULT')), +('Service-Macro-Delete', '6', 'DeactivateVnfBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'DEFAULT')), +('Service-Macro-Delete', '7', 'DeactivatePnfBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'DEFAULT')), +('Service-Macro-Delete', '8', 'DeactivateNetworkBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'DEFAULT')), +('Service-Macro-Delete', '9', 'DeleteNetworkBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'DEFAULT')), +('Service-Macro-Delete', '10', 'DeleteNetworkCollectionBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'DEFAULT')), +('Service-Macro-Delete', '11', 'DeactivateServiceInstanceBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'DEFAULT')), +('Service-Macro-Delete', '12', 'UnassignVfModuleBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'DEFAULT')), +('Service-Macro-Delete', '13', 'UnassignVolumeGroupBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'DEFAULT')), +('Service-Macro-Delete', '14', 'UnassignVnfBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'DEFAULT')), +('Service-Macro-Delete', '15', 'UnassignNetworkBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'DEFAULT')), +('Service-Macro-Delete', '16', 'UnassignServiceInstanceBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Delete' and CLOUD_OWNER = 'DEFAULT')), ('Service-Macro-Upgrade', '1', 'ChangeModelServiceInstanceBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Macro-Upgrade' and CLOUD_OWNER = 'DEFAULT')), ('Network-Create', '1', 'AssignNetworkBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Network-Create' and CLOUD_OWNER = 'DEFAULT')), ('Network-Create', '2', 'CreateNetworkBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Network-Create' and CLOUD_OWNER = 'DEFAULT')), @@ -322,6 +323,7 @@ VALUES ('VNFConfigModifyActivity','*','*','*','*','Manual','Abort','*', '*'), ('VNFUnsetInMaintFlagActivity','*','*','*','*','Manual','Abort','*', '*'), ('VNFUnsetClosedLoopDisabledActivity','*','*','*','*','Manual','Abort','*', '*'), +('DeleteChildServiceBB', '*', '*', '*', '*', 'Rollback', 'Abort', '*', '*'), ('CreateChildServiceBB', '*', '*', '*', '*', 'Rollback', 'Abort', '*', '*'); INSERT INTO building_block_detail (building_block_name, resource_type, target_action) @@ -364,12 +366,12 @@ VALUES ('CreateNetworkBB', 'NETWORK', 'CREATE'), ('CreateNetworkCollectionBB', 'NETWORK_COLLECTION', 'CREATE'), ('CreateChildServiceBB', 'NO_VALIDATE', 'CUSTOM'), -('DeleteChildServiceBB', 'NO_VALIDATE', 'CUSTOM'), ('DeleteVolumeGroupBB', 'VOLUME_GROUP', 'DELETE'), ('DeleteVfModuleBB', 'VF_MODULE', 'DELETE'), ('DeleteNetworkBB', 'NETWORK', 'DELETE'), ('DeleteNetworkCollectionBB', 'NETWORK_COLLECTION', 'DELETE'), +('DeleteChildServiceBB', 'NO_VALIDATE', 'CUSTOM'), ('ConfigurationScaleOutBB', 'NO_VALIDATE', 'CUSTOM'), ('GenericVnfHealthCheckBB', 'NO_VALIDATE', 'CUSTOM'), diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/DeleteChildServiceBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/DeleteChildServiceBB.bpmn index cfa55d2101..3be6d32792 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/DeleteChildServiceBB.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/DeleteChildServiceBB.bpmn @@ -1,5 +1,5 @@ - + SequenceFlow_01wirq3 @@ -27,18 +27,13 @@ SequenceFlow_0v4loyx SequenceFlow_12rysg7 - - SequenceFlow_0v4loyx - SequenceFlow_096kfnj - - SequenceFlow_096kfnj + SequenceFlow_0v4loyx - + ${execution.getVariable("CHILD_SVC_REQ_STATUS")=="COMPLETED"} - SequenceFlow_01wirq3 @@ -56,71 +51,58 @@ - - - - - - - - - - - + + + + + + + - + - - - - - - - + + + + + + + + + + - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - @@ -130,6 +112,12 @@ + + + + + + diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/service/composition/ChildServiceRequestBuilder.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/service/composition/ChildServiceRequestBuilder.java index 135b3d6ec4..2a008e3573 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/service/composition/ChildServiceRequestBuilder.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/service/composition/ChildServiceRequestBuilder.java @@ -13,15 +13,14 @@ import org.onap.so.serviceinstancebeans.RelatedInstance; import org.onap.so.serviceinstancebeans.RelatedInstanceList; import org.onap.so.serviceinstancebeans.RequestDetails; import org.onap.so.serviceinstancebeans.RequestInfo; +import org.onap.so.serviceinstancebeans.RequestParameters; import org.onap.so.serviceinstancebeans.Service; import org.onap.so.serviceinstancebeans.ServiceInstancesRequest; -import org.onap.so.serviceinstancebeans.RequestParameters; import org.onap.so.serviceinstancebeans.SubscriberInfo; import java.io.IOException; import java.util.Map; public class ChildServiceRequestBuilder { - private final BuildingBlockExecution buildingBlockExecution; private Service parent; private Service child; @@ -66,6 +65,17 @@ public class ChildServiceRequestBuilder { return new ChildServiceRequestBuilder(buildingBlockExecution, parent, child); } + public static ChildServiceRequestBuilder getInstance(final BuildingBlockExecution buildingBlockExecution, + Service parentInstance, Service childInstance) { + Service child = null; + Service parent = null; + if (childInstance != null) { + parent = parentInstance; + child = childInstance; + } + return new ChildServiceRequestBuilder(buildingBlockExecution, parent, child); + } + public ChildServiceRequestBuilder setParentRequestId(String parentRequestId) { sir.getRequestDetails().getRequestInfo().setRequestorId(parentRequestId); return this; @@ -83,10 +93,28 @@ public class ChildServiceRequestBuilder { public ServiceInstancesRequest build() { RequestContext context = buildingBlockExecution.getGeneralBuildingBlock().getRequestContext(); - sir.setRequestDetails(createRequestDetails(context)); + + if (context.getAction().equals("deleteInstance")) { + sir.setRequestDetails(createRequestDetailsDeleteChild(context)); + } else { + sir.setRequestDetails(createRequestDetails(context)); + } return sir; } + private RequestDetails createRequestDetailsDeleteChild(RequestContext context) { + RequestDetails details = sir.getRequestDetails(); + + details.setRequestParameters(createRequestParameters(context, child)); + details.setRequestInfo(createRequestInfo(context)); + details.setCloudConfiguration(createCloudConfiguration()); + details.setModelInfo(child.getModelInfo()); + details.setSubscriberInfo(createSubscriberInfo()); + details.setRelatedInstanceList(createRelatedInstanceList()); + + return details; + } + private RequestDetails createRequestDetails(RequestContext context) { RequestDetails details = sir.getRequestDetails(); @@ -104,8 +132,13 @@ public class ChildServiceRequestBuilder { private RequestParameters createRequestParameters(RequestContext context, Service childService) { RequestParameters requestParameters = new RequestParameters(); - requestParameters.getUserParams().add(context.getRequestParameters().getUserParams().get(0)); - requestParameters.getUserParams().add(Map.of("service", childService)); + + if (!context.getRequestParameters().getUserParams().isEmpty()) { + requestParameters.getUserParams().add(context.getRequestParameters().getUserParams().get(0)); + if (context.getAction().equals("createInstance")) { + requestParameters.getUserParams().add(Map.of("service", childService)); + } + } requestParameters.setSubscriptionServiceType(context.getRequestParameters().getSubscriptionServiceType()); requestParameters.setaLaCarte(context.getRequestParameters().getALaCarte()); requestParameters.setPayload(context.getRequestParameters().getPayload()); diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/service/composition/DeleteChildServiceBB.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/service/composition/DeleteChildServiceBB.java index a3f70c8f5b..52d1b68ccd 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/service/composition/DeleteChildServiceBB.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/service/composition/DeleteChildServiceBB.java @@ -16,27 +16,114 @@ package org.onap.so.bpmn.infrastructure.service.composition; +import org.onap.aai.domain.yang.ServiceInstance; +import org.onap.aaiclient.client.aai.AAIResourcesClient; +import org.onap.aaiclient.client.aai.entities.uri.AAIUriFactory; +import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder; +import org.onap.aaiclient.client.graphinventory.entities.uri.Depth; +import org.onap.logging.filter.base.ONAPComponents; import org.onap.so.bpmn.common.BuildingBlockExecution; +import org.onap.so.bpmn.servicedecomposition.entities.ResourceKey; +import org.onap.so.client.exception.ExceptionBuilder; +import org.onap.so.client.orchestration.ApiHandlerClient; +import org.onap.so.serviceinstancebeans.ModelInfo; +import org.onap.so.serviceinstancebeans.ModelType; +import org.onap.so.serviceinstancebeans.Service; +import org.onap.so.serviceinstancebeans.ServiceInstancesRequest; +import org.onap.so.serviceinstancebeans.ServiceInstancesResponse; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import java.util.Map; +import java.util.UUID; +import static org.onap.so.bpmn.infrastructure.service.composition.ServiceCompositionConstants.CHILD_SVC_INSTANCE_ID; +import static org.onap.so.bpmn.infrastructure.service.composition.ServiceCompositionConstants.CHILD_SVC_REQ_CORRELATION_ID; +import static org.onap.so.bpmn.infrastructure.service.composition.ServiceCompositionConstants.CHILD_SVC_REQ_ERROR; +import static org.onap.so.bpmn.infrastructure.service.composition.ServiceCompositionConstants.CHILD_SVC_REQ_ID; +import static org.onap.so.bpmn.infrastructure.service.composition.ServiceCompositionConstants.CHILD_SVC_REQ_PAYLOAD; + @Component public class DeleteChildServiceBB { + @Autowired + protected ExceptionBuilder exceptionBuilder; + + @Autowired + private ApiHandlerClient apiHandlerClient; + + private AAIResourcesClient aaiResourcesClient = new AAIResourcesClient(); + private final Logger log = LoggerFactory.getLogger(this.getClass()); public void buildRequest(final BuildingBlockExecution buildingBlockExecution) { log.info("Building Delete Service Request"); + Map lookupMap = buildingBlockExecution.getLookupMap(); + String childSvcInstanceId = lookupMap.get(ResourceKey.CHILD_SERVICE_INSTANCE_ID); + String childServiceInstanceId = + buildingBlockExecution.getLookupMap().get(ResourceKey.CHILD_SERVICE_INSTANCE_ID); + String parentServiceInstanceId = buildingBlockExecution.getLookupMap().get(ResourceKey.SERVICE_INSTANCE_ID); + ServiceInstance childInstanceAAI = aaiResourcesClient.get(ServiceInstance.class, + AAIUriFactory + .createResourceUri( + AAIFluentTypeBuilder.Types.SERVICE_INSTANCE.getFragment(childServiceInstanceId)) + .depth(Depth.TWO)) + .orElse(null); + ServiceInstance parentInstanceAAI = + aaiResourcesClient.get(ServiceInstance.class, + AAIUriFactory.createResourceUri( + AAIFluentTypeBuilder.Types.SERVICE_INSTANCE.getFragment(parentServiceInstanceId)) + .depth(Depth.TWO)) + .orElse(null); + if (childInstanceAAI == null || parentInstanceAAI == null) { + exceptionBuilder.buildAndThrowWorkflowException(buildingBlockExecution, 10004, "Service AAI request failed", + ONAPComponents.SO); + } + Service parentInstance = serviceInstanceToServiceBeanMapper(parentInstanceAAI); + Service childInstance = serviceInstanceToServiceBeanMapper(childInstanceAAI); + ServiceInstancesRequest sir = ChildServiceRequestBuilder + .getInstance(buildingBlockExecution, parentInstance, childInstance) + .setParentRequestId( + buildingBlockExecution.getGeneralBuildingBlock().getRequestContext().getMsoRequestId()) + .setChildSvcInstanceId(childSvcInstanceId).setCorrelationId(UUID.randomUUID().toString()).build(); + buildingBlockExecution.setVariable(CHILD_SVC_REQ_PAYLOAD, sir); } public void sendRequest(final BuildingBlockExecution buildingBlockExecution) { - log.info("Sending Delete Service Request"); + try { + ServiceInstancesRequest sir = buildingBlockExecution.getVariable(CHILD_SVC_REQ_PAYLOAD); + log.info("Sending Delete Service Request: \n{}", sir.toString()); + buildingBlockExecution.setVariable(CHILD_SVC_REQ_CORRELATION_ID, + sir.getRequestDetails().getRequestInfo().getCorrelator()); + ServiceInstancesResponse response = apiHandlerClient.deleteServiceInstance(sir); + buildingBlockExecution.setVariable(CHILD_SVC_REQ_ID, response.getRequestReferences().getRequestId()); + buildingBlockExecution.setVariable(CHILD_SVC_INSTANCE_ID, response.getRequestReferences().getInstanceId()); + } catch (Exception e) { + exceptionBuilder.buildAndThrowWorkflowException(buildingBlockExecution, 10003, e.getMessage(), + ONAPComponents.SO); + } } - public void handleFailure(final BuildingBlockExecution buildingBlockExecution, final String responsePayload) { - // log error - // build workflowException with proper message + public void handleFailure(final BuildingBlockExecution buildingBlockExecution) { + Map lookupMap = buildingBlockExecution.getLookupMap(); + String childSvcInstanceName = lookupMap.get(ResourceKey.CHILD_SERVICE_INSTANCE_NAME); + String childErrorMessage = buildingBlockExecution.getVariable(CHILD_SVC_REQ_ERROR); + String errorMessage = + String.format("Failed deleting child service %:qqs %s", childSvcInstanceName, childErrorMessage); + exceptionBuilder.buildAndThrowWorkflowException(buildingBlockExecution, 10001, errorMessage, ONAPComponents.SO); } + private static Service serviceInstanceToServiceBeanMapper(ServiceInstance serviceInstance) { + Service service = new Service(); + service.setInstanceName(service.getInstanceName()); + ModelInfo modelInfo = new ModelInfo(); + modelInfo.setModelId(serviceInstance.getModelVersionId()); + modelInfo.setModelType(ModelType.service); + modelInfo.setModelVersionId(serviceInstance.getModelVersionId()); + modelInfo.setModelInstanceName(serviceInstance.getServiceInstanceName()); + modelInfo.setModelInvariantId(serviceInstance.getModelInvariantId()); + service.setModelInfo(modelInfo); + return service; + } } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java index ef0fbc850e..31a7caacda 100755 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java @@ -692,11 +692,11 @@ public class WorkflowAction { logger.debug("{}, {}", pair.getValue0(), pair.getValue1()); } Map resourceInstanceIds = new HashMap<>(); - Arrays.stream(WorkflowType.values()).filter(type -> !type.equals(WorkflowType.SERVICE)) - .forEach(type -> resourceList.stream().filter(resource -> type.equals(resource.getResourceType())) - .forEach(resource -> updateWorkflowResourceIds(flowsToExecute, type, resource, - retrieveAAIResourceId(aaiResourceIds, type), null, serviceInstanceId, - resourceInstanceIds))); + Arrays.stream(WorkflowType.values()).forEach(type -> resourceList.stream() + .filter(resource -> type.equals(resource.getResourceType()) + && !(WorkflowType.SERVICE.equals(type) && !resource.hasParent())) + .forEach(resource -> updateWorkflowResourceIds(flowsToExecute, type, resource, + retrieveAAIResourceId(aaiResourceIds, type), null, serviceInstanceId, resourceInstanceIds))); } private String retrieveAAIResourceId(List> aaiResourceIds, WorkflowType resource) { @@ -750,7 +750,8 @@ public class WorkflowAction { } if (resource.hasParent() && WorkflowType.SERVICE.equals(resourceType) && WorkflowType.SERVICE.equals(parent.getResourceType())) { - workflowResourceIds.setChildServiceInstanceId(resourceId); + String childServiceInstanceId = resource.isGenerated() ? resourceId : resource.getResourceId(); + workflowResourceIds.setChildServiceInstanceId(childServiceInstanceId); workflowResourceIds.setChildServiceInstanceName(resource.getInstanceName()); } else { WorkflowResourceIdsUtils.setInstanceNameByWorkflowType(workflowResourceIds, resourceType, diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/ServiceEBBLoader.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/ServiceEBBLoader.java index 79e801b740..f16365b742 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/ServiceEBBLoader.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/ServiceEBBLoader.java @@ -25,8 +25,12 @@ package org.onap.so.bpmn.infrastructure.workflow.tasks.ebb.loader; import com.fasterxml.jackson.core.JsonProcessingException; import org.camunda.bpm.engine.delegate.DelegateExecution; import org.javatuples.Pair; +import org.onap.aai.domain.yang.ComposedResource; +import org.onap.aai.domain.yang.ComposedResources; import org.onap.aai.domain.yang.GenericVnf; import org.onap.aai.domain.yang.Relationship; +import org.onap.aai.domain.yang.RelationshipData; +import org.onap.aai.domain.yang.RelationshipList; import org.onap.aai.domain.yang.ServiceInstance; import org.onap.aai.domain.yang.VpnBinding; import org.onap.aaiclient.client.aai.AAICommonObjectMapperProvider; @@ -204,6 +208,7 @@ public class ServiceEBBLoader { new Resource(WorkflowType.SERVICE, serviceInstanceMSO.getServiceInstanceId(), false, null); serviceResource.setModelInvariantId(serviceInstanceAAI.getModelInvariantId()); resourceList.add(serviceResource); + traverseServiceInstanceChildService(resourceList, serviceResource, serviceInstanceAAI); traverseServiceInstanceMSOVnfs(resourceList, serviceResource, aaiResourceIds, serviceInstanceMSO); traverseServiceInstanceMSOPnfs(resourceList, serviceResource, aaiResourceIds, serviceInstanceMSO); if (serviceInstanceMSO.getNetworks() != null) { @@ -280,6 +285,54 @@ public class ServiceEBBLoader { } } + public void traverseServiceInstanceChildService(List resourceList, Resource serviceResource, + ServiceInstance serviceInstanceAAI) { + + ComposedResources composedResources = serviceInstanceAAI.getComposedResources(); + if (composedResources == null) { + return; + } + + List listOfComposedResource = composedResources.getComposedResource(); + + listOfComposedResource.forEach(composedResource -> { + // Get ServiceInstance from composedResource relationship List + RelationshipList relationshipList = composedResource.getRelationshipList(); + if (relationshipList == null) { + return; + } + List composedResourceRelationshipList = relationshipList.getRelationship(); + ServiceInstance childService = new ServiceInstance(); + composedResourceRelationshipList.forEach(composedRelation -> { + if ("service-instance".equalsIgnoreCase(composedRelation.getRelatedTo())) { + List rData = composedRelation.getRelationshipData(); + rData.forEach(data -> { + if ("service-instance.service-instance-id".equalsIgnoreCase(data.getRelationshipKey())) { + childService.setServiceInstanceId(data.getRelationshipValue()); + } + }); + composedRelation.getRelatedToProperty().forEach(relatedToProperty -> { + if ("service-instance.service-instance-name" + .equalsIgnoreCase(relatedToProperty.getPropertyKey())) { + childService.setServiceInstanceName(relatedToProperty.getPropertyValue()); + } + }); + } + }); + + if (childService.getServiceInstanceId() == null) { + return; + } + + Resource childServiceResource = + new Resource(WorkflowType.SERVICE, childService.getServiceInstanceId(), false, serviceResource); + + childServiceResource.setInstanceName(childService.getServiceInstanceName()); + resourceList.add(childServiceResource); + }); + + } + protected void traverseVrfConfiguration(List> aaiResourceIds, List resourceList, Resource serviceResource, org.onap.so.db.catalog.beans.Service service, RelatedInstance relatedVpnBinding, RelatedInstance relatedLocalNetwork) diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/service/composition/ChildServiceRequestBuilderTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/service/composition/ChildServiceRequestBuilderTest.java index d1db3aadcd..e57232ebb7 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/service/composition/ChildServiceRequestBuilderTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/service/composition/ChildServiceRequestBuilderTest.java @@ -53,6 +53,7 @@ public class ChildServiceRequestBuilderTest { context.setProductFamilyId("FamilyId"); context.setSource("source"); context.setRequestorId("RequestOrId"); + context.setAction("createInstance"); CloudRegion cloudRegion = new CloudRegion(); cloudRegion.setCloudOwner("CloudOwner"); @@ -82,10 +83,26 @@ public class ChildServiceRequestBuilderTest { gbb.setServiceInstance(serviceInstance); mockExecution = mock(BuildingBlockExecution.class); doReturn(gbb).when(mockExecution).getGeneralBuildingBlock(); + doReturn("CreateChildServiceBB").when(mockExecution).getFlowToBeCalled(); } @Test - public void childServiceRequestBuilderTest() { + public void deleteChildServiceRequestBuilderTest() { + Service parent = new Service(); + Service child = new Service(); + + ChildServiceRequestBuilder builder = ChildServiceRequestBuilder.getInstance(mockExecution, parent, child); + ServiceInstancesRequest sir = builder + .setParentRequestId(mockExecution.getGeneralBuildingBlock().getRequestContext().getMsoRequestId()) + .setCorrelationId(UUID.randomUUID().toString()).setChildSvcInstanceId("childInstanceId").build(); + + Assert.assertEquals("childInstanceId", sir.getServiceInstanceId()); + Assert.assertEquals("serviceInstanceId", + sir.getRequestDetails().getRelatedInstanceList()[0].getRelatedInstance().getInstanceId()); + } + + @Test + public void createChildServiceRequestBuilderTest() { ServiceInstancesRequest sir = ChildServiceRequestBuilder.getInstance(mockExecution, "service1-instanceName") .setParentRequestId(mockExecution.getGeneralBuildingBlock().getRequestContext().getMsoRequestId()) @@ -180,6 +197,7 @@ public class ChildServiceRequestBuilderTest { context.setProductFamilyId("FamilyId"); context.setSource("source"); context.setRequestorId("RequestOrId"); + context.setAction("createInstance"); CloudRegion cloudRegion = new CloudRegion(); cloudRegion.setCloudOwner("CloudOwner"); @@ -198,6 +216,7 @@ public class ChildServiceRequestBuilderTest { gbb.setServiceInstance(serviceInstance); mockExecution = mock(BuildingBlockExecution.class); doReturn(gbb).when(mockExecution).getGeneralBuildingBlock(); + doReturn("CreateChildServiceBB").when(mockExecution).getFlowToBeCalled(); ServiceInstancesRequest sir = ChildServiceRequestBuilder .getInstance(mockExecution, "service1-instanceName-child") @@ -231,6 +250,4 @@ public class ChildServiceRequestBuilderTest { } return null; } - - } diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/ServiceEBBLoaderTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/ServiceEBBLoaderTest.java index 2725626c1a..9377daea5e 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/ServiceEBBLoaderTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/ServiceEBBLoaderTest.java @@ -32,7 +32,11 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.ExpectedException; import org.mockito.Mock; +import org.onap.aai.domain.yang.ComposedResource; +import org.onap.aai.domain.yang.ComposedResources; +import org.onap.aai.domain.yang.RelatedToProperty; import org.onap.aai.domain.yang.Relationship; +import org.onap.aai.domain.yang.RelationshipData; import org.onap.aai.domain.yang.RelationshipList; import org.onap.aai.domain.yang.ServiceInstance; import org.onap.aaiclient.client.aai.entities.Relationships; @@ -364,4 +368,56 @@ public class ServiceEBBLoaderTest extends BaseTaskTest { resourceList.add(new Resource(WorkflowType.VFMODULE, "72d9d1cd-f46d-447a-abdb-451d6fb05fa8", false, r2)); return resourceList; } + + @Test + public void traverseServiceInstanceChildServiceTest() { + List resourceList = new ArrayList<>(); + Resource parentResource = new Resource(WorkflowType.SERVICE, "parentId", false, null); + String resourceId = "siP"; + ServiceInstance serviceInstanceAAI = new ServiceInstance(); + serviceInstanceAAI.setServiceInstanceId(resourceId); + + RelationshipData relationshipData = new RelationshipData(); + relationshipData.setRelationshipKey("service-instance.service-instance-id"); + relationshipData.setRelationshipValue("80ced9d5-666e-406b-88f0-a05d31328b70"); + RelatedToProperty relatedToProperty = new RelatedToProperty(); + relatedToProperty.setPropertyKey("service-instance.service-instance-name"); + relatedToProperty.setPropertyValue("child_euler_002"); + + RelationshipData relationshipData1 = new RelationshipData(); + relationshipData1.setRelationshipKey("service-instance.service-instance-id"); + relationshipData1.setRelationshipValue("fa5640af-c827-4372-baae-7f1c50fdb5ed"); + RelatedToProperty relatedToProperty1 = new RelatedToProperty(); + relatedToProperty1.setPropertyKey("service-instance.service-instance-name"); + relatedToProperty.setPropertyValue("child_euler_001"); + + + Relationship relationship = new Relationship(); + Relationship relationship1 = new Relationship(); + relationship.setRelatedTo("service-instance"); + relationship1.setRelatedTo("service-instance"); + relationship.getRelationshipData().add(relationshipData); + relationship.getRelatedToProperty().add(relatedToProperty); + relationship1.getRelationshipData().add(relationshipData1); + relationship1.getRelatedToProperty().add(relatedToProperty1); + + RelationshipList relationshipList = new RelationshipList(); + RelationshipList relationshipList1 = new RelationshipList(); + relationshipList.getRelationship().add(relationship); + relationshipList1.getRelationship().add(relationship1); + + ComposedResource composedResource = new ComposedResource(); + composedResource.setRelationshipList(relationshipList); + ComposedResource composedResource1 = new ComposedResource(); + composedResource1.setRelationshipList(relationshipList); + + ComposedResources composedResources = new ComposedResources(); + composedResources.getComposedResource().add(composedResource); + composedResources.getComposedResource().add(composedResource1); + + serviceInstanceAAI.setComposedResources(composedResources); + + serviceEBBLoader.traverseServiceInstanceChildService(resourceList, parentResource, serviceInstanceAAI); + assertEquals(2, resourceList.size()); + } } -- cgit 1.2.3-korg