-
Type:
Task
-
Status: Closed
-
Priority:
Critical
-
Resolution: Unresolved
-
Affects Version/s: CSD2
-
Fix Version/s: CSD2
-
Component/s: Profile-YAML
-
Labels:None
-
Resolution:
Section 11 of WD03, Rev05 has the following example which shows constraints on a requirement. The intent is to constrain the properties used for finding/matching the Target (Compute) node of a relationship. If we still want to allow this, we have no grammar for doing this and need one. Also, the grammar implied by the example perhaps is not sufficient to indicate that these constraints are on the properties of the Target node.
Here is the example as written:
node_templates:
mysql:
type: tosca.nodes.DBMS.MySQL
properties:
- omitted here for sake of brevity
requirements:
- host: tosca.nodes.Compute
constraints: - num_cpus: { in_range: [ 1, 4 ] }
- mem_size: { greater_or_equal: 2 }
- os_arch: x86_64
- os_type: linux
- os_distribution: ubuntu
Ok, so summing up the suggestion would be to go with 'target_filter' which would look something like this:
mysql:
type: tosca.nodes.DBMS.MySQL
properties:
requirements:
target_filter:
We will have to add a section to the spec that defines the grammer for the target_filter statement. It is basically a list of filter constraints on properties of the entity to be selected. Each entry is a key-value pair where the key is the name of a property and the value is the filter criterion. Note that there can be multiple entries for the same property (since we are using a list), so one would be able to to defined multiple additive criteria.
I will work with Matt on including this into the spec, if everyone is ok.