From b678c5bfea0f1b142c2a4a5bdee1e3309a021887 Mon Sep 17 00:00:00 2001 From: zhipengh Date: Tue, 22 Dec 2015 15:04:53 +0800 Subject: JIRA:PARSER-15 Provide Standalone Heat-Translator Liberty Pypi Packages --- .../tests/data/test_host_assignment.yaml | 80 ++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 tosca2heat/heat-translator-0.3.0/translator/tests/data/test_host_assignment.yaml (limited to 'tosca2heat/heat-translator-0.3.0/translator/tests/data/test_host_assignment.yaml') diff --git a/tosca2heat/heat-translator-0.3.0/translator/tests/data/test_host_assignment.yaml b/tosca2heat/heat-translator-0.3.0/translator/tests/data/test_host_assignment.yaml new file mode 100644 index 0000000..acffd24 --- /dev/null +++ b/tosca2heat/heat-translator-0.3.0/translator/tests/data/test_host_assignment.yaml @@ -0,0 +1,80 @@ +tosca_definitions_version: tosca_simple_yaml_1_0 + +description: > + A template to test host assignment for translated hot resources. + It makes sure if a resource depends on multiple hosts only the + one with the "HostedOn" relationship is picked as the host. In + this template, the translated resource 'app_collectd_create_deploy' + would depend on 'logstash_server' and 'app_server'. But it would + have "HostedOn" relationship with 'app_server', and that server + would be its host. + +imports: + - custom_types/logstash.yaml + - custom_types/collectd.yaml + - custom_types/rsyslog.yaml + - custom_types/elasticsearch.yaml + +dsl_definitions: + host_capabilities: &host_capabilities + # compute properties (flavor) + disk_size: 10 GB + num_cpus: 1 + mem_size: 4096 MB + os_capabilities: &os_capabilities + architecture: x86_64 + type: Linux + distribution: Ubuntu + version: 14.04 + +topology_template: + node_templates: + app_collectd: + type: tosca.nodes.SoftwareComponent.Collectd + requirements: + - host: + node: app_server + - log_endpoint: + node: logstash + capability: log_endpoint + relationship: + type: tosca.relationships.ConnectsTo + interfaces: + Configure: + pre_configure_target: + implementation: logstash/configure_collectd.py + interfaces: + Standard: + create: collectd/create.sh + configure: + implementation: collectd/config.py + inputs: + logstash_ip: { get_attribute: [logstash_server, private_address] } + start: collectd/start.sh + + logstash: + type: tosca.nodes.SoftwareComponent.Logstash + requirements: + - host: + node: logstash_server + interfaces: + Standard: + create: logstash/create.sh + start: logstash/start.sh + + app_server: + type: tosca.nodes.Compute + capabilities: + os: + properties: *os_capabilities + host: + properties: *host_capabilities + + logstash_server: + type: tosca.nodes.Compute + capabilities: + os: + properties: *os_capabilities + host: + properties: *host_capabilities + -- cgit 1.2.3-korg