blob: 66c32793c84cfddcc63a8a258580446717e8f5e1 [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 "demo-exampleservice.publicNetworkTosca" -}}
18tosca_definitions_version: tosca_simple_yaml_1_0
19description: Setup public network
20imports:
Scott Bakerb6ed4402018-06-22 16:58:28 -070021 - custom_types/addressmanagerservice.yaml
22 - custom_types/addressmanagerserviceinstance.yaml
23 - custom_types/addresspool.yaml
Scott Baker6a4fd492018-06-19 08:12:42 -070024 - custom_types/networktemplate.yaml
25 - custom_types/network.yaml
Scott Bakerb6ed4402018-06-22 16:58:28 -070026 - custom_types/serviceinstancelink.yaml
Scott Baker6a4fd492018-06-19 08:12:42 -070027 - custom_types/site.yaml
28 - custom_types/slice.yaml
29topology_template:
30 node_templates:
31 mysite:
32 type: tosca.nodes.Site
33 properties:
34 name: {{ .Values.cordSiteName }}
35 must-exist: true
36
37 public_networking_slice:
38 description: This slice exists solely to own the public network
39 type: tosca.nodes.Slice
40 properties:
41 network: noauto
42 name: public_networking
43 requirements:
44 - site:
45 node: mysite
46 relationship: tosca.relationships.BelongsToOne
47
48 # public network
49 public_template:
50 type: tosca.nodes.NetworkTemplate
51 properties:
52 name: public_template
53 visibility: public
54 translation: none
55 vtn_kind: PUBLIC
56
57 public:
58 type: tosca.nodes.Network
59 properties:
60 name: public
61 permit_all_slices: true
62 subnet: {{ .Values.addresspool_public_cidr }}
63 # ip_version: 4
64 requirements:
65 - template:
66 node: public_template
67 relationship: tosca.relationships.BelongsToOne
68 - owner:
69 node: public_networking_slice
70 relationship: tosca.relationships.BelongsToOne
Scott Bakerb6ed4402018-06-22 16:58:28 -070071
72 service#addressmanager:
73 type: tosca.nodes.AddressManagerService
74 properties:
75 name: addressmanager
76
77 addresses_public:
78 type: tosca.nodes.AddressPool
79 properties:
80 name: addresses_public
81 addresses: {{ .Values.addresspool_public_cidr }}
82 gateway_ip: {{ .Values.addresspool_public_gateway_ip }}
83 gateway_mac: {{ .Values.addresspool_public_gateway_mac }}
84 requirements:
85 - service:
86 node: service#addressmanager
87 relationship: tosca.relationships.BelongsToOne
88
89 AddressManagerServiceInstancePublicNetwork:
90 type: tosca.nodes.AddressManagerServiceInstance
91 requirements:
92 - owner:
93 node: service#addressmanager
94 relationship: tosca.relationships.BelongsToOne
95 - address_pool:
96 node: addresses_public
97 relationship: tosca.relationships.BelongsToOne
98 properties:
99 name: AM_public_net
100
101 public_to_address_manager:
102 type: tosca.nodes.ServiceInstanceLink
103 requirements:
104 - provider_service_instance:
105 node: AddressManagerServiceInstancePublicNetwork
106 relationship: tosca.relationships.BelongsToOne
107 - subscriber_network:
108 node: public
109 relationship: tosca.relationships.BelongsToOne
110
Scott Baker6a4fd492018-06-19 08:12:42 -0700111{{- end -}}