summaryrefslogtreecommitdiffstats
path: root/tosca2heat/tosca-parser/toscaparser/tests/data/policies
diff options
context:
space:
mode:
Diffstat (limited to 'tosca2heat/tosca-parser/toscaparser/tests/data/policies')
-rw-r--r--tosca2heat/tosca-parser/toscaparser/tests/data/policies/custom_definitions.yaml10
-rw-r--r--tosca2heat/tosca-parser/toscaparser/tests/data/policies/tosca_policy_template.yaml85
2 files changed, 95 insertions, 0 deletions
diff --git a/tosca2heat/tosca-parser/toscaparser/tests/data/policies/custom_definitions.yaml b/tosca2heat/tosca-parser/toscaparser/tests/data/policies/custom_definitions.yaml
new file mode 100644
index 0000000..7f15ade
--- /dev/null
+++ b/tosca2heat/tosca-parser/toscaparser/tests/data/policies/custom_definitions.yaml
@@ -0,0 +1,10 @@
+tosca_definitions_version: tosca_simple_yaml_1_0
+
+policy_types:
+ mycompany.mytypes.myScalingPolicy:
+ derived_from: tosca.policies.Scaling
+ metadata:
+ type: map
+ entry_schema:
+ type: string
+
diff --git a/tosca2heat/tosca-parser/toscaparser/tests/data/policies/tosca_policy_template.yaml b/tosca2heat/tosca-parser/toscaparser/tests/data/policies/tosca_policy_template.yaml
new file mode 100644
index 0000000..92bebe5
--- /dev/null
+++ b/tosca2heat/tosca-parser/toscaparser/tests/data/policies/tosca_policy_template.yaml
@@ -0,0 +1,85 @@
+tosca_definitions_version: tosca_simple_yaml_1_0
+
+description: >
+ Template for deploying servers based on policies.
+
+imports:
+ - custom_definitions.yaml
+
+topology_template:
+ node_templates:
+ my_server_1:
+ type: tosca.nodes.Compute
+ capabilities:
+ # Host container properties
+ host:
+ properties:
+ num_cpus: 2
+ disk_size: 10 GB
+ mem_size: 512 MB
+ # Guest Operating System properties
+ os:
+ properties:
+ # host Operating System image properties
+ architecture: x86_64
+ type: Linux
+ distribution: RHEL
+ version: 6.5
+
+ my_server_2:
+ type: tosca.nodes.Compute
+ capabilities:
+ host:
+ properties:
+ disk_size: 10 GB
+ num_cpus: 2
+ mem_size: 4096 MB
+ os:
+ properties:
+ architecture: x86_64
+ type: Linux
+ distribution: Ubuntu
+ version: 14.04
+
+ groups:
+ webserver_group:
+ members: [ my_server_1, my_server_2 ]
+ type: tosca.groups.Root
+ metadata: { user1: 1008, user2: 1002 }
+
+
+ policies:
+ - my_compute_placement_policy:
+ type: tosca.policies.Placement
+ description: Apply placement policy to servers
+ metadata: { user1: 1001, user2: 1002 }
+ targets: [ my_server_1, my_server_2 ]
+ triggers:
+ resize_compute:
+ description: trigger
+ event_type: tosca.events.resource.utilization
+ schedule:
+ start_time: "2015-05-07T07:00:00Z"
+ end_time: "2015-06-07T07:00:00Z"
+ target_filter:
+ node: master-container
+ requirement: host
+ capability: Container
+ condition:
+ constraint: utilization greater_than 50%
+ period: 60
+ evaluations: 1
+ method: average
+ action:
+ resize: # Operation name
+ inputs:
+ strategy: LEAST_USED
+ implementation: Senlin.webhook()
+ - my_groups_placement:
+ type: mycompany.mytypes.myScalingPolicy
+ targets: [ webserver_group ]
+ description: my company scaling policy
+ metadata:
+ user1: 1001
+ user2: 1003
+