cloudsoft.io

TOSCA Example

This is an example of the Workflow artifact to define an effector using a simple one-step workflow accessing topology inputs and effector parameters:

tosca_definitions_version: tosca_simple_yaml_1_3

metadata:
  template_name: testInitDEffectorReference
  template_version: 1.0.0-SNAPSHOT

topology_template:
  inputs:
    topo_param:
      value: hello
  node_templates:
    a_server:
      type: tosca.nodes.Compute
      interfaces:
        custom:
          eff1:
            inputs:
              eff_param: world
            implementation:
              primary:
                type: brooklyn.tosca.artifacts.Implementation.Workflow
                properties:
                  input:
                    greeting: { get_input: topo_param }
                  steps:
                    - return ${greeting} ${eff_param}

This is an example of the InitD artifact used as the start operation:

tosca_definitions_version: tosca_simple_yaml_1_3

metadata:
  template_name: testSoftwareComponentTemplateWithStandardScripts
  template_version: 1.0.0-SNAPSHOT

topology_template:
  node_templates:
    a_server:
      type: tosca.nodes.Compute
      interfaces:
        Standard:
          operations:
            start:
              implementation:
                primary:
                  type: brooklyn.tosca.artifacts.Implementation.InitD
                  properties:
                    commands:
                      default:
                        02-step2: classpath://scripts/echos/start.sh
                        # NB: 02 will run _after_ 01
                        01-step1:
                          implementation: classpath://scripts/echos/hello-args.sh
                          inputs:
                            to: world
                            at: before-start