blob: 4c05f597c624da5305b590f4a0342cc6e3e77f22 [file] [log] [blame]
Andy Bavierc4d39fc2017-10-24 16:48:32 -07001
2{#
3Copyright 2017-present Open Networking Foundation
4
5Licensed under the Apache License, Version 2.0 (the "License");
6you may not use this file except in compliance with the License.
7You may obtain a copy of the License at
8
9http://www.apache.org/licenses/LICENSE-2.0
10
11Unless required by applicable law or agreed to in writing, software
12distributed under the License is distributed on an "AS IS" BASIS,
13WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14See the License for the specific language governing permissions and
15limitations under the License.
16#}
17
18
19tosca_definitions_version: tosca_simple_yaml_1_0
20
21description: TOSCA example of adding a service and service instance
22
23imports:
24 - custom_types/xos.yaml
25 - custom_types/slice.yaml
26 - custom_types/site.yaml
27 - custom_types/image.yaml
28 - custom_types/flavor.yaml
29 - custom_types/network.yaml
30 - custom_types/networkslice.yaml
31 - custom_types/templateservice.yaml
32 - custom_types/templateserviceinstance.yaml
33
34topology_template:
35 node_templates:
36
37# site, image, fully created in deployment.yaml
38 {{ site_name }}:
39 type: tosca.nodes.Site
40 properties:
41 must-exist: true
42 name: {{ site_name }}
43
44 m1.small:
45 type: tosca.nodes.Flavor
46 properties:
47 name: m1.small
48 must-exist: true
49
50 trusty-server-multi-nic:
51 type: tosca.nodes.Image
52 properties:
53 name: trusty-server-multi-nic
54
55# management networks, fully created in management-net.yaml
56 management:
57 type: tosca.nodes.Network
58 properties:
59 must-exist: true
60 name: management
61
62{% if use_management_hosts %}
63 management_hosts:
64 type: tosca.nodes.Network
65 properties:
66 must-exist: true
67 name: management_hosts
68{% endif %}
69
70# public network, fully created in public-net.yaml
71 public:
72 type: tosca.nodes.Network
73 properties:
74 must-exist: true
75 name: public
76
77# CORD Services
78 service#template:
79 type: tosca.nodes.TemplateService
80 properties:
81 name: template
82 public_key: {{ lookup('file', config_cord_profile_dir + '/key_import/templateservice_rsa.pub') }}
83 private_key_fn: /opt/xos/services/templateservice/keys/templateservice_rsa
84
85# CORD Slices
86 {{ site_name }}_template:
87 description: Template Slice
88 type: tosca.nodes.Slice
89 properties:
90 name: {{ site_name }}_template
91 default_isolation: vm
92 network: noauto
93 requirements:
94 - site:
95 node: mysite
96 relationship: tosca.relationships.BelongsToOne
97 - service:
98 node: service#template
99 relationship: tosca.relationships.BelongsToOne
100 - default_image:
101 node: trusty-server-multi-nic
102 relationship: tosca.relationships.BelongsToOne
103 - default_flavor:
104 node: m1.small
105 relationship: tosca.relationships.BelongsToOne
106
107# CORD Service Instances
108 serviceinstance#template:
109 type: tosca.nodes.TemplateServiceInstance
110 properties:
111 name: template_instance
112 requirements:
113 - owner:
114 node: service#template
115 relationship: tosca.relationships.BelongsToOne
116
117# CORD NetworkSlices
118 template_slice_management_network:
119 type: tosca.nodes.NetworkSlice
120 requirements:
121 - network:
122 node: management
123 relationship: tosca.relationships.BelongsToOne
124 - slice:
125 node: {{ site_name }}_template
126 relationship: tosca.relationships.BelongsToOne
127
128 template_slice_public_network:
129 type: tosca.nodes.NetworkSlice
130 requirements:
131 - network:
132 node: public
133 relationship: tosca.relationships.BelongsToOne
134 - slice:
135 node: {{ site_name }}_template
136 relationship: tosca.relationships.BelongsToOne