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 | */}} |
Hyunsun Moon | 35abc2e | 2019-10-19 15:05:03 -0600 | [diff] [blame] | 17 | {{- define "mcord-services.onosFabricTosca" -}} |
Andy Bavier | a40e82b | 2018-05-07 17:00:36 -0700 | [diff] [blame] | 18 | tosca_definitions_version: tosca_simple_yaml_1_0 |
Hyunsun Moon | 35abc2e | 2019-10-19 15:05:03 -0600 | [diff] [blame] | 19 | description: Configures ONOS services |
Matteo Scandolo | 3f2426b | 2019-01-18 13:46:26 -0800 | [diff] [blame] | 20 | |
| 21 | imports: |
| 22 | - custom_types/onosapp.yaml |
| 23 | - custom_types/onosservice.yaml |
| 24 | - custom_types/serviceinstanceattribute.yaml |
| 25 | |
Matteo Scandolo | 3f2426b | 2019-01-18 13:46:26 -0800 | [diff] [blame] | 26 | topology_template: |
| 27 | node_templates: |
| 28 | |
| 29 | service#onos: |
| 30 | type: tosca.nodes.ONOSService |
| 31 | properties: |
| 32 | name: onos |
| 33 | kind: data |
Hyunsun Moon | b391551 | 2019-12-01 00:41:28 -0800 | [diff] [blame] | 34 | rest_hostname: {{ .onosFabricRestHost | quote }} |
| 35 | rest_port: {{ .onosFabricRestPort }} |
Matteo Scandolo | 3f2426b | 2019-01-18 13:46:26 -0800 | [diff] [blame] | 36 | |
| 37 | onos_app#segmentrouting: |
| 38 | type: tosca.nodes.ONOSApp |
| 39 | properties: |
| 40 | name: org.onosproject.segmentrouting |
| 41 | app_id: org.onosproject.segmentrouting |
| 42 | requirements: |
| 43 | - owner: |
| 44 | node: service#onos |
| 45 | relationship: tosca.relationships.BelongsToOne |
| 46 | |
| 47 | onos_app#netcfghostprovider: |
| 48 | type: tosca.nodes.ONOSApp |
| 49 | properties: |
| 50 | name: org.onosproject.netcfghostprovider |
| 51 | app_id: org.onosproject.netcfghostprovider |
| 52 | requirements: |
| 53 | - owner: |
| 54 | node: service#onos |
| 55 | relationship: tosca.relationships.BelongsToOne |
| 56 | |
| 57 | onos_app#openflow: |
| 58 | type: tosca.nodes.ONOSApp |
| 59 | properties: |
| 60 | name: org.onosproject.openflow |
| 61 | app_id: org.onosproject.openflow |
| 62 | requirements: |
| 63 | - owner: |
| 64 | node: service#onos |
| 65 | relationship: tosca.relationships.BelongsToOne |
| 66 | {{- end -}} |
| 67 | |
Hyunsun Moon | 35abc2e | 2019-10-19 15:05:03 -0600 | [diff] [blame] | 68 | {{- define "mcord-services.onosProgranTosca" -}} |
| 69 | tosca_definitions_version: tosca_simple_yaml_1_0 |
| 70 | description: Configures ONOS services |
| 71 | |
| 72 | imports: |
| 73 | - custom_types/onosapp.yaml |
| 74 | - custom_types/onosservice.yaml |
| 75 | - custom_types/serviceinstanceattribute.yaml |
| 76 | |
| 77 | topology_template: |
| 78 | node_templates: |
| 79 | |
| 80 | service#onos-progran: |
| 81 | type: tosca.nodes.ONOSService |
| 82 | properties: |
| 83 | name: onos-progran |
| 84 | kind: data |
Hyunsun Moon | b391551 | 2019-12-01 00:41:28 -0800 | [diff] [blame] | 85 | rest_hostname: {{ .onosProgranRestHost | quote }} |
| 86 | rest_port: {{ .onosProgranRestPort }} |
Hyunsun Moon | 35abc2e | 2019-10-19 15:05:03 -0600 | [diff] [blame] | 87 | |
| 88 | onos_app#progran: |
| 89 | type: tosca.nodes.ONOSApp |
| 90 | properties: |
| 91 | name: org.onosproject.progran |
| 92 | app_id: org.onosproject.progran |
| 93 | requirements: |
| 94 | - owner: |
| 95 | node: service#onos-progran |
| 96 | relationship: tosca.relationships.BelongsToOne |
| 97 | {{- end -}} |
| 98 | |
| 99 | {{- define "mcord-services.serviceGraphTosca" -}} |
Andy Bavier | a40e82b | 2018-05-07 17:00:36 -0700 | [diff] [blame] | 100 | tosca_definitions_version: tosca_simple_yaml_1_0 |
| 101 | |
| 102 | imports: |
Andy Bavier | a40e82b | 2018-05-07 17:00:36 -0700 | [diff] [blame] | 103 | - custom_types/mcordsubscriberservice.yaml |
Andy Bavier | a40e82b | 2018-05-07 17:00:36 -0700 | [diff] [blame] | 104 | - custom_types/servicegraphconstraint.yaml |
| 105 | - custom_types/servicedependency.yaml |
Matteo Scandolo | 2b08edc | 2019-01-25 15:03:37 -0800 | [diff] [blame] | 106 | - custom_types/service.yaml |
Hyunsun Moon | 35abc2e | 2019-10-19 15:05:03 -0600 | [diff] [blame] | 107 | {{- if or .Values.fabric.enabled .Values.progran.enabled }} |
| 108 | - custom_types/onosservice.yaml |
| 109 | {{- end }} |
| 110 | {{- if .Values.fabric.enabled }} |
| 111 | - custom_types/fabricservice.yaml |
| 112 | - custom_types/vrouterservice.yaml |
| 113 | {{- end }} |
| 114 | {{- if .Values.progran.enabled }} |
| 115 | - custom_types/progranservice.yaml |
| 116 | {{- end }} |
Andy Bavier | a40e82b | 2018-05-07 17:00:36 -0700 | [diff] [blame] | 117 | |
Matteo Scandolo | 2b08edc | 2019-01-25 15:03:37 -0800 | [diff] [blame] | 118 | description: Configures the M-CORD service graph |
Andy Bavier | a40e82b | 2018-05-07 17:00:36 -0700 | [diff] [blame] | 119 | |
| 120 | topology_template: |
| 121 | node_templates: |
Andy Bavier | a40e82b | 2018-05-07 17:00:36 -0700 | [diff] [blame] | 122 | service#mcord: |
| 123 | type: tosca.nodes.MCordSubscriberService |
| 124 | properties: |
| 125 | name: mcord |
Matteo Scandolo | 3f2426b | 2019-01-18 13:46:26 -0800 | [diff] [blame] | 126 | must-exist: true |
Andy Bavier | a40e82b | 2018-05-07 17:00:36 -0700 | [diff] [blame] | 127 | |
Woojoong Kim | 79360c3 | 2019-07-08 15:56:50 -0700 | [diff] [blame] | 128 | service#omec-cp: |
Matteo Scandolo | 2b08edc | 2019-01-25 15:03:37 -0800 | [diff] [blame] | 129 | type: tosca.nodes.Service |
| 130 | properties: |
Woojoong Kim | 79360c3 | 2019-07-08 15:56:50 -0700 | [diff] [blame] | 131 | name: omec-cp |
Matteo Scandolo | 2b08edc | 2019-01-25 15:03:37 -0800 | [diff] [blame] | 132 | |
Woojoong Kim | 79360c3 | 2019-07-08 15:56:50 -0700 | [diff] [blame] | 133 | service#omec-up: |
Matteo Scandolo | 2b08edc | 2019-01-25 15:03:37 -0800 | [diff] [blame] | 134 | type: tosca.nodes.Service |
| 135 | properties: |
Woojoong Kim | 79360c3 | 2019-07-08 15:56:50 -0700 | [diff] [blame] | 136 | name: omec-up |
Matteo Scandolo | 2b08edc | 2019-01-25 15:03:37 -0800 | [diff] [blame] | 137 | |
Matteo Scandolo | c889afb | 2019-02-15 10:42:00 -0800 | [diff] [blame] | 138 | service#cdn-local: |
| 139 | type: tosca.nodes.Service |
| 140 | properties: |
| 141 | name: cdn-local |
| 142 | |
| 143 | service#cdn-remote: |
| 144 | type: tosca.nodes.Service |
| 145 | properties: |
| 146 | name: cdn-remote |
| 147 | |
Hyunsun Moon | 35abc2e | 2019-10-19 15:05:03 -0600 | [diff] [blame] | 148 | {{- if .Values.fabric.enabled }} |
| 149 | service#onos: |
| 150 | type: tosca.nodes.ONOSService |
Matteo Scandolo | 3f2426b | 2019-01-18 13:46:26 -0800 | [diff] [blame] | 151 | properties: |
Hyunsun Moon | 35abc2e | 2019-10-19 15:05:03 -0600 | [diff] [blame] | 152 | name: onos |
| 153 | must-exist: true |
Matteo Scandolo | 3f2426b | 2019-01-18 13:46:26 -0800 | [diff] [blame] | 154 | |
Hyunsun Moon | 35abc2e | 2019-10-19 15:05:03 -0600 | [diff] [blame] | 155 | service#fabric: |
| 156 | type: tosca.nodes.FabricService |
Matteo Scandolo | a9ac2b8 | 2019-01-29 16:55:35 -0800 | [diff] [blame] | 157 | properties: |
Hyunsun Moon | 35abc2e | 2019-10-19 15:05:03 -0600 | [diff] [blame] | 158 | name: fabric |
| 159 | must-exist: true |
Matteo Scandolo | a9ac2b8 | 2019-01-29 16:55:35 -0800 | [diff] [blame] | 160 | |
Hyunsun Moon | 35abc2e | 2019-10-19 15:05:03 -0600 | [diff] [blame] | 161 | service#vrouter: |
| 162 | type: tosca.nodes.VRouterService |
Woojoong Kim | ee78bac | 2019-06-21 14:31:42 -0700 | [diff] [blame] | 163 | properties: |
Hyunsun Moon | 35abc2e | 2019-10-19 15:05:03 -0600 | [diff] [blame] | 164 | name: vrouter |
| 165 | must-exist: true |
| 166 | {{- end }} |
Woojoong Kim | ee78bac | 2019-06-21 14:31:42 -0700 | [diff] [blame] | 167 | |
Hyunsun Moon | 35abc2e | 2019-10-19 15:05:03 -0600 | [diff] [blame] | 168 | {{- if .Values.progran.enabled }} |
| 169 | service#onos-progran: |
| 170 | type: tosca.nodes.ONOSService |
Woojoong Kim | ee78bac | 2019-06-21 14:31:42 -0700 | [diff] [blame] | 171 | properties: |
Hyunsun Moon | 35abc2e | 2019-10-19 15:05:03 -0600 | [diff] [blame] | 172 | name: onos-progran |
| 173 | must-exist: true |
Woojoong Kim | ee78bac | 2019-06-21 14:31:42 -0700 | [diff] [blame] | 174 | |
Hyunsun Moon | 35abc2e | 2019-10-19 15:05:03 -0600 | [diff] [blame] | 175 | service#progran: |
| 176 | type: tosca.nodes.ProgranService |
Woojoong Kim | ee78bac | 2019-06-21 14:31:42 -0700 | [diff] [blame] | 177 | properties: |
Hyunsun Moon | 35abc2e | 2019-10-19 15:05:03 -0600 | [diff] [blame] | 178 | name: progran |
| 179 | must-exist: true |
| 180 | {{- end }} |
Woojoong Kim | ee78bac | 2019-06-21 14:31:42 -0700 | [diff] [blame] | 181 | |
Woojoong Kim | 5fa7e48 | 2019-07-30 00:12:12 -0700 | [diff] [blame] | 182 | service_dependency#mcord_epc_cp: |
| 183 | type: tosca.nodes.ServiceDependency |
| 184 | properties: |
| 185 | connect_method: none |
| 186 | requirements: |
| 187 | - subscriber_service: |
| 188 | node: service#omec-cp |
| 189 | relationship: tosca.relationships.BelongsToOne |
| 190 | - provider_service: |
| 191 | node: service#mcord |
| 192 | relationship: tosca.relationships.BelongsToOne |
| 193 | |
| 194 | service_dependency#mcord_epc_up: |
| 195 | type: tosca.nodes.ServiceDependency |
| 196 | properties: |
| 197 | connect_method: none |
| 198 | requirements: |
| 199 | - subscriber_service: |
| 200 | node: service#omec-up |
| 201 | relationship: tosca.relationships.BelongsToOne |
| 202 | - provider_service: |
| 203 | node: service#mcord |
| 204 | relationship: tosca.relationships.BelongsToOne |
Woojoong Kim | 5fa7e48 | 2019-07-30 00:12:12 -0700 | [diff] [blame] | 205 | |
| 206 | service_dependency#epc_cp_epc_up: |
| 207 | type: tosca.nodes.ServiceDependency |
| 208 | properties: |
| 209 | connect_method: none |
| 210 | requirements: |
| 211 | - subscriber_service: |
| 212 | node: service#omec-up |
| 213 | relationship: tosca.relationships.BelongsToOne |
| 214 | - provider_service: |
| 215 | node: service#omec-cp |
| 216 | relationship: tosca.relationships.BelongsToOne |
| 217 | |
Hyunsun Moon | 35abc2e | 2019-10-19 15:05:03 -0600 | [diff] [blame] | 218 | service_dependency#cdn_remote_cdn_local: |
Woojoong Kim | ee78bac | 2019-06-21 14:31:42 -0700 | [diff] [blame] | 219 | type: tosca.nodes.ServiceDependency |
| 220 | properties: |
| 221 | connect_method: none |
| 222 | requirements: |
| 223 | - subscriber_service: |
| 224 | node: service#cdn-local |
| 225 | relationship: tosca.relationships.BelongsToOne |
| 226 | - provider_service: |
Woojoong Kim | ee78bac | 2019-06-21 14:31:42 -0700 | [diff] [blame] | 227 | node: service#cdn-remote |
| 228 | relationship: tosca.relationships.BelongsToOne |
Hyunsun Moon | 35abc2e | 2019-10-19 15:05:03 -0600 | [diff] [blame] | 229 | |
| 230 | {{- if .Values.fabric.enabled }} |
| 231 | service_dependency#fabric_vrouter: |
| 232 | type: tosca.nodes.ServiceDependency |
| 233 | properties: |
| 234 | connect_method: none |
| 235 | requirements: |
| 236 | - subscriber_service: |
| 237 | node: service#fabric |
Woojoong Kim | ee78bac | 2019-06-21 14:31:42 -0700 | [diff] [blame] | 238 | relationship: tosca.relationships.BelongsToOne |
Hyunsun Moon | 35abc2e | 2019-10-19 15:05:03 -0600 | [diff] [blame] | 239 | - provider_service: |
| 240 | node: service#onos |
| 241 | relationship: tosca.relationships.BelongsToOne |
| 242 | |
| 243 | service_dependency#onos_fabric: |
| 244 | type: tosca.nodes.ServiceDependency |
| 245 | properties: |
| 246 | connect_method: none |
| 247 | requirements: |
| 248 | - subscriber_service: |
| 249 | node: service#vrouter |
| 250 | relationship: tosca.relationships.BelongsToOne |
| 251 | - provider_service: |
| 252 | node: service#fabric |
| 253 | relationship: tosca.relationships.BelongsToOne |
| 254 | {{- end }} |
| 255 | |
| 256 | {{- if .Values.progran.enabled }} |
| 257 | service_dependency#mcord_progran: |
| 258 | type: tosca.nodes.ServiceDependency |
| 259 | properties: |
| 260 | connect_method: none |
| 261 | requirements: |
| 262 | - subscriber_service: |
| 263 | node: service#progran |
| 264 | relationship: tosca.relationships.BelongsToOne |
| 265 | - provider_service: |
| 266 | node: service#mcord |
| 267 | relationship: tosca.relationships.BelongsToOne |
| 268 | |
| 269 | service_dependency#onos_progran: |
| 270 | type: tosca.nodes.ServiceDependency |
| 271 | properties: |
| 272 | connect_method: none |
| 273 | requirements: |
| 274 | - subscriber_service: |
| 275 | node: service#progran |
| 276 | relationship: tosca.relationships.BelongsToOne |
| 277 | - provider_service: |
| 278 | node: service#onos-progran |
| 279 | relationship: tosca.relationships.BelongsToOne |
| 280 | {{- end }} |
Woojoong Kim | ee78bac | 2019-06-21 14:31:42 -0700 | [diff] [blame] | 281 | |
Andy Bavier | a40e82b | 2018-05-07 17:00:36 -0700 | [diff] [blame] | 282 | constraints: |
| 283 | type: tosca.nodes.ServiceGraphConstraint |
| 284 | properties: |
Hyunsun Moon | 35abc2e | 2019-10-19 15:05:03 -0600 | [diff] [blame] | 285 | {{- if and .Values.fabric.enabled .Values.progran.enabled }} |
| 286 | constraints: '[ [null, "mcord", null, "fabric"], ["cdn-remote", "omec-cp", "progran", "vrouter"], ["cdn-local", "omec-up", "onos-progran", "onos"] ]' |
| 287 | {{- else if and (not .Values.fabric.enabled) .Values.progran.enabled }} |
| 288 | constraints: '[ [null, null, "mcord", null], ["cdn-remote", "omec-cp", null, "progran"], ["cdn-local", "omec-up", null, "onos-progran"] ]' |
| 289 | {{- else if and .Values.fabric.enabled (not .Values.progran.enabled) }} |
| 290 | constraints: '[ [null, "mcord", "fabric"], ["cdn-remote", "omec-cp", "vrouter"], ["cdn-local", "omec-up", "onos"] ]' |
| 291 | {{- else }} |
| 292 | constraints: '[ [null, "mcord"], ["cdn-remote", "omec-cp"], ["cdn-local", "omec-up"] ]' |
| 293 | {{- end }} |
| 294 | {{- end -}} |