service composition, WIP
diff --git a/xos/tosca/custom_types/xos.yaml b/xos/tosca/custom_types/xos.yaml
index 95fe2dc..87c96b4 100644
--- a/xos/tosca/custom_types/xos.yaml
+++ b/xos/tosca/custom_types/xos.yaml
@@ -1,6 +1,9 @@
tosca_definitions_version: tosca_simple_yaml_1_0
node_types:
+ tosca.nodes.Service:
+ derived_from: tosca.nodes.Root
+
tosca.nodes.Slice:
derived_from: tosca.nodes.Root
properties:
@@ -11,4 +14,8 @@
tosca.relationships.MemberOfSlice:
derived_from: tosca.relationships.Root
-
\ No newline at end of file
+ tosca.relationships.MemberOfService:
+ derived_from: tosca.relationships.Root
+
+ tosca.relationships.TenantOfService:
+ derived_from: tosca.relationships.Root
diff --git a/xos/tosca/samples/composition.yaml b/xos/tosca/samples/composition.yaml
new file mode 100644
index 0000000..8340b21
--- /dev/null
+++ b/xos/tosca/samples/composition.yaml
@@ -0,0 +1,55 @@
+tosca_definitions_version: tosca_simple_yaml_1_0
+
+description: Template for deploying a single server with predefined properties.
+
+imports:
+ - custom_types/xos.yaml
+
+topology_template:
+ node_templates:
+ # CORD Services
+ service_volt:
+ type: tosca.nodes.Service
+ requirements:
+ - vcpe_tenant:
+ node: service_vcpe
+ relationship: tosca.relationships.IsTenantOf
+
+ service_vcpe:
+ type: tosca.nodes.Service
+ requirements:
+ - vbng_tenant:
+ node: service_vbng
+ relationship: tosca.relationships.IsTenantOf
+
+ service_vbng:
+ type: tosca.nodes.Service
+
+ mysite_tosca:
+ type: tosca.nodes.Slice
+ requirements:
+ - volt_service:
+ node: service_volt
+ relationship: tosca.relationships.MemberOfService
+
+ my_server:
+ type: tosca.nodes.Compute
+ capabilities:
+ # Host container properties
+ host:
+ properties:
+ num_cpus: 1
+ disk_size: 10 GB
+ mem_size: 4 MB
+ # Guest Operating System properties
+ os:
+ properties:
+ # host Operating System image properties
+ architecture: x86_64
+ type: linux
+ distribution: rhel
+ version: 6.5
+ requirements:
+ - slice:
+ node: mysite_tosca
+ relationship: tosca.relationships.MemberOfSlice