diff options
Diffstat (limited to 'catalog-be/src/main/resources/scripts')
8 files changed, 97 insertions, 14 deletions
diff --git a/catalog-be/src/main/resources/scripts/sdcBePy/common/normative/toscaTypes.py b/catalog-be/src/main/resources/scripts/sdcBePy/common/normative/toscaTypes.py index 97fb2d1d7e..56fe2b4b39 100644 --- a/catalog-be/src/main/resources/scripts/sdcBePy/common/normative/toscaTypes.py +++ b/catalog-be/src/main/resources/scripts/sdcBePy/common/normative/toscaTypes.py @@ -114,10 +114,7 @@ def _results_ok(results, response_codes): def _get_response_code(update_version): - response_codes = [200, 201] - if update_version is False: - response_codes.append(409) - + response_codes = [200, 201, 409] return response_codes diff --git a/catalog-be/src/main/resources/scripts/sdcBePy/tosca/data/onapTypesToUpgrade.json b/catalog-be/src/main/resources/scripts/sdcBePy/tosca/data/onapTypesToUpgrade.json index 0c363b01ea..7076705619 100644 --- a/catalog-be/src/main/resources/scripts/sdcBePy/tosca/data/onapTypesToUpgrade.json +++ b/catalog-be/src/main/resources/scripts/sdcBePy/tosca/data/onapTypesToUpgrade.json @@ -4,6 +4,23 @@ "NS", "NsVirtualLink" ], + "nfv_2_7_1": [ + "vduCompute", + "vduVirtualFileStorage", + "vnfExtCp", + "vduCp", + "vipCp" + ], + "nfv_3_3_1": [ + "VNF", + "vduVirtualBlockStorage" + ], + "nfv_4_1_1": [ + "VNF", + "osContainer", + "osContainerGroup", + "virtualCp" + ], "onap": [ ], "sol":[ diff --git a/catalog-be/src/main/resources/scripts/sdcBePy/tosca/imports/runNormativeType.py b/catalog-be/src/main/resources/scripts/sdcBePy/tosca/imports/runNormativeType.py index ee4e05b21a..4e9a14932f 100644 --- a/catalog-be/src/main/resources/scripts/sdcBePy/tosca/imports/runNormativeType.py +++ b/catalog-be/src/main/resources/scripts/sdcBePy/tosca/imports/runNormativeType.py @@ -4,7 +4,7 @@ import sys from sdcBePy.common.normative.toscaTypes import process_and_create_normative_types from sdcBePy.tosca.main import get_args, usage -from sdcBePy.tosca.models.normativeTypesList import get_normative, get_heat, get_nfv, get_onap, get_sol +from sdcBePy.tosca.models.normativeTypesList import get_normative, get_heat, get_nfv, get_nfv_2_7_1, get_nfv_3_3_1, get_nfv_4_1_1, get_onap, get_sol def run(candidate, exit_on_success=True): @@ -37,6 +37,17 @@ def run_import_nfv(): nfv_candidate = get_nfv() run(nfv_candidate) +def run_import_nfv_2_7_1(): + nfv_candidate = get_nfv_3_3_1() + run(nfv_candidate) + +def run_import_nfv_3_3_1(): + nfv_candidate = get_nfv_3_3_1() + run(nfv_candidate) + +def run_import_nfv_4_1_1(): + nfv_candidate = get_nfv_3_3_1() + run(nfv_candidate) def run_import_onap(): onap_candidate = get_onap() diff --git a/catalog-be/src/main/resources/scripts/sdcBePy/tosca/models/normativeToUpdateList.py b/catalog-be/src/main/resources/scripts/sdcBePy/tosca/models/normativeToUpdateList.py index a2830185d5..2d243d80ab 100644 --- a/catalog-be/src/main/resources/scripts/sdcBePy/tosca/models/normativeToUpdateList.py +++ b/catalog-be/src/main/resources/scripts/sdcBePy/tosca/models/normativeToUpdateList.py @@ -27,13 +27,20 @@ def get_heat_and_normative_to_update_list(types, base_file_location): ] -def get_nfv_onap_sol_to_update_list(types, base_file_location): +def get_onap_sol_to_update_list(types, base_file_location): return [ - get_nfv(types, base_file_location), get_onap(types, base_file_location), get_sol(types, base_file_location) ] +def get_nfv_to_update_list(types, base_file_location): + return [ + get_nfv(types, base_file_location), + get_nfv_2_7_1(types, base_file_location), + get_nfv_3_3_1(types, base_file_location), + get_nfv_4_1_1(types, base_file_location), + ] + def get_heat(types, base_location="/"): return NormativeTypeCandidate(base_location + "heat-types/", @@ -48,7 +55,18 @@ def get_normative(types, base_location="/"): def get_nfv(types, base_location="/"): return NormativeTypeCandidate(base_location + "nfv-types/", types.get_type("nfv")) - + +def get_nfv_2_7_1(types, base_location="/"): + return NormativeTypeCandidate(base_location + "nfv-types/2.7.1/", + types.get_type("nfv_2_7_1")) + +def get_nfv_3_3_1(types, base_location="/"): + return NormativeTypeCandidate(base_location + "nfv-types/3.3.1/", + types.get_type("nfv_3_3_1")) + +def get_nfv_4_1_1(types, base_location="/"): + return NormativeTypeCandidate(base_location + "nfv-types/4.1.1/", + types.get_type("nfv_4_1_1")) def get_onap(types, base_location="/"): return NormativeTypeCandidate(base_location + "onap-types/", diff --git a/catalog-be/src/main/resources/scripts/sdcBePy/tosca/models/normativeTypesList.py b/catalog-be/src/main/resources/scripts/sdcBePy/tosca/models/normativeTypesList.py index 46b8d9b5bc..12a4491b96 100644 --- a/catalog-be/src/main/resources/scripts/sdcBePy/tosca/models/normativeTypesList.py +++ b/catalog-be/src/main/resources/scripts/sdcBePy/tosca/models/normativeTypesList.py @@ -6,6 +6,9 @@ def get_normative_type_candidate_list(base_file_location): get_normative(base_file_location), get_heat(base_file_location), get_nfv(base_file_location), + get_nfv_2_7_1(base_file_location), + get_nfv_3_3_1(base_file_location), + get_nfv_4_1_1(base_file_location), get_onap(base_file_location), get_sol(base_file_location) ] @@ -110,7 +113,26 @@ def get_nfv(base_file_location="/"): "PonUni", "OltNni", "OntNni"]) - + +def get_nfv_2_7_1(base_file_location="/"): + return NormativeTypeCandidate(base_file_location + "nfv-types/2.7.1/", + ["vduCompute", + "vduVirtualFileStorage", + "vnfExtCp", + "vduCp", + "vipCp"]) + +def get_nfv_3_3_1(base_file_location="/"): + return NormativeTypeCandidate(base_file_location + "nfv-types/3.3.1/", + ["vduVirtualBlockStorage", + "VNF"]) + +def get_nfv_4_1_1(base_file_location="/"): + return NormativeTypeCandidate(base_file_location + "nfv-types/4.1.1/", + ["VNF", + "osContainer", + "osContainerGroup", + "virtualCp"]) def get_onap(base_file_location="/"): return NormativeTypeCandidate(base_file_location + "onap-types/", diff --git a/catalog-be/src/main/resources/scripts/sdcBePy/tosca/upgrade/run.py b/catalog-be/src/main/resources/scripts/sdcBePy/tosca/upgrade/run.py index 47acd05f5f..8cdf22842f 100644 --- a/catalog-be/src/main/resources/scripts/sdcBePy/tosca/upgrade/run.py +++ b/catalog-be/src/main/resources/scripts/sdcBePy/tosca/upgrade/run.py @@ -9,12 +9,13 @@ from sdcBePy.tosca.main import parse_and_create_proxy from sdcBePy.tosca.models.normativeElementsList import get_normative_element_candidate_list, \ get_normative_element_with_metadata_list from sdcBePy.tosca.models.normativeToUpdateList import TypesToUpdate, get_heat_and_normative_to_update_list, \ - get_nfv_onap_sol_to_update_list + get_onap_sol_to_update_list, get_nfv_to_update_list def main(sdc_be_proxy): update_version = True - update_onap_version = False + update_onap_version = False + update_nfv_version = True # use to run script form this dir (not like the command) # base_file_location = os.getcwd() + "/../../../../import/tosca/" @@ -28,8 +29,11 @@ def main(sdc_be_proxy): heat_and_normative_list = get_heat_and_normative_to_update_list(all_types, base_file_location) process_type_list(heat_and_normative_list, sdc_be_proxy, update_version) - nfv_onap_sol_list = get_nfv_onap_sol_to_update_list(all_types, base_file_location) - process_type_list(nfv_onap_sol_list, sdc_be_proxy, update_onap_version) + onap_sol_list = get_onap_sol_to_update_list(all_types, base_file_location) + process_type_list(onap_sol_list, sdc_be_proxy, update_onap_version) + + nfv_list = get_nfv_to_update_list(all_types, base_file_location) + process_type_list(nfv_list, sdc_be_proxy, update_nfv_version) logger.log("Updating end ->", "All normatives updated successfully!") print_and_exit(0, None) diff --git a/catalog-be/src/main/resources/scripts/sdcBePy/tosca/upgrade/runUpgradeNormative.py b/catalog-be/src/main/resources/scripts/sdcBePy/tosca/upgrade/runUpgradeNormative.py index 4b0d0cc8a2..a4305ec352 100644 --- a/catalog-be/src/main/resources/scripts/sdcBePy/tosca/upgrade/runUpgradeNormative.py +++ b/catalog-be/src/main/resources/scripts/sdcBePy/tosca/upgrade/runUpgradeNormative.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 from sdcBePy.tosca.imports.runNormativeType import run -from sdcBePy.tosca.models.normativeToUpdateList import get_heat, get_normative, get_nfv, get_onap, get_sol +from sdcBePy.tosca.models.normativeToUpdateList import get_heat, get_normative, get_nfv, get_2_7_1, get_nfv_3_3_1, get_nfv_4_1_1, get_onap, get_sol from sdcBePy.tosca.models.normativeTypesList import get_heat1707, get_heat1702_3537, get_heat_version from sdcBePy.tosca.upgrade.run import get_all_types @@ -21,7 +21,18 @@ def run_upgrade_normative(): def run_upgrade_nfv(): normative_candidate = get_nfv(all_types) run(normative_candidate) + +def run_upgrade_nfv_2_7_1(): + normative_candidate = get_nfv_2_7_1(all_types) + run(normative_candidate) + +def run_upgrade_nfv_3_3_1(): + normative_candidate = get_nfv_3_3_1(all_types) + run(normative_candidate) +def run_upgrade_nfv_4_1_1(): + normative_candidate = get_nfv_4_1_1(all_types) + run(normative_candidate) def run_upgrade_onap(): normative_candidate = get_onap(all_types) diff --git a/catalog-be/src/main/resources/scripts/setup.py b/catalog-be/src/main/resources/scripts/setup.py index da2cad2da3..e536e9360f 100644 --- a/catalog-be/src/main/resources/scripts/setup.py +++ b/catalog-be/src/main/resources/scripts/setup.py @@ -25,6 +25,9 @@ setup( "sdcimportnormative=sdcBePy.tosca.imports.runNormativeType:run_import_normative", "sdcimportheat=sdcBePy.tosca.imports.runNormativeType:run_import_heat", "sdcimportnfv=sdcBePy.tosca.imports.runNormativeType:run_import_nfv", + "sdcimportnfv271=sdcBePy.tosca.imports.runNormativeType:run_import_nfv_2_7_1", + "sdcimportnfv331=sdcBePy.tosca.imports.runNormativeType:run_import_nfv_3_3_1", + "sdcimportnfv411=sdcBePy.tosca.imports.runNormativeType:run_import_nfv_4_1_1", "sdcimportonap=sdcBePy.tosca.imports.runNormativeType:run_import_onap", "sdcimportsol=sdcBePy.tosca.imports.runNormativeType:run_import_sol", "sdcimportannotation=sdcBePy.tosca.imports.runNormativeType:run_import_annotation", |