Skip to content

Instantly share code, notes, and snippets.

@DmZ
Created November 21, 2014 14:32
Show Gist options
  • Save DmZ/c98672bd25ad481d1530 to your computer and use it in GitHub Desktop.
Save DmZ/c98672bd25ad481d1530 to your computer and use it in GitHub Desktop.
Pool resources example
application:
bindings:
- [vms, component1]
- [vms, component2]
- [component1, component2]
components:
vms:
type: workflow.Instance
interfaces:
result:
component1_addresses:
type: publish-signal(list<string>)
name: IP addresses for component1
component2_addresses:
type: publish-signal(string)
name: IP addresses for component2
configuration:
configuration.workflows:
launch:
steps:
- get_env_props:
action: getEnvironmentProperties
output:
config: result
- allocate_addresses:
action: serviceCall
precedingPhases: [ get_env_props ]
parameters:
service: resource-pool
command: allocate-resources
arguments:
type: ...
count: ...
output:
allocate-result: result
return:
component1_addresses:
value: "{$.allocate-result.resources[0].gs.private}"
component2_addresses:
value: "{$.allocate-result.resources[0].app.public}"
component1:
tyoe: workflow.Instance
interfaces:
result:
some_value: publish_signal(string)
vms:
component1_addresses: consume-signal(list<string>)
required: [ vms ]
configuration:
configuration.workflows:
launch:
steps:
- get_env_props:
...
output:
config: result
- provision:
precedingPhases: [ get_env_props ]
parameters:
staticIps: "{$.config.vms.component1_addresses}"
- next_steps: ...
return:
some_value:
value: ""
component2:
tyoe: workflow.Instance
interfaces:
component1:
some_value: consume-signal(string)
vms:
component1_addresses: consume-signal(list<string>)
required: [ vms, component1 ]
configuration:
configuration.workflows:
launch:
steps:
- get_env_props:
...
output:
config: result
- provision:
precedingPhases: [ get_env_props ]
parameters:
staticIps: "{$.config.vms.component2_addresses}"
- next_steps:
... "{$.config.component1.some_value}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment