deb-murano/meta/io.murano/Classes/Environment.yaml
Stan Lagun fc586b949d Removes early creation of Heat stack
Murano environment deployment started with empty stack
creation so that it can be done prior to keystone token expiration
for Heat to establish trusts based on user's token.
When environment does nothing with the stack (for example
all environment applications are HOT based and deploy into their
own stacks) empty stack remains. Because most applications
start their deployment with instance/other resources deployment
stack will be created early anyway. So this strategy is redundant.

Change-Id: Id8ec1df2c83f540b272ef70bd054f70de9da7715
Closes-Bug: #1473129
2015-07-31 00:50:34 +03:00

75 lines
2.0 KiB
YAML

Namespaces:
=: io.murano
res: io.murano.resources
sys: io.murano.system
Name: Environment
Properties:
name:
Contract: $.string().notNull()
applications:
Contract: [$.class(Application).owned().notNull()]
agentListener:
Contract: $.class(sys:AgentListener)
Usage: Runtime
stack:
Contract: $.class(sys:HeatStack)
Usage: Runtime
instanceNotifier:
Contract: $.class(sys:InstanceNotifier)
Usage: Runtime
defaultNetworks:
Contract:
environment: $.class(res:Network)
flat: $.class(res:Network)
Usage: In
securityGroupManager:
Contract: $.class(sys:SecurityGroupManager)
Usage: Runtime
reporter:
Contract: $.class(sys:StatusReporter)
Usage: Runtime
Methods:
initialize:
Body:
- $generatedEnvironmentName: $.getAttr(generatedEnvironmentName)
- If: $generatedEnvironmentName = null
Then:
- $generatedEnvironmentName: randomName()
- $.setAttr(generatedEnvironmentName, $generatedEnvironmentName)
- $this.agentListener: new(sys:AgentListener, name => $generatedEnvironmentName)
- $stackDescriptionFormat: 'This stack was generated by Murano for environment {0} (ID: {1})'
- $this.stack: new(sys:HeatStack,
name => 'murano-' + $generatedEnvironmentName,
description => $stackDescriptionFormat.format($.name, $.id()))
- $this.instanceNotifier: new(sys:InstanceNotifier, environment => $this)
- $this.reporter: new(sys:StatusReporter, environment => $this)
- $net: null
- If: $.defaultNetworks.environment != null
Then:
- $net: $.defaultNetworks.environment
- If: $.defaultNetworks.flat != null
Then:
- $net: $.defaultNetworks.flat
- If: $net != null
Then:
- $this.securityGroupManager: $net.generateSecurityGroupManager($this)
deploy:
Usage: Action
Body:
- $.applications.pselect($.deploy())
destroy:
Body:
- $.stack.delete()