Merge "[DMAAP] DMaaP ServiceMesh compatibility"
[oom.git] / kubernetes / contrib / components / netbox / components / netbox-app / resources / config / provisioning / provision.sh
1 #!/bin/sh
2
3 # Create region
4
5 echo "Create region: RegionOne"
6 curl --silent -X POST \
7   http://{{ .Values.service.name }}:{{ .Values.service.internalPort }}/api/dcim/regions/ \
8   -H 'Authorization: Token onceuponatimeiplayedwithnetbox20180814' \
9   -H 'Content-Type: application/json' \
10   -d '{
11   "name": "RegionOne",
12   "slug": "RegionOne"
13 }'
14
15 # Create tenant group
16
17 echo "Create tenant group: ONAP group"
18 curl --silent -X POST \
19   http://{{ .Values.service.name }}:{{ .Values.service.internalPort }}/api/tenancy/tenant-groups/ \
20   -H 'Authorization: Token onceuponatimeiplayedwithnetbox20180814' \
21   -H 'Content-Type: application/json' \
22   -d '{
23   "name": "ONAP group",
24   "slug": "onap-group"
25 }'
26
27 # Create tenant
28
29 echo "Create tenant ONAP in ONAP group"
30 curl --silent -X POST \
31   http://{{ .Values.service.name }}:{{ .Values.service.internalPort }}/api/tenancy/tenants/ \
32   -H 'Authorization: Token onceuponatimeiplayedwithnetbox20180814' \
33   -H 'Content-Type: application/json' \
34   -d '{
35   "name": "ONAP",
36   "slug": "onap",
37   "group": 1,
38   "description": "ONAP tenant",
39   "comments": "Tenant for ONAP demo use cases"
40 }'
41
42 # Create site
43
44 echo "Create ONAP demo site: Montreal Lab"
45 curl --silent -X POST \
46   http://{{ .Values.service.name }}:{{ .Values.service.internalPort }}/api/dcim/sites/ \
47   -H 'Authorization: Token onceuponatimeiplayedwithnetbox20180814' \
48   -H 'Content-Type: application/json' \
49   -d '{
50   "name": "Montreal Lab D3",
51   "slug": "mtl-lab-d3",
52   "region": 1,
53   "tenant": 1,
54   "facility": "Campus",
55   "time_zone": "Canada/Atlantic",
56   "description": "Site hosting the ONAP use cases",
57   "physical_address": "1 Graham Bell",
58   "shipping_address": "1 Graham Bell",
59   "contact_name": "Alexis",
60   "contact_phone": "0000000000",
61   "contact_email": "adetalhouet89@gmail.com",
62   "comments": "ONAP lab"
63 }'
64
65 # Create prefixes
66
67 echo "Create Prefix for vFW protected network"
68 curl --silent -X POST \
69   http://{{ .Values.service.name }}:{{ .Values.service.internalPort }}/api/ipam/prefixes/ \
70   -H 'Authorization: Token onceuponatimeiplayedwithnetbox20180814' \
71   -H 'Content-Type: application/json' \
72   -d '{
73   "prefix": "{{ .Values.service.private2 }}",
74   "site": 1,
75   "tenant": 1,
76   "is_pool": false,
77   "description": "IP Pool for private network 2"
78 }'
79
80 echo "Create Prefix for vFW unprotected network"
81 curl --silent -X POST \
82   http://{{ .Values.service.name }}:{{ .Values.service.internalPort }}/api/ipam/prefixes/ \
83   -H 'Authorization: Token onceuponatimeiplayedwithnetbox20180814' \
84   -H 'Content-Type: application/json' \
85   -d '{
86   "prefix": "{{ .Values.service.private1 }}",
87   "site": 1,
88   "tenant": 1,
89   "is_pool": false,
90   "description": "IP Pool for private network 1"
91 }'
92
93 echo "Create Prefix for ONAP general purpose network"
94 curl --silent -X POST \
95   http://{{ .Values.service.name }}:{{ .Values.service.internalPort }}/api/ipam/prefixes/ \
96   -H 'Authorization: Token onceuponatimeiplayedwithnetbox20180814' \
97   -H 'Content-Type: application/json' \
98   -d '{
99   "prefix": "{{ .Values.service.management }}",
100   "site": 1,
101   "tenant": 1,
102   "is_pool": false,
103   "description": "IP Pool for ONAP - general purpose"
104 }'
105
106 # Reserve ports, gateway and dhcp, for each protected and unprotected networks.
107
108 curl --silent -X  POST \
109   http://{{ .Values.service.name }}:{{ .Values.service.internalPort }}/api/ipam/prefixes/1/available-ips/ \
110   -H 'Authorization: Token onceuponatimeiplayedwithnetbox20180814' \
111   -H 'Content-Type: application/json'
112
113 curl --silent -X  POST \
114   http://{{ .Values.service.name }}:{{ .Values.service.internalPort }}/api/ipam/prefixes/1/available-ips/ \
115   -H 'Authorization: Token onceuponatimeiplayedwithnetbox20180814' \
116   -H 'Content-Type: application/json'
117
118 curl --silent -X  POST \
119   http://{{ .Values.service.name }}:{{ .Values.service.internalPort }}/api/ipam/prefixes/2/available-ips/ \
120   -H 'Authorization: Token onceuponatimeiplayedwithnetbox20180814' \
121   -H 'Content-Type: application/json'
122
123 curl --silent -X  POST \
124   http://{{ .Values.service.name }}:{{ .Values.service.internalPort }}/api/ipam/prefixes/2/available-ips/ \
125   -H 'Authorization: Token onceuponatimeiplayedwithnetbox20180814' \
126   -H 'Content-Type: application/json'
127
128 curl --silent -X  POST \
129   http://{{ .Values.service.name }}:{{ .Values.service.internalPort }}/api/ipam/prefixes/3/available-ips/ \
130   -H 'Authorization: Token onceuponatimeiplayedwithnetbox20180814' \
131   -H 'Content-Type: application/json'
132
133 curl --silent -X  POST \
134   http://{{ .Values.service.name }}:{{ .Values.service.internalPort }}/api/ipam/prefixes/3/available-ips/ \
135   -H 'Authorization: Token onceuponatimeiplayedwithnetbox20180814' \
136   -H 'Content-Type: application/json'