Policy
Edit (pull request)A policy applies on a group of nodes in a topology template.
Only one policy type is currently supported in A4C : tosca.policy.ha
This policy is not described by TOSCA (policies are actually a WIP). We have defined this one to support high availability features.
Keynames
The following is the list of recognized keynames recognized for a TOSCA Policy definition and parsed by Alien4Cloud:
| Keyname | Required | Description |
|---|---|---|
| name | yes | The required name of the policy. |
| type | yes | The type of the policy. |
Several notation are availables to express policy.
Standard Grammar
name: <policy_name>
type: <policy_type_name>Example
node_templates:
server1:
type: tosca.nodes.Compute
server2:
type: tosca.nodes.Compute
groups:
server_group_1:
members: [ server1, server2 ]
policies:
- name: my_scaling_ha_policy
type: tosca.policy.haShortcut Grammar
<policy_name>: <policy_type_name>Example
node_templates:
server1:
type: tosca.nodes.Compute
server2:
type: tosca.nodes.Compute
groups:
server_group_1:
members: [ server1, server2 ]
policies:
- my_scaling_ha_policy: tosca.policy.haTOSCA Samples Grammar
This grammar has been used in TOSCA simple profile example. We support it for compatibility but don’t recommend it.
<policy_name>:
type: <policy_type_name>Example
node_templates:
server1:
type: tosca.nodes.Compute
server2:
type: tosca.nodes.Compute
groups:
server_group_1:
members: [ server1, server2 ]
policies:
- my_scaling_ha_policy:
type: tosca.policy.ha