blob: 0c485d8840ebdbfbec5d8b3349084aada04d5fff [file] [log] [blame]
Scott Baker6a4fd492018-06-19 08:12:42 -07001{{/* vim: set filetype=mustache: */}}
2{{/*
3Copyright 2018-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{{- define "exampleservice.serviceTosca" -}}
18tosca_definitions_version: tosca_simple_yaml_1_0
19
20imports:
21 - custom_types/slice.yaml
22 - custom_types/site.yaml
23 - custom_types/image.yaml
24 - custom_types/flavor.yaml
25 - custom_types/network.yaml
26 - custom_types/networktemplate.yaml
27 - custom_types/networkslice.yaml
Scott Baker35940ec2018-06-28 15:52:54 -070028 - custom_types/openstackservice.yaml
29 - custom_types/trustdomain.yaml
Scott Baker6a4fd492018-06-19 08:12:42 -070030 - custom_types/exampleservice.yaml
31 - custom_types/exampleserviceinstance.yaml
32
33description: configure exampleservice
34
35topology_template:
36 node_templates:
Scott Baker35940ec2018-06-28 15:52:54 -070037 service#openstack:
38 type: tosca.nodes.OpenStackService
39 properties:
40 name: "OpenStack"
41 must-exist: true
42
43 untrusted_trustdomain:
44 type: tosca.nodes.TrustDomain
45 properties:
46 name: "untrusted-openstack"
47 requirements:
48 - owner:
49 node: service#openstack
50 relationship: tosca.relationships.BelongsToOne
Scott Baker6a4fd492018-06-19 08:12:42 -070051
52# site, image, fully created in deployment.yaml
53 mysite:
54 type: tosca.nodes.Site
55 properties:
56 must-exist: true
57 name: {{ .cordSiteName }}
58
59 m1.small:
60 type: tosca.nodes.Flavor
61 properties:
62 name: m1.small
63 must-exist: true
64
65 trusty-server-multi-nic:
66 type: tosca.nodes.Image
67 properties:
68 name: "trusty-server-multi-nic"
69 container_format: "BARE"
70 disk_format: "QCOW2"
71 path: "https://github.com/opencord/platform-install/releases/download/vms/trusty-server-cloudimg-amd64-disk1.img.20170201"
72
73# private network template, fully created somewhere else
74 private:
75 type: tosca.nodes.NetworkTemplate
76 properties:
77 must-exist: true
78 name: Private
79
80# management networks, fully created in management-net.yaml
81 management_network:
82 type: tosca.nodes.Network
83 properties:
84 must-exist: true
85 name: management
86
87# public network, fully created somewhere else
88 public_network:
89 type: tosca.nodes.Network
90 properties:
91 must-exist: true
92 name: public
93
94 exampleservice_network:
95 type: tosca.nodes.Network
96 properties:
97 name: exampleservice_network
98 labels: exampleservice_private_network
99 requirements:
100 - template:
101 node: private
102 relationship: tosca.relationships.BelongsToOne
103 - owner:
104 node: exampleservice_slice
105 relationship: tosca.relationships.BelongsToOne
106
107# ExampleService Slices
108 exampleservice_slice:
109 description: Example Service Slice
110 type: tosca.nodes.Slice
111 properties:
112 name: exampleservice
113 default_isolation: vm
114 network: noauto
115 requirements:
116 - site:
117 node: mysite
118 relationship: tosca.relationships.BelongsToOne
119 - service:
120 node: exampleservice
121 relationship: tosca.relationships.BelongsToOne
122 - default_image:
123 node: trusty-server-multi-nic
124 relationship: tosca.relationships.BelongsToOne
125 - default_flavor:
126 node: m1.small
127 relationship: tosca.relationships.BelongsToOne
Scott Baker35940ec2018-06-28 15:52:54 -0700128 - trust_domain:
129 node: untrusted_trustdomain
130 relationship: tosca.relationships.BelongsToOne
Scott Baker6a4fd492018-06-19 08:12:42 -0700131
132# ExampleService NetworkSlices
133 exampleservice_slice_management_network:
134 type: tosca.nodes.NetworkSlice
135 requirements:
136 - network:
137 node: management_network
138 relationship: tosca.relationships.BelongsToOne
139 - slice:
140 node: exampleservice_slice
141 relationship: tosca.relationships.BelongsToOne
142
143 exampleservice_slice_public_network:
144 type: tosca.nodes.NetworkSlice
145 requirements:
146 - network:
147 node: public_network
148 relationship: tosca.relationships.BelongsToOne
149 - slice:
150 node: exampleservice_slice
151 relationship: tosca.relationships.BelongsToOne
152
153 exampleservice_slice_exampleservice_network:
154 type: tosca.nodes.NetworkSlice
155 requirements:
156 - network:
157 node: exampleservice_network
158 relationship: tosca.relationships.BelongsToOne
159 - slice:
160 node: exampleservice_slice
161 relationship: tosca.relationships.BelongsToOne
162
163 exampleservice:
164 type: tosca.nodes.ExampleService
165 properties:
166 name: exampleservice
167 public_key: {{ .publicKey | quote }}
168 private_key_fn: /opt/xos/services/exampleservice/keys/id_rsa
169 service_message: hello
170
171 exampletenant1:
172 type: tosca.nodes.ExampleServiceInstance
173 properties:
174 name: exampletenant1
175 tenant_message: world
176 requirements:
177 - owner:
178 node: exampleservice
179 relationship: tosca.relationships.BelongsToOne
180{{- end -}}