tliron / puccini

Cloud topology management and deployment tools based on TOSCA
https://puccini.cloud
Apache License 2.0
88 stars 20 forks source link

trigger condition should accept a list of conditions #96

Closed philippemerle closed 2 years ago

philippemerle commented 2 years ago

Following is a simplified version of an ETSI NFV SOL 001 example:

tosca_definitions_version: tosca_simple_yaml_1_3
node_types:
  MyCompany.SunshineDB.1_0.1_0:
    attributes:
      utilization_vnf_indicator:
        type: float
      call_proc_scale_level:
        type: integer
topology_template:
  node_templates:
    SunshineDB:
      type: MyCompany.SunshineDB.1_0.1_0
  policies:
    - auto_scale:
        type: tosca.policies.Root
        targets: [ SunshineDB ]
        triggers:
          scale_out:
            event: an_event
            condition:
              - utilization_vnf_indicator: [ { greater_or_equal: 60.0 } ]
              - call_proc_scale_level: [ { less_than: 3 } ]
            action: []

Then

$ puccini-tosca compile issue_trigger_condition.yaml 
PROBLEMS (1)
  file:/.../issue_trigger_condition.yaml
    @20,13 topology_template.policies{0}.triggers["scale_out"].condition: "list" instead of "map"

So a trigger condition shall be a map for puccini. However some months ago, the OASIS TOSCA TC replied to the ETSI NV SOL working group that a similar example was correct (see issue #2 of https://www.oasis-open.org/committees/download.php/69341/TOSCA%20TC%20Response%20to%20ETSI%20NFV%20Liaison%20Statement.docx).

What do you think about this issue?

tliron commented 2 years ago

Thanks for this reminder. Yes, actually conditions are special because they have 3 different possible notations: long map notation, short map notation (for a single clause only), and short list notation (for multiple clauses as AND).