Skip to content

Instantly share code, notes, and snippets.

@chemikadze
Last active August 29, 2015 14:06
Show Gist options
  • Save chemikadze/eed52e0e483d44929285 to your computer and use it in GitHub Desktop.
Save chemikadze/eed52e0e483d44929285 to your computer and use it in GitHub Desktop.
Example of usage constants service to provide
# launch and add to env
application:
interfaces:
values:
subnet: bind(const#network.subnet)
prefixLength: bind(const#network.prefixLength)
configuration:
values: bind(const#configuration.values)
configuration:
configuration.values:
network.subnet: "192.168.0.0"
network.prefixLength: 16
components:
const:
type: cobalt.common.Constants
interfaces:
network:
subnet: publish-signal(string)
prefixLength: publish-signal(int)
# import on environment page
policies: {}
markers: []
properties:
oracle-url:
type: string
value: "jdbc:oracle:thin:@//localhost/myservice"
application:
bindings:
- [workflow, env-props]
- [workflow, network-info]
components:
env-props:
type: reference.Service
interfaces:
props:
oracle-url: publish-signal(string)
network-info:
type: reference.Service
interfaces:
network:
subnet: publish-signal(string)
prefixLength: publish-signal(string)
workflow:
type: workflow.Instance
interfaces:
network:
subnet: consume-signal(string)
prefixLength: consume-signal(string)
props:
oracle-url: consume-signal(string)
outputs:
network: publish-signal(string)
url: publish-signal(string)
required: [network, props]
configuration:
configuration.workflows:
launch:
steps:
- get-env:
action: getSignals
output:
result: result
return:
network:
value: "{$.result.network.subnet}/{$.result.network.prefixLength}"
url:
value: "{$.result.props.oracle-url}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment