From 43098043c4ef31d9d5dead66568d7d9482a6b165 Mon Sep 17 00:00:00 2001 From: liamfallon Date: Tue, 25 Jan 2022 19:55:43 +0000 Subject: Rename TOSCA Control Loop to ACM This commit renames the TOSCA Control Loop functionality in CLAMP to Automation Composition Management. This review is a direct renaming review and, as everything is renamed together it is large. Issue-ID: POLICY-3939 Change-Id: I28f0a6dd889bf3570a4c1365ae9e71fc58db6d6c Signed-off-by: liamfallon --- .../policy/clamp/clds/config/AafConfiguration.java | 2 +- .../main/resources/application-noaaf.properties | 6 +- runtime/src/main/resources/application.properties | 6 +- .../resources/clds/camel/rest/clamp-api-v2.xml | 34 +- .../main/resources/clds/camel/routes/acm-flows.xml | 387 +++++++++++++++++++++ .../clds/camel/routes/controlloop-flows.xml | 387 --------------------- .../RuntimeCommissioningResponseItTestCase.java | 2 +- .../RuntimeInstantiationResponseItTestCase.java | 5 +- runtime/src/test/resources/application.properties | 6 +- .../test/resources/http-cache/third_party_proxy.py | 36 +- 10 files changed, 436 insertions(+), 435 deletions(-) create mode 100644 runtime/src/main/resources/clds/camel/routes/acm-flows.xml delete mode 100644 runtime/src/main/resources/clds/camel/routes/controlloop-flows.xml (limited to 'runtime/src') diff --git a/runtime/src/main/java/org/onap/policy/clamp/clds/config/AafConfiguration.java b/runtime/src/main/java/org/onap/policy/clamp/clds/config/AafConfiguration.java index e8502b72a..bdefdfe6d 100644 --- a/runtime/src/main/java/org/onap/policy/clamp/clds/config/AafConfiguration.java +++ b/runtime/src/main/java/org/onap/policy/clamp/clds/config/AafConfiguration.java @@ -61,7 +61,7 @@ public class AafConfiguration { registration.addUrlPatterns("/restservices/clds/v2/policyToscaModels/*"); registration.addUrlPatterns("/restservices/clds/v2/policies/*"); registration.addUrlPatterns("/restservices/clds/v2/loop/*"); - registration.addUrlPatterns("/restservices/clds/v2/toscaControlLoop/*"); + registration.addUrlPatterns("/restservices/clds/v2/acm/*"); registration.setName("cadiFilter"); registration.setOrder(0); return registration; diff --git a/runtime/src/main/resources/application-noaaf.properties b/runtime/src/main/resources/application-noaaf.properties index 9f13a314c..22f9774e1 100644 --- a/runtime/src/main/resources/application-noaaf.properties +++ b/runtime/src/main/resources/application-noaaf.properties @@ -193,6 +193,6 @@ clamp.config.cds.userName=ccsdkapps clamp.config.cds.password=ccsdkapps # Configuration settings for ControlLoop Runtime Rest API -clamp.config.controlloop.runtime.url=http://localhost:6969 -clamp.config.controlloop.runtime.userName=runtimeUser -clamp.config.controlloop.runtime.password=zb!XztG34 +clamp.config.acm.runtime.url=http://localhost:6969 +clamp.config.acm.runtime.userName=runtimeUser +clamp.config.acm.runtime.password=zb!XztG34 diff --git a/runtime/src/main/resources/application.properties b/runtime/src/main/resources/application.properties index 21b37c69f..054b88972 100644 --- a/runtime/src/main/resources/application.properties +++ b/runtime/src/main/resources/application.properties @@ -203,6 +203,6 @@ clamp.config.cds.userName=ccsdkapps clamp.config.cds.password=ccsdkapps # Configuration settings for ControlLoop Runtime Rest API -clamp.config.controlloop.runtime.url=http://localhost:6969 -clamp.config.controlloop.runtime.userName=runtimeUser -clamp.config.controlloop.runtime.password=zb!XztG34 +clamp.config.acm.runtime.url=http://localhost:6969 +clamp.config.acm.runtime.userName=runtimeUser +clamp.config.acm.runtime.password=zb!XztG34 diff --git a/runtime/src/main/resources/clds/camel/rest/clamp-api-v2.xml b/runtime/src/main/resources/clds/camel/rest/clamp-api-v2.xml index 8c9824ef7..8ad20a844 100644 --- a/runtime/src/main/resources/clds/camel/rest/clamp-api-v2.xml +++ b/runtime/src/main/resources/clds/camel/rest/clamp-api-v2.xml @@ -1476,7 +1476,7 @@ - - - - - + @@ -1679,7 +1679,7 @@ - + @@ -1713,7 +1713,7 @@ - + @@ -1748,7 +1748,7 @@ - + @@ -1783,7 +1783,7 @@ - + @@ -1796,7 +1796,7 @@ true - + java.lang.Exception @@ -1806,19 +1806,19 @@ + message="GET Automation Composition Definitions request failed: ${exception.stacktrace}"/> 500 - GET Control Loop Definitions FAILED + GET Automation Composition Definitions FAILED - - - + @@ -1939,7 +1939,7 @@ - - + + + + + + + GET + + + application/json + + + ${header.name} + + + ${header.version} + + + + + + + + + + + + + + + + + POST + + + application/json + + + + + + + + + + + + + + + + + DELETE + + + application/json + + + ${header.name} + + + ${header.version} + + + + + + + + + + + + + + + + + GET + + + application/json + + + + + + + + + + + + + + + + + DELETE + + + application/json + + + ${header.name} + + + ${header.version} + + + + + + + + + + + + + + + + + POST + + + application/json + + + + + + + + + + + + + + + + + DELETE + + + application/json + + + ${header.name} + + + ${header.version} + + + + + + + + + + + + + + + + + POST + + + application/json + + + + + + + + + + + + + + + + + PUT + + + application/json + + + + + + + + + + + + + + + + + GET + + + application/json + + + ${header.name} + + + ${header.version} + + + + + + + + + + + + + + + + + GET + + + application/json + + + ${header.section} + + + + + + + + + + + + + + + + + GET + + + application/json + + + + + + + + + + + + + + + + + GET + + + application/json + + + + + + + + + + + + + + + + + GET + + + application/json + + + ${header.common} + + + + + + + + + + + diff --git a/runtime/src/main/resources/clds/camel/routes/controlloop-flows.xml b/runtime/src/main/resources/clds/camel/routes/controlloop-flows.xml deleted file mode 100644 index 146ab14d5..000000000 --- a/runtime/src/main/resources/clds/camel/routes/controlloop-flows.xml +++ /dev/null @@ -1,387 +0,0 @@ - - - - - - - - GET - - - application/json - - - ${header.name} - - - ${header.version} - - - - - - - - - - - - - - - - - POST - - - application/json - - - - - - - - - - - - - - - - - DELETE - - - application/json - - - ${header.name} - - - ${header.version} - - - - - - - - - - - - - - - - - GET - - - application/json - - - - - - - - - - - - - - - - - DELETE - - - application/json - - - ${header.name} - - - ${header.version} - - - - - - - - - - - - - - - - - POST - - - application/json - - - - - - - - - - - - - - - - - DELETE - - - application/json - - - ${header.name} - - - ${header.version} - - - - - - - - - - - - - - - - - POST - - - application/json - - - - - - - - - - - - - - - - - PUT - - - application/json - - - - - - - - - - - - - - - - - GET - - - application/json - - - ${header.name} - - - ${header.version} - - - - - - - - - - - - - - - - - GET - - - application/json - - - ${header.section} - - - - - - - - - - - - - - - - - GET - - - application/json - - - - - - - - - - - - - - - - - GET - - - application/json - - - - - - - - - - - - - - - - - GET - - - application/json - - - ${header.common} - - - - - - - - - - - diff --git a/runtime/src/test/java/org/onap/policy/clamp/runtime/RuntimeCommissioningResponseItTestCase.java b/runtime/src/test/java/org/onap/policy/clamp/runtime/RuntimeCommissioningResponseItTestCase.java index 7824be460..8c9c5b3e4 100644 --- a/runtime/src/test/java/org/onap/policy/clamp/runtime/RuntimeCommissioningResponseItTestCase.java +++ b/runtime/src/test/java/org/onap/policy/clamp/runtime/RuntimeCommissioningResponseItTestCase.java @@ -125,7 +125,7 @@ public class RuntimeCommissioningResponseItTestCase { ProducerTemplate prodTemplate = camelContext.createProducerTemplate(); Exchange exchangeResponse = - prodTemplate.send("direct:get-control-loop-definitions", ExchangeBuilder.anExchange(camelContext) + prodTemplate.send("direct:get-acm-definitions", ExchangeBuilder.anExchange(camelContext) .withProperty("name", "ToscaServiceTemplate") .withProperty("version", "1.0.0") .withProperty("raiseHttpExceptionFlag", "true") diff --git a/runtime/src/test/java/org/onap/policy/clamp/runtime/RuntimeInstantiationResponseItTestCase.java b/runtime/src/test/java/org/onap/policy/clamp/runtime/RuntimeInstantiationResponseItTestCase.java index cc08ea0a6..d655257c6 100644 --- a/runtime/src/test/java/org/onap/policy/clamp/runtime/RuntimeInstantiationResponseItTestCase.java +++ b/runtime/src/test/java/org/onap/policy/clamp/runtime/RuntimeInstantiationResponseItTestCase.java @@ -53,9 +53,10 @@ public class RuntimeInstantiationResponseItTestCase { private static final String RAISE_HTTP_EXCEPTION_FLAG = "raiseHttpExceptionFlag"; - private static final String SAMPLE_CONTROL_LOOP_LIST = "{\"controlLoopList\": [{\"name\": \"PMSHInstance0\"," + private static final String SAMPLE_CONTROL_LOOP_LIST = + "{\"automationCompositionList\": [{\"name\": \"PMSHInstance0\"," + "\"version\": \"1.0.1\",\"definition\": {},\"state\": \"UNINITIALISED\",\"orderedState\": \"UNINITIALISED\"," - + "\"description\": \"PMSH control loop instance 0\",\"elements\": {}}]}"; + + "\"description\": \"PMSH Automation Composition instance 0\",\"elements\": {}}]}"; private static final String SAMPLE_TOSCA_TEMPLATE = "{\"tosca_definitions_version\": \"tosca_simple_yaml_1_1_0\"," diff --git a/runtime/src/test/resources/application.properties b/runtime/src/test/resources/application.properties index f2cf0dd33..d09b3ce49 100644 --- a/runtime/src/test/resources/application.properties +++ b/runtime/src/test/resources/application.properties @@ -182,6 +182,6 @@ clamp.config.tosca.converter.default.datatypes=classpath:/clds/tosca-converter/d clamp.config.tosca.converter.dictionary.support.enabled=true # Configuration settings for ControlLoop Runtime Rest API -clamp.config.controlloop.runtime.url=http://localhost:${docker.http-cache.port.host} -clamp.config.controlloop.runtime.userName=runtimeUser -clamp.config.controlloop.runtime.password=zb!XztG34 +clamp.config.acm.runtime.url=http://localhost:${docker.http-cache.port.host} +clamp.config.acm.runtime.userName=runtimeUser +clamp.config.acm.runtime.password=zb!XztG34 diff --git a/runtime/src/test/resources/http-cache/third_party_proxy.py b/runtime/src/test/resources/http-cache/third_party_proxy.py index 786c366e0..9c22f3ff5 100644 --- a/runtime/src/test/resources/http-cache/third_party_proxy.py +++ b/runtime/src/test/resources/http-cache/third_party_proxy.py @@ -276,44 +276,44 @@ class Proxy(SimpleHTTPServer.SimpleHTTPRequestHandler): with open(cached_file_content, 'w') as f: f.write(response) return True - elif (self.path.startswith("/onap/controlloop/v2/commission/toscaservicetemplate")) and http_type == "GET": + elif (self.path.startswith("/onap/policy/clamp/acm/v2/commission/toscaservicetemplate")) and http_type == "GET": if not _file_available: cached_file_folder = cached_file_folder.split('bridgeEndpoint')[0] print(("cached file folder for onap is %s: ", cached_file_folder)) - print("self.path start with /onap/controlloop/v2/commission/, generating response json...") + print("self.path start with /onap/policy/clamp/acm/v2/commission/, generating response json...") jsonGenerated = "{\"tosca_definitions_version\": \"tosca_simple_yaml_1_1_0\",\"data_types\": {},\"node_types\": {}, \"policy_types\": {}, \"topology_template\": {}, \"name\": \"ToscaServiceTemplateSimple\", \"version\": \"1.0.0\", \"metadata\": {}}" self._create_cache(jsonGenerated, cached_file_folder, cached_file_header, cached_file_content) return True - elif (self.path.startswith("/onap/controlloop/v2/commission/toscaServiceTemplateSchema")) and http_type == "GET": + elif (self.path.startswith("/onap/policy/clamp/acm/v2/commission/toscaServiceTemplateSchema")) and http_type == "GET": if not _file_available: cached_file_folder = cached_file_folder.split('bridgeEndpoint')[0] print(("cached file folder for onap is %s: ", cached_file_folder)) - print("self.path start with /onap/controlloop/v2/commission/, generating response json...") + print("self.path start with /onap/policy/clamp/acm/v2/commission/, generating response json...") jsonGenerated = "{\"tosca_definitions_version\": \"tosca_simple_yaml_1_1_0\",\"data_types\": {},\"node_types\": {}, \"policy_types\": {}, \"topology_template\": {}, \"name\": \"ToscaServiceTemplateSimple\", \"version\": \"1.0.0\", \"metadata\": {}}" self._create_cache(jsonGenerated, cached_file_folder, cached_file_header, cached_file_content) return True - elif (self.path.startswith("/onap/controlloop/v2/commission/elements")) and http_type == "GET": + elif (self.path.startswith("/onap/policy/clamp/acm/v2/commission/elements")) and http_type == "GET": if not _file_available: - print("self.path start with /commission/elements Control Loop Elements, generating response json...") + print("self.path start with /commission/elements Automation Composition Elements, generating response json...") jsonGenerated = "[{\"name\": ,\"org.onap.domain.pmsh.PMSH_DCAEMicroservice\": [{ \"version\": \"1.2.3\", \"derived_from\": null }]}]" self._create_cache(jsonGenerated, cached_file_folder, cached_file_header, cached_file_content) return True - elif (self.path.startswith("/onap/controlloop/v2/commission")) and http_type == "GET": + elif (self.path.startswith("/onap/policy/clamp/acm/v2/commission")) and http_type == "GET": if not _file_available: - print("self.path start with /commission control loop definition, generating response json...") + print("self.path start with /commission Automation Composition definition, generating response json...") #jsondata = json.loads(self.data_string) jsonGenerated = "[{\"name\": ,\"org.onap.domain.pmsh.PMSHControlLoopDefinition\": [{ \"version\": \"1.2.3\", \"derived_from\": null }]}]" self._create_cache(jsonGenerated, cached_file_folder, cached_file_header, cached_file_content) return True - elif (self.path.startswith("/onap/controlloop/v2/commission/getCommonOrInstanceProperties")) and http_type == "GET": + elif (self.path.startswith("/onap/policy/clamp/acm/v2/commission/getCommonOrInstanceProperties")) and http_type == "GET": if not _file_available: print("self.path start with /commission getting common properties, generating response json...") with open("example/node_template.json", "r") as f: jsonGenerated = f.read() self._create_cache(jsonGenerated, cached_file_folder, cached_file_header, cached_file_content) return True - elif (self.path.startswith("/onap/controlloop/v2/commission")) and http_type == "POST": - print("self.path start with POST /onap/controlloop/v2/commission, copying body to response ...") + elif (self.path.startswith("/onap/policy/clamp/acm/v2/commission")) and http_type == "POST": + print("self.path start with POST /onap/policy/clamp/acm/v2/commission, copying body to response ...") if not os.path.exists(cached_file_folder): os.makedirs(cached_file_folder, 0o777) with open(cached_file_header, 'w+') as f: @@ -321,18 +321,18 @@ class Proxy(SimpleHTTPServer.SimpleHTTPRequestHandler): with open(cached_file_content, 'w+') as f: f.write(self.data_string) return True - elif (self.path.startswith("/onap/controlloop/v2/commission")) and http_type == "DELETE": + elif (self.path.startswith("/onap/policy/clamp/acm/v2/commission")) and http_type == "DELETE": print("self.path start with /commission Decommissioning, generating response json...") jsonGenerated = "{\"errorDetails\": null,\"affectedControlLoopDefinitions\": [{ \"name\": \"ToscaServiceTemplateSimple\", \"version\": \"1.0.0\" }]}" self._create_cache(jsonGenerated, cached_file_folder, cached_file_header, cached_file_content) return True - elif (self.path.startswith("/onap/controlloop/v2/instantiation")) and http_type == "GET": + elif (self.path.startswith("/onap/policy/clamp/acm/v2/instantiation")) and http_type == "GET": print("self.path start with /instantiation Retrieving Instantiation, generating response json...") - jsonGenerated = "{\"controlLoopList\": [{\"name\": \"PMSHInstance0\",\"version\": \"1.0.1\",\"definition\": {},\"state\": \"UNINITIALISED\",\"orderedState\": \"UNINITIALISED\",\"description\": \"PMSH control loop instance 0\",\"elements\": {}}]}"; + jsonGenerated = "{\"automationCompositionList\": [{\"name\": \"PMSHInstance0\",\"version\": \"1.0.1\",\"definition\": {},\"state\": \"UNINITIALISED\",\"orderedState\": \"UNINITIALISED\",\"description\": \"PMSH Automation Composition instance 0\",\"elements\": {}}]}"; self._create_cache(jsonGenerated, cached_file_folder, cached_file_header, cached_file_content) return True - elif (self.path.startswith("/onap/controlloop/v2/instanceProperties")) and http_type == "POST": - print("self.path start with POST /onap/controlloop/v2/instanceProperties, copying body to response ...") + elif (self.path.startswith("/onap/policy/clamp/acm/v2/instanceProperties")) and http_type == "POST": + print("self.path start with POST /onap/policy/clamp/acm/v2/instanceProperties, copying body to response ...") if not os.path.exists(cached_file_folder): os.makedirs(cached_file_folder, 0o777) with open(cached_file_header, 'w+') as f: @@ -340,12 +340,12 @@ class Proxy(SimpleHTTPServer.SimpleHTTPRequestHandler): with open(cached_file_content, 'w+') as f: f.write(self.data_string) return True - elif (self.path.startswith("/onap/controlloop/v2/instanceProperties")) and http_type == "DELETE": + elif (self.path.startswith("/onap/policy/clamp/acm/v2/instanceProperties")) and http_type == "DELETE": print("self.path start with /instanceProperties Deleting instance properties, generating response json...") jsonGenerated = "{\"errorDetails\": null,\"affectedControlLoopDefinitions\": [{ \"name\": \"PMSH_Instance1\", \"version\": \"2.3.1\" }]}" self._create_cache(jsonGenerated, cached_file_folder, cached_file_header, cached_file_content) return True - elif (self.path.startswith("/onap/controlloop/v2/instantiation/command")) and http_type == "PUT": + elif (self.path.startswith("/onap/policy/clamp/acm/v2/instantiation/command")) and http_type == "PUT": print("self.path start with /instantiation/command Changing order state, generating response json...") jsonGenerated = "{\"orderedState\":\"PASSIVE\",\"controlLoopIdentifierList\":[{\"name\":\"PMSH_Instance1\",\"version\":\"2.3.1\"}]}" self._create_cache(jsonGenerated, cached_file_folder, cached_file_header, cached_file_content) -- cgit 1.2.3-korg