diff options
author | SagarS <sagar.shetty@est.tech> | 2022-05-31 09:37:33 +0100 |
---|---|---|
committer | SagarS <sagar.shetty@est.tech> | 2022-05-31 11:42:52 +0100 |
commit | a26443597d3c617dda67228cbecd77808a04a18d (patch) | |
tree | e6eab4d2da21b331a2ee1d26fa394e609acd2970 | |
parent | ac1dbd50fb13a05f17c417c374fbdddfee4dfa4e (diff) |
[SO] Implementing CNFM API flyway corrections
Change-Id: I834c95875816876822db99d700009b5aa4968584
Signed-off-by: SagarS <sagar.shetty@est.tech>
Issue-ID: SO-3905
3 files changed, 7 insertions, 14 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 1d77854a2a..1f2e49be54 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 @@ -40,7 +40,8 @@ INSERT INTO northbound_request_ref_lookup(MACRO_ACTION, ACTION, REQUEST_SCOPE, I ('VFModule-ScaleOut', 'scaleOut', 'VfModule', true, true, '7','7', 'DEFAULT', '*'), ('VNF-InPlaceUpdate', 'inPlaceSoftwareUpdate', 'Vnf', true, true, '7','7', 'DEFAULT', '*'), ('VNF-Config-Update', 'applyUpdatedConfig', 'Vnf', true, true, '7','7', 'DEFAULT', '*'), -('CNF-Macro-Upgrade', 'upgradeCnf', 'Vnf', false,true, '7', '7','DEFAULT', '*'); +('CNF-Macro-Upgrade', 'upgradeCnf', 'Vnf', false,true, '7', '7','DEFAULT', '*'), +('Cnf-Create', 'createInstance', 'Cnf', true, true, '7','7','DEFAULT', '*'); INSERT INTO orchestration_flow_reference(COMPOSITE_ACTION, SEQ_NO, FLOW_NAME, SCOPE, ACTION, FLOW_VERSION, NB_REQ_REF_LOOKUP_ID) VALUES @@ -269,7 +270,8 @@ INSERT INTO orchestration_flow_reference(COMPOSITE_ACTION, SEQ_NO, FLOW_NAME, SC ('CNF-Macro-Upgrade', '9', 'ActivateVfModuleBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'CNF-Macro-Upgrade' and CLOUD_OWNER = 'DEFAULT')), ('CNF-Macro-Upgrade', '10', 'ChangeModelVnfBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'CNF-Macro-Upgrade' and CLOUD_OWNER = 'DEFAULT')), ('CNF-Macro-Upgrade', '11', 'ActivateVnfBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'CNF-Macro-Upgrade' and CLOUD_OWNER = 'DEFAULT')), -('CNF-Macro-Upgrade', '12', 'AAIUnsetVnfInMaintBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'CNF-Macro-Upgrade' and CLOUD_OWNER = 'DEFAULT')); +('CNF-Macro-Upgrade', '12', 'AAIUnsetVnfInMaintBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'CNF-Macro-Upgrade' and CLOUD_OWNER = 'DEFAULT')), +('CNF-Create', '1', 'CnfInstantiateBB', NULL, NULL, 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Cnf-Create' and CLOUD_OWNER = 'DEFAULT')); INSERT INTO rainy_day_handler_macro (FLOW_NAME, SERVICE_TYPE, VNF_TYPE, ERROR_CODE, WORK_STEP, POLICY, SECONDARY_POLICY, REG_EX_ERROR_MESSAGE, SERVICE_ROLE) VALUES @@ -427,7 +429,8 @@ VALUES ('ControllerExecutionBB', 'NO_VALIDATE', 'CUSTOM'), ('StatusCheckBB', 'NO_VALIDATE', 'CUSTOM'), ('HealthCheckBB', 'NO_VALIDATE', 'CUSTOM'), -('UpgradeVfModuleBB', 'NO_VALIDATE', 'CUSTOM'); +('UpgradeVfModuleBB', 'NO_VALIDATE', 'CUSTOM'), +('CnfInstantiateBB', 'CNF', 'ACTIVATE'); INSERT INTO orchestration_status_state_transition_directive (resource_type, orchestration_status, target_action, flow_directive) diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V9.1__AddCNFMFlowmappings.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V9.1__AddCNFMFlowmappings.sql deleted file mode 100644 index 80c7014d6b..0000000000 --- a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V9.1__AddCNFMFlowmappings.sql +++ /dev/null @@ -1,10 +0,0 @@ -USE catalogdb; - -INSERT INTO northbound_request_ref_lookup(MACRO_ACTION, ACTION, REQUEST_SCOPE, IS_ALACARTE, IS_TOPLEVELFLOW, MIN_API_VERSION, MAX_API_VERSION,cloud_owner,service_type) VALUES -('Cnf-Create', 'createInstance', 'Cnf', true, true, '1','1','DEFAULT', '*') - -INSERT INTO orchestration_flow_reference(COMPOSITE_ACTION, SEQ_NO, FLOW_NAME, FLOW_VERSION, NB_REQ_REF_LOOKUP_ID) VALUES -('CNF-Create', '1', 'CnfInstantiateBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Cnf-Create')) - -INSERT INTO building_block_detail (BUILDING_BLOCK_NAME, RESOURCE_TYPE, TARGET_ACTION) VALUES -('CnfInstantiateBB', 'CNF', 'ACTIVATE') diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java index 7e9231b5df..9bd533c753 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java @@ -381,7 +381,7 @@ public class ServiceInstances extends AbstractRestHandler { } @POST - @Path("/{version:[vV][1]}/serviceInstances/{serviceInstanceId}/cnfs") + @Path("/{version:[vV][7]}/serviceInstances/{serviceInstanceId}/cnfs") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @Operation(description = "Create CNF on a specified version and serviceInstance", responses = @ApiResponse( |