summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docs/installationprocedure/feature.configuration.rst9
-rw-r--r--docs/installationprocedure/featureconfig.rst (renamed from docs/configguide/featureconfig.rst)0
-rw-r--r--docs/installationprocedure/index.rst (renamed from docs/configguide/index.rst)9
-rw-r--r--docs/installationprocedure/installerconfig.rst (renamed from docs/configguide/installerconfig.rst)0
-rw-r--r--docs/parser_docs/policy2tosca/policy2tosca.rst87
-rwxr-xr-xtests/functest_run.sh193
-rw-r--r--tosca2heat/heat-translator/translator/hot/syntax/hot_resource.py18
-rw-r--r--tosca2heat/heat-translator/translator/hot/tests/test_translate_outputs.py4
-rw-r--r--tosca2heat/heat-translator/translator/hot/tosca/tosca_compute.py2
-rw-r--r--tosca2heat/heat-translator/translator/hot/tosca/tosca_network_network.py4
-rw-r--r--tosca2heat/heat-translator/translator/hot/translate_node_templates.py12
-rw-r--r--tosca2heat/heat-translator/translator/tests/data/hot_output/hot_elk.yaml25
-rw-r--r--tosca2heat/heat-translator/translator/tests/data/hot_output/hot_elk_from_csar.yaml27
-rw-r--r--tosca2heat/heat-translator/translator/tests/data/hot_output/hot_host_assignment.yaml2
-rw-r--r--tosca2heat/heat-translator/translator/tests/data/hot_output/hot_nfv_sample.yaml29
-rw-r--r--tosca2heat/heat-translator/translator/tests/data/hot_output/hot_nodejs_mongodb_two_instances.yaml8
-rw-r--r--tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_instance_wordpress.yaml2
-rw-r--r--tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_instance_wordpress_from_csar.yaml2
-rw-r--r--tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_server.yaml2
-rw-r--r--tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_server_with_defaults_with_input.yaml2
-rw-r--r--tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_server_with_defaults_without_input.yaml2
-rw-r--r--tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_attachment.yaml2
-rw-r--r--tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_attachment_notation1_alt1.yaml4
-rw-r--r--tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_attachment_notation1_alt2.yaml4
-rw-r--r--tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_attachment_notation2_alt1.yaml4
-rw-r--r--tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_attachment_notation2_alt2.yaml4
-rw-r--r--tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_custom_relationship_type.yaml2
-rw-r--r--tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_relationship_template.yaml2
-rw-r--r--tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_multiple_blockstorage_with_attachment_alt1.yaml4
-rw-r--r--tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_multiple_blockstorage_with_attachment_alt2.yaml4
-rw-r--r--tosca2heat/heat-translator/translator/tests/data/test_tosca_nfv_sample.yaml22
31 files changed, 286 insertions, 205 deletions
diff --git a/docs/installationprocedure/feature.configuration.rst b/docs/installationprocedure/feature.configuration.rst
new file mode 100644
index 0000000..86d7dfa
--- /dev/null
+++ b/docs/installationprocedure/feature.configuration.rst
@@ -0,0 +1,9 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+ .. (c) <optionally add copywriters name>
+
+
+Abstract
+========
+This document provides information on how to configure required
+components during the installation of the platform.
diff --git a/docs/configguide/featureconfig.rst b/docs/installationprocedure/featureconfig.rst
index dc4fc50..dc4fc50 100644
--- a/docs/configguide/featureconfig.rst
+++ b/docs/installationprocedure/featureconfig.rst
diff --git a/docs/configguide/index.rst b/docs/installationprocedure/index.rst
index 03ba4b0..13def7e 100644
--- a/docs/configguide/index.rst
+++ b/docs/installationprocedure/index.rst
@@ -3,13 +3,12 @@
.. http://creativecommons.org/licenses/by/4.0
.. (c) OPNFV, Ericsson AB and others.
-==========================
-Parser Configuration Guide
-==========================
+********************************************
+Parser Configuration and Configuration Guide
+********************************************
.. toctree::
:numbered:
:maxdepth: 2
-.. include:: featureconfig.rst
-.. include:: installerconfig.rst
+ feature.configuration.rst
diff --git a/docs/configguide/installerconfig.rst b/docs/installationprocedure/installerconfig.rst
index efe6265..efe6265 100644
--- a/docs/configguide/installerconfig.rst
+++ b/docs/installationprocedure/installerconfig.rst
diff --git a/docs/parser_docs/policy2tosca/policy2tosca.rst b/docs/parser_docs/policy2tosca/policy2tosca.rst
new file mode 100644
index 0000000..fa238b2
--- /dev/null
+++ b/docs/parser_docs/policy2tosca/policy2tosca.rst
@@ -0,0 +1,87 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+
+===================
+Parser POLICY2TOSCA
+===================
+
+Overview
+========
+
+Parser is an open source project and licensed under Apache 2. Parser will help
+to provide a tooling mechanism, by parsing Telecom operators’ VNF descriptors
+(YANG templates) into TOSCA templates and then further translate TOSCA
+templates into certain common templates, which could be used in IaaS orchestration
+projects like OpenStack Heat.
+
+Prerequisites
+=============
+
+Parser - POLICY2TOSCA requires the following to be installed.
+
+1. cliff
+--------
+
+Install cliff with the following links.
+::
+- `install <http://docs.openstack.org/developer/cliff/install.html>`
+or
+- `demoapp <http://docs.openstack.org/developer/cliff/demoapp.html>`
+
+Installation
+============================
+
+Please follow the below installation steps to install parser - POLICY2TOSCA.
+
+Step 1: Clone the parser project.
+
+.. code-block:: bash
+
+ git clone https://gerrit.opnfv.org/gerrit/parser
+
+Step 2: Install the policy2tosca module.
+
+.. code-block:: bash
+
+ cd parser/policy2tosca
+ python setup.py install
+
+Execution
+===========================
+
+Step 1: To see a list of commands available.
+
+.. code-block:: bash
+
+ policy2tosca --help
+
+Step 2: To see help for an individual command, include the command name on the command line
+
+.. code-block:: bash
+
+ policy2tosca help <service>
+
+Step 3: To inject/remove policy types/policy definitions provide the TOSCA file as input to policy2tosca command line.
+
+.. code-block:: bash
+
+ policy2tosca <service> [arguments]
+
+Example:
+
+.. code-block:: bash
+
+ policy2tosca add-definition --policy_name rule2 --policy_type tosca.policies.Placement.Geolocation --description "test description" --properties region:us-north-1,region:us-north-2,min_inst:2 --targets VNF2,VNF4 --metadata "map of strings" --triggers "1,2,3,4" --source example.yaml
+
+
+Step 4: Verify the TOSCA YAMl updated with the injection/removal executed.
+
+.. code-block:: bash
+
+ cat "<source tosca file>"
+
+Example:
+
+.. code-block:: bash
+
+ cat example_tosca.yaml
diff --git a/tests/functest_run.sh b/tests/functest_run.sh
index e5341c0..2b45089 100755
--- a/tests/functest_run.sh
+++ b/tests/functest_run.sh
@@ -9,7 +9,13 @@
##############################################################################
PARSER_CI_DEBUG=${CI_DEBUG:-false}
-[[ "${PARSER_CI_DEBUG}" == "true" ]] && set -x
+[[ "${PARSER_CI_DEBUG}" == "true" ]] && {
+ set -x
+ debug="--debug"
+} || {
+ set +x
+ debug=""
+}
PARSER_IMAGE_URL_FILE=cirros-0.3.0-x86_64-disk.img
PARSER_IMAGE_URL=https://launchpad.net/cirros/trunk/0.3.0/+download/${PARSER_IMAGE_URL_FILE}
@@ -30,29 +36,32 @@ PARSER_ROLE=admin
PARSER_STACK_NAME=vRNC_Stack
# VRNC_INPUT_TEMPLATE_FILE=../tosca2heat/tosca-parser/toscaparser/extensions/nfv/tests/data/vRNC/Definitions/vRNC.yaml
-VRNC_INPUT_TEMPLATE_FILE=../tosca2heat/heat-translator/translator/tests/data/test_tosca_nfv_sample.yaml
-
+VRNC_INPUT_TEMPLATE_RAW_FILE=../tosca2heat/heat-translator/translator/tests/data/test_tosca_nfv_sample.yaml
VRNC_OUTPUT_TEMPLATE_FILE=./vRNC_Hot_Template.yaml
+VRNC_INPUT_TEMPLATE_FILE=${VRNC_INPUT_TEMPLATE_RAW_FILE%.*}_patch.yaml
+
download_parser_image() {
[ -e "${PARSER_IMAGE_URL_FILE}" ] && {
- echo "Image ${PARSER_IMAGE_URL_FILE} has bee cached, needn't download again."
+ echo " Image ${PARSER_IMAGE_URL_FILE} has bee cached, needn't download again."
cp ${PARSER_IMAGE_URL_FILE} ${PARSER_IMAGE_FILE}
return 0
}
- echo "Download image ${PARSER_IMAGE_URL_FILE}..."
+ echo ""
+ echo " Download image ${PARSER_IMAGE_URL_FILE}..."
wget ${PARSER_IMAGE_URL} -o ${PARSER_IMAGE_FILE}
}
register_parser_image() {
- openstack image list | grep -qwo "${PARSER_IMAGE_NAME}" && {
- echo "Image ${PARSER_IMAGE_NAME} has bee registed, needn't registe again."
+ openstack ${debug} image list | grep -qwo "${PARSER_IMAGE_NAME}" && {
+ echo " Image ${PARSER_IMAGE_NAME} has bee registed, needn't registe again."
return 0
}
- echo "Registe image ${PARSER_IMAGE_NAME}..."
- openstack image create "${PARSER_IMAGE_NAME}" \
+ echo ""
+ echo " Registe image ${PARSER_IMAGE_NAME}..."
+ openstack ${debug} image create "${PARSER_IMAGE_NAME}" \
--public \
--disk-format ${PARSER_IMAGE_FORMAT} \
--container-format bare \
@@ -61,33 +70,32 @@ register_parser_image() {
create_parser_user_and_project() {
-
# 1. create parser project
- openstack project list | grep -qwo "${PARSER_PROJECT}" && {
- echo "Project ${PARSER_PROJECT} exist, doesn't create agian."
+ openstack ${debug} project list | grep -qwo "${PARSER_PROJECT}" && {
+ echo " Project ${PARSER_PROJECT} exist, doesn't create agian."
} || {
- openstack project create ${PARSER_PROJECT} \
+ openstack ${debug} project create ${PARSER_PROJECT} \
--description "Project for parser test"
- echo "Create project ${PARSER_PROJECT} successful."
+ echo " Create project ${PARSER_PROJECT} successful."
}
# 2. create parser user.
- openstack user list | grep -qwo ${PARSER_USER} && {
- echo "User ${PARSER_USER} exist, doesn't create again."
+ openstack ${debug} user list | grep -qwo ${PARSER_USER} && {
+ echo " User ${PARSER_USER} exist, doesn't create again."
} || {
- openstack user create ${PARSER_USER} --password ${PARSER_PASSWORD} \
+ openstack ${debug} user create ${PARSER_USER} --password ${PARSER_PASSWORD} \
--project ${PARSER_PROJECT} --email ${PARSER_EMAIL}
- echo "Create user ${PARSER_USER} successful."
+ echo " Create user ${PARSER_USER} successful."
}
# 3. grant role for parser user
- openstack user role list ${PARSER_USER} --project ${PARSER_PROJECT} \
+ openstack ${debug} user role list ${PARSER_USER} --project ${PARSER_PROJECT} \
| grep -qow ${PARSER_ROLE} && {
- echo "User ${PARSER_USER} has role ${PARSER_ROLE} in project ${PARSER_PROJECT}, doesn't create."
+ echo " User ${PARSER_USER} has role ${PARSER_ROLE} in project ${PARSER_PROJECT}, doesn't create."
} || {
- openstack role add ${PARSER_ROLE} --user ${PARSER_USER} \
+ openstack ${debug} role add ${PARSER_ROLE} --user ${PARSER_USER} \
--project ${PARSER_PROJECT}
- echo "Grant user ${PARSER_USER} the role ${PARSER_ROLE} in project ${PARSER_PROJECT} successful."
+ echo " Grant user ${PARSER_USER} the role ${PARSER_ROLE} in project ${PARSER_PROJECT} successful."
}
}
@@ -101,117 +109,140 @@ change_env_to_parser_user_project() {
}
+
+make_patch_for_provider_network() {
+
+ # copy temp file
+ echo " Patch provider network for input file:"
+ echo " Raw yaml file: ${VRNC_INPUT_TEMPLATE_RAW_FILE}"
+ echo " Patched yaml file: ${VRNC_INPUT_TEMPLATE_FILE}"
+ cp ${VRNC_INPUT_TEMPLATE_RAW_FILE} ${VRNC_INPUT_TEMPLATE_FILE}
+ echo ""
+
+ # Delete the provider:network_type
+ echo " Patch provider:network_type..."
+ sed -i '/network_type:/d' ${VRNC_INPUT_TEMPLATE_FILE}
+
+ # Delete the provider:segmentation_id
+ echo " Patch provider:segmentation_id..."
+ sed -i '/segmentation_id:/d' ${VRNC_INPUT_TEMPLATE_FILE}
+
+ # Delete the provider:physical_network
+ echo " Patch provider:physical_network..."
+ sed -i '/physical_network:/d' ${VRNC_INPUT_TEMPLATE_FILE}
+
+ echo ""
+
+}
+
+
translator_and_deploy_vRNC() {
+
(
# 1. Delete parser stack ${PARSER_STACK_NAME}, use admin user in admin project
- openstack stack list | grep -qow ${PARSER_STACK_NAME} && {
- echo "stack ${PARSER_STACK_NAME} exist, delete it first."
+ openstack ${debug} stack list | grep -qow ${PARSER_STACK_NAME} && {
+ echo " Stack ${PARSER_STACK_NAME} exist, delete it first."
openstack stack delete --yes --wait ${PARSER_STACK_NAME}
}
# 2. Switch env to parser project temporally
- echo "switch openstack env to parser project"
+ echo " Switch openstack env to parser project"
change_env_to_parser_user_project
+ echo ""
+
+ # 3. Patch provider network
+ echo " Make patch for provider network"
+ make_patch_for_provider_network
- # 3. Translator yaml
- echo "Translator input file ${VRNC_INPUT_TEMPLATE_FILE} and output is ${VRNC_OUTPUT_TEMPLATE_FILE}"
+ # 4. Translator yaml
+ echo " Translator use parser:"
+ echo " 1. Input file: ${VRNC_INPUT_TEMPLATE_FILE}"
+ echo " 2. Output file: ${VRNC_OUTPUT_TEMPLATE_FILE}"
heat-translator --template-type tosca --template-file ${VRNC_INPUT_TEMPLATE_FILE} \
--output-file ${VRNC_OUTPUT_TEMPLATE_FILE}
+ echo ""
- # 4. deploy vRNC
- echo "Deploy stack..."
- openstack stack create -t ${VRNC_OUTPUT_TEMPLATE_FILE} ${PARSER_STACK_NAME}
-
- # 5. Wait for create vRNC
- echo "Waiting for deploying stack..."
- sleep 180
+ # 5. deploy vRNC
+ echo " Deploy stack..."
+ [[ "${PARSER_CI_DEBUG}" == "true" ]] && debug="--debug" || debug=""
+ openstack ${debug} stack create --timeout 30 --wait --enable-rollback \
+ -t ${VRNC_OUTPUT_TEMPLATE_FILE} ${PARSER_STACK_NAME}
# 6. Validate the deploy result.
- echo "Checking the result of deployment..."
- # 1). check vdu
- openstack server list | grep -qwo "${PARSER_STACK_NAME}" && {
- echo " Check VDU successful."
- } || {
- echo " Check VDU unsuccessful."
- exit 1
- }
- # 2). check VL-network
- openstack network list | grep -qwo "${PARSER_STACK_NAME}" && {
- echo " Check VL-network successful."
- } || {
- echo " Check VL-network unsuccessful."
- exit 1
- }
- # 3). check VL-subnet
- openstack subnet list | grep -qwo "${PARSER_STACK_NAME}" && {
- echo " Check VL-subnet successful."
- } || {
- echo " Check VL-subnet unsuccessful."
- exit 1
- }
- # 4). check port
- neutron port-list | grep -qwo "${PARSER_STACK_NAME}" && {
- echo " Check CP successful."
+ echo " Checking the result of deployment..."
+ openstack ${debug} stack show ${PARSER_STACK_NAME} | grep -qow "CREATE_COMPLETE" && {
+ echo " Check the result of deployment successfully."
} || {
- echo " Check CP unsuccessful."
- exit 1
+ echo " Check the result of deployment unsuccessfully."
}
- echo "Checkthe result of deployment successfully."
)
}
reset_parser_test() {
+
set +e
- echo "cleanup..."
+ echo " Clean-up the environment..."
# 1. Delete resource created by parser user
(
# 1). Switch env to parser project temporally
change_env_to_parser_user_project
# 2). Delete the stack ${PARSER_STACK_NAME}
- openstack stack list | grep -qow ${PARSER_STACK_NAME} && {
- echo "stack ${PARSER_STACK_NAME} has been created, delete it after test."
- openstack stack delete --yes --wait ${PARSER_STACK_NAME}
+ echo ""
+ openstack ${debug} stack list | grep -qow ${PARSER_STACK_NAME} && {
+ echo " Stack ${PARSER_STACK_NAME} has been created, delete it after test."
+ echo ""
+ openstack ${debug} stack delete --yes --wait ${PARSER_STACK_NAME}
+ echo ""
+ }
+
+ # 3). Delete patch tmp file ${VRNC_INPUT_TEMPLATE_FILE}
+ [ -e ${VRNC_OUTPUT_TEMPLATE_FILE} -a ${PARSER_CI_DEBUG} != "true" ] && {
+ echo " Delete patch temp file ${VRNC_INPUT_TEMPLATE_FILE} after test."
+ rm -fr ${VRNC_INPUT_TEMPLATE_FILE}
}
- # 3). Delete hot tmp file ${VRNC_OUTPUT_TEMPLATE_FILE}
+ # 4). Delete hot tmp file ${VRNC_OUTPUT_TEMPLATE_FILE}
[ -e ${VRNC_OUTPUT_TEMPLATE_FILE} -a ${PARSER_CI_DEBUG} != "true" ] && {
- echo "delete hot temp file ${VRNC_OUTPUT_TEMPLATE_FILE} after test."
+ echo " Delete hot temp file ${VRNC_OUTPUT_TEMPLATE_FILE} after test."
rm -fr ${VRNC_OUTPUT_TEMPLATE_FILE}
}
- # 4). Delete tmp image ${PARSER_IMAGE_FILE}
+ # 5). Delete tmp image ${PARSER_IMAGE_FILE}
[[ -e ${PARSER_IMAGE_FILE} ]] && {
- echo "delete local image file ${PARSER_IMAGE_FILE} after test."
+ echo " Delete local image file ${PARSER_IMAGE_FILE} after test."
rm -fr ${PARSER_IMAGE_FILE}
}
- # 5). Delete tmp image ${PARSER_IMAGE_URL_FILE}
+ # 6). Delete tmp image ${PARSER_IMAGE_URL_FILE}
[ -e ${PARSER_IMAGE_URL_FILE} -a ${PARSER_CI_DEBUG} != "true" ] && {
- echo "delete local URL image file ${PARSER_IMAGE_URL_FILE} after test."
+ echo " Delete local URL image file ${PARSER_IMAGE_URL_FILE} after test."
rm -fr ${PARSER_IMAGE_URL_FILE}
}
- # 6). Delete image from openstack
- parser_image_id=$(openstack image list | grep -w "${PARSER_IMAGE_NAME}" | awk '{print $2}')
+ # 7). Delete image from openstack
+ parser_image_id=$(openstack ${debug} image list | grep -w "${PARSER_IMAGE_NAME}" | awk '{print $2}')
[[ -n "${parser_image_id}" ]] && openstack image delete "${parser_image_id}"
sleep 3
)
# 2. Delete role, user and project
- openstack user role list "${PARSER_USER}" --project "${PARSER_PROJECT}" \
- | grep -qow " ${PARSER_ROLE}" && {
- openstack role remove "${PARSER_ROLE}" --user "${PARSER_USER}" \
+ echo " Delete user ${PARSER_USER}'s role from project ${PARSER_PROJECT}"
+ openstack ${debug} user role list "${PARSER_USER}" --project "${PARSER_PROJECT}" \
+ | grep -qow "${PARSER_ROLE}" && {
+ openstack ${debug} role remove "${PARSER_ROLE}" --user "${PARSER_USER}" \
--project "${PARSER_PROJECT}"
}
- openstack user list | grep -qow "${PARSER_USER}" && {
+ echo " Delete user ${PARSER_USER}"
+ openstack ${debug} user list | grep -qow "${PARSER_USER}" && {
openstack user delete "${PARSER_USER}"
}
- openstack project list | grep -qwo "${PARSER_PROJECT}" && {
+ echo " Delete project ${PARSER_PROJECT}"
+ openstack ${debug} project list | grep -qwo "${PARSER_PROJECT}" && {
openstack project delete "${PARSER_PROJECT}"
}
@@ -236,10 +267,14 @@ echo "|========= 1/4. Preparing VM image for parser... =========|"
download_parser_image
register_parser_image
+echo ""
echo "|========= 2/4. Creating test user for parser... =========|"
create_parser_user_and_project
+echo ""
echo "|========= 3/4. Parse -> translate -> deploy vRNC... =========|"
translator_and_deploy_vRNC
+echo ""
echo "|========= 4/4. Test ok... =========|"
+echo ""
diff --git a/tosca2heat/heat-translator/translator/hot/syntax/hot_resource.py b/tosca2heat/heat-translator/translator/hot/syntax/hot_resource.py
index 261d8ee..8994c63 100644
--- a/tosca2heat/heat-translator/translator/hot/syntax/hot_resource.py
+++ b/tosca2heat/heat-translator/translator/hot/syntax/hot_resource.py
@@ -357,9 +357,10 @@ class HotResource(object):
node_type = node.type_definition
if isinstance(node_type, str) or \
- node_type.type == "tosca.policies.Placement" or \
- node_type.type == "tosca.policies.Colocate" or \
- node_type.type == "tosca.policies.Antilocate":
+ node_type.is_derived_from("tosca.policies.Root"):
+ # node_type.type == "tosca.policies.Placement" or \
+ # node_type.type == "tosca.policies.Placement.Colocate" or \
+ # node_type.type == "tosca.policies.Placement.Antilocate":
return operations
while True:
@@ -377,9 +378,10 @@ class HotResource(object):
def _get_interface_operations_from_type(node_type, node, lifecycle_name):
operations = {}
if isinstance(node_type, str) or \
- node_type.type == "tosca.policies.Placement" or \
- node_type.type == "tosca.policies.Colocate" or \
- node_type.type == "tosca.policies.Antilocate":
+ node_type.is_derived_from("tosca.policies.Root"):
+ # node_type.type == "tosca.policies.Placement" or \
+ # node_type.type == "tosca.policies.Placement.Colocate" or \
+ # node_type.type == "tosca.policies.Placement.Antilocate":
return operations
if node_type.interfaces and lifecycle_name in node_type.interfaces:
for name, elems in node_type.interfaces[lifecycle_name].items():
@@ -396,8 +398,8 @@ class HotResource(object):
def get_base_type(node_type):
if node_type.parent_type is not None:
if node_type.parent_type.type.endswith('.Root') or \
- node_type.type == "tosca.policies.Colocate" or \
- node_type.type == "tosca.policies.Antilocate":
+ node_type.type == "tosca.policies.Placement.Colocate" or \
+ node_type.type == "tosca.policies.Placement.Antilocate":
return node_type
else:
return HotResource.get_base_type(node_type.parent_type)
diff --git a/tosca2heat/heat-translator/translator/hot/tests/test_translate_outputs.py b/tosca2heat/heat-translator/translator/hot/tests/test_translate_outputs.py
index 955150e..c02a547 100644
--- a/tosca2heat/heat-translator/translator/hot/tests/test_translate_outputs.py
+++ b/tosca2heat/heat-translator/translator/hot/tests/test_translate_outputs.py
@@ -33,12 +33,12 @@ class ToscaTemplateOutputTest(TestCase):
'server, http://<IP>:3000',
'value':
{'get_attr':
- ['app_server', 'networks', 'private', 0]}},
+ ['app_server', 'networks']}},
'mongodb_url':
{'description': 'URL for the mongodb server.',
'value':
{'get_attr':
- ['mongo_server', 'networks', 'private', 0]}}}
+ ['mongo_server', 'networks']}}}
hot_translation_dict = \
toscaparser.utils.yamlparser.simple_parse(hot_translation)
diff --git a/tosca2heat/heat-translator/translator/hot/tosca/tosca_compute.py b/tosca2heat/heat-translator/translator/hot/tosca/tosca_compute.py
index 45637ec..9ceb049 100644
--- a/tosca2heat/heat-translator/translator/hot/tosca/tosca_compute.py
+++ b/tosca2heat/heat-translator/translator/hot/tosca/tosca_compute.py
@@ -332,7 +332,7 @@ class ToscaCompute(HotResource):
attriute.'))
if attribute == 'private_address' or \
attribute == 'public_address':
- attr['get_attr'] = [self.name, 'networks', 'private', 0]
+ attr['get_attr'] = [self.name, 'networks']
return attr
diff --git a/tosca2heat/heat-translator/translator/hot/tosca/tosca_network_network.py b/tosca2heat/heat-translator/translator/hot/tosca/tosca_network_network.py
index 2b80313..a4e565e 100644
--- a/tosca2heat/heat-translator/translator/hot/tosca/tosca_network_network.py
+++ b/tosca2heat/heat-translator/translator/hot/tosca/tosca_network_network.py
@@ -57,8 +57,8 @@ class ToscaNetwork(HotResource):
self.existing_resource_id = value
break
elif key == 'segmentation_id':
- net_props['segmentation_id'] = \
- tosca_props['segmentation_id']
+ # net_props['segmentation_id'] = \
+ # tosca_props['segmentation_id']
# Hardcode to vxlan for now until we add the network type
# and physical network to the spec.
net_props['value_specs'] = {'provider:segmentation_id':
diff --git a/tosca2heat/heat-translator/translator/hot/translate_node_templates.py b/tosca2heat/heat-translator/translator/hot/translate_node_templates.py
index f32d42b..4dd9556 100644
--- a/tosca2heat/heat-translator/translator/hot/translate_node_templates.py
+++ b/tosca2heat/heat-translator/translator/hot/translate_node_templates.py
@@ -533,14 +533,20 @@ class TranslateNodeTemplates(object):
def _get_attachment_node(self, node, suffix, volume_name):
attach = False
ntpl = self.nodetemplates
- for key, value in node.relationships.items():
- if key.is_derived_from('tosca.relationships.AttachesTo'):
- if value.is_derived_from('tosca.nodes.BlockStorage'):
+ for key_r, value_n in node.relationships.items():
+ if key_r.is_derived_from('tosca.relationships.AttachesTo'):
+ if value_n.is_derived_from('tosca.nodes.BlockStorage'):
attach = True
if attach:
relationship_tpl = None
for req in node.requirements:
for key, val in req.items():
+ if isinstance(val, dict):
+ if value_n.name != val.get('node'):
+ continue
+ else:
+ if value_n.name != val:
+ continue
attach = val
relship = val.get('relationship')
for rkey, rval in val.items():
diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_elk.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_elk.yaml
index a298745..1fbd44e 100644
--- a/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_elk.yaml
+++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_elk.yaml
@@ -52,8 +52,6 @@ resources:
get_attr:
- mongo_server
- networks
- - private
- - 0
server:
get_resource: app_server
depends_on:
@@ -110,8 +108,6 @@ resources:
get_attr:
- mongo_server
- networks
- - private
- - 0
server:
get_resource: mongo_server
depends_on:
@@ -186,8 +182,6 @@ resources:
get_attr:
- logstash_server
- networks
- - private
- - 0
server:
get_resource: app_server
depends_on:
@@ -279,8 +273,6 @@ resources:
get_attr:
- logstash_server
- networks
- - private
- - 0
server:
get_resource: app_server
depends_on:
@@ -355,8 +347,6 @@ resources:
get_attr:
- elasticsearch_server
- networks
- - private
- - 0
server:
get_resource: logstash_server
depends_on:
@@ -430,14 +420,10 @@ resources:
get_attr:
- elasticsearch_server
- networks
- - private
- - 0
kibana_ip:
get_attr:
- kibana_server
- networks
- - private
- - 0
server:
get_resource: kibana_server
depends_on:
@@ -510,8 +496,6 @@ outputs:
get_attr:
- app_server
- networks
- - private
- - 0
mongodb_url:
description: URL for the mongodb server.
@@ -519,8 +503,6 @@ outputs:
get_attr:
- mongo_server
- networks
- - private
- - 0
logstash_url:
description: URL for the logstash server.
@@ -528,8 +510,6 @@ outputs:
get_attr:
- logstash_server
- networks
- - private
- - 0
elasticsearch_url:
description: URL for the elasticsearch server.
@@ -537,8 +517,6 @@ outputs:
get_attr:
- elasticsearch_server
- networks
- - private
- - 0
kibana_url:
description: URL for the kibana server.
@@ -546,6 +524,3 @@ outputs:
get_attr:
- kibana_server
- networks
- - private
- - 0
-
diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_elk_from_csar.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_elk_from_csar.yaml
index 5eb1701..50491ef 100644
--- a/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_elk_from_csar.yaml
+++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_elk_from_csar.yaml
@@ -52,8 +52,7 @@ resources:
get_attr:
- mongo_server
- networks
- - private
- - 0
+
server:
get_resource: app_server
depends_on:
@@ -110,8 +109,7 @@ resources:
get_attr:
- mongo_server
- networks
- - private
- - 0
+
server:
get_resource: mongo_server
depends_on:
@@ -186,8 +184,6 @@ resources:
get_attr:
- logstash_server
- networks
- - private
- - 0
server:
get_resource: app_server
depends_on:
@@ -279,8 +275,6 @@ resources:
get_attr:
- logstash_server
- networks
- - private
- - 0
server:
get_resource: app_server
depends_on:
@@ -355,8 +349,6 @@ resources:
get_attr:
- elasticsearch_server
- networks
- - private
- - 0
server:
get_resource: logstash_server
depends_on:
@@ -430,14 +422,11 @@ resources:
get_attr:
- elasticsearch_server
- networks
- - private
- - 0
kibana_ip:
get_attr:
- kibana_server
- networks
- - private
- - 0
+
server:
get_resource: kibana_server
depends_on:
@@ -510,8 +499,6 @@ outputs:
get_attr:
- app_server
- networks
- - private
- - 0
mongodb_url:
description: URL for the mongodb server.
@@ -519,8 +506,6 @@ outputs:
get_attr:
- mongo_server
- networks
- - private
- - 0
logstash_url:
description: URL for the logstash server.
@@ -528,8 +513,6 @@ outputs:
get_attr:
- logstash_server
- networks
- - private
- - 0
elasticsearch_url:
description: URL for the elasticsearch server.
@@ -537,8 +520,6 @@ outputs:
get_attr:
- elasticsearch_server
- networks
- - private
- - 0
kibana_url:
description: URL for the kibana server.
@@ -546,6 +527,4 @@ outputs:
get_attr:
- kibana_server
- networks
- - private
- - 0
diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_host_assignment.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_host_assignment.yaml
index 33f3059..29f12cc 100644
--- a/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_host_assignment.yaml
+++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_host_assignment.yaml
@@ -59,8 +59,6 @@ resources:
get_attr:
- logstash_server
- networks
- - private
- - 0
server:
get_resource: app_server
depends_on:
diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_nfv_sample.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_nfv_sample.yaml
index f2d14ed..79750d4 100644
--- a/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_nfv_sample.yaml
+++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_nfv_sample.yaml
@@ -8,36 +8,60 @@ resources:
VDU1:
type: OS::Nova::Server
properties:
- flavor: m1.medium
+ flavor: m1.tiny
image: rhel-6.5-test-image
networks:
- port: { get_resource: CP1 }
user_data_format: SOFTWARE_CONFIG
depends_on:
- VDU2
+ - BlockStorage
+
VDU2:
type: OS::Nova::Server
properties:
- flavor: m1.medium
+ flavor: m1.tiny
image: rhel-6.5-test-image
networks:
- port: { get_resource: CP2 }
user_data_format: SOFTWARE_CONFIG
+ BlockStorage:
+ type: OS::Cinder::Volume
+ properties:
+ size: 1
+
+ tosca.relationships.attachesto_1:
+ type: OS::Cinder::VolumeAttachment
+ properties:
+ instance_uuid:
+ get_resource: VDU1
+ mountpoint: /dev/vdb1
+ volume_id:
+ get_resource: BlockStorage
+
CP1:
type: OS::Neutron::Port
properties:
fixed_ips:
- ip_address: '192.168.0.55'
network: { get_resource: VL1 }
+
CP2:
type: OS::Neutron::Port
properties:
fixed_ips:
- ip_address: '192.168.0.56'
network: { get_resource: VL1 }
+
VL1:
type: OS::Neutron::Net
+ properties:
+ name: test_net
+ value_specs:
+ provider:network_type: vxlan
+ provider:segmentation_id: 100
+
VL1_subnet:
type: OS::Neutron::Subnet
properties:
@@ -48,5 +72,6 @@ resources:
gateway_ip: 192.168.0.1
cidr: 192.168.0.0/24
network: { get_resource: VL1 }
+
outputs: {}
diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_nodejs_mongodb_two_instances.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_nodejs_mongodb_two_instances.yaml
index b95120b..3406b51 100644
--- a/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_nodejs_mongodb_two_instances.yaml
+++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_nodejs_mongodb_two_instances.yaml
@@ -46,8 +46,6 @@ resources:
get_attr:
- mongo_server
- networks
- - private
- - 0
server:
get_resource: mongo_server
depends_on:
@@ -120,8 +118,6 @@ resources:
get_attr:
- mongo_server
- networks
- - private
- - 0
server:
get_resource: app_server
depends_on:
@@ -173,13 +169,9 @@ outputs:
get_attr:
- mongo_server
- networks
- - private
- - 0
nodejs_url:
description: URL for the nodejs server, http://<IP>:3000
value:
get_attr:
- app_server
- networks
- - private
- - 0
diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_instance_wordpress.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_instance_wordpress.yaml
index 8c10a93..fbbeab2 100644
--- a/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_instance_wordpress.yaml
+++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_instance_wordpress.yaml
@@ -205,5 +205,3 @@ outputs:
get_attr:
- server
- networks
- - private
- - 0
diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_instance_wordpress_from_csar.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_instance_wordpress_from_csar.yaml
index 3598540..02c0543 100644
--- a/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_instance_wordpress_from_csar.yaml
+++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_instance_wordpress_from_csar.yaml
@@ -203,5 +203,3 @@ outputs:
get_attr:
- server
- networks
- - private
- - 0
diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_server.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_server.yaml
index 5cffb43..e494791 100644
--- a/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_server.yaml
+++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_server.yaml
@@ -32,5 +32,3 @@ outputs:
get_attr:
- my_server
- networks
- - private
- - 0
diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_server_with_defaults_with_input.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_server_with_defaults_with_input.yaml
index 1eb88a7..6211cad 100644
--- a/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_server_with_defaults_with_input.yaml
+++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_server_with_defaults_with_input.yaml
@@ -32,5 +32,3 @@ outputs:
get_attr:
- my_server
- networks
- - private
- - 0
diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_server_with_defaults_without_input.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_server_with_defaults_without_input.yaml
index 4e7e6b5..22a0198 100644
--- a/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_server_with_defaults_without_input.yaml
+++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_single_server_with_defaults_without_input.yaml
@@ -32,5 +32,3 @@ outputs:
get_attr:
- my_server
- networks
- - private
- - 0
diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_attachment.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_attachment.yaml
index 5ff5382..6803858 100644
--- a/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_attachment.yaml
+++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_attachment.yaml
@@ -63,8 +63,6 @@ outputs:
get_attr:
- my_server
- networks
- - private
- - 0
volume_id:
description: The volume id of the block storage instance.
value:
diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_attachment_notation1_alt1.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_attachment_notation1_alt1.yaml
index 9ffaf23..0450b1f 100644
--- a/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_attachment_notation1_alt1.yaml
+++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_attachment_notation1_alt1.yaml
@@ -76,16 +76,12 @@ outputs:
get_attr:
- my_web_app_tier_1
- networks
- - private
- - 0
private_ip_2:
description: The private IP address of the applications second tier.
value:
get_attr:
- my_web_app_tier_2
- networks
- - private
- - 0
volume_id:
description: The volume id of the block storage instance.
value:
diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_attachment_notation1_alt2.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_attachment_notation1_alt2.yaml
index 9b5e71c..e65e789 100644
--- a/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_attachment_notation1_alt2.yaml
+++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_attachment_notation1_alt2.yaml
@@ -76,16 +76,12 @@ outputs:
get_attr:
- my_web_app_tier_1
- networks
- - private
- - 0
private_ip_2:
description: The private IP address of the applications second tier.
value:
get_attr:
- my_web_app_tier_2
- networks
- - private
- - 0
volume_id:
description: The volume id of the block storage instance.
value:
diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_attachment_notation2_alt1.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_attachment_notation2_alt1.yaml
index 1b4eb73..a8c114e 100644
--- a/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_attachment_notation2_alt1.yaml
+++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_attachment_notation2_alt1.yaml
@@ -80,16 +80,12 @@ outputs:
get_attr:
- my_web_app_tier_1
- networks
- - private
- - 0
private_ip_2:
description: The private IP address of the applications second tier.
value:
get_attr:
- my_web_app_tier_2
- networks
- - private
- - 0
volume_id:
description: The volume id of the block storage instance.
value:
diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_attachment_notation2_alt2.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_attachment_notation2_alt2.yaml
index 0311a55..59b46ae 100644
--- a/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_attachment_notation2_alt2.yaml
+++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_attachment_notation2_alt2.yaml
@@ -80,16 +80,12 @@ outputs:
get_attr:
- my_web_app_tier_1
- networks
- - private
- - 0
private_ip_2:
description: The private IP address of the applications second tier.
value:
get_attr:
- my_web_app_tier_2
- networks
- - private
- - 0
volume_id:
description: The volume id of the block storage instance.
value:
diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_custom_relationship_type.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_custom_relationship_type.yaml
index bce4603..639832c 100644
--- a/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_custom_relationship_type.yaml
+++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_custom_relationship_type.yaml
@@ -64,8 +64,6 @@ outputs:
get_attr:
- my_server
- networks
- - private
- - 0
volume_id:
description: The volume id of the block storage instance.
value:
diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_relationship_template.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_relationship_template.yaml
index e17dff9..20b77c2 100644
--- a/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_relationship_template.yaml
+++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_blockstorage_with_relationship_template.yaml
@@ -57,8 +57,6 @@ outputs:
get_attr:
- my_server
- networks
- - private
- - 0
volume_id:
description: The volume id of the block storage instance.
value:
diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_multiple_blockstorage_with_attachment_alt1.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_multiple_blockstorage_with_attachment_alt1.yaml
index 55ada08..cff83f9 100644
--- a/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_multiple_blockstorage_with_attachment_alt1.yaml
+++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_multiple_blockstorage_with_attachment_alt1.yaml
@@ -89,16 +89,12 @@ outputs:
get_attr:
- my_server
- networks
- - private
- - 0
server_ip_2:
description: The private IP address of the applications second server.
value:
get_attr:
- my_server2
- networks
- - private
- - 0
volume_id_1:
description: The volume id of the first block storage instance.
value:
diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_multiple_blockstorage_with_attachment_alt2.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_multiple_blockstorage_with_attachment_alt2.yaml
index 3386d79..0fdcb4b 100644
--- a/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_multiple_blockstorage_with_attachment_alt2.yaml
+++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/storage/hot_multiple_blockstorage_with_attachment_alt2.yaml
@@ -89,16 +89,12 @@ outputs:
get_attr:
- my_server
- networks
- - private
- - 0
server_ip_2:
description: The private IP address of the applications second server.
value:
get_attr:
- my_server2
- networks
- - private
- - 0
volume_id_1:
description: The volume id of the first block storage instance.
value:
diff --git a/tosca2heat/heat-translator/translator/tests/data/test_tosca_nfv_sample.yaml b/tosca2heat/heat-translator/translator/tests/data/test_tosca_nfv_sample.yaml
index 538d63d..5803bd2 100644
--- a/tosca2heat/heat-translator/translator/tests/data/test_tosca_nfv_sample.yaml
+++ b/tosca2heat/heat-translator/translator/tests/data/test_tosca_nfv_sample.yaml
@@ -10,8 +10,8 @@ topology_template:
capabilities:
host:
properties:
- num_cpus: 2
- disk_size: 10 GB
+ num_cpus: 1
+ disk_size: 1 GB
mem_size: 512 MB
# Guest Operating System properties
os:
@@ -23,14 +23,25 @@ topology_template:
version: 6.5
requirements:
- high_availability: VDU2
+ - local_storage:
+ node: BlockStorage
+ relationship:
+ type: tosca.relationships.AttachesTo
+ properties:
+ location: /dev/vdb1
+
+ BlockStorage:
+ type: tosca.nodes.BlockStorage
+ properties:
+ size: 1 GB
VDU2:
type: tosca.nodes.nfv.VDU
capabilities:
host:
properties:
- num_cpus: 2
- disk_size: 10 GB
+ num_cpus: 1
+ disk_size: 1 GB
mem_size: 512 MB
# Guest Operating System properties
os:
@@ -73,3 +84,6 @@ topology_template:
start_ip: '192.168.0.50'
end_ip: '192.168.0.200'
gateway_ip: '192.168.0.1'
+ network_name: test_net
+ network_type: vxlan
+ segmentation_id: 100