Open lauwers opened 1 year ago
I envision declarative policies to be defined using a set of invariants, i.e. Boolean expressions that must hold true at all times. However, this will likely require extensions to our TOSCA Path
syntax to allow get_property
functions to access members of a group. For example:
groups:
sw-group:
members: [ sw1, sw2, sw3 ]
policies:
anti-colocation:
target: sw-group
conditions:
$not:
$equal:
- $get_property: [ ALL, RELATIONSHIP, host, TARGET, uuid ]
- $get_property: [ OTHER, RELATIONSHIP, host, TARGET, uuid ]
In this TOSCA Path proposal, the ALL
keyword means all members of the target group and OTHER
means *all other members of the group`.
Alternatively, we could introduce a GROUP
keyword to avoid the need to identify the target group in the policy definition. Comments?
TOSCA's current policy syntax supports imperative policies only. These policies follow an
event-condition-action
pattern. We should add support for declarative policies that follow acontext-capability-constraint
pattern and express invariant conditions that must hold true at all times. Ironically, all the policy examples in the spec (e.g. colocation and anti-colocation placement policies) are examples of declarative policies, but TOSCA currently does not include syntax that allows one to define the semantics of such policies.