Andy Bavier | a40e82b | 2018-05-07 17:00:36 -0700 | [diff] [blame] | 1 | {{/* vim: set filetype=mustache: */}} |
| 2 | {{/* |
| 3 | Copyright 2018-present Open Networking Foundation |
| 4 | |
| 5 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | you may not use this file except in compliance with the License. |
| 7 | You may obtain a copy of the License at |
| 8 | |
| 9 | http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | |
| 11 | Unless required by applicable law or agreed to in writing, software |
| 12 | distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | See the License for the specific language governing permissions and |
| 15 | limitations under the License. |
| 16 | */}} |
| 17 | {{- define "mcord.fixtureTosca" -}} |
| 18 | tosca_definitions_version: tosca_simple_yaml_1_0 |
| 19 | |
| 20 | imports: |
Andy Bavier | a40e82b | 2018-05-07 17:00:36 -0700 | [diff] [blame] | 21 | - custom_types/site.yaml |
Andy Bavier | a40e82b | 2018-05-07 17:00:36 -0700 | [diff] [blame] | 22 | |
| 23 | description: set up site and deployment and link them |
| 24 | |
| 25 | topology_template: |
| 26 | node_templates: |
| 27 | |
| 28 | {{ .Values.cordSiteName }}: |
| 29 | type: tosca.nodes.Site |
| 30 | properties: |
| 31 | name: {{ .Values.cordSiteName }} |
| 32 | site_url: http://mysite.opencord.us/ |
| 33 | hosts_nodes: true |
| 34 | |
Andy Bavier | a40e82b | 2018-05-07 17:00:36 -0700 | [diff] [blame] | 35 | {{- end -}} |
| 36 | |
Matteo Scandolo | 3f2426b | 2019-01-18 13:46:26 -0800 | [diff] [blame] | 37 | {{- define "mcord.onosTosca" -}} |
| 38 | tosca_definitions_version: tosca_simple_yaml_1_0 |
| 39 | |
| 40 | imports: |
| 41 | - custom_types/onosapp.yaml |
| 42 | - custom_types/onosservice.yaml |
| 43 | - custom_types/serviceinstanceattribute.yaml |
| 44 | |
| 45 | description: Configures the VOLTHA ONOS service |
| 46 | |
| 47 | topology_template: |
| 48 | node_templates: |
| 49 | |
| 50 | service#onos: |
| 51 | type: tosca.nodes.ONOSService |
| 52 | properties: |
| 53 | name: onos |
| 54 | kind: data |
| 55 | rest_hostname: {{ .onosRestService | quote }} |
| 56 | rest_port: 8181 |
| 57 | |
| 58 | onos_app#segmentrouting: |
| 59 | type: tosca.nodes.ONOSApp |
| 60 | properties: |
| 61 | name: org.onosproject.segmentrouting |
| 62 | app_id: org.onosproject.segmentrouting |
| 63 | requirements: |
| 64 | - owner: |
| 65 | node: service#onos |
| 66 | relationship: tosca.relationships.BelongsToOne |
| 67 | |
| 68 | onos_app#netcfghostprovider: |
| 69 | type: tosca.nodes.ONOSApp |
| 70 | properties: |
| 71 | name: org.onosproject.netcfghostprovider |
| 72 | app_id: org.onosproject.netcfghostprovider |
| 73 | requirements: |
| 74 | - owner: |
| 75 | node: service#onos |
| 76 | relationship: tosca.relationships.BelongsToOne |
| 77 | |
| 78 | onos_app#openflow: |
| 79 | type: tosca.nodes.ONOSApp |
| 80 | properties: |
| 81 | name: org.onosproject.openflow |
| 82 | app_id: org.onosproject.openflow |
| 83 | requirements: |
| 84 | - owner: |
| 85 | node: service#onos |
| 86 | relationship: tosca.relationships.BelongsToOne |
| 87 | {{- end -}} |
| 88 | |
Andy Bavier | a40e82b | 2018-05-07 17:00:36 -0700 | [diff] [blame] | 89 | {{- define "mcord.serviceGraphTosca" -}} |
| 90 | tosca_definitions_version: tosca_simple_yaml_1_0 |
| 91 | |
| 92 | imports: |
Matteo Scandolo | 3f2426b | 2019-01-18 13:46:26 -0800 | [diff] [blame] | 93 | - custom_types/fabricservice.yaml |
Andy Bavier | a40e82b | 2018-05-07 17:00:36 -0700 | [diff] [blame] | 94 | - custom_types/mcordsubscriberservice.yaml |
Matteo Scandolo | 3f2426b | 2019-01-18 13:46:26 -0800 | [diff] [blame] | 95 | - custom_types/onosservice.yaml |
Woojoong Kim | 5fa7e48 | 2019-07-30 00:12:12 -0700 | [diff] [blame] | 96 | {{- if .Values.progran.enabled }} |
Andy Bavier | a40e82b | 2018-05-07 17:00:36 -0700 | [diff] [blame] | 97 | - custom_types/progranservice.yaml |
Woojoong Kim | 5fa7e48 | 2019-07-30 00:12:12 -0700 | [diff] [blame] | 98 | {{- end }} |
Matteo Scandolo | a9ac2b8 | 2019-01-29 16:55:35 -0800 | [diff] [blame] | 99 | - custom_types/vrouterservice.yaml |
Andy Bavier | a40e82b | 2018-05-07 17:00:36 -0700 | [diff] [blame] | 100 | - custom_types/servicegraphconstraint.yaml |
| 101 | - custom_types/servicedependency.yaml |
Matteo Scandolo | 2b08edc | 2019-01-25 15:03:37 -0800 | [diff] [blame] | 102 | - custom_types/service.yaml |
Andy Bavier | a40e82b | 2018-05-07 17:00:36 -0700 | [diff] [blame] | 103 | |
Matteo Scandolo | 2b08edc | 2019-01-25 15:03:37 -0800 | [diff] [blame] | 104 | description: Configures the M-CORD service graph |
Andy Bavier | a40e82b | 2018-05-07 17:00:36 -0700 | [diff] [blame] | 105 | |
| 106 | topology_template: |
| 107 | node_templates: |
Woojoong Kim | 5fa7e48 | 2019-07-30 00:12:12 -0700 | [diff] [blame] | 108 | {{ if .Values.progran.enabled }} |
Andy Bavier | a40e82b | 2018-05-07 17:00:36 -0700 | [diff] [blame] | 109 | service#progran: |
| 110 | type: tosca.nodes.ProgranService |
| 111 | properties: |
| 112 | name: progran |
| 113 | must-exist: true |
Woojoong Kim | 5fa7e48 | 2019-07-30 00:12:12 -0700 | [diff] [blame] | 114 | {{ end }} |
Matteo Scandolo | a9ac2b8 | 2019-01-29 16:55:35 -0800 | [diff] [blame] | 115 | service#vrouter: |
| 116 | type: tosca.nodes.VRouterService |
| 117 | properties: |
| 118 | name: vrouter |
| 119 | must-exist: true |
| 120 | |
Andy Bavier | a40e82b | 2018-05-07 17:00:36 -0700 | [diff] [blame] | 121 | service#mcord: |
| 122 | type: tosca.nodes.MCordSubscriberService |
| 123 | properties: |
| 124 | name: mcord |
Matteo Scandolo | 3f2426b | 2019-01-18 13:46:26 -0800 | [diff] [blame] | 125 | must-exist: true |
Andy Bavier | a40e82b | 2018-05-07 17:00:36 -0700 | [diff] [blame] | 126 | |
Matteo Scandolo | 3f2426b | 2019-01-18 13:46:26 -0800 | [diff] [blame] | 127 | service#onos: |
| 128 | type: tosca.nodes.ONOSService |
| 129 | properties: |
| 130 | name: onos |
| 131 | must-exist: true |
| 132 | |
| 133 | service#fabric: |
| 134 | type: tosca.nodes.FabricService |
| 135 | properties: |
| 136 | name: fabric |
| 137 | must-exist: true |
| 138 | |
Woojoong Kim | 79360c3 | 2019-07-08 15:56:50 -0700 | [diff] [blame] | 139 | service#omec-cp: |
Matteo Scandolo | 2b08edc | 2019-01-25 15:03:37 -0800 | [diff] [blame] | 140 | type: tosca.nodes.Service |
| 141 | properties: |
Woojoong Kim | 79360c3 | 2019-07-08 15:56:50 -0700 | [diff] [blame] | 142 | name: omec-cp |
Matteo Scandolo | 2b08edc | 2019-01-25 15:03:37 -0800 | [diff] [blame] | 143 | |
Woojoong Kim | 79360c3 | 2019-07-08 15:56:50 -0700 | [diff] [blame] | 144 | service#omec-up: |
Matteo Scandolo | 2b08edc | 2019-01-25 15:03:37 -0800 | [diff] [blame] | 145 | type: tosca.nodes.Service |
| 146 | properties: |
Woojoong Kim | 79360c3 | 2019-07-08 15:56:50 -0700 | [diff] [blame] | 147 | name: omec-up |
Matteo Scandolo | 2b08edc | 2019-01-25 15:03:37 -0800 | [diff] [blame] | 148 | |
Matteo Scandolo | c889afb | 2019-02-15 10:42:00 -0800 | [diff] [blame] | 149 | service#cdn-local: |
| 150 | type: tosca.nodes.Service |
| 151 | properties: |
| 152 | name: cdn-local |
| 153 | |
| 154 | service#cdn-remote: |
| 155 | type: tosca.nodes.Service |
| 156 | properties: |
| 157 | name: cdn-remote |
| 158 | |
Matteo Scandolo | 3f2426b | 2019-01-18 13:46:26 -0800 | [diff] [blame] | 159 | service_dependency#onos-fabric_fabric: |
| 160 | type: tosca.nodes.ServiceDependency |
| 161 | properties: |
| 162 | connect_method: none |
| 163 | requirements: |
| 164 | - subscriber_service: |
| 165 | node: service#fabric |
| 166 | relationship: tosca.relationships.BelongsToOne |
| 167 | - provider_service: |
| 168 | node: service#onos |
| 169 | relationship: tosca.relationships.BelongsToOne |
| 170 | |
Matteo Scandolo | a9ac2b8 | 2019-01-29 16:55:35 -0800 | [diff] [blame] | 171 | service_dependency#vrouter_fabric: |
| 172 | type: tosca.nodes.ServiceDependency |
| 173 | properties: |
| 174 | connect_method: none |
| 175 | requirements: |
| 176 | - subscriber_service: |
| 177 | node: service#vrouter |
| 178 | relationship: tosca.relationships.BelongsToOne |
| 179 | - provider_service: |
| 180 | node: service#fabric |
| 181 | relationship: tosca.relationships.BelongsToOne |
| 182 | |
Woojoong Kim | 5fa7e48 | 2019-07-30 00:12:12 -0700 | [diff] [blame] | 183 | {{ if .Values.progran.enabled }} |
Woojoong Kim | ee78bac | 2019-06-21 14:31:42 -0700 | [diff] [blame] | 184 | service_dependency#mcord_progran: |
| 185 | type: tosca.nodes.ServiceDependency |
| 186 | properties: |
| 187 | connect_method: none |
| 188 | requirements: |
| 189 | - subscriber_service: |
| 190 | node: service#progran |
| 191 | relationship: tosca.relationships.BelongsToOne |
| 192 | - provider_service: |
| 193 | node: service#mcord |
| 194 | relationship: tosca.relationships.BelongsToOne |
| 195 | |
| 196 | service_dependency#progran_epc_cp: |
| 197 | type: tosca.nodes.ServiceDependency |
| 198 | properties: |
| 199 | connect_method: none |
| 200 | requirements: |
| 201 | - subscriber_service: |
Woojoong Kim | 79360c3 | 2019-07-08 15:56:50 -0700 | [diff] [blame] | 202 | node: service#omec-cp |
Woojoong Kim | ee78bac | 2019-06-21 14:31:42 -0700 | [diff] [blame] | 203 | relationship: tosca.relationships.BelongsToOne |
| 204 | - provider_service: |
| 205 | node: service#progran |
| 206 | relationship: tosca.relationships.BelongsToOne |
| 207 | |
Woojoong Kim | ee78bac | 2019-06-21 14:31:42 -0700 | [diff] [blame] | 208 | service_dependency#progran_epc_up: |
| 209 | type: tosca.nodes.ServiceDependency |
| 210 | properties: |
| 211 | connect_method: none |
| 212 | requirements: |
| 213 | - subscriber_service: |
Woojoong Kim | 79360c3 | 2019-07-08 15:56:50 -0700 | [diff] [blame] | 214 | node: service#omec-up |
Woojoong Kim | ee78bac | 2019-06-21 14:31:42 -0700 | [diff] [blame] | 215 | relationship: tosca.relationships.BelongsToOne |
| 216 | - provider_service: |
| 217 | node: service#progran |
| 218 | relationship: tosca.relationships.BelongsToOne |
| 219 | |
Woojoong Kim | 5fa7e48 | 2019-07-30 00:12:12 -0700 | [diff] [blame] | 220 | {{ else }} |
| 221 | service_dependency#mcord_epc_cp: |
| 222 | type: tosca.nodes.ServiceDependency |
| 223 | properties: |
| 224 | connect_method: none |
| 225 | requirements: |
| 226 | - subscriber_service: |
| 227 | node: service#omec-cp |
| 228 | relationship: tosca.relationships.BelongsToOne |
| 229 | - provider_service: |
| 230 | node: service#mcord |
| 231 | relationship: tosca.relationships.BelongsToOne |
| 232 | |
| 233 | service_dependency#mcord_epc_up: |
| 234 | type: tosca.nodes.ServiceDependency |
| 235 | properties: |
| 236 | connect_method: none |
| 237 | requirements: |
| 238 | - subscriber_service: |
| 239 | node: service#omec-up |
| 240 | relationship: tosca.relationships.BelongsToOne |
| 241 | - provider_service: |
| 242 | node: service#mcord |
| 243 | relationship: tosca.relationships.BelongsToOne |
| 244 | {{ end }} |
| 245 | |
| 246 | service_dependency#epc_cp_epc_up: |
| 247 | type: tosca.nodes.ServiceDependency |
| 248 | properties: |
| 249 | connect_method: none |
| 250 | requirements: |
| 251 | - subscriber_service: |
| 252 | node: service#omec-up |
| 253 | relationship: tosca.relationships.BelongsToOne |
| 254 | - provider_service: |
| 255 | node: service#omec-cp |
| 256 | relationship: tosca.relationships.BelongsToOne |
| 257 | |
Woojoong Kim | ee78bac | 2019-06-21 14:31:42 -0700 | [diff] [blame] | 258 | service_dependency#epc_up_cdn_local: |
| 259 | type: tosca.nodes.ServiceDependency |
| 260 | properties: |
| 261 | connect_method: none |
| 262 | requirements: |
| 263 | - subscriber_service: |
| 264 | node: service#cdn-local |
| 265 | relationship: tosca.relationships.BelongsToOne |
| 266 | - provider_service: |
Woojoong Kim | 79360c3 | 2019-07-08 15:56:50 -0700 | [diff] [blame] | 267 | node: service#omec-up |
Woojoong Kim | ee78bac | 2019-06-21 14:31:42 -0700 | [diff] [blame] | 268 | relationship: tosca.relationships.BelongsToOne |
| 269 | |
| 270 | service_dependency#cdn_local_cdn_remote: |
| 271 | type: tosca.nodes.ServiceDependency |
| 272 | properties: |
| 273 | connect_method: none |
| 274 | requirements: |
| 275 | - subscriber_service: |
| 276 | node: service#cdn-remote |
| 277 | relationship: tosca.relationships.BelongsToOne |
| 278 | - provider_service: |
| 279 | node: service#cdn-local |
| 280 | relationship: tosca.relationships.BelongsToOne |
| 281 | |
Andy Bavier | a40e82b | 2018-05-07 17:00:36 -0700 | [diff] [blame] | 282 | constraints: |
| 283 | type: tosca.nodes.ServiceGraphConstraint |
| 284 | properties: |
Woojoong Kim | 5fa7e48 | 2019-07-30 00:12:12 -0700 | [diff] [blame] | 285 | {{ if (.Values.seba.enabled) and (.Values.progran.enabled) }} |
Woojoong Kim | 79360c3 | 2019-07-08 15:56:50 -0700 | [diff] [blame] | 286 | constraints: '[ ["mcord", null, "onos"], ["progran", null, "fabric"], ["omec-cp", null, null] ["omec-up", null, null] ]' |
Woojoong Kim | 5fa7e48 | 2019-07-30 00:12:12 -0700 | [diff] [blame] | 287 | {{ else if (not .Values.seba.enabled) and (.Values.progran.enabled) }} |
Woojoong Kim | 79360c3 | 2019-07-08 15:56:50 -0700 | [diff] [blame] | 288 | constraints: '[ ["mcord", "progran", null], ["omec-cp", "omec-up", "onos"], [null, "cdn-local", "fabric"], [null, "cdn-remote", "vrouter"] ]' |
Woojoong Kim | 5fa7e48 | 2019-07-30 00:12:12 -0700 | [diff] [blame] | 289 | {{ else if (not .Values.seba.enabled) and (not .Values.progran.enabled) }} |
| 290 | constraints: '[ [null, "mcord", null], ["omec-cp", "omec-up", "onos"], [null, "cdn-local", "fabric"], [null, "cdn-remote", "vrouter"] ]' |
| 291 | {{ end }} |
Woojoong Kim | ee78bac | 2019-06-21 14:31:42 -0700 | [diff] [blame] | 292 | {{- end -}} |