From fefa3e408f77289594e47edc878d1bee61fca90b Mon Sep 17 00:00:00 2001 From: "Gitelman, Tal (tg851x)" Date: Tue, 20 Mar 2018 01:04:54 +0200 Subject: [PATCH] Normative alignemet Change-Id: I6115e20fe95662153903873d19439bc7cf0c2ff1 Issue-ID: SDC-1104 Signed-off-by: Gitelman, Tal (tg851x) --- .../resources/import/tosca/nfv-types/NSD/NSD.json | 15 +++ .../resources/import/tosca/nfv-types/NSD/NSD.yml | 41 ++++++++ .../resources/import/tosca/nfv-types/NSD/NSD.zip | Bin 0 -> 554 bytes .../resources/import/tosca/nfv-types/VDU/VDU.json | 15 +++ .../resources/import/tosca/nfv-types/VDU/VDU.yml | 22 ++++ .../resources/import/tosca/nfv-types/VDU/VDU.zip | Bin 0 -> 457 bytes .../allottedResource/allottedResource.json | 0 .../allottedResource/allottedResource.yml | 0 .../allottedResource/allottedResource.zip | Bin .../tosca/nfv-types/extImageFile/extImageFile.json | 15 +++ .../tosca/nfv-types/extImageFile/extImageFile.yml | 25 +++++ .../tosca/nfv-types/extImageFile/extImageFile.zip | Bin 0 -> 377 bytes .../nfv-types/extLocalStorage/extLocalStorage.json | 15 +++ .../nfv-types/extLocalStorage/extLocalStorage.yml | 14 +++ .../nfv-types/extLocalStorage/extLocalStorage.zip | Bin 0 -> 350 bytes .../import/tosca/nfv-types/extZteCP/extZteCP.json | 15 +++ .../import/tosca/nfv-types/extZteCP/extZteCP.yml | 76 ++++++++++++++ .../import/tosca/nfv-types/extZteCP/extZteCP.zip | Bin 0 -> 586 bytes .../tosca/nfv-types/extZteVDU/extZteVDU.json | 15 +++ .../import/tosca/nfv-types/extZteVDU/extZteVDU.yml | 67 ++++++++++++ .../import/tosca/nfv-types/extZteVDU/extZteVDU.zip | Bin 0 -> 636 bytes .../import/tosca/nfv-types/extZteVL/extZteVL.json | 15 +++ .../import/tosca/nfv-types/extZteVL/extZteVL.yml | 69 +++++++++++++ .../import/tosca/nfv-types/extZteVL/extZteVL.zip | Bin 0 -> 529 bytes .../genericNeutronNet/genericNeutronNet.json | 0 .../genericNeutronNet/genericNeutronNet.yml | 0 .../genericNeutronNet/genericNeutronNet.zip | Bin .../overlayTunnel/overlayTunnel.json | 0 .../overlayTunnel/overlayTunnel.yml | 0 .../overlayTunnel/overlayTunnel.zip | Bin .../underlayVpn/underlayVpn.json | 0 .../underlayVpn/underlayVpn.yml | 0 .../underlayVpn/underlayVpn.zip | Bin .../tosca/nfv-types/vduCompute/vduCompute.json | 15 +++ .../tosca/nfv-types/vduCompute/vduCompute.yml | 96 +++++++++++++++++ .../tosca/nfv-types/vduCompute/vduCompute.zip | Bin 0 -> 667 bytes .../import/tosca/nfv-types/vduCpd/vduCpd.json | 15 +++ .../import/tosca/nfv-types/vduCpd/vduCpd.yml | 57 +++++++++++ .../import/tosca/nfv-types/vduCpd/vduCpd.zip | Bin 0 -> 554 bytes .../vduVirtualStorage/vduVirtualStorage.json | 15 +++ .../vduVirtualStorage/vduVirtualStorage.yml | 27 +++++ .../vduVirtualStorage/vduVirtualStorage.zip | Bin 0 -> 421 bytes .../vnfVirtualLinkDesc/vnfVirtualLinkDesc.json | 15 +++ .../vnfVirtualLinkDesc/vnfVirtualLinkDesc.yml | 26 +++++ .../vnfVirtualLinkDesc/vnfVirtualLinkDesc.zip | Bin 0 -> 478 bytes .../scripts/import/tosca/importNfvTypes.py | 113 +++++++++++++++++++++ .../scripts/import/tosca/importNormativeTypes.py | 2 +- .../scripts/import/tosca/importONAPNormativeAll.py | 16 ++- .../scripts/import/tosca/importOnapTypes.py | 16 +-- .../scripts/import/tosca/importSolTypes.py | 99 ++++++++++++++++++ .../scripts/import/tosca/onapTypesToUpgrade.json | 4 + .../scripts/import/tosca/upgradeNfvTypes.py | 104 +++++++++++++++++++ .../scripts/import/tosca/upgradeONAPNormative.py | 12 ++- .../scripts/import/tosca/upgradeSolTypes.py | 104 +++++++++++++++++++ 54 files changed, 1136 insertions(+), 19 deletions(-) create mode 100644 catalog-be/src/main/resources/import/tosca/nfv-types/NSD/NSD.json create mode 100644 catalog-be/src/main/resources/import/tosca/nfv-types/NSD/NSD.yml create mode 100644 catalog-be/src/main/resources/import/tosca/nfv-types/NSD/NSD.zip create mode 100644 catalog-be/src/main/resources/import/tosca/nfv-types/VDU/VDU.json create mode 100644 catalog-be/src/main/resources/import/tosca/nfv-types/VDU/VDU.yml create mode 100644 catalog-be/src/main/resources/import/tosca/nfv-types/VDU/VDU.zip rename catalog-be/src/main/resources/import/tosca/{normative-types => nfv-types}/allottedResource/allottedResource.json (100%) rename catalog-be/src/main/resources/import/tosca/{normative-types => nfv-types}/allottedResource/allottedResource.yml (100%) rename catalog-be/src/main/resources/import/tosca/{normative-types => nfv-types}/allottedResource/allottedResource.zip (100%) create mode 100644 catalog-be/src/main/resources/import/tosca/nfv-types/extImageFile/extImageFile.json create mode 100644 catalog-be/src/main/resources/import/tosca/nfv-types/extImageFile/extImageFile.yml create mode 100644 catalog-be/src/main/resources/import/tosca/nfv-types/extImageFile/extImageFile.zip create mode 100644 catalog-be/src/main/resources/import/tosca/nfv-types/extLocalStorage/extLocalStorage.json create mode 100644 catalog-be/src/main/resources/import/tosca/nfv-types/extLocalStorage/extLocalStorage.yml create mode 100644 catalog-be/src/main/resources/import/tosca/nfv-types/extLocalStorage/extLocalStorage.zip create mode 100644 catalog-be/src/main/resources/import/tosca/nfv-types/extZteCP/extZteCP.json create mode 100644 catalog-be/src/main/resources/import/tosca/nfv-types/extZteCP/extZteCP.yml create mode 100644 catalog-be/src/main/resources/import/tosca/nfv-types/extZteCP/extZteCP.zip create mode 100644 catalog-be/src/main/resources/import/tosca/nfv-types/extZteVDU/extZteVDU.json create mode 100644 catalog-be/src/main/resources/import/tosca/nfv-types/extZteVDU/extZteVDU.yml create mode 100644 catalog-be/src/main/resources/import/tosca/nfv-types/extZteVDU/extZteVDU.zip create mode 100644 catalog-be/src/main/resources/import/tosca/nfv-types/extZteVL/extZteVL.json create mode 100644 catalog-be/src/main/resources/import/tosca/nfv-types/extZteVL/extZteVL.yml create mode 100644 catalog-be/src/main/resources/import/tosca/nfv-types/extZteVL/extZteVL.zip rename catalog-be/src/main/resources/import/tosca/{heat-types => nfv-types}/genericNeutronNet/genericNeutronNet.json (100%) rename catalog-be/src/main/resources/import/tosca/{heat-types => nfv-types}/genericNeutronNet/genericNeutronNet.yml (100%) rename catalog-be/src/main/resources/import/tosca/{heat-types => nfv-types}/genericNeutronNet/genericNeutronNet.zip (100%) rename catalog-be/src/main/resources/import/tosca/{heat-types => nfv-types}/overlayTunnel/overlayTunnel.json (100%) rename catalog-be/src/main/resources/import/tosca/{heat-types => nfv-types}/overlayTunnel/overlayTunnel.yml (100%) rename catalog-be/src/main/resources/import/tosca/{heat-types => nfv-types}/overlayTunnel/overlayTunnel.zip (100%) rename catalog-be/src/main/resources/import/tosca/{heat-types => nfv-types}/underlayVpn/underlayVpn.json (100%) rename catalog-be/src/main/resources/import/tosca/{heat-types => nfv-types}/underlayVpn/underlayVpn.yml (100%) rename catalog-be/src/main/resources/import/tosca/{heat-types => nfv-types}/underlayVpn/underlayVpn.zip (100%) create mode 100644 catalog-be/src/main/resources/import/tosca/nfv-types/vduCompute/vduCompute.json create mode 100644 catalog-be/src/main/resources/import/tosca/nfv-types/vduCompute/vduCompute.yml create mode 100644 catalog-be/src/main/resources/import/tosca/nfv-types/vduCompute/vduCompute.zip create mode 100644 catalog-be/src/main/resources/import/tosca/nfv-types/vduCpd/vduCpd.json create mode 100644 catalog-be/src/main/resources/import/tosca/nfv-types/vduCpd/vduCpd.yml create mode 100644 catalog-be/src/main/resources/import/tosca/nfv-types/vduCpd/vduCpd.zip create mode 100644 catalog-be/src/main/resources/import/tosca/nfv-types/vduVirtualStorage/vduVirtualStorage.json create mode 100644 catalog-be/src/main/resources/import/tosca/nfv-types/vduVirtualStorage/vduVirtualStorage.yml create mode 100644 catalog-be/src/main/resources/import/tosca/nfv-types/vduVirtualStorage/vduVirtualStorage.zip create mode 100644 catalog-be/src/main/resources/import/tosca/nfv-types/vnfVirtualLinkDesc/vnfVirtualLinkDesc.json create mode 100644 catalog-be/src/main/resources/import/tosca/nfv-types/vnfVirtualLinkDesc/vnfVirtualLinkDesc.yml create mode 100644 catalog-be/src/main/resources/import/tosca/nfv-types/vnfVirtualLinkDesc/vnfVirtualLinkDesc.zip create mode 100644 catalog-be/src/main/resources/scripts/import/tosca/importNfvTypes.py create mode 100644 catalog-be/src/main/resources/scripts/import/tosca/importSolTypes.py create mode 100644 catalog-be/src/main/resources/scripts/import/tosca/upgradeNfvTypes.py create mode 100644 catalog-be/src/main/resources/scripts/import/tosca/upgradeSolTypes.py diff --git a/catalog-be/src/main/resources/import/tosca/nfv-types/NSD/NSD.json b/catalog-be/src/main/resources/import/tosca/nfv-types/NSD/NSD.json new file mode 100644 index 0000000000..22788ec06c --- /dev/null +++ b/catalog-be/src/main/resources/import/tosca/nfv-types/NSD/NSD.json @@ -0,0 +1,15 @@ +{ + "payloadName": "NSD.yml", + "contactId": "jh0003", + "name": "NSD", + "description": "NSD", + "resourceIconPath": "network", + "resourceType": "VFC", + "categories": [{ + "name": "Generic", + "subcategories": [{ + "name": "Network Elements" + }] + }], + "tags": ["NSD"] +} \ No newline at end of file diff --git a/catalog-be/src/main/resources/import/tosca/nfv-types/NSD/NSD.yml b/catalog-be/src/main/resources/import/tosca/nfv-types/NSD/NSD.yml new file mode 100644 index 0000000000..1b3d8820d5 --- /dev/null +++ b/catalog-be/src/main/resources/import/tosca/nfv-types/NSD/NSD.yml @@ -0,0 +1,41 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +node_types: + org.openecomp.resource.vfc.NSD: + derived_from: tosca.nodes.Root + description: ECOMP Allotted Resource base type all other allotted resources node types derive from + properties: + nsd_id: + type: string + required: true + description: ID of the NSD + nsd_designer: + type: string + required: true + description: Designer of the NSD + nsd_version: + type: string + required: true + description: Version of the NSD + nsd_name: + type: string + required: true + description: Name of the NSD + providing_service_uuid: + type: string + required: true + description: The depending service uuid in order to map the allotted resource to the specific service version + providing_service_invariant_uuid: + type: string + required: true + description: The depending service invariant uuid in order to map the allotted resource to the specific service version + providing_service_name: + type: string + required: true + description: The depending service name in order to map the allotted resource to the specific service version + requirements: + - virtualLink: + capability: tosca.capabilities.network.Linkable + relationship: tosca.relationships.network.LinksTo + capabilities: + virtual_linkable: + type: tosca.capabilities.network.Linkable diff --git a/catalog-be/src/main/resources/import/tosca/nfv-types/NSD/NSD.zip b/catalog-be/src/main/resources/import/tosca/nfv-types/NSD/NSD.zip new file mode 100644 index 0000000000000000000000000000000000000000..d741b50c16febf83fad1c0ecb7cbe7d7149acd31 GIT binary patch literal 554 zcmWIWW@Zs#U|`^22xSZK)@xz2p2o<)@ROB+fgLF77wn=}nVYjWWN+Rb1D<=#Ph@{E znO^$3ZPE3G4ztBFFN9w3{30tD8KiOZ;NDt|XtO!?3eCd4My_@CY6oQ|T|AZKJ&fRDCY3_yt$JJcEWH^aS9}}rEyTP+I zbKU>9-d!@?KFm>9i(Y7z1Q!Gq3p>p#o|M>CnezYR-}CSHe>l5yf^pQ2l^Y5!a4wwC zT*l{Qr+9j8+SwC~*9}$jxQnbwTe?`rvt~Z}JlV9=$rF}ZCs`cZ$tzlH* z0b9S1;-~80DQ;0Xn1kco`A0SH`qbMn1^JS$8JuBC`j% z{7=}=E~))jV9tGc`Hx$9GI8a>AGUu9SX%Pp^B#eH2OQ>9zpb0NKf2P;>J_u)sppmL zx`LBJpBdV-?929=YG)C1yR<51y?R&iORH~N%T%s&h=aN?~RW$nnhw9yITZxS?@LT zzr46Xh$~|bn;pmEpI!PtHz}=dIDXJELn|z#^jqt!Tl?PL_FF>L&_wtT10y z#~9$v$YjreD{NJOp$h^EU=kkETu=c<1__3DKNl;U_PER_dcL)26A~TZ&B_MS#R!Cv LKspK-VGIla&_TQO literal 0 HcmV?d00001 diff --git a/catalog-be/src/main/resources/import/tosca/normative-types/allottedResource/allottedResource.json b/catalog-be/src/main/resources/import/tosca/nfv-types/allottedResource/allottedResource.json similarity index 100% rename from catalog-be/src/main/resources/import/tosca/normative-types/allottedResource/allottedResource.json rename to catalog-be/src/main/resources/import/tosca/nfv-types/allottedResource/allottedResource.json diff --git a/catalog-be/src/main/resources/import/tosca/normative-types/allottedResource/allottedResource.yml b/catalog-be/src/main/resources/import/tosca/nfv-types/allottedResource/allottedResource.yml similarity index 100% rename from catalog-be/src/main/resources/import/tosca/normative-types/allottedResource/allottedResource.yml rename to catalog-be/src/main/resources/import/tosca/nfv-types/allottedResource/allottedResource.yml diff --git a/catalog-be/src/main/resources/import/tosca/normative-types/allottedResource/allottedResource.zip b/catalog-be/src/main/resources/import/tosca/nfv-types/allottedResource/allottedResource.zip similarity index 100% rename from catalog-be/src/main/resources/import/tosca/normative-types/allottedResource/allottedResource.zip rename to catalog-be/src/main/resources/import/tosca/nfv-types/allottedResource/allottedResource.zip diff --git a/catalog-be/src/main/resources/import/tosca/nfv-types/extImageFile/extImageFile.json b/catalog-be/src/main/resources/import/tosca/nfv-types/extImageFile/extImageFile.json new file mode 100644 index 0000000000..49895e44a6 --- /dev/null +++ b/catalog-be/src/main/resources/import/tosca/nfv-types/extImageFile/extImageFile.json @@ -0,0 +1,15 @@ +{ + "payloadName": "extImageFile.yml", + "contactId": "jh0003", + "name": "Ext Image File", + "description": "Ext Image File", + "resourceIconPath": "defaulticon", + "resourceType": "VFC", + "categories": [{ + "name": "Generic", + "subcategories": [{ + "name": "Infrastructure" + }] + }], + "tags": ["Ext Image File"] +} \ No newline at end of file diff --git a/catalog-be/src/main/resources/import/tosca/nfv-types/extImageFile/extImageFile.yml b/catalog-be/src/main/resources/import/tosca/nfv-types/extImageFile/extImageFile.yml new file mode 100644 index 0000000000..0715993b40 --- /dev/null +++ b/catalog-be/src/main/resources/import/tosca/nfv-types/extImageFile/extImageFile.yml @@ -0,0 +1,25 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +node_types: + tosca.nodes.nfv.ext.ImageFile: + derived_from: tosca.nodes.Root + properties: + file_url: + type: string + required: false + container_type: + type: string + required: false + name: + type: string + required: false + disk_format: + type: string + required: false + version: + type: string + required: false + capabilities: + guest_os: + type: tosca.capabilities.nfv.ext.GuestOs + image_fle: + type: tosca.capabilities.nfv.ext.ImageFile diff --git a/catalog-be/src/main/resources/import/tosca/nfv-types/extImageFile/extImageFile.zip b/catalog-be/src/main/resources/import/tosca/nfv-types/extImageFile/extImageFile.zip new file mode 100644 index 0000000000000000000000000000000000000000..acee3847543a5caed6f375354c5d243e7e87bc5d GIT binary patch literal 377 zcmWIWW@Zs#U|`^2;96+xEgI;naT&8Wm+IjMS;xjA!#9Q}?M z@a*|6TI;wq<~M_Yx{6&w>#>zOlPqrJ9sM_Ni7xl)-gBC>&h#wq=`AgKU>KmLe2z=I z>)PQP@58-Ty0onJ7LqbLMheWLYH7iz&<(dHK%xIqTJiul^6prS0d%o7$P4@0MfBTI$sC zV}8eNwUYP%Z$>7223$d)0t^HYPymyd0m229VPueCIQFIgNv7dtMuB^id64MJB*Z_-i467){P zVezFfYk)T+lRX12PpSaD2?7dW604WFppuLX k5)AcIx>K_aFEbuHHzz3zi4O2)WdoVO2!yFX`Z3rz0Hp$Y2><{9 literal 0 HcmV?d00001 diff --git a/catalog-be/src/main/resources/import/tosca/nfv-types/extZteCP/extZteCP.json b/catalog-be/src/main/resources/import/tosca/nfv-types/extZteCP/extZteCP.json new file mode 100644 index 0000000000..955e5e3e30 --- /dev/null +++ b/catalog-be/src/main/resources/import/tosca/nfv-types/extZteCP/extZteCP.json @@ -0,0 +1,15 @@ +{ + "payloadName": "extZteCP.yml", + "contactId": "jh0003", + "name": "ext ZTE CP", + "description": "Ext ZTE CP", + "resourceIconPath": "network", + "resourceType": "CP", + "categories": [{ + "name": "Generic", + "subcategories": [{ + "name": "Network Elements" + }] + }], + "tags": ["ext ZTE CP"] +} \ No newline at end of file diff --git a/catalog-be/src/main/resources/import/tosca/nfv-types/extZteCP/extZteCP.yml b/catalog-be/src/main/resources/import/tosca/nfv-types/extZteCP/extZteCP.yml new file mode 100644 index 0000000000..207047a3d7 --- /dev/null +++ b/catalog-be/src/main/resources/import/tosca/nfv-types/extZteCP/extZteCP.yml @@ -0,0 +1,76 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +node_types: + tosca.nodes.nfv.ext.zte.CP: + derived_from: tosca.nodes.Root + properties: + guest_os_mtu: + type: integer + required: false + bandwidth: + type: integer + required: false + interface_name: + type: string + required: false + allowed_address_pairs: + type: list + required: false + entry_schema: + type: tosca.datatypes.nfv.ext.AddressPairs + ip_address: + type: string + required: false + bond: + type: string + required: false + proxiedVNFs: + type: list + required: false + entry_schema: + type: string + sfc_encapsulation: + type: string + required: false + floating_ip_address: + type: tosca.datatypes.nfv.ext.FloatingIP + required: false + service_ip_address: + required: false + type: string + mac_address: + type: string + required: false + proxiedVNFtype: + type: string + required: false + macbond: + type: string + required: false + vnic_type: + type: string + required: false + direction: + type: string + required: false + order: + type: integer + required: false + requirements: + - forwarder: + capability: tosca.capabilities.nfv.Forwarder + occurrences: + - 0 + - UNBOUNDED + - virtualbinding: + capability: tosca.capabilities.nfv.VirtualBindable + occurrences: + - 0 + - UNBOUNDED + - virtualLink: + capability: tosca.capabilities.nfv.VirtualLinkable + occurrences: + - 0 + - UNBOUNDED + capabilities: + forwarder: + type: tosca.capabilities.nfv.Forwarder \ No newline at end of file diff --git a/catalog-be/src/main/resources/import/tosca/nfv-types/extZteCP/extZteCP.zip b/catalog-be/src/main/resources/import/tosca/nfv-types/extZteCP/extZteCP.zip new file mode 100644 index 0000000000000000000000000000000000000000..ca6d0738deed134d2cb493f49890adacf4311c9c GIT binary patch literal 586 zcmWIWW@Zs#U|`^2*qayTy*6~I*BV9!1~YaB1|FbjYDGy@Nvd;zUS)31){xVAw+#gL zJlFohEP7{ko^LQSE7x_62{E0bJB!4YdX(;*^ti5eWyhvhyBdYn9(qQ-J7bsT@X@i^ z=*9$P#rI886P*97=z6IYa62-DJ!9>!6=7MWPxm;gw(~iM#)t+-S+Y65oVD->yJkK2 zwE5c~m)fw+WHVWnct1@2rTw1i$EWnww(FP#+RcmYcbvk%YHA(NGUID&xr&;spCnKD z81CP*OiOA5WAGlf^lvFo?1b&p3Yn#*HjAD2XfoJ&mz8hBwfB!dB=972tYUst;FhX+ z;zX^473-X1+?vJsMSuCqN z|Kf4;BKys=BpTP}BrS|n@SIb;SO4@U_5g22CVK{4@u~uhSrAYFlc=%G1r=pvkYG@Z kh~roBzRcLZ-09OZa|9jW&B_MS$_RvUK>8Xm#V{}c0O-f>0{{R3 literal 0 HcmV?d00001 diff --git a/catalog-be/src/main/resources/import/tosca/nfv-types/extZteVDU/extZteVDU.json b/catalog-be/src/main/resources/import/tosca/nfv-types/extZteVDU/extZteVDU.json new file mode 100644 index 0000000000..2ebc518c0c --- /dev/null +++ b/catalog-be/src/main/resources/import/tosca/nfv-types/extZteVDU/extZteVDU.json @@ -0,0 +1,15 @@ +{ + "payloadName": "extZteVDU.yml", + "contactId": "jh0003", + "name": "Ext Zte VDU", + "description": "Ext Zte VDU", + "resourceIconPath": "compute", + "resourceType": "VFC", + "categories": [{ + "name": "Generic", + "subcategories": [{ + "name": "Infrastructure" + }] + }], + "tags": ["Ext Zte VDU"] +} \ No newline at end of file diff --git a/catalog-be/src/main/resources/import/tosca/nfv-types/extZteVDU/extZteVDU.yml b/catalog-be/src/main/resources/import/tosca/nfv-types/extZteVDU/extZteVDU.yml new file mode 100644 index 0000000000..1638305021 --- /dev/null +++ b/catalog-be/src/main/resources/import/tosca/nfv-types/extZteVDU/extZteVDU.yml @@ -0,0 +1,67 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +node_types: + tosca.nodes.nfv.ext.zte.VDU: + derived_from: tosca.nodes.Root + properties: + manual_scale_select_vim: + type: boolean + required: false + vdu_type: + type: string + required: false + watchdog: + type: tosca.datatypes.nfv.ext.zte.WatchDog + required: false + name: + type: string + required: false + local_affinity_antiaffinity_rule: + type: tosca.datatypes.nfv.ext.LocalAffinityOrAntiAffinityRule + required: false + support_scaling: + type: boolean + required: false + storage_policy: + type: string + required: false + key_vdu: + type: boolean + required: false + location_info: + type: tosca.datatypes.nfv.ext.LocationInfo + required: false + inject_data_list: + type: list + required: false + entry_schema: + type: tosca.datatypes.nfv.ext.InjectData + requirements: + - guest_os: + capability: tosca.capabilities.nfv.ext.GuestOs + occurrences: + - 0 + - UNBOUNDED + - local_storage: + capability: tosca.capabilities.nfv.ext.LocalAttachment + occurrences: + - 0 + - UNBOUNDED + - volume_storage: + capability: tosca.capabilities.Attachment + occurrences: + - 0 + - UNBOUNDED + - dependency: + capability: tosca.capabilities.Node + occurrences: + - 0 + - UNBOUNDED + capabilities: + scalable: + type: tosca.capabilities.Scalable + monitoring_parameter: + type: tosca.capabilities.nfv.Metric + nfv_compute: + type: tosca.capabilities.nfv.ext.Compute.Container.Architecture + virtualbinding: + type: tosca.capabilities.nfv.VirtualBindable \ No newline at end of file diff --git a/catalog-be/src/main/resources/import/tosca/nfv-types/extZteVDU/extZteVDU.zip b/catalog-be/src/main/resources/import/tosca/nfv-types/extZteVDU/extZteVDU.zip new file mode 100644 index 0000000000000000000000000000000000000000..2bf0f54ea3e527472eb23992c9b9870c6677c9ff GIT binary patch literal 636 zcmWIWW@Zs#U|`^2@aA;&PJ6GL!@$JA;K0tnzzY;jttg2qNey!e)vL_SSsQx0@0Ni; z?Q`uv%+eRb@7)Lr)!wS`w(ITU)Hj?vzUIF5y!GX^wV#uSS75{2;7K3n7#}a@{-wei z9+0&>uzGq0ui?ehO^MZ0w(zo5D6e@a|6|Vi^mEz|Zm@WCOTOOImE+y2{hFyR@uT#@ zirC!GhRIxu);WGOs@iQ)SpQ8fdb&VuL&q$M$n1nOT;ZIDPtI&oH&B>({TAPIkr^U7 zH_lZvAL6~nkw3L>f!G=mHOKt*p+~L%?|;C#xa>FQ7yrgj3;z7$xf|=oDUxgD_wK)L zb68#1ZO-cDT8}l&W2WRjmC}=W^-wwN*_^MFZt2g=xan+O=;?BNefp!B6DF<_s5!DN zNafc#Ce<&2ZyMS2x8%I@KEa=1A^OXY)pBkn!;Z40`!&lYzq%~wWVls(-gl1Wj*Fb< zlTseDuqQt-Fq`s*Il?e$#-*QE*y1PFnk8*NQYN#LecO5k#qXIe+O7iDxhsVGt~9&$ z->^@AqQ+~WpDLzp$UUh$eYv=ps+o~nLJsM9G@4t!-%F5T` z-k$x_|Dh;LL6^bVuM4kl3Aismr*lS}vAqpn3l|CfG$YrA&&+lQaed{R(aYtd4{ z>$~n*_=3dgd-WxEd@&2DnA($UUh_ubONqvo<_Mj|HW^DKS3LRt z3pKZ1Id!~lyRPJUOQAIu?myW2Km1V86!7wapm{iotx(TQ=3{B7qRk+ zuS9QD+==+f`x+kj)XLsan4WUA{hfKCkEYNmaoe>0cN8P%_$`T7XueVU-YshV({G+Mck&oZ+`&n$n?km3h|KeL| zj~n{F{y+QkKKJ|JrGFKJcU5ZKZ(DVljoZ`Xmb%OSuV({gExs?D-odm^V_IPMjJb9a zmL+n3TKv}UD3gEi>;ThCkqvjE%&UEptABO%dv(_r-(R?J)lWNB3B$(|mG@T{iHGf< zayYhzy$Iiw3^}lS;G0$7$F|*T8#Pf|_n1aTq zK+lDW=I17S)az1CcyiDvbNZr<3mF1EqdTfM3UpgPH|1ExbmVF5rFUMhch1=LXU4yn zx0lrOojnhn{*&QQ%%WTLrL1z}->cPG+gQFZPVi~IVRLHtoj2Z7B#Yy9%Kgvo_gTa9 zm*>#?O9~m!4ha2v=`rcl4xeqi&!+wT^|!%*#@LP Z8}goB0i*-GS=m6E8G$eXNUJh|cmToAF(3c{ literal 0 HcmV?d00001 diff --git a/catalog-be/src/main/resources/import/tosca/nfv-types/vduCpd/vduCpd.json b/catalog-be/src/main/resources/import/tosca/nfv-types/vduCpd/vduCpd.json new file mode 100644 index 0000000000..f8d2254472 --- /dev/null +++ b/catalog-be/src/main/resources/import/tosca/nfv-types/vduCpd/vduCpd.json @@ -0,0 +1,15 @@ +{ + "payloadName": "vduCpd.yml", + "contactId": "jh0003", + "name": "VDU Cpd", + "description": "VDU Cpd", + "resourceIconPath": "port", + "resourceType": "CP", + "categories": [{ + "name": "Generic", + "subcategories": [{ + "name": "Network Elements" + }] + }], + "tags": ["VDU Cpd"] +} \ No newline at end of file diff --git a/catalog-be/src/main/resources/import/tosca/nfv-types/vduCpd/vduCpd.yml b/catalog-be/src/main/resources/import/tosca/nfv-types/vduCpd/vduCpd.yml new file mode 100644 index 0000000000..673e923182 --- /dev/null +++ b/catalog-be/src/main/resources/import/tosca/nfv-types/vduCpd/vduCpd.yml @@ -0,0 +1,57 @@ +#NOT SPEC COMPLAINT!!!!!!!!!!!!!!!!!!!!!! +tosca_definitions_version: tosca_simple_yaml_1_0_0 +node_types: + tosca.nodes.nfv.VduCpd: + derived_from: tosca.nodes.Root + properties: + virtual_network_interface_requirements: + type: list + required: false + status: SUPPORTED + entry_schema: + type: tosca.datatypes.nfv.VirtualNetworkInterfaceRequirements + role: + type: string + required: false + status: SUPPORTED + constraints: + - valid_values: + - root + - leaf + bitrate_requirement: + type: integer + required: false + status: SUPPORTED + description: + type: string + required: false + status: SUPPORTED + layer_protocol: + type: string + required: true + status: SUPPORTED + constraints: + - valid_values: + - ethernet + - mpls + - odu2 + - ipv4 + - ipv6 + - pseudo_wire + address_data: + type: list + required: false + status: SUPPORTED + entry_schema: + type: tosca.datatype.nfv.AddressData + requirements: + - virtual_binding: + capability: tosca.capabilities.nfv.VirtualBindable + occurrences: + - 0 + - UNBOUNDED + - virtual_link: + capability: tosca.capabilities.nfv.VirtualLinkable + occurrences: + - 0 + - UNBOUNDED \ No newline at end of file diff --git a/catalog-be/src/main/resources/import/tosca/nfv-types/vduCpd/vduCpd.zip b/catalog-be/src/main/resources/import/tosca/nfv-types/vduCpd/vduCpd.zip new file mode 100644 index 0000000000000000000000000000000000000000..e1bb32dd231ef0893ab2c6784ba4300f30370696 GIT binary patch literal 554 zcmWIWW@h1HU|`^2c-xTU^I~pI-xfv&hFPo(3?R|6lv3w{6urvaoTHNu=G`{nX?tJE z#cQqZ(VobD|JIUrrn$mPPOfWGx~Ll%`AOqe>;1Z-w-#X=4o}Ek!PoYo``6z<75nG2 z_g37xxBf`h=i1*DzbCx6|66wU2K(A2jZCseRpKekB9GLB{{|k|v`Ha4G^$d0dXZ)E zy@n^-nkJlek>C1a%Z38i%|8-fg{JNjR^$;dOGt6tcV^Owx!?cD1x;MvAW^+J&(tGE zTU++S?B(H|eT`g89fkg^nYe)Ecyb9#hsw+i5*1V0942=<-DFrS7f~o{^s(edp84*- zf2(Xdr(HRM+{&^vL?k&Ch{AThq+oy*)i_8;cYEDG&IKu1mV%~qIh~q(q znm+TA^rTWRp7^m=(dY9FcdqlD367%81xGTDo@9<^Di5t-+cnEVELJ!yw)^kn?Hg9H zPTJUiBRl{9jX5j->A&as!z5B|F8G+E)#byof0H;OOyl)i^E(4rSM*NL7p%W9)sRK; z#5zO!0=av~A8t#Jbk8;W`7|Z$`QsG%i!&ppY+fHW)oPJzp8vhYO)q!cJ-Yf;#(B+( zwb@DqQj>n^sQ-4Z+iv;fwc>8$HrMY}yoZzbl$##b5AbGW5&_2}_SgkRFc2sxfGMQ7 V4)A7W1Bo#Lp#_k>156PN3;=oD@PPmT literal 0 HcmV?d00001 diff --git a/catalog-be/src/main/resources/import/tosca/nfv-types/vduVirtualStorage/vduVirtualStorage.json b/catalog-be/src/main/resources/import/tosca/nfv-types/vduVirtualStorage/vduVirtualStorage.json new file mode 100644 index 0000000000..7dab2ece94 --- /dev/null +++ b/catalog-be/src/main/resources/import/tosca/nfv-types/vduVirtualStorage/vduVirtualStorage.json @@ -0,0 +1,15 @@ +{ + "payloadName": "vduVirtualStorage.yml", + "contactId": "jh0003", + "name": "VDU VirtualStorage", + "description": "VDU VirtualStorage", + "resourceIconPath": "objectStorage", + "resourceType": "VFC", + "categories": [{ + "name": "Generic", + "subcategories": [{ + "name": "Infrastructure" + }] + }], + "tags": ["VDU VirtualStorage"] +} \ No newline at end of file diff --git a/catalog-be/src/main/resources/import/tosca/nfv-types/vduVirtualStorage/vduVirtualStorage.yml b/catalog-be/src/main/resources/import/tosca/nfv-types/vduVirtualStorage/vduVirtualStorage.yml new file mode 100644 index 0000000000..5d22e1e6d4 --- /dev/null +++ b/catalog-be/src/main/resources/import/tosca/nfv-types/vduVirtualStorage/vduVirtualStorage.yml @@ -0,0 +1,27 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +node_types: + tosca.nodes.nfv.VDU.VirtualStorage: + derived_from: tosca.nodes.Root + properties: + id: + type: string + required: true + status: SUPPORTED + size_of_storage: + type: string + required: true + status: SUPPORTED + rdma_enabled: + type: boolean + required: false + status: SUPPORTED + type_of_storage: + type: string + required: true + status: SUPPORTED + capabilities: + virtual_storage: + type: tosca.capabilities.nfv.VirtualStorage + occurrences: + - 1 + - UNBOUNDED diff --git a/catalog-be/src/main/resources/import/tosca/nfv-types/vduVirtualStorage/vduVirtualStorage.zip b/catalog-be/src/main/resources/import/tosca/nfv-types/vduVirtualStorage/vduVirtualStorage.zip new file mode 100644 index 0000000000000000000000000000000000000000..fb92ab45d9e1b9398c3403bc792b949e1d9a2821 GIT binary patch literal 421 zcmWIWW@Zs#U|`^2NUk&T{RH`QEH*k({5%s~wT*$KzRqcioKFc$z6kmC>GZWYl{1qZQx$k^q|YY^FK3HKoayC(q>z27IwD&HR-zY8U{X#CHJmc^Cdl#SX zZ`y8=aCqAL|FvGMc6Q~t?~4sX|F8XayKl?e6<+J+{uQ@*`g-@ydp7y6eMN<983Mc+ znd}*Gg_H^~tUy2kOyUSPE~qpkg9HPEC6k;Oab2w5%cTO#kBm9XvM_74>T z7yjQlc$o7==w5e^qy5vgs#>p>6;{995G0wlUnPCzlzZzANOSCYz#6Gz(SBz74+kB0 zakZ6uQ_Bx$RNSMuqml(k-=p~7=3uk | --scheme=, default http] [-i | --ip=] [-p | --port= ] [-f | --ifile= ] # +# # +# shortest activation (be host = localhost, be port = 8080): # +# python importUsers.py [-f | --ifile= ] # +# # +##################################################################################################################################################################################################### + +def importNfvTypes(scheme, beHost, bePort, adminUser, fileDir, updateversion): + + nfvTypes = [ "underlayVpn", + "overlayTunnel", + "genericNeutronNet", + "allottedResource", + "extImageFile", + "extLocalStorage", + "extZteCP", + "extZteVDU", + "extZteVL", + "NSD", + "VDU", + "vduCompute", + "vduCpd", + "vduVirtualStorage", + "vnfVirtualLinkDesc" + ] + + responseCodes = [200, 201] + + if(updateversion == 'false'): + responseCodes = [200, 201, 409] + + results = [] + for nfvType in nfvTypes: + result = createNormativeType(scheme, beHost, bePort, adminUser, fileDir, nfvType, updateversion) + results.append(result) + if ( result[1] == None or result[1] not in responseCodes) : + print "Failed creating heat type " + nfvType + ". " + str(result[1]) + return results + + +def main(argv): + print 'Number of arguments:', len(sys.argv), 'arguments.' + + beHost = 'localhost' + bePort = '8080' + adminUser = 'jh0003' + updateversion = 'true' + scheme = 'http' + + try: + opts, args = getopt.getopt(argv,"i:p:u:v:h:",["ip=","port=","user=","updateversion="]) + except getopt.GetoptError: + usage() + errorAndExit(2, 'Invalid input') + + for opt, arg in opts: + #print opt, arg + if opt == '-h': + usage() + sys.exit(3) + elif opt in ("-i", "--ip"): + beHost = arg + elif opt in ("-p", "--port"): + bePort = arg + elif opt in ("-u", "--user"): + adminUser = arg + elif opt in ("-s", "--scheme"): + scheme = arg + elif opt in ("-v", "--updateversion"): + if (arg.lower() == "false" or arg.lower() == "no"): + updateversion = 'false' + + print 'scheme =',scheme,',be host =',beHost,', be port =', bePort,', user =', adminUser + + if ( beHost == None ): + usage() + sys.exit(3) + + results = importNfvTypes(scheme, beHost, bePort, adminUser, "../../../import/tosca/nfv-types/", updateversion) + + print "-----------------------------" + for result in results: + print "{0:20} | {1:6}".format(result[0], result[1]) + print "-----------------------------" + + responseCodes = [200, 201] + + if(updateversion == 'false'): + responseCodes = [200, 201, 409] + + failedNormatives = filter(lambda x: x[1] == None or x[1] not in responseCodes, results) + if (len(failedNormatives) > 0): + errorAndExit(1, None) + else: + errorAndExit(0, None) + + +if __name__ == "__main__": + main(sys.argv[1:]) diff --git a/catalog-be/src/main/resources/scripts/import/tosca/importNormativeTypes.py b/catalog-be/src/main/resources/scripts/import/tosca/importNormativeTypes.py index df2cd49687..5b7b52d0a1 100644 --- a/catalog-be/src/main/resources/scripts/import/tosca/importNormativeTypes.py +++ b/catalog-be/src/main/resources/scripts/import/tosca/importNormativeTypes.py @@ -87,7 +87,7 @@ def usage(): def importNormativeTypes(scheme, beHost, bePort, adminUser, fileDir, updateversion): - normativeTypes = [ "root", "compute", "softwareComponent", "webServer", "webApplication", "DBMS", "database", "objectStorage", "blockStorage", "containerRuntime", "containerApplication", "loadBalancer", "port", "network", "allottedResource"] + normativeTypes = [ "root", "compute", "softwareComponent", "webServer", "webApplication", "DBMS", "database", "objectStorage", "blockStorage", "containerRuntime", "containerApplication", "loadBalancer", "port", "network"] #normativeTypes = [ "root" ] responseCodes = [200, 201] diff --git a/catalog-be/src/main/resources/scripts/import/tosca/importONAPNormativeAll.py b/catalog-be/src/main/resources/scripts/import/tosca/importONAPNormativeAll.py index eb55bf84bc..6144d69104 100644 --- a/catalog-be/src/main/resources/scripts/import/tosca/importONAPNormativeAll.py +++ b/catalog-be/src/main/resources/scripts/import/tosca/importONAPNormativeAll.py @@ -8,7 +8,9 @@ import time from importNormativeElements import * from importNormativeTypes import importNormativeTypes from importHeatTypes import importHeatTypes +from importNfvTypes import importNfvTypes from importOnapTypes import importOnapTypes +from importSolTypes import importSolTypes from importNormativeCapabilities import importNormativeCapabilities from importCategoryTypes import importCategories from importNormativeInterfaceLifecycleTypes import importNormativeInterfaceLifecycleType @@ -125,11 +127,19 @@ def main(argv): fileLocation = baseFileLocation + "heat-types/" resultsHeat = importHeatTypes(scheme, beHost, bePort, adminUser, fileLocation, updateversion) handleResults(resultsHeat, updateversion) - + + fileLocation = baseFileLocation + "nfv-types/" + resultsHeat = importNfvTypes(scheme, beHost, bePort, adminUser, fileLocation, updateversion) + handleResults(resultsHeat, updateversion) + fileLocation = baseFileLocation + "onap-types/" resultsHeat = importOnapTypes(scheme, beHost, bePort, adminUser, fileLocation, updateversion) handleResults(resultsHeat, updateversion) - + + fileLocation = baseFileLocation + "sol-types/" + resultsHeat = importSolTypes(scheme, beHost, bePort, adminUser, fileLocation, updateversion) + handleResults(resultsHeat, updateversion) + fileLocation = baseFileLocation + "group-types/" importGroupTypes(scheme, beHost, bePort, adminUser, False, fileLocation) @@ -139,5 +149,5 @@ def main(argv): errorAndExit(0, None) if __name__ == "__main__": - main(sys.argv[1:]) + main(sys.argv[1:]) diff --git a/catalog-be/src/main/resources/scripts/import/tosca/importOnapTypes.py b/catalog-be/src/main/resources/scripts/import/tosca/importOnapTypes.py index faad226d39..f703b4b4ac 100644 --- a/catalog-be/src/main/resources/scripts/import/tosca/importOnapTypes.py +++ b/catalog-be/src/main/resources/scripts/import/tosca/importOnapTypes.py @@ -20,19 +20,9 @@ import importCommon ##################################################################################################################################################################################################### def importOnapTypes(scheme, beHost, bePort, adminUser, fileDir, updateversion): - - onapTypes = [ "extImageFile", - "extLocalStorage", - "extZteCP", - "extZteVDU", - "extZteVL", - "NSD", - "VDU", - "vduCompute", - "vduCpd", - "vduVirtualStorage", - "vnfVirtualLinkDesc" - ] + + #Add desired type names to the list + onapTypes = [] responseCodes = [200, 201] diff --git a/catalog-be/src/main/resources/scripts/import/tosca/importSolTypes.py b/catalog-be/src/main/resources/scripts/import/tosca/importSolTypes.py new file mode 100644 index 0000000000..0015a26655 --- /dev/null +++ b/catalog-be/src/main/resources/scripts/import/tosca/importSolTypes.py @@ -0,0 +1,99 @@ +import pycurl +import sys, getopt +from StringIO import StringIO +import json +import copy +from importCommon import * +from importNormativeTypes import * +import importCommon + +##################################################################################################################################################################################################### +# # +# Import Sol Types from a given file # +# # +# activation : # +# python importSolTypes.py [optional -s | --scheme=, default http] [-i | --ip=] [-p | --port= ] [-f | --ifile= ] # +# # +# shortest activation (be host = localhost, be port = 8080): # +# python importUsers.py [-f | --ifile= ] # +# # +##################################################################################################################################################################################################### + +def importSolTypes(scheme, beHost, bePort, adminUser, fileDir, updateversion): + + #Add desired type names to the list + solTypes = [] + + responseCodes = [200, 201] + + if(updateversion == 'false'): + responseCodes = [200, 201, 409] + + results = [] + for onapType in solTypes: + result = createNormativeType(scheme, beHost, bePort, adminUser, fileDir, onapType, updateversion) + results.append(result) + if ( result[1] == None or result[1] not in responseCodes) : + print "Failed creating heat type " + onapType + ". " + str(result[1]) + return results + + +def main(argv): + print 'Number of arguments:', len(sys.argv), 'arguments.' + + beHost = 'localhost' + bePort = '8080' + adminUser = 'jh0003' + updateversion = 'true' + scheme = 'http' + + try: + opts, args = getopt.getopt(argv,"i:p:u:v:h:",["ip=","port=","user=","updateversion="]) + except getopt.GetoptError: + usage() + errorAndExit(2, 'Invalid input') + + for opt, arg in opts: + #print opt, arg + if opt == '-h': + usage() + sys.exit(3) + elif opt in ("-i", "--ip"): + beHost = arg + elif opt in ("-p", "--port"): + bePort = arg + elif opt in ("-u", "--user"): + adminUser = arg + elif opt in ("-s", "--scheme"): + scheme = arg + elif opt in ("-v", "--updateversion"): + if (arg.lower() == "false" or arg.lower() == "no"): + updateversion = 'false' + + print 'scheme =',scheme,',be host =',beHost,', be port =', bePort,', user =', adminUser + + if ( beHost == None ): + usage() + sys.exit(3) + + results = importSolTypes(scheme, beHost, bePort, adminUser, "../../../import/tosca/sol-types/", updateversion) + + print "-----------------------------" + for result in results: + print "{0:20} | {1:6}".format(result[0], result[1]) + print "-----------------------------" + + responseCodes = [200, 201] + + if(updateversion == 'false'): + responseCodes = [200, 201, 409] + + failedNormatives = filter(lambda x: x[1] == None or x[1] not in responseCodes, results) + if (len(failedNormatives) > 0): + errorAndExit(1, None) + else: + errorAndExit(0, None) + + +if __name__ == "__main__": + main(sys.argv[1:]) diff --git a/catalog-be/src/main/resources/scripts/import/tosca/onapTypesToUpgrade.json b/catalog-be/src/main/resources/scripts/import/tosca/onapTypesToUpgrade.json index 6045ddd6ff..9101291fc9 100644 --- a/catalog-be/src/main/resources/scripts/import/tosca/onapTypesToUpgrade.json +++ b/catalog-be/src/main/resources/scripts/import/tosca/onapTypesToUpgrade.json @@ -1,4 +1,8 @@ { + "nfv": [ + ], "onap": [ + ], + "sol":[ ] } \ No newline at end of file diff --git a/catalog-be/src/main/resources/scripts/import/tosca/upgradeNfvTypes.py b/catalog-be/src/main/resources/scripts/import/tosca/upgradeNfvTypes.py new file mode 100644 index 0000000000..66d82f9e91 --- /dev/null +++ b/catalog-be/src/main/resources/scripts/import/tosca/upgradeNfvTypes.py @@ -0,0 +1,104 @@ +import pycurl +import sys, getopt +from StringIO import StringIO +import json +import copy +from importCommon import * +from importNormativeTypes import * +import importCommon +import json + + +################################################################################################################################################################################################ +# # +# Upgrades all Heat and Normative types confiugred in "typesToUpgrade.json" file # +# # +# activation # +# python upgradeHeatAndNormativeTypes.py [-s | --scheme= ] [-i | --ip=] [-p | --port= ] [-f | --ifile= ] # +# # +# shortest activation (be host = localhost, be port = 8080): # +# python upgradeHeatAndNormativeTypes.py [-f | --ifile= ] # +# # +################################################################################################################################################################################################ +def upgradeNfvTypesPerConfigFile(scheme, beHost, bePort, adminUser, baseDir, updateversion): + responseCodes = [200, 201] + if (updateversion == 'false'): + responseCodes = [200, 201, 409] + with open("onapTypesToUpgrade.json", 'r') as stream: + try: + types = json.load(stream) + nfvTypes = types["nfv"] + debug(nfvTypes) + nfvFileDir = baseDir + "nfv-types/" + debug(nfvFileDir) + results = [] + for nfvType in nfvTypes: + result = createNormativeType(scheme, beHost, bePort, adminUser, nfvFileDir, nfvType.encode('ascii', 'ignore'), updateversion) + results.append(result) + if (result[1] == None or result[1] not in responseCodes): + print "Failed creating nfv type " + nfvType + ". " + str(result[1]) + except yaml.YAMLError as exc: + print(exc) + + + +def main(argv): + print 'Number of arguments:', len(sys.argv), 'arguments.' + + beHost = 'localhost' + bePort = '8080' + adminUser = 'jh0003' + updateversion = 'true' + scheme = 'http' + + try: + opts, args = getopt.getopt(argv, "i:p:u:v:h:s:", ["ip=", "port=", "user=", "updateversion=","scheme="]) + except getopt.GetoptError: + usage() + errorAndExit(2, 'Invalid input') + + for opt, arg in opts: + # print opt, arg + if opt == '-h': + usage() + sys.exit(3) + elif opt in ("-i", "--ip"): + beHost = arg + elif opt in ("-p", "--port"): + bePort = arg + elif opt in ("-u", "--user"): + adminUser = arg + elif opt in ("-s", "--scheme"): + scheme = arg + elif opt in ("-v", "--updateversion"): + if (arg.lower() == "false" or arg.lower() == "no"): + updateversion = 'false' + + print 'scheme =',scheme,', be host =',beHost, ', be port =', bePort, ', user =', adminUser + + if (beHost == None): + usage() + sys.exit(3) + + results = upgradeNfvTypesPerConfigFile(scheme, beHost, bePort, adminUser, "../../../import/tosca/", updateversion) + + print "-----------------------------" + for result in results: + print "{0:20} | {1:6}".format(result[0], result[1]) + print "-----------------------------" + + responseCodes = [200, 201] + + if (updateversion == 'false'): + responseCodes = [200, 201, 409] + + failedNormatives = filter(lambda x: x[1] == None or x[1] not in responseCodes, results) + if (len(failedNormatives) > 0): + errorAndExit(1, None) + else: + errorAndExit(0, None) + + +if __name__ == "__main__": + main(sys.argv[1:]) + diff --git a/catalog-be/src/main/resources/scripts/import/tosca/upgradeONAPNormative.py b/catalog-be/src/main/resources/scripts/import/tosca/upgradeONAPNormative.py index 21a477503c..5c57762c61 100644 --- a/catalog-be/src/main/resources/scripts/import/tosca/upgradeONAPNormative.py +++ b/catalog-be/src/main/resources/scripts/import/tosca/upgradeONAPNormative.py @@ -11,7 +11,9 @@ from importPolicyTypes import importPolicyTypes from importGroupTypes import importGroupTypes from importNormativeCapabilities import importNormativeCapabilities from importNormativeInterfaceLifecycleTypes import importNormativeInterfaceLifecycleType +from upgradeNfvTypes import upgradeNfvTypesPerConfigFile from upgradeONAPTypes import upgradeOnapTypesPerConfigFile +from upgradeSolTypes import upgradeSolTypesPerConfigFile from importCommon import * @@ -119,10 +121,16 @@ def main(argv): resultsHeat = upgradeTypesPerConfigFile(scheme, beHost, bePort, adminUser, baseFileLocation, updateversion) handleResults(resultsHeat) - + + resultsHeat = upgradeNfvTypesPerConfigFile(scheme, beHost, bePort, adminUser, baseFileLocation, updateOnapVersion) + handleResults(resultsHeat) + resultsHeat = upgradeOnapTypesPerConfigFile(scheme, beHost, bePort, adminUser, baseFileLocation, updateOnapVersion) handleResults(resultsHeat) - + + resultsHeat = upgradeSolTypesPerConfigFile(scheme, beHost, bePort, adminUser, baseFileLocation, updateOnapVersion) + handleResults(resultsHeat) + errorAndExit(0, None) if __name__ == "__main__": diff --git a/catalog-be/src/main/resources/scripts/import/tosca/upgradeSolTypes.py b/catalog-be/src/main/resources/scripts/import/tosca/upgradeSolTypes.py new file mode 100644 index 0000000000..25d9b4d1fc --- /dev/null +++ b/catalog-be/src/main/resources/scripts/import/tosca/upgradeSolTypes.py @@ -0,0 +1,104 @@ +import pycurl +import sys, getopt +from StringIO import StringIO +import json +import copy +from importCommon import * +from importNormativeTypes import * +import importCommon +import json + + +################################################################################################################################################################################################ +# # +# Upgrades all Heat and Normative types confiugred in "typesToUpgrade.json" file # +# # +# activation # +# python upgradeHeatAndNormativeTypes.py [-s | --scheme= ] [-i | --ip=] [-p | --port= ] [-f | --ifile= ] # +# # +# shortest activation (be host = localhost, be port = 8080): # +# python upgradeHeatAndNormativeTypes.py [-f | --ifile= ] # +# # +################################################################################################################################################################################################ +def upgradeSolTypesPerConfigFile(scheme, beHost, bePort, adminUser, baseDir, updateversion): + responseCodes = [200, 201] + if (updateversion == 'false'): + responseCodes = [200, 201, 409] + with open("onapTypesToUpgrade.json", 'r') as stream: + try: + types = json.load(stream) + solTypes = types["sol"] + debug(solTypes) + solFileDir = baseDir + "sol-types/" + debug(solFileDir) + results = [] + for solType in solTypes: + result = createNormativeType(scheme, beHost, bePort, adminUser, solFileDir, solType.encode('ascii', 'ignore'), updateversion) + results.append(result) + if (result[1] == None or result[1] not in responseCodes): + print "Failed creating sol type " + solType + ". " + str(result[1]) + except yaml.YAMLError as exc: + print(exc) + + + +def main(argv): + print 'Number of arguments:', len(sys.argv), 'arguments.' + + beHost = 'localhost' + bePort = '8080' + adminUser = 'jh0003' + updateversion = 'true' + scheme = 'http' + + try: + opts, args = getopt.getopt(argv, "i:p:u:v:h:s:", ["ip=", "port=", "user=", "updateversion=","scheme="]) + except getopt.GetoptError: + usage() + errorAndExit(2, 'Invalid input') + + for opt, arg in opts: + # print opt, arg + if opt == '-h': + usage() + sys.exit(3) + elif opt in ("-i", "--ip"): + beHost = arg + elif opt in ("-p", "--port"): + bePort = arg + elif opt in ("-u", "--user"): + adminUser = arg + elif opt in ("-s", "--scheme"): + scheme = arg + elif opt in ("-v", "--updateversion"): + if (arg.lower() == "false" or arg.lower() == "no"): + updateversion = 'false' + + print 'scheme =',scheme,', be host =',beHost, ', be port =', bePort, ', user =', adminUser + + if (beHost == None): + usage() + sys.exit(3) + + results = upgradeSolTypesPerConfigFile(scheme, beHost, bePort, adminUser, "../../../import/tosca/", updateversion) + + print "-----------------------------" + for result in results: + print "{0:20} | {1:6}".format(result[0], result[1]) + print "-----------------------------" + + responseCodes = [200, 201] + + if (updateversion == 'false'): + responseCodes = [200, 201, 409] + + failedNormatives = filter(lambda x: x[1] == None or x[1] not in responseCodes, results) + if (len(failedNormatives) > 0): + errorAndExit(1, None) + else: + errorAndExit(0, None) + + +if __name__ == "__main__": + main(sys.argv[1:]) + -- 2.16.6