Normative alignemet 59/36859/2
authorGitelman, Tal (tg851x) <tg851x@intl.att.com>
Mon, 19 Mar 2018 23:04:54 +0000 (01:04 +0200)
committerMichael Lando <ml636r@att.com>
Mon, 19 Mar 2018 23:09:14 +0000 (23:09 +0000)
Change-Id: I6115e20fe95662153903873d19439bc7cf0c2ff1
Issue-ID: SDC-1104
Signed-off-by: Gitelman, Tal (tg851x) <tg851x@intl.att.com>
54 files changed:
catalog-be/src/main/resources/import/tosca/nfv-types/NSD/NSD.json [new file with mode: 0644]
catalog-be/src/main/resources/import/tosca/nfv-types/NSD/NSD.yml [new file with mode: 0644]
catalog-be/src/main/resources/import/tosca/nfv-types/NSD/NSD.zip [new file with mode: 0644]
catalog-be/src/main/resources/import/tosca/nfv-types/VDU/VDU.json [new file with mode: 0644]
catalog-be/src/main/resources/import/tosca/nfv-types/VDU/VDU.yml [new file with mode: 0644]
catalog-be/src/main/resources/import/tosca/nfv-types/VDU/VDU.zip [new file with mode: 0644]
catalog-be/src/main/resources/import/tosca/nfv-types/allottedResource/allottedResource.json [moved from catalog-be/src/main/resources/import/tosca/normative-types/allottedResource/allottedResource.json with 100% similarity]
catalog-be/src/main/resources/import/tosca/nfv-types/allottedResource/allottedResource.yml [moved from catalog-be/src/main/resources/import/tosca/normative-types/allottedResource/allottedResource.yml with 100% similarity]
catalog-be/src/main/resources/import/tosca/nfv-types/allottedResource/allottedResource.zip [moved from catalog-be/src/main/resources/import/tosca/normative-types/allottedResource/allottedResource.zip with 100% similarity]
catalog-be/src/main/resources/import/tosca/nfv-types/extImageFile/extImageFile.json [new file with mode: 0644]
catalog-be/src/main/resources/import/tosca/nfv-types/extImageFile/extImageFile.yml [new file with mode: 0644]
catalog-be/src/main/resources/import/tosca/nfv-types/extImageFile/extImageFile.zip [new file with mode: 0644]
catalog-be/src/main/resources/import/tosca/nfv-types/extLocalStorage/extLocalStorage.json [new file with mode: 0644]
catalog-be/src/main/resources/import/tosca/nfv-types/extLocalStorage/extLocalStorage.yml [new file with mode: 0644]
catalog-be/src/main/resources/import/tosca/nfv-types/extLocalStorage/extLocalStorage.zip [new file with mode: 0644]
catalog-be/src/main/resources/import/tosca/nfv-types/extZteCP/extZteCP.json [new file with mode: 0644]
catalog-be/src/main/resources/import/tosca/nfv-types/extZteCP/extZteCP.yml [new file with mode: 0644]
catalog-be/src/main/resources/import/tosca/nfv-types/extZteCP/extZteCP.zip [new file with mode: 0644]
catalog-be/src/main/resources/import/tosca/nfv-types/extZteVDU/extZteVDU.json [new file with mode: 0644]
catalog-be/src/main/resources/import/tosca/nfv-types/extZteVDU/extZteVDU.yml [new file with mode: 0644]
catalog-be/src/main/resources/import/tosca/nfv-types/extZteVDU/extZteVDU.zip [new file with mode: 0644]
catalog-be/src/main/resources/import/tosca/nfv-types/extZteVL/extZteVL.json [new file with mode: 0644]
catalog-be/src/main/resources/import/tosca/nfv-types/extZteVL/extZteVL.yml [new file with mode: 0644]
catalog-be/src/main/resources/import/tosca/nfv-types/extZteVL/extZteVL.zip [new file with mode: 0644]
catalog-be/src/main/resources/import/tosca/nfv-types/genericNeutronNet/genericNeutronNet.json [moved from catalog-be/src/main/resources/import/tosca/heat-types/genericNeutronNet/genericNeutronNet.json with 100% similarity]
catalog-be/src/main/resources/import/tosca/nfv-types/genericNeutronNet/genericNeutronNet.yml [moved from catalog-be/src/main/resources/import/tosca/heat-types/genericNeutronNet/genericNeutronNet.yml with 100% similarity]
catalog-be/src/main/resources/import/tosca/nfv-types/genericNeutronNet/genericNeutronNet.zip [moved from catalog-be/src/main/resources/import/tosca/heat-types/genericNeutronNet/genericNeutronNet.zip with 100% similarity]
catalog-be/src/main/resources/import/tosca/nfv-types/overlayTunnel/overlayTunnel.json [moved from catalog-be/src/main/resources/import/tosca/heat-types/overlayTunnel/overlayTunnel.json with 100% similarity]
catalog-be/src/main/resources/import/tosca/nfv-types/overlayTunnel/overlayTunnel.yml [moved from catalog-be/src/main/resources/import/tosca/heat-types/overlayTunnel/overlayTunnel.yml with 100% similarity]
catalog-be/src/main/resources/import/tosca/nfv-types/overlayTunnel/overlayTunnel.zip [moved from catalog-be/src/main/resources/import/tosca/heat-types/overlayTunnel/overlayTunnel.zip with 100% similarity]
catalog-be/src/main/resources/import/tosca/nfv-types/underlayVpn/underlayVpn.json [moved from catalog-be/src/main/resources/import/tosca/heat-types/underlayVpn/underlayVpn.json with 100% similarity]
catalog-be/src/main/resources/import/tosca/nfv-types/underlayVpn/underlayVpn.yml [moved from catalog-be/src/main/resources/import/tosca/heat-types/underlayVpn/underlayVpn.yml with 100% similarity]
catalog-be/src/main/resources/import/tosca/nfv-types/underlayVpn/underlayVpn.zip [moved from catalog-be/src/main/resources/import/tosca/heat-types/underlayVpn/underlayVpn.zip with 100% similarity]
catalog-be/src/main/resources/import/tosca/nfv-types/vduCompute/vduCompute.json [new file with mode: 0644]
catalog-be/src/main/resources/import/tosca/nfv-types/vduCompute/vduCompute.yml [new file with mode: 0644]
catalog-be/src/main/resources/import/tosca/nfv-types/vduCompute/vduCompute.zip [new file with mode: 0644]
catalog-be/src/main/resources/import/tosca/nfv-types/vduCpd/vduCpd.json [new file with mode: 0644]
catalog-be/src/main/resources/import/tosca/nfv-types/vduCpd/vduCpd.yml [new file with mode: 0644]
catalog-be/src/main/resources/import/tosca/nfv-types/vduCpd/vduCpd.zip [new file with mode: 0644]
catalog-be/src/main/resources/import/tosca/nfv-types/vduVirtualStorage/vduVirtualStorage.json [new file with mode: 0644]
catalog-be/src/main/resources/import/tosca/nfv-types/vduVirtualStorage/vduVirtualStorage.yml [new file with mode: 0644]
catalog-be/src/main/resources/import/tosca/nfv-types/vduVirtualStorage/vduVirtualStorage.zip [new file with mode: 0644]
catalog-be/src/main/resources/import/tosca/nfv-types/vnfVirtualLinkDesc/vnfVirtualLinkDesc.json [new file with mode: 0644]
catalog-be/src/main/resources/import/tosca/nfv-types/vnfVirtualLinkDesc/vnfVirtualLinkDesc.yml [new file with mode: 0644]
catalog-be/src/main/resources/import/tosca/nfv-types/vnfVirtualLinkDesc/vnfVirtualLinkDesc.zip [new file with mode: 0644]
catalog-be/src/main/resources/scripts/import/tosca/importNfvTypes.py [new file with mode: 0644]
catalog-be/src/main/resources/scripts/import/tosca/importNormativeTypes.py
catalog-be/src/main/resources/scripts/import/tosca/importONAPNormativeAll.py
catalog-be/src/main/resources/scripts/import/tosca/importOnapTypes.py
catalog-be/src/main/resources/scripts/import/tosca/importSolTypes.py [new file with mode: 0644]
catalog-be/src/main/resources/scripts/import/tosca/onapTypesToUpgrade.json
catalog-be/src/main/resources/scripts/import/tosca/upgradeNfvTypes.py [new file with mode: 0644]
catalog-be/src/main/resources/scripts/import/tosca/upgradeONAPNormative.py
catalog-be/src/main/resources/scripts/import/tosca/upgradeSolTypes.py [new file with mode: 0644]

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 (file)
index 0000000..22788ec
--- /dev/null
@@ -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 (file)
index 0000000..1b3d882
--- /dev/null
@@ -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 (file)
index 0000000..d741b50
Binary files /dev/null and b/catalog-be/src/main/resources/import/tosca/nfv-types/NSD/NSD.zip differ
diff --git a/catalog-be/src/main/resources/import/tosca/nfv-types/VDU/VDU.json b/catalog-be/src/main/resources/import/tosca/nfv-types/VDU/VDU.json
new file mode 100644 (file)
index 0000000..5d721d4
--- /dev/null
@@ -0,0 +1,15 @@
+{
+       "payloadName": "VDU.yml",
+       "contactId": "jh0003",
+       "name": "VDU",
+       "description": "VDU",
+       "resourceIconPath": "compute",
+       "resourceType": "VFC",
+       "categories": [{
+               "name": "Generic",
+               "subcategories": [{
+                       "name": "Infrastructure"
+               }]
+       }],
+       "tags": ["VDU"]
+}
\ No newline at end of file
diff --git a/catalog-be/src/main/resources/import/tosca/nfv-types/VDU/VDU.yml b/catalog-be/src/main/resources/import/tosca/nfv-types/VDU/VDU.yml
new file mode 100644 (file)
index 0000000..541126f
--- /dev/null
@@ -0,0 +1,22 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types:
+  tosca.nodes.nfv.VDU:
+    derived_from: tosca.nodes.SoftwareComponent
+    capabilities:
+#Not found in any spec
+#      high_availability:
+#        type: nfv.capabilities.HA
+      Virtualbinding:
+        type: tosca.capabilities.nfv.VirtualBindable
+#      monitoring_parameter:
+#        type: nfv.capabilities.Metric
+    requirements:
+#Not found in any spec
+#      - high_availability:
+#        capability: nfv.capabilities.HA
+#        relationship: nfv.relationships.HA
+#        occurrences: [ 0, 1 ]
+      - host:
+          capability: tosca.capabilities.Container
+          node: tosca.nodes.Compute
+          relationship: tosca.relationships.HostedOn
diff --git a/catalog-be/src/main/resources/import/tosca/nfv-types/VDU/VDU.zip b/catalog-be/src/main/resources/import/tosca/nfv-types/VDU/VDU.zip
new file mode 100644 (file)
index 0000000..9010bf0
Binary files /dev/null and b/catalog-be/src/main/resources/import/tosca/nfv-types/VDU/VDU.zip differ
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 (file)
index 0000000..49895e4
--- /dev/null
@@ -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 (file)
index 0000000..0715993
--- /dev/null
@@ -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 (file)
index 0000000..acee384
Binary files /dev/null and b/catalog-be/src/main/resources/import/tosca/nfv-types/extImageFile/extImageFile.zip differ
diff --git a/catalog-be/src/main/resources/import/tosca/nfv-types/extLocalStorage/extLocalStorage.json b/catalog-be/src/main/resources/import/tosca/nfv-types/extLocalStorage/extLocalStorage.json
new file mode 100644 (file)
index 0000000..6cfdd47
--- /dev/null
@@ -0,0 +1,15 @@
+{
+       "payloadName": "extLocalStorage.yml",
+       "contactId": "jh0003",
+       "name": "Ext Local Storage",
+       "description": "Ext Local Storage",
+       "resourceIconPath": "objectStorage",
+       "resourceType": "VFC",
+       "categories": [{
+               "name": "Generic",
+               "subcategories": [{
+                       "name": "Infrastructure"
+               }]
+       }],
+       "tags": ["Ext Local Storage"]
+}
\ No newline at end of file
diff --git a/catalog-be/src/main/resources/import/tosca/nfv-types/extLocalStorage/extLocalStorage.yml b/catalog-be/src/main/resources/import/tosca/nfv-types/extLocalStorage/extLocalStorage.yml
new file mode 100644 (file)
index 0000000..4650332
--- /dev/null
@@ -0,0 +1,14 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  tosca.nodes.nfv.ext.LocalStorage: 
+    derived_from: tosca.nodes.Root
+    properties: 
+      size: 
+        type: string
+        required: false
+      disk_type: 
+        type: string
+        required: false
+    capabilities: 
+      local_attachment: 
+        type: tosca.capabilities.nfv.ext.LocalAttachment
\ No newline at end of file
diff --git a/catalog-be/src/main/resources/import/tosca/nfv-types/extLocalStorage/extLocalStorage.zip b/catalog-be/src/main/resources/import/tosca/nfv-types/extLocalStorage/extLocalStorage.zip
new file mode 100644 (file)
index 0000000..b3bcc91
Binary files /dev/null and b/catalog-be/src/main/resources/import/tosca/nfv-types/extLocalStorage/extLocalStorage.zip differ
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 (file)
index 0000000..955e5e3
--- /dev/null
@@ -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 (file)
index 0000000..207047a
--- /dev/null
@@ -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 (file)
index 0000000..ca6d073
Binary files /dev/null and b/catalog-be/src/main/resources/import/tosca/nfv-types/extZteCP/extZteCP.zip differ
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 (file)
index 0000000..2ebc518
--- /dev/null
@@ -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 (file)
index 0000000..1638305
--- /dev/null
@@ -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 (file)
index 0000000..2bf0f54
Binary files /dev/null and b/catalog-be/src/main/resources/import/tosca/nfv-types/extZteVDU/extZteVDU.zip differ
diff --git a/catalog-be/src/main/resources/import/tosca/nfv-types/extZteVL/extZteVL.json b/catalog-be/src/main/resources/import/tosca/nfv-types/extZteVL/extZteVL.json
new file mode 100644 (file)
index 0000000..0104a79
--- /dev/null
@@ -0,0 +1,15 @@
+{
+       "payloadName": "extZteVL.yml",
+       "contactId": "jh0003",
+       "name": "ext ZTE VL",
+       "description": "Ext ZTE VL",
+       "resourceIconPath": "network",
+       "resourceType": "VL",
+       "categories": [{
+               "name": "Generic",
+               "subcategories": [{
+                       "name": "Network Elements"
+               }]
+       }],
+       "tags": ["ext ZTE VL"]
+}
\ No newline at end of file
diff --git a/catalog-be/src/main/resources/import/tosca/nfv-types/extZteVL/extZteVL.yml b/catalog-be/src/main/resources/import/tosca/nfv-types/extZteVL/extZteVL.yml
new file mode 100644 (file)
index 0000000..8618019
--- /dev/null
@@ -0,0 +1,69 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types: 
+  tosca.nodes.nfv.ext.zte.VL: 
+    derived_from: tosca.nodes.Root
+    properties: 
+      segmentation_id: 
+        type: string
+        required: false
+      network_name: 
+        type: string
+        required: false
+      is_predefined: 
+        type: boolean
+        required: false
+      mtu: 
+        type: integer
+        required: false
+      dns_nameservers: 
+        type: list
+        required: false
+        entry_schema: 
+          type: string
+      physical_network: 
+        type: string
+        required: false
+      dhcp_enabled: 
+        type: boolean
+        required: false
+      network_id: 
+        type: string
+        required: false
+      host_routes: 
+        type: list
+        required: false
+        entry_schema: 
+          type: tosca.datatypes.nfv.ext.HostRouteInfo
+      ip_version: 
+        type: integer
+        required: false
+      vendor: 
+        type: string
+        required: false
+      name: 
+        type: string
+        required: false
+      start_ip: 
+        type: string
+        required: false
+      vlan_transparent: 
+        type: boolean
+        required: false
+      cidr: 
+        type: string
+        required: false
+      gateway_ip: 
+        type: string
+        required: false
+      network_type: 
+        type: string
+        required: false
+      end_ip: 
+        type: string
+        required: false
+      location_info: 
+        type: tosca.datatypes.nfv.ext.LocationInfo
+        required: false
+    capabilities: 
+      virtual_linkable: 
+        type: tosca.capabilities.nfv.VirtualLinkable
\ No newline at end of file
diff --git a/catalog-be/src/main/resources/import/tosca/nfv-types/extZteVL/extZteVL.zip b/catalog-be/src/main/resources/import/tosca/nfv-types/extZteVL/extZteVL.zip
new file mode 100644 (file)
index 0000000..5f04404
Binary files /dev/null and b/catalog-be/src/main/resources/import/tosca/nfv-types/extZteVL/extZteVL.zip differ
diff --git a/catalog-be/src/main/resources/import/tosca/nfv-types/vduCompute/vduCompute.json b/catalog-be/src/main/resources/import/tosca/nfv-types/vduCompute/vduCompute.json
new file mode 100644 (file)
index 0000000..42f5978
--- /dev/null
@@ -0,0 +1,15 @@
+{
+       "payloadName": "vduCompute.yml",
+       "contactId": "jh0003",
+       "name": "VDU Compute",
+       "description": "VDU Compute",
+       "resourceIconPath": "compute",
+       "resourceType": "VFC",
+       "categories": [{
+               "name": "Generic",
+               "subcategories": [{
+                       "name": "Infrastructure"
+               }]
+       }],
+       "tags": ["VDU Compute"]
+}
\ No newline at end of file
diff --git a/catalog-be/src/main/resources/import/tosca/nfv-types/vduCompute/vduCompute.yml b/catalog-be/src/main/resources/import/tosca/nfv-types/vduCompute/vduCompute.yml
new file mode 100644 (file)
index 0000000..a1c4b48
--- /dev/null
@@ -0,0 +1,96 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types:
+  tosca.nodes.nfv.VDU.Compute:
+    derived_from: tosca.nodes.Root
+    properties:
+      configurable_properties:
+        type: map
+        required: true
+        status: SUPPORTED
+        entry_schema:
+          type: tosca.datatypes.nfv.VnfcConfigurableProperties
+      name:
+        type: string
+        required: true
+        status: SUPPORTED
+      nfvi_constraints:
+        type: list
+        required: false
+        status: SUPPORTED
+        entry_schema:
+          type: string
+      descrption:
+        type: string
+        required: true
+        status: SUPPORTED
+      boot_order:
+        type: list
+        required: false
+        status: SUPPORTED
+        entry_schema:
+          type: string
+    attributes:
+      private_address:
+        type: string
+        status: SUPPORTED
+      public_address:
+        type: string
+        status: SUPPORTED
+      networks:
+        type: string
+        status: SUPPORTED
+      ports:
+        type: string
+        status: SUPPORTED
+    requirements:
+    - local_storage:
+        capability: tosca.capabilities.Attachment
+        occurrences:
+        - 0
+        - UNBOUNDED
+    - virtual_storage:
+        capability: tosca.capabilities.nfv.VirtualStorage
+        occurrences:
+        - 0
+        - UNBOUNDED
+    capabilities:
+      scalable:
+        type: tosca.capabilities.Scalable
+        occurrences:
+        - 1
+        - UNBOUNDED
+      virtual_compute:
+        type: tosca.capabilities.nfv.VirtualCompute
+        occurrences:
+        - 1
+        - UNBOUNDED
+      endpoint:
+        type: tosca.capabilities.Endpoint.Admin
+        occurrences:
+        - 1
+        - UNBOUNDED
+      os:
+        type: tosca.capabilities.OperatingSystem
+        occurrences:
+        - 1
+        - UNBOUNDED
+      virtual_binding:
+        type: tosca.capabilities.nfv.VirtualBindable
+        occurrences:
+        - 1
+        - UNBOUNDED
+      host:
+        type: tosca.capabilities.Container
+        occurrences:
+        - 1
+        - UNBOUNDED
+      binding:
+        type: tosca.capabilities.network.Bindable
+        occurrences:
+        - 1
+        - UNBOUNDED
+      monitoring_parameter:
+        type: tosca.capabilities.nfv.Metric
+        occurrences:
+        - 1
+        - UNBOUNDED
\ No newline at end of file
diff --git a/catalog-be/src/main/resources/import/tosca/nfv-types/vduCompute/vduCompute.zip b/catalog-be/src/main/resources/import/tosca/nfv-types/vduCompute/vduCompute.zip
new file mode 100644 (file)
index 0000000..3110626
Binary files /dev/null and b/catalog-be/src/main/resources/import/tosca/nfv-types/vduCompute/vduCompute.zip differ
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 (file)
index 0000000..f8d2254
--- /dev/null
@@ -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 (file)
index 0000000..673e923
--- /dev/null
@@ -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 (file)
index 0000000..e1bb32d
Binary files /dev/null and b/catalog-be/src/main/resources/import/tosca/nfv-types/vduCpd/vduCpd.zip differ
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 (file)
index 0000000..7dab2ec
--- /dev/null
@@ -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 (file)
index 0000000..5d22e1e
--- /dev/null
@@ -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 (file)
index 0000000..fb92ab4
Binary files /dev/null and b/catalog-be/src/main/resources/import/tosca/nfv-types/vduVirtualStorage/vduVirtualStorage.zip differ
diff --git a/catalog-be/src/main/resources/import/tosca/nfv-types/vnfVirtualLinkDesc/vnfVirtualLinkDesc.json b/catalog-be/src/main/resources/import/tosca/nfv-types/vnfVirtualLinkDesc/vnfVirtualLinkDesc.json
new file mode 100644 (file)
index 0000000..b591df2
--- /dev/null
@@ -0,0 +1,15 @@
+{
+       "payloadName": "vnfVirtualLinkDesc.yml",
+       "contactId": "jh0003",
+       "name": "VnfVirtualLinkDesc",
+       "description": "VnfVirtualLinkDesc",
+       "resourceIconPath": "network",
+       "resourceType": "VL",
+       "categories": [{
+               "name": "Generic",
+               "subcategories": [{
+                       "name": "Infrastructure"
+               }]
+       }],
+       "tags": ["VnfVirtualLinkDesc"]
+}
\ No newline at end of file
diff --git a/catalog-be/src/main/resources/import/tosca/nfv-types/vnfVirtualLinkDesc/vnfVirtualLinkDesc.yml b/catalog-be/src/main/resources/import/tosca/nfv-types/vnfVirtualLinkDesc/vnfVirtualLinkDesc.yml
new file mode 100644 (file)
index 0000000..ecb5e0b
--- /dev/null
@@ -0,0 +1,26 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+node_types:
+  tosca.nodes.nfv.VnfVirtualLinkDesc:
+    derived_from: tosca.nodes.Root
+    properties:
+      connectivity_type:
+        type: tosca.datatypes.nfv.ConnectivityType
+        required: true
+      description:
+        type: string
+        required: false
+      test_access:
+        type: list
+        entry_schema:
+          type: string
+        required: false
+      vl_flavours:
+        type: map
+        entry_schema:
+          type: tosca.datatypes.nfv.VlFlavour
+        required: true
+    capabilities:
+      #monitoring_parameters:
+        # modeled as ad hoc (named) capabilities in node template
+      virtual_linkable:
+        type: tosca.capabilities.nfv.VirtualLinkable
\ No newline at end of file
diff --git a/catalog-be/src/main/resources/import/tosca/nfv-types/vnfVirtualLinkDesc/vnfVirtualLinkDesc.zip b/catalog-be/src/main/resources/import/tosca/nfv-types/vnfVirtualLinkDesc/vnfVirtualLinkDesc.zip
new file mode 100644 (file)
index 0000000..3d29909
Binary files /dev/null and b/catalog-be/src/main/resources/import/tosca/nfv-types/vnfVirtualLinkDesc/vnfVirtualLinkDesc.zip differ
diff --git a/catalog-be/src/main/resources/scripts/import/tosca/importNfvTypes.py b/catalog-be/src/main/resources/scripts/import/tosca/importNfvTypes.py
new file mode 100644 (file)
index 0000000..019067b
--- /dev/null
@@ -0,0 +1,113 @@
+import pycurl
+import sys, getopt
+from StringIO import StringIO
+import json
+import copy
+from importCommon import *
+from importNormativeTypes import *
+import importCommon
+
+#####################################################################################################################################################################################################
+#                                                                                                                                                                                                                                                                                                                                                                                              #       
+# Import Nfv Types from a given file                                                                                                                                                                                                                                                                                                                           #
+#                                                                                                                                                                                                                                                                                                                                                                                                      #               
+# activation :                                                                                                                                                                                                                                                                                                                                                                         #
+#       python importNfvTypes.py [optional -s <scheme> | --scheme=<scheme>, default http] [-i <be host> | --ip=<be host>] [-p <be port> | --port=<be port> ] [-f <input file> | --ifile=<input file> ] #
+#                                                                                                                                                                                                                                                                                                                                                                                                      #                       
+# shortest activation (be host = localhost, be port = 8080):                                                                                                                                                                                                                                                                           #
+#              python importUsers.py [-f <input file> | --ifile=<input file> ]                                                                                                                                                                                                                                                 #
+#                                                                                                                                                                                                                                                                                                                                                                                              #       
+#####################################################################################################################################################################################################
+
+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:])
index df2cd49..5b7b52d 100644 (file)
@@ -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]
        
index eb55bf8..6144d69 100644 (file)
@@ -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:])
 
index faad226..f703b4b 100644 (file)
@@ -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 (file)
index 0000000..0015a26
--- /dev/null
@@ -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> | --scheme=<scheme>, default http] [-i <be host> | --ip=<be host>] [-p <be port> | --port=<be port> ] [-f <input file> | --ifile=<input file> ] #
+#                                                                                                                                                                                                                                                                                                                                                                                                      #                       
+# shortest activation (be host = localhost, be port = 8080):                                                                                                                                                                                                                                                                           #
+#              python importUsers.py [-f <input file> | --ifile=<input file> ]                                                                                                                                                                                                                                                 #
+#                                                                                                                                                                                                                                                                                                                                                                                              #       
+#####################################################################################################################################################################################################
+
+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/upgradeNfvTypes.py b/catalog-be/src/main/resources/scripts/import/tosca/upgradeNfvTypes.py
new file mode 100644 (file)
index 0000000..66d82f9
--- /dev/null
@@ -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> | --scheme=<scheme> ] [-i <be host> | --ip=<be host>] [-p <be port> | --port=<be port> ] [-f <input file> | --ifile=<input file> ] #
+#                                                                                                                                                                                                                                                                                                                                         #
+# shortest activation (be host = localhost, be port = 8080):                                                                                                                                                                                                              #
+#              python upgradeHeatAndNormativeTypes.py [-f <input file> | --ifile=<input file> ]                                                                                                                                                                       #
+#                                                                                                                                                                                                                                                                                                                                     #
+################################################################################################################################################################################################
+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:])
+
index 21a4775..5c57762 100644 (file)
@@ -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 (file)
index 0000000..25d9b4d
--- /dev/null
@@ -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> | --scheme=<scheme> ] [-i <be host> | --ip=<be host>] [-p <be port> | --port=<be port> ] [-f <input file> | --ifile=<input file> ] #
+#                                                                                                                                                                                                                                                                                                                                         #
+# shortest activation (be host = localhost, be port = 8080):                                                                                                                                                                                                              #
+#              python upgradeHeatAndNormativeTypes.py [-f <input file> | --ifile=<input file> ]                                                                                                                                                                       #
+#                                                                                                                                                                                                                                                                                                                                     #
+################################################################################################################################################################################################
+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:])
+