blob: df38901bab038b5476109b6daf0f62e37e84cfb4 [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:
Andy Bavierc4d39fc2017-10-24 16:48:32 -070024 - custom_types/slice.yaml
25 - custom_types/site.yaml
26 - custom_types/image.yaml
27 - custom_types/flavor.yaml
28 - custom_types/network.yaml
29 - custom_types/networkslice.yaml
30 - custom_types/templateservice.yaml
31 - custom_types/templateserviceinstance.yaml
32
33topology_template:
34 node_templates:
35
36# site, image, fully created in deployment.yaml
37 {{ site_name }}:
38 type: tosca.nodes.Site
39 properties:
40 must-exist: true
41 name: {{ site_name }}
42
43 m1.small:
44 type: tosca.nodes.Flavor
45 properties:
46 name: m1.small
47 must-exist: true
48
49 trusty-server-multi-nic:
50 type: tosca.nodes.Image
51 properties:
52 name: trusty-server-multi-nic
53
54# management networks, fully created in management-net.yaml
55 management:
56 type: tosca.nodes.Network
57 properties:
58 must-exist: true
59 name: management
60
61{% if use_management_hosts %}
62 management_hosts:
63 type: tosca.nodes.Network
64 properties:
65 must-exist: true
66 name: management_hosts
67{% endif %}
68
69# public network, fully created in public-net.yaml
70 public:
71 type: tosca.nodes.Network
72 properties:
73 must-exist: true
74 name: public
75
76# CORD Services
77 service#template:
78 type: tosca.nodes.TemplateService
79 properties:
80 name: template
81 public_key: {{ lookup('file', config_cord_profile_dir + '/key_import/templateservice_rsa.pub') }}
82 private_key_fn: /opt/xos/services/templateservice/keys/templateservice_rsa
83
84# CORD Slices
85 {{ site_name }}_template:
86 description: Template Slice
87 type: tosca.nodes.Slice
88 properties:
89 name: {{ site_name }}_template
90 default_isolation: vm
91 network: noauto
92 requirements:
93 - site:
94 node: mysite
95 relationship: tosca.relationships.BelongsToOne
96 - service:
97 node: service#template
98 relationship: tosca.relationships.BelongsToOne
99 - default_image:
100 node: trusty-server-multi-nic
101 relationship: tosca.relationships.BelongsToOne
102 - default_flavor:
103 node: m1.small
104 relationship: tosca.relationships.BelongsToOne
105
106# CORD Service Instances
107 serviceinstance#template:
108 type: tosca.nodes.TemplateServiceInstance
109 properties:
110 name: template_instance
111 requirements:
112 - owner:
113 node: service#template
114 relationship: tosca.relationships.BelongsToOne
115
116# CORD NetworkSlices
117 template_slice_management_network:
118 type: tosca.nodes.NetworkSlice
119 requirements:
120 - network:
121 node: management
122 relationship: tosca.relationships.BelongsToOne
123 - slice:
124 node: {{ site_name }}_template
125 relationship: tosca.relationships.BelongsToOne
126
127 template_slice_public_network:
128 type: tosca.nodes.NetworkSlice
129 requirements:
130 - network:
131 node: public
132 relationship: tosca.relationships.BelongsToOne
133 - slice:
134 node: {{ site_name }}_template
135 relationship: tosca.relationships.BelongsToOne