Initial OpenECOMP SDC commit
Change-Id: I0924d5a6ae9cdc161ae17c68d3689a30d10f407b
Signed-off-by: Michael Lando <ml636r@att.com>
diff --git a/asdc-tests/src/test/resources/CI/demoResourcesWanLan/LAN_Connector/LAN_Connector.json b/asdc-tests/src/test/resources/CI/demoResourcesWanLan/LAN_Connector/LAN_Connector.json
new file mode 100644
index 0000000..1bf5938
--- /dev/null
+++ b/asdc-tests/src/test/resources/CI/demoResourcesWanLan/LAN_Connector/LAN_Connector.json
@@ -0,0 +1,11 @@
+{
+ "payloadName": "LAN_Connector.yml",
+ "contactId": "jh0003",
+ "resourceName": "org.openecomp.asdc.nodes.Connector.LAN_Connector",
+ "description": "Represents a LAN_Connector Node Type.",
+ "resourceIconPath": "defaulticon",
+ "category": "Infrastructure",
+ "tags": [
+ "org.openecomp.asdc.nodes.Connector.LAN_Connector"
+ ]
+}
\ No newline at end of file
diff --git a/asdc-tests/src/test/resources/CI/demoResourcesWanLan/LAN_Connector/LAN_Connector.yml b/asdc-tests/src/test/resources/CI/demoResourcesWanLan/LAN_Connector/LAN_Connector.yml
new file mode 100644
index 0000000..4fff368
--- /dev/null
+++ b/asdc-tests/src/test/resources/CI/demoResourcesWanLan/LAN_Connector/LAN_Connector.yml
@@ -0,0 +1,23 @@
+org.openecomp.asdc.nodes.Connector.LAN_Connector:
+ #The LAN_Connector node connects Router and VNF_Container
+ derived_from: org.openecomp.asdc.nodes.Connector
+ properties:
+ network_id:
+ #or called: vlan_id
+ type: string
+ required: true
+ network_type:
+ #The technology types used by LAN connector
+ type: string
+ attributes:
+ network_ip_address:
+ #ip address is generated only after the node is instantiated at run-time
+ type: string
+ requirements:
+ - connectToRouter :
+ capability: tosca.capabilities.Root
+ node: org.openecomp.asdc.nodes.Router
+ - connectToVNF :
+ capability: tosca.capabilities.Root
+ node: org.openecomp.asdc.nodes.VNF_Container
+ #These two explicit requirements specify the LAN_Connector has two "connectTo" to connect to the node of Router type and VNF_Container type respectively
diff --git a/asdc-tests/src/test/resources/CI/demoResourcesWanLan/LAN_Connector/LAN_Connector.zip b/asdc-tests/src/test/resources/CI/demoResourcesWanLan/LAN_Connector/LAN_Connector.zip
new file mode 100644
index 0000000..1b02f06
--- /dev/null
+++ b/asdc-tests/src/test/resources/CI/demoResourcesWanLan/LAN_Connector/LAN_Connector.zip
Binary files differ
diff --git a/asdc-tests/src/test/resources/CI/demoResourcesWanLan/VNF/VNF.json b/asdc-tests/src/test/resources/CI/demoResourcesWanLan/VNF/VNF.json
new file mode 100644
index 0000000..35b426c
--- /dev/null
+++ b/asdc-tests/src/test/resources/CI/demoResourcesWanLan/VNF/VNF.json
@@ -0,0 +1,11 @@
+{
+ "payloadName": "VNF.yml",
+ "contactId": "jh0003",
+ "resourceName": "org.openecomp.asdc.nodes.VNF",
+ "description": "Represents a VNF Node Type.",
+ "resourceIconPath": "defaulticon",
+ "category": "Infrastructure",
+ "tags": [
+ "org.openecomp.asdc.nodes.VNF"
+ ]
+}
\ No newline at end of file
diff --git a/asdc-tests/src/test/resources/CI/demoResourcesWanLan/VNF/VNF.yml b/asdc-tests/src/test/resources/CI/demoResourcesWanLan/VNF/VNF.yml
new file mode 100644
index 0000000..22be623
--- /dev/null
+++ b/asdc-tests/src/test/resources/CI/demoResourcesWanLan/VNF/VNF.yml
@@ -0,0 +1,16 @@
+org.openecomp.asdc.nodes.VNF:
+ #The VNF node is required to be hosted by a VNF_Container
+ derived_from: org.openecomp.asdc.nodes.Root
+ properties:
+ service_name:
+ type: string
+ attributes:
+ #attribute means the value is fulfilled at run-time.
+ service_id:
+ #In this case, we consider the VNF node only has the service_id value when the node is instantiated
+ type: string
+ requirements:
+ #the "host" requirement can establish the relationship with a VNF_Container node
+ - host :
+ capability: org.openecomp.asdc.capabilities.Container
+ node: org.openecomp.asdc.nodes.VNF_Container
\ No newline at end of file
diff --git a/asdc-tests/src/test/resources/CI/demoResourcesWanLan/VNF/VNF.zip b/asdc-tests/src/test/resources/CI/demoResourcesWanLan/VNF/VNF.zip
new file mode 100644
index 0000000..c01081f
--- /dev/null
+++ b/asdc-tests/src/test/resources/CI/demoResourcesWanLan/VNF/VNF.zip
Binary files differ
diff --git a/asdc-tests/src/test/resources/CI/demoResourcesWanLan/VNF_Container/VNF_Container.json b/asdc-tests/src/test/resources/CI/demoResourcesWanLan/VNF_Container/VNF_Container.json
new file mode 100644
index 0000000..c134778
--- /dev/null
+++ b/asdc-tests/src/test/resources/CI/demoResourcesWanLan/VNF_Container/VNF_Container.json
@@ -0,0 +1,11 @@
+{
+ "payloadName": "VNF_Container.yml",
+ "contactId": "jh0003",
+ "resourceName": "org.openecomp.asdc.nodes.VNF_Container",
+ "description": "Represents a VNF_Container Node Type.",
+ "resourceIconPath": "defaulticon",
+ "category": "Infrastructure",
+ "tags": [
+ "org.openecomp.asdc.nodes.VNF_Container"
+ ]
+}
\ No newline at end of file
diff --git a/asdc-tests/src/test/resources/CI/demoResourcesWanLan/VNF_Container/VNF_Container.yml b/asdc-tests/src/test/resources/CI/demoResourcesWanLan/VNF_Container/VNF_Container.yml
new file mode 100644
index 0000000..b8dd8355
--- /dev/null
+++ b/asdc-tests/src/test/resources/CI/demoResourcesWanLan/VNF_Container/VNF_Container.yml
@@ -0,0 +1,10 @@
+org.openecomp.asdc.nodes.VNF_Container:
+ #The VNF_Container node provides the capability to host VNFs.
+ derived_from: org.openecomp.asdc.nodes.Root
+ capabilities:
+ host:
+ #The "host" capability allows other TOSCA nodes (VNF) that requires such a capability to connect to this node
+ type: org.openecomp.asdc.capabilities.Container
+ connectTo:
+ #The "connectTo" capability allows other TOSCA nodes (connectors) that requires such a capability to connect to this node.
+ type: org.openecomp.asdc.capabilities.Endpoint
\ No newline at end of file
diff --git a/asdc-tests/src/test/resources/CI/demoResourcesWanLan/VNF_Container/VNF_Container.zip b/asdc-tests/src/test/resources/CI/demoResourcesWanLan/VNF_Container/VNF_Container.zip
new file mode 100644
index 0000000..a8e006e
--- /dev/null
+++ b/asdc-tests/src/test/resources/CI/demoResourcesWanLan/VNF_Container/VNF_Container.zip
Binary files differ
diff --git a/asdc-tests/src/test/resources/CI/demoResourcesWanLan/WAN_Connector/WAN_Connector.json b/asdc-tests/src/test/resources/CI/demoResourcesWanLan/WAN_Connector/WAN_Connector.json
new file mode 100644
index 0000000..4cb0880
--- /dev/null
+++ b/asdc-tests/src/test/resources/CI/demoResourcesWanLan/WAN_Connector/WAN_Connector.json
@@ -0,0 +1,11 @@
+{
+ "payloadName": "WAN_Connector.yml",
+ "contactId": "jh0003",
+ "resourceName": "org.openecomp.asdc.nodes.Connector.WAN_Connector",
+ "description": "Represents a WAN_Connector Node Type.",
+ "resourceIconPath": "defaulticon",
+ "category": "Infrastructure",
+ "tags": [
+ "org.openecomp.asdc.nodes.Connector.WAN_Connector"
+ ]
+}
\ No newline at end of file
diff --git a/asdc-tests/src/test/resources/CI/demoResourcesWanLan/WAN_Connector/WAN_Connector.yml b/asdc-tests/src/test/resources/CI/demoResourcesWanLan/WAN_Connector/WAN_Connector.yml
new file mode 100644
index 0000000..741d585
--- /dev/null
+++ b/asdc-tests/src/test/resources/CI/demoResourcesWanLan/WAN_Connector/WAN_Connector.yml
@@ -0,0 +1,25 @@
+org.openecomp.asdc.nodes.Connector.WAN_Connector:
+ #The WAN_Connector node only connects to Router
+ derived_from: org.openecomp.asdc.nodes.Connector
+ properties:
+ customer_id:
+ type: string
+ required: true
+ vpn_id:
+ type: string
+ required: true
+ vpn_name:
+ type: string
+ required: true
+ network_type:
+ #The technology types used by WAN connector
+ type: string
+ attributes:
+ network_ip_address:
+ #ip address is generated only after the node is instantiated at run-time
+ type: string
+ requirements:
+ - connectTo :
+ capability: org.openecomp.asdc.capabilities.Endpoint
+ node: org.openecomp.asdc.nodes.Router
+ #This explicit requirement specifies WAN_Connector has only one "connectTo" to connect to the node of Router type
\ No newline at end of file
diff --git a/asdc-tests/src/test/resources/CI/demoResourcesWanLan/WAN_Connector/WAN_Connector.zip b/asdc-tests/src/test/resources/CI/demoResourcesWanLan/WAN_Connector/WAN_Connector.zip
new file mode 100644
index 0000000..e193820
--- /dev/null
+++ b/asdc-tests/src/test/resources/CI/demoResourcesWanLan/WAN_Connector/WAN_Connector.zip
Binary files differ
diff --git a/asdc-tests/src/test/resources/CI/demoResourcesWanLan/capabilityTypesWanLan.yml b/asdc-tests/src/test/resources/CI/demoResourcesWanLan/capabilityTypesWanLan.yml
new file mode 100644
index 0000000..3298923
--- /dev/null
+++ b/asdc-tests/src/test/resources/CI/demoResourcesWanLan/capabilityTypesWanLan.yml
@@ -0,0 +1,4 @@
+org.openecomp.asdc.capabilities.Endpoint:
+ derived_from: tosca.capabilities.Endpoint
+org.openecomp.asdc.capabilities.Container:
+ derived_from: tosca.capabilities.Container
\ No newline at end of file
diff --git a/asdc-tests/src/test/resources/CI/demoResourcesWanLan/capabilityTypesWanLan.zip b/asdc-tests/src/test/resources/CI/demoResourcesWanLan/capabilityTypesWanLan.zip
new file mode 100644
index 0000000..869be32
--- /dev/null
+++ b/asdc-tests/src/test/resources/CI/demoResourcesWanLan/capabilityTypesWanLan.zip
Binary files differ
diff --git a/asdc-tests/src/test/resources/CI/demoResourcesWanLan/connector/connector.json b/asdc-tests/src/test/resources/CI/demoResourcesWanLan/connector/connector.json
new file mode 100644
index 0000000..99be86c
--- /dev/null
+++ b/asdc-tests/src/test/resources/CI/demoResourcesWanLan/connector/connector.json
@@ -0,0 +1,11 @@
+{
+ "payloadName": "connector.yml",
+ "contactId": "jh0003",
+ "resourceName": "org.openecomp.asdc.nodes.Connector",
+ "description": "Represents a connector Node Type.",
+ "resourceIconPath": "defaulticon",
+ "category": "Abstract",
+ "tags": [
+ "org.openecomp.asdc.nodes.Connector"
+ ]
+}
\ No newline at end of file
diff --git a/asdc-tests/src/test/resources/CI/demoResourcesWanLan/connector/connector.yml b/asdc-tests/src/test/resources/CI/demoResourcesWanLan/connector/connector.yml
new file mode 100644
index 0000000..d9c9361
--- /dev/null
+++ b/asdc-tests/src/test/resources/CI/demoResourcesWanLan/connector/connector.yml
@@ -0,0 +1,10 @@
+org.openecomp.asdc.nodes.Connector:
+ #Connector is the parent node of both WAN and LAN connectors.
+ derived_from: org.openecomp.asdc.nodes.Root
+ requirements:
+ - connectTo:
+ capability: org.openecomp.asdc.capabilities.Endpoint
+ #the requirement can establish the relationship with a node providing such capability
+ relationship: org.openecomp.asdc.relationships.ConnectsTo
+ #occurrences means how many times this requirement can appear in one node.
+ occurrences: [1, UNBOUNDED]
\ No newline at end of file
diff --git a/asdc-tests/src/test/resources/CI/demoResourcesWanLan/connector/connector.zip b/asdc-tests/src/test/resources/CI/demoResourcesWanLan/connector/connector.zip
new file mode 100644
index 0000000..3c37303
--- /dev/null
+++ b/asdc-tests/src/test/resources/CI/demoResourcesWanLan/connector/connector.zip
Binary files differ
diff --git a/asdc-tests/src/test/resources/CI/demoResourcesWanLan/deleteResourcesLanWanDemo.sh b/asdc-tests/src/test/resources/CI/demoResourcesWanLan/deleteResourcesLanWanDemo.sh
new file mode 100644
index 0000000..9f992d5
--- /dev/null
+++ b/asdc-tests/src/test/resources/CI/demoResourcesWanLan/deleteResourcesLanWanDemo.sh
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+function usage {
+ echo "Usage: $0 <hostIp> <hostPort>"
+}
+
+function deleteResource() {
+
+ ELEMENT_NAME=$1
+ echo "###################### Removing Element ${ELEMENT_NAME} Start ######################"
+ curl -X "DELETE" -H "USER_ID: jh0003" ${HOST_IP}:${HOST_PORT}/sdc2/rest/v1/catalog/resources/res_${ELEMENT_NAME}".1.0"
+ echo ""
+ echo "###################### Removing Element ${ELEMENT_NAME} End ########################"
+ echo ""
+ echo ""
+ echo ""
+}
+if [ $# -lt 2 ]
+then
+ usage
+ exit 2
+fi
+
+HOST_IP=$1
+HOST_PORT=$2
+
+
+deleteResource "org.openecomp.asdc.nodes.Connector.LAN_Connector"
+deleteResource "org.openecomp.asdc.nodes.Connector.WAN_Connector"
+deleteResource "org.openecomp.asdc.nodes.Connector"
+deleteResource "org.openecomp.asdc.nodes.VNF"
+deleteResource "org.openecomp.asdc.nodes.VNF_Container"
+deleteResource "org.openecomp.asdc.nodes.Router"
+deleteResource "org.openecomp.asdc.nodes.Root"
+
+
diff --git a/asdc-tests/src/test/resources/CI/demoResourcesWanLan/importResourcesLanWanDemo.sh b/asdc-tests/src/test/resources/CI/demoResourcesWanLan/importResourcesLanWanDemo.sh
new file mode 100644
index 0000000..90a06d5
--- /dev/null
+++ b/asdc-tests/src/test/resources/CI/demoResourcesWanLan/importResourcesLanWanDemo.sh
@@ -0,0 +1,49 @@
+#!/bin/bash
+
+function usage {
+ echo "Usage: $0 <hostIp> <hostPort>"
+}
+
+function addResource() {
+
+ ELEMENT_NAME=$1
+ echo -e "###################### Adding Element ${ELEMENT_NAME} Start ######################"
+ CURRENT_ZIP_FILE=./${ELEMENT_NAME}/${ELEMENT_NAME}.zip
+ CURRENT_JSON_FILE=./${ELEMENT_NAME}/${ELEMENT_NAME}.json
+ JSON_CONTENT=`paste -s ${CURRENT_JSON_FILE}`
+ curl -v -F resourceMetadata="${JSON_CONTENT}" -F resourceZip=@${CURRENT_ZIP_FILE} -H "USER_ID: jh0003" ${HOST_IP}:${HOST_PORT}/sdc2/rest/v1/catalog/upload/multipart
+ echo ""
+ echo -e "###################### Adding Element ${ELEMENT_NAME} End ########################"
+
+}
+if [ $# -lt 2 ]
+then
+ usage
+ exit 2
+fi
+
+HOST_IP=$1
+HOST_PORT=$2
+
+#Add The CapabilityTypes
+http_code=$(curl -s -o /dev/null -w "%{http_code}" -v -F capabilityTypeZip=@capabilityTypesWanLan.zip -H "USER_ID: jh0003" ${HOST_IP}:${HOST_PORT}/sdc2/rest/v1/catalog/uploadType/capability)
+if [ ${http_code} -eq 201 ]; then
+ echo -e "\n###################### Adding The CapabilityTypes status code:${http_code} End ########################\n\n\n"
+elif [ ${http_code} -eq 500 ]; then
+ echo -e "\n###################### Failed to add CapabilityTypes status code:${http_code} End ########################\n\n\n"
+ exit 1
+else
+ echo -e "\n###################### Failed to add CapabilityTypes status code:${http_code} End ########################\n\n\n"
+ exit 1
+fi
+
+addResource "root"
+addResource "router"
+addResource "VNF_Container"
+addResource "VNF"
+addResource "connector"
+addResource "WAN_Connector"
+addResource "LAN_Connector"
+
+
+
diff --git a/asdc-tests/src/test/resources/CI/demoResourcesWanLan/root/root.json b/asdc-tests/src/test/resources/CI/demoResourcesWanLan/root/root.json
new file mode 100644
index 0000000..54cbb79
--- /dev/null
+++ b/asdc-tests/src/test/resources/CI/demoResourcesWanLan/root/root.json
@@ -0,0 +1,11 @@
+{
+ "payloadName": "root.yml",
+ "contactId": "jh0003",
+ "resourceName": "org.openecomp.asdc.nodes.Root",
+ "description": "Represents a generic software component that can be managed and run by a Compute Node Type.",
+ "resourceIconPath": "defaulticon",
+ "category": "Abstract",
+ "tags": [
+ "org.openecomp.asdc.nodes.Root"
+ ]
+}
\ No newline at end of file
diff --git a/asdc-tests/src/test/resources/CI/demoResourcesWanLan/root/root.yml b/asdc-tests/src/test/resources/CI/demoResourcesWanLan/root/root.yml
new file mode 100644
index 0000000..34e7d0f
--- /dev/null
+++ b/asdc-tests/src/test/resources/CI/demoResourcesWanLan/root/root.yml
@@ -0,0 +1,3 @@
+org.openecomp.asdc.nodes.Root:
+ #Define the root node for ASDC modeling
+ derived_from: tosca.nodes.Root
\ No newline at end of file
diff --git a/asdc-tests/src/test/resources/CI/demoResourcesWanLan/root/root.zip b/asdc-tests/src/test/resources/CI/demoResourcesWanLan/root/root.zip
new file mode 100644
index 0000000..ff604d5
--- /dev/null
+++ b/asdc-tests/src/test/resources/CI/demoResourcesWanLan/root/root.zip
Binary files differ
diff --git a/asdc-tests/src/test/resources/CI/demoResourcesWanLan/router/router.json b/asdc-tests/src/test/resources/CI/demoResourcesWanLan/router/router.json
new file mode 100644
index 0000000..19e4669
--- /dev/null
+++ b/asdc-tests/src/test/resources/CI/demoResourcesWanLan/router/router.json
@@ -0,0 +1,11 @@
+{
+ "payloadName": "router.yml",
+ "contactId": "jh0003",
+ "resourceName": "org.openecomp.asdc.nodes.Router",
+ "description": "Represents a Router Node Type.",
+ "resourceIconPath": "defaulticon",
+ "category": "Infrastructure",
+ "tags": [
+ "org.openecomp.asdc.nodes.Router"
+ ]
+}
\ No newline at end of file
diff --git a/asdc-tests/src/test/resources/CI/demoResourcesWanLan/router/router.yml b/asdc-tests/src/test/resources/CI/demoResourcesWanLan/router/router.yml
new file mode 100644
index 0000000..0598663
--- /dev/null
+++ b/asdc-tests/src/test/resources/CI/demoResourcesWanLan/router/router.yml
@@ -0,0 +1,13 @@
+org.openecomp.asdc.nodes.Router:
+ #The Router node has a property "routing_table" which is a list. The entry of the routing_table is the customized data type "RoutingTableEntry"
+ derived_from: org.openecomp.asdc.nodes.Root
+ properties:
+ routing_table:
+ type: list
+ entry_schema:
+ #"entry_schema" is the TOSCA spec to describe the type of the list item
+ type: RoutingTableEntry
+ capabilities:
+ connectTo:
+ #The "connectTo" capability allows other TOSCA nodes (connectors) that requires such a capability to connect to this node.
+ type: org.openecomp.asdc.capabilities.Endpoint
\ No newline at end of file
diff --git a/asdc-tests/src/test/resources/CI/demoResourcesWanLan/router/router.zip b/asdc-tests/src/test/resources/CI/demoResourcesWanLan/router/router.zip
new file mode 100644
index 0000000..57ff8e0
--- /dev/null
+++ b/asdc-tests/src/test/resources/CI/demoResourcesWanLan/router/router.zip
Binary files differ