Merge "Added MuranoPL infrastructure for advanced networking scenarios"

This commit is contained in:
Jenkins 2014-04-29 09:52:01 +00:00 committed by Gerrit Code Review
commit ecaa708b62
5 changed files with 52 additions and 3 deletions

View File

@ -1,5 +1,6 @@
Namespaces:
=: io.murano
res: io.murano.resources
sys: io.murano.system
Name: Environment
@ -23,6 +24,12 @@ Properties:
Contract: $.class(sys:InstanceNotifier)
Usage: Runtime
defaultNetworks:
Contract:
environment: $.class(res:Network)
flat: $.class(res:Network)
Usage: In
Workflow:
initialize:
Body:

View File

@ -20,6 +20,15 @@ Properties:
ipAddresses:
Contract: [$.string()]
Usage: Out
networks:
Contract:
useEnvironmentNetwork: $.bool().notNull()
useFlatNetwork: $.bool().notNull()
customNetworks: [$.class(Network).notNull()]
Default:
useEnvironmentNetwork: true
useFlatNetwork: false
customNetworks: []
Workflow:
initialize:
@ -30,6 +39,14 @@ Workflow:
deploy:
Body:
- If: $.networks.useEnvironmentNetwork
Then:
$.joinNet($.environment.defaultNetworks.environment)
- If: $.networks.useFlatNetwork
Then:
$.joinNet($.environment.defaultNetworks.flat)
- $.networks.customNetworks.select($this.joinNet($))
- $userData: $.prepareUserData()
- $template:
Resources:
@ -43,15 +60,22 @@ Workflow:
format('{0}-PublicIp', $.name):
Value:
- Fn::GetAtt: [$.name, PublicIp]
- $.environment.stack.updateTemplate($template)
- $.environment.stack.push()
- $outputs: $.environment.stack.output()
- $.ipAddresses: $outputs.get(format('{0}-PublicIp', $this.name))
- $.environment.instanceNotifier.trackApplication($this)
joinNet:
Arguments:
- net:
Contract: $.class(Network)
Body:
- If: $net != null
Then:
$net.addHostToNetwork($)
destroy:
Body:
- $template: $.environment.stack.current()

View File

@ -0,0 +1,10 @@
Namespaces:
=: io.murano.resources
Name: Network
Workflow:
addHostToNetwork:
Arguments:
- instance:
Contract: $.class(Instance).notNull()

View File

@ -18,4 +18,5 @@ Classes:
io.murano.Environment: Environment.yaml
io.murano.Application: Application.yaml
io.murano.resources.Instance: resources/Instance.yaml
io.murano.resources.Network: resources/Network.yaml
io.murano.resources.Instance: resources/Instance.yaml

View File

@ -262,6 +262,13 @@ class TypeScheme(object):
def __call__(self, data, context, this, object_store,
namespace_resolver, default):
# TODO(ativelkov, slagun): temporary fix, need a better way of handling
# composite defaults
# A bug (#1313694) has been filed
if data is NoValue:
data = default
context = self.prepare_context(
context, this, object_store, namespace_resolver,
default)