Page tree
Skip to end of metadata
Go to start of metadata

A policy definition defines a policy that can be associated with a TOSCA topology or top-level entity definition (e.g., group definition, node template, etc.).

Example

The following represents a policy definition:

policies:

  - my_compute_placement_policy:

      type: tosca.policies.placement

      description: Apply my placement policy to my application’s servers

      targets: [ my_server_1, my_server_2 ]

      # remainder of policy definition left off for brevity

Grammar

Policy definitions have one the following grammars:

<policy_name>:

  type: <policy_type_name>

  description: <policy_description>

  metadata:

    <map of string>

  properties:

    <property_assignments>

  targets: [<list_of_policy_targets>]

  triggers:

    <list_of_trigger_definitions>

In the above grammar, the pseudo values that appear in angle brackets have the following meaning:

  • policy_name: represents the required symbolic name of the policy as a string.
  • policy_type_name: represents the name of the policy the definition is based upon.
  • policy_description: contains an optional description of the policy.
  • property_assignments: represents the optional list of property assignments for the policy definition  that provide values for properties defined in its declared Policy Type.
  • list_of_policy_targets: represents the optional list of names of node templates or groups that the policy is to applied to.
  • list_of_trigger_definitions: represents the optional list of trigger definitions for the policy.

Keynotes

The following is the list of recognized keynames for a TOSCA policy definition:

Keyname

Required

Type

Description

type

yes

string

The required name of the policy type the policy definition is based upon.

description

no

description

The optional description for the policy definition.

metadata

no

map of string

Defines a section used to declare additional metadata information.

properties

no

list of

property assignments

An optional list of property value assignments for the policy definition.

targets

 

no

string[]

An optional list of valid Node Templates or Groups the Policy can be applied to.

 

 

  • No labels