diff options
author | Gitelman, Tal (tg851x) <tg851x@intl.att.com> | 2018-03-20 01:04:54 +0200 |
---|---|---|
committer | Michael Lando <ml636r@att.com> | 2018-03-19 23:09:14 +0000 |
commit | fefa3e408f77289594e47edc878d1bee61fca90b (patch) | |
tree | fe8a7349a53e59085f6135f9b1d8729738d9a6ac /catalog-be | |
parent | 41cf18e4eebdae0692b832278b5a48f90345eedc (diff) |
Normative alignemet
Change-Id: I6115e20fe95662153903873d19439bc7cf0c2ff1
Issue-ID: SDC-1104
Signed-off-by: Gitelman, Tal (tg851x) <tg851x@intl.att.com>
Diffstat (limited to 'catalog-be')
54 files changed, 1136 insertions, 19 deletions
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 Binary files differnew file mode 100644 index 0000000000..d741b50c16 --- /dev/null +++ b/catalog-be/src/main/resources/import/tosca/nfv-types/NSD/NSD.zip 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 index 0000000000..5d721d4abc --- /dev/null +++ b/catalog-be/src/main/resources/import/tosca/nfv-types/VDU/VDU.json @@ -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 index 0000000000..541126f7e3 --- /dev/null +++ b/catalog-be/src/main/resources/import/tosca/nfv-types/VDU/VDU.yml @@ -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 Binary files differnew file mode 100644 index 0000000000..9010bf0544 --- /dev/null +++ b/catalog-be/src/main/resources/import/tosca/nfv-types/VDU/VDU.zip 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 index 143f62346d..143f62346d 100644 --- 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 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 index 00d3bd243d..00d3bd243d 100644 --- 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 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 Binary files differindex fd3f7e9d79..fd3f7e9d79 100644 --- 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 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 Binary files differnew file mode 100644 index 0000000000..acee384754 --- /dev/null +++ b/catalog-be/src/main/resources/import/tosca/nfv-types/extImageFile/extImageFile.zip 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 index 0000000000..6cfdd47b1e --- /dev/null +++ b/catalog-be/src/main/resources/import/tosca/nfv-types/extLocalStorage/extLocalStorage.json @@ -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 index 0000000000..4650332c21 --- /dev/null +++ b/catalog-be/src/main/resources/import/tosca/nfv-types/extLocalStorage/extLocalStorage.yml @@ -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 Binary files differnew file mode 100644 index 0000000000..b3bcc91c90 --- /dev/null +++ b/catalog-be/src/main/resources/import/tosca/nfv-types/extLocalStorage/extLocalStorage.zip 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 Binary files differnew file mode 100644 index 0000000000..ca6d0738de --- /dev/null +++ b/catalog-be/src/main/resources/import/tosca/nfv-types/extZteCP/extZteCP.zip 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 Binary files differnew file mode 100644 index 0000000000..2bf0f54ea3 --- /dev/null +++ b/catalog-be/src/main/resources/import/tosca/nfv-types/extZteVDU/extZteVDU.zip 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 index 0000000000..0104a79c21 --- /dev/null +++ b/catalog-be/src/main/resources/import/tosca/nfv-types/extZteVL/extZteVL.json @@ -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 index 0000000000..8618019587 --- /dev/null +++ b/catalog-be/src/main/resources/import/tosca/nfv-types/extZteVL/extZteVL.yml @@ -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 Binary files differnew file mode 100644 index 0000000000..5f04404f25 --- /dev/null +++ b/catalog-be/src/main/resources/import/tosca/nfv-types/extZteVL/extZteVL.zip diff --git a/catalog-be/src/main/resources/import/tosca/heat-types/genericNeutronNet/genericNeutronNet.json b/catalog-be/src/main/resources/import/tosca/nfv-types/genericNeutronNet/genericNeutronNet.json index d9b008a870..d9b008a870 100644 --- a/catalog-be/src/main/resources/import/tosca/heat-types/genericNeutronNet/genericNeutronNet.json +++ b/catalog-be/src/main/resources/import/tosca/nfv-types/genericNeutronNet/genericNeutronNet.json diff --git a/catalog-be/src/main/resources/import/tosca/heat-types/genericNeutronNet/genericNeutronNet.yml b/catalog-be/src/main/resources/import/tosca/nfv-types/genericNeutronNet/genericNeutronNet.yml index 12dc13e98b..12dc13e98b 100644 --- a/catalog-be/src/main/resources/import/tosca/heat-types/genericNeutronNet/genericNeutronNet.yml +++ b/catalog-be/src/main/resources/import/tosca/nfv-types/genericNeutronNet/genericNeutronNet.yml diff --git a/catalog-be/src/main/resources/import/tosca/heat-types/genericNeutronNet/genericNeutronNet.zip b/catalog-be/src/main/resources/import/tosca/nfv-types/genericNeutronNet/genericNeutronNet.zip Binary files differindex ed51f834f3..ed51f834f3 100644 --- a/catalog-be/src/main/resources/import/tosca/heat-types/genericNeutronNet/genericNeutronNet.zip +++ b/catalog-be/src/main/resources/import/tosca/nfv-types/genericNeutronNet/genericNeutronNet.zip diff --git a/catalog-be/src/main/resources/import/tosca/heat-types/overlayTunnel/overlayTunnel.json b/catalog-be/src/main/resources/import/tosca/nfv-types/overlayTunnel/overlayTunnel.json index 8c556b9ff1..8c556b9ff1 100644 --- a/catalog-be/src/main/resources/import/tosca/heat-types/overlayTunnel/overlayTunnel.json +++ b/catalog-be/src/main/resources/import/tosca/nfv-types/overlayTunnel/overlayTunnel.json diff --git a/catalog-be/src/main/resources/import/tosca/heat-types/overlayTunnel/overlayTunnel.yml b/catalog-be/src/main/resources/import/tosca/nfv-types/overlayTunnel/overlayTunnel.yml index 51a8ce539e..51a8ce539e 100644 --- a/catalog-be/src/main/resources/import/tosca/heat-types/overlayTunnel/overlayTunnel.yml +++ b/catalog-be/src/main/resources/import/tosca/nfv-types/overlayTunnel/overlayTunnel.yml diff --git a/catalog-be/src/main/resources/import/tosca/heat-types/overlayTunnel/overlayTunnel.zip b/catalog-be/src/main/resources/import/tosca/nfv-types/overlayTunnel/overlayTunnel.zip Binary files differindex 9340f06ca7..9340f06ca7 100644 --- a/catalog-be/src/main/resources/import/tosca/heat-types/overlayTunnel/overlayTunnel.zip +++ b/catalog-be/src/main/resources/import/tosca/nfv-types/overlayTunnel/overlayTunnel.zip diff --git a/catalog-be/src/main/resources/import/tosca/heat-types/underlayVpn/underlayVpn.json b/catalog-be/src/main/resources/import/tosca/nfv-types/underlayVpn/underlayVpn.json index 1311fe9f32..1311fe9f32 100644 --- a/catalog-be/src/main/resources/import/tosca/heat-types/underlayVpn/underlayVpn.json +++ b/catalog-be/src/main/resources/import/tosca/nfv-types/underlayVpn/underlayVpn.json diff --git a/catalog-be/src/main/resources/import/tosca/heat-types/underlayVpn/underlayVpn.yml b/catalog-be/src/main/resources/import/tosca/nfv-types/underlayVpn/underlayVpn.yml index 1e22852c75..1e22852c75 100644 --- a/catalog-be/src/main/resources/import/tosca/heat-types/underlayVpn/underlayVpn.yml +++ b/catalog-be/src/main/resources/import/tosca/nfv-types/underlayVpn/underlayVpn.yml diff --git a/catalog-be/src/main/resources/import/tosca/heat-types/underlayVpn/underlayVpn.zip b/catalog-be/src/main/resources/import/tosca/nfv-types/underlayVpn/underlayVpn.zip Binary files differindex 65bc805bb7..65bc805bb7 100644 --- a/catalog-be/src/main/resources/import/tosca/heat-types/underlayVpn/underlayVpn.zip +++ b/catalog-be/src/main/resources/import/tosca/nfv-types/underlayVpn/underlayVpn.zip 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 index 0000000000..42f5978ad1 --- /dev/null +++ b/catalog-be/src/main/resources/import/tosca/nfv-types/vduCompute/vduCompute.json @@ -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 index 0000000000..a1c4b486b6 --- /dev/null +++ b/catalog-be/src/main/resources/import/tosca/nfv-types/vduCompute/vduCompute.yml @@ -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 Binary files differnew file mode 100644 index 0000000000..311062658f --- /dev/null +++ b/catalog-be/src/main/resources/import/tosca/nfv-types/vduCompute/vduCompute.zip 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 Binary files differnew file mode 100644 index 0000000000..e1bb32dd23 --- /dev/null +++ b/catalog-be/src/main/resources/import/tosca/nfv-types/vduCpd/vduCpd.zip 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 Binary files differnew file mode 100644 index 0000000000..fb92ab45d9 --- /dev/null +++ b/catalog-be/src/main/resources/import/tosca/nfv-types/vduVirtualStorage/vduVirtualStorage.zip 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 index 0000000000..b591df2bbb --- /dev/null +++ b/catalog-be/src/main/resources/import/tosca/nfv-types/vnfVirtualLinkDesc/vnfVirtualLinkDesc.json @@ -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 index 0000000000..ecb5e0bb52 --- /dev/null +++ b/catalog-be/src/main/resources/import/tosca/nfv-types/vnfVirtualLinkDesc/vnfVirtualLinkDesc.yml @@ -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 Binary files differnew file mode 100644 index 0000000000..3d29909033 --- /dev/null +++ b/catalog-be/src/main/resources/import/tosca/nfv-types/vnfVirtualLinkDesc/vnfVirtualLinkDesc.zip 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 index 0000000000..019067b849 --- /dev/null +++ b/catalog-be/src/main/resources/scripts/import/tosca/importNfvTypes.py @@ -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:]) 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> | --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/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> | --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:]) + 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> | --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:]) + |