xlab-si / xopera-opera

xOpera orchestrator compliant with TOSCA YAML v1.3 in the making
https://xlab-si.github.io/xopera-docs/
Apache License 2.0
35 stars 14 forks source link

Assigning the value of a parameter definition unsupported #223

Closed philippemerle closed 2 years ago

philippemerle commented 2 years ago

The following service template:

tosca_definitions_version: tosca_simple_yaml_1_3
node_types:
  MyNodeType:
    derived_from: tosca.nodes.Root
    properties:
      my_property:
        type: string
    interfaces:
      Standard:
        operations:
          create:
            inputs:
              parameter:
                type: string
                value: { get_property: [SELF, my_property] }
topology_template:
  node_templates:
    node:
      type: MyNodeType
      properties:
        my_property: HelloWorld

can not be validated by opera:

$ opera validate unsupported_features/parameter_value.yaml
Validating service template...
parameter_value.yaml:14:17: [PropertyDefinition] Invalid keys: value

Assigning the value of a parameter definition seems to be unsupported by the opera parser, doesn't it?

philippemerle commented 2 years ago

operation_definition_for_type.py contains:

class OperationDefinitionForType(Entity):
    ATTRS = dict(
        description=String,
        implementation=OperationImplementationDefinition,
        inputs=Map(PropertyDefinition),
        outputs=Map(List(String)),
    )

Should inputs=Map(PropertyDefinition) be replaced by inputs=Map(ParameterDefinition)?

anzoman commented 2 years ago

Thanks @philippemerle for uncovering this, we made a mistake, inputs=Map(ParameterDefinition) seems to be the right thing.