support for setting default_image / default_flavor from tosca
diff --git a/xos/tosca/custom_types/xos.m4 b/xos/tosca/custom_types/xos.m4
index 10910fb..68362f3 100644
--- a/xos/tosca/custom_types/xos.m4
+++ b/xos/tosca/custom_types/xos.m4
@@ -622,6 +622,13 @@
type: string
required: false
description: default isolation to use when bringing up instances (default to 'vm')
+ default_flavor:
+ # Note: we should probably formally introduce flavors to Tosca
+ # at some point, and use a requirement/relationship instead of
+ # a text string.
+ type: string
+ required: false
+ description: default flavor to use for slice
tosca.nodes.Node:
derived_from: tosca.nodes.Root
@@ -720,6 +727,10 @@
derived_from: tosca.relationships.Root
valid_target_types: [ tosca.capabilities.xos.Image ]
+ tosca.relationships.DefaultImage:
+ derived_from: tosca.relationships.Root
+ valid_target_types: [ tosca.capabilities.xos.Image ]
+
tosca.relationships.SupportsImage:
derived_from: tosca.relationships.Root
valid_target_types: [ tosca.capabilities.xos.Image ]
diff --git a/xos/tosca/custom_types/xos.yaml b/xos/tosca/custom_types/xos.yaml
index 4c12e7f..49cc435 100644
--- a/xos/tosca/custom_types/xos.yaml
+++ b/xos/tosca/custom_types/xos.yaml
@@ -817,6 +817,13 @@
type: string
required: false
description: default isolation to use when bringing up instances (default to 'vm')
+ default_flavor:
+ # Note: we should probably formally introduce flavors to Tosca
+ # at some point, and use a requirement/relationship instead of
+ # a text string.
+ type: string
+ required: false
+ description: default flavor to use for slice
tosca.nodes.Node:
derived_from: tosca.nodes.Root
@@ -937,6 +944,10 @@
derived_from: tosca.relationships.Root
valid_target_types: [ tosca.capabilities.xos.Image ]
+ tosca.relationships.DefaultImage:
+ derived_from: tosca.relationships.Root
+ valid_target_types: [ tosca.capabilities.xos.Image ]
+
tosca.relationships.SupportsImage:
derived_from: tosca.relationships.Root
valid_target_types: [ tosca.capabilities.xos.Image ]
diff --git a/xos/tosca/samples/slice_default_image.yaml b/xos/tosca/samples/slice_default_image.yaml
new file mode 100644
index 0000000..91b95c7
--- /dev/null
+++ b/xos/tosca/samples/slice_default_image.yaml
@@ -0,0 +1,30 @@
+tosca_definitions_version: tosca_simple_yaml_1_0
+
+description: >
+ * Create a new deployment, controller, and site.
+ * Add a SiteDeployment from the site to the deployment using the controller.
+ * Create a Slice in the Site, with one Instance
+
+imports:
+ - custom_types/xos.yaml
+
+topology_template:
+ node_templates:
+ mysite:
+ type: tosca.nodes.Site
+
+ trusty-server-multi-nic:
+ type: tosca.nodes.Image
+
+ mysite_test1:
+ type: tosca.nodes.Slice
+ requirements:
+ - slice:
+ node: mysite
+ relationship: tosca.relationships.MemberOfSite
+ - default_image:
+ node: trusty-server-multi-nic
+ relationship: tosca.relationships.DefaultImage
+ properties:
+ default_flavor: m1.small
+