blob: 3f8e78e791fb1b74121a99fe33c644163b014019 [file] [log] [blame]
liamfallone62f7112019-05-24 10:50:57 +00001.. This work is licensed under a
2.. Creative Commons Attribution 4.0 International License.
3.. http://creativecommons.org/licenses/by/4.0
4
5.. _tosca-label:
6
7TOSCA Policy Primer
8-------------------
9
10.. contents::
11 :depth: 2
12
13This page gives a short overview of how Policy is modelled in the
14`TOSCA Simple Profile in YAML <http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.1/TOSCA-Simple-Profile-YAML-v1.1.pdf>`__.
15
16TOSCA defines three concepts for Policy: Policy Type, Policy, and Trigger.
17
liamfallon4d1d9832019-05-30 20:53:05 +000018.. image:: images/TOSCAPolicyConcepts.svg
liamfallone62f7112019-05-24 10:50:57 +000019 :width: 800
20
21Policy Type
22~~~~~~~~~~~
23
24A Policy Type is used to specify the types of policies that may be used in a service. The parameter definitions
25for a policy of this type, the entity types to which it applies, and what triggers policies of this type may be
26specified.
27
28
29The types of policies that are used in a service are defined in the policy_types section of the TOSCA service template
30as a Policy Type. More formally, TOSCA defines a Policy Type as an artifact that "defines a type of requirement that
31affects or governs an application or service’s topology at some stage of its life cycle, but is not explicitly part of
32the topology itself". In the definition of a Policy Type in TOSCA, you specify:
33
34* its properties, which define the type of configuration parameters that the policy takes
35* its targets, which define the node types and/or groups to which the policy type applies
36* its triggers, which specify the conditions in which policies of this type are fired
37
38Policy
39~~~~~~
40
41A Policy is used to specify the actual instances of policies that are used in a service. The parameter values of the
42policy and the actual entities to which it applies may be specified.
43
44The policies that are used in a service are defined in the policies section of the TOSCA topology template as a Policy.
45More formally, TOSCA defines a Policy as an artifact that "defines a policy that can be associated with a TOSCA
46topology or top-level entity definition". In the definition of a Policy in TOSCA, you specify:
47
48* its properties, which define the values of the configuration parameters that the policy takes
49* its targets, which define the node types and/or group types to which the policy type applies
50
51Note that policy triggers are specified on the Policy Type definition and are not specified on the Policy itself.
52
53Trigger
54~~~~~~~
55
56A Trigger defines an event, condition, and action that is used to initiate execution of a policy associated with it.
57The definition of the Trigger allows specification of the type of events to trigger on, the filters on those events,
58conditions and constraints for trigger firing, the action to perform on triggering, and various other parameters.
59
60The triggers that are used in a service are defined as reusable modules in the TOSCA service template as a Trigger.
61More formally, TOSCA defines a Trigger as an artifact that "defines the event, condition and action that is used to
62“trigger” a policy it is associated with". In the definition of a Trigger in TOSCA, you specify:
63
64* its event_type, which defines the name of the event that fires the policy
65* its schedule, which defines the time interval in which the trigger is active
66* its target_filter, which defines specific filters for firing such as specific characteristics of the nodes or
liamfallon4d1d9832019-05-30 20:53:05 +000067 relations for which the trigger should or should not fire
liamfallone62f7112019-05-24 10:50:57 +000068* its condition, which defines extra conditions on the incoming event for firing the trigger
69* its constraint, which defines extra conditions on the incoming event for not firing the trigger
70* its period, which defines the period to use for evaluating conditions and constraints
71* its evaluations, which defines the number of evaluations that must be performed over the period to assert the
liamfallon4d1d9832019-05-30 20:53:05 +000072 condition or constraint exists
liamfallone62f7112019-05-24 10:50:57 +000073* its method, the method to use for evaluation of conditions and constraints
74* its action, the workflow or operation to invoke when the trigger fires
75
76Note that how a Trigger actually works with a Policy is not clear from the specification.
77
78End of Document
79