blob: 1ab726d6aac02e3528d4c4148e8b2324e7ceb224 [file] [log] [blame]
Rene_Robertfb177972019-07-09 14:39:47 +02001.. This work is licensed under a Creative Commons Attribution 4.0
2.. International License. http://creativecommons.org/licenses/by/4.0
3.. Copyright 2019 ONAP Contributors. All rights reserved.
4
5.. _doc_guide_user_pre_ser-inst:
6
7
8Pre Service instantiation Operations
9====================================
10
11Several operations need to be performed after Service model distribution,
12but before instantiating a service.
13
14Those operations are only available via REST API requests.
15
16Various tools can be used to send REST API requests.
17
18Here after are examples using "curl" command line tool that you can use in
19a Unix Terminal.
20
21
22Declare owningEntity, lineOfBusiness, Platform and Project
23----------------------------------------------------------
24
25At one point during Service Instantiation, the user need to select values for
26those 4 parameters
27
28* Owning Entity
29* Line Of Business
30* Platform
31* Project
32
33
34Those parameters and values must be pre-declared in ONAP VID component
35using REST API
36
37Those informations will be available to all service instantiation
38(you only need to declare them once in ONAP)
39
40
Rene_Robertaa9be1c2019-10-24 09:23:25 +020041Example for "Owning Entity" named "OE-Generic"
42
43For Owning_Entity, it is important to declare the information in AAI
44with a UUID value for "owning-entity-id". That value will be necessary
45to instantiate a service with SO using GR_API.
46
47::
48
49 curl -X PUT \
50 https://aai.api.sparky.simpledemo.onap.org:30233/aai/v13/business/owning-entities/owning-entity/8874891f-5120-4b98-b452-46284513958d \
51 -H 'Accept: application/json' \
52 -H 'Authorization: Basic QUFJOkFBSQ==' \
53 -H 'Content-Type: application/json' \
54 -H 'X-FromAppId: AAI' \
55 -H 'X-TransactionId: get_aai_subscr' \
56 -H 'cache-control: no-cache' \
57 -d '{
58 "owning-entity-name": "OE-Generic",
59 "owning-entity-id": "8874891f-5120-4b98-b452-46284513958d"
60 }'
61
62::
63
64 curl -X GET \
65 https://aai.api.sparky.simpledemo.onap.org:30233/aai/v16/business/owning-entities \
66 -H 'Accept: application/json' \
67 -H 'Authorization: Basic QUFJOkFBSQ==' \
68 -H 'Content-Type: application/json' \
69 -H 'X-FromAppId: AAI' \
70 -H 'X-TransactionId: get_aai_subscr' \
71 -H 'cache-control: no-cache'
72
73
74To declare the Owning Entity in VID:
Rene_Robertfb177972019-07-09 14:39:47 +020075
76::
77
78 curl -X POST \
andreasgeisslerbd27fe92020-02-18 11:31:10 +010079 https://vid.api.simpledemo.onap.org:30200/vid/maintenance/category_parameter/owningEntity \
Rene_Robertfb177972019-07-09 14:39:47 +020080 -H 'Accept-Encoding: gzip, deflate' \
81 -H 'Content-Type: application/json' \
82 -H 'cache-control: no-cache' \
83 -d '{
Rene_Robertaa9be1c2019-10-24 09:23:25 +020084 "options": ["OE-Generic"]
Rene_Robertfb177972019-07-09 14:39:47 +020085 }'
86
Rene_Robertaa9be1c2019-10-24 09:23:25 +020087
Rene_Robertfb177972019-07-09 14:39:47 +020088Example for "platform" named "Test_Platform"
89
90::
91
92 curl -X POST \
andreasgeisslerbd27fe92020-02-18 11:31:10 +010093 https://vid.api.simpledemo.onap.org:30200/vid/maintenance/category_parameter/platform \
Rene_Robertfb177972019-07-09 14:39:47 +020094 -H 'Content-Type: application/json' \
95 -H 'cache-control: no-cache' \
96 -d '{
andreasgeisslerbd27fe92020-02-18 11:31:10 +010097 "options": ["Test_Platform"]
Rene_Robertfb177972019-07-09 14:39:47 +020098 }'
99
100Example for "line of business" named "Test_LOB"
101
102::
103
104 curl -X POST \
andreasgeisslerbd27fe92020-02-18 11:31:10 +0100105 https://vid.api.simpledemo.onap.org:30200/vid/maintenance/category_parameter/lineOfBusiness \
Rene_Robertfb177972019-07-09 14:39:47 +0200106 -H 'Content-Type: application/json' \
107 -H 'cache-control: no-cache' \
108 -d '{
109 "options": ["Test_LOB"]
110 }'
111
112Example for "project" named "Test_project"
113
114::
115
116 curl -X POST \
andreasgeisslerbd27fe92020-02-18 11:31:10 +0100117 https://vid.api.simpledemo.onap.org:30200/vid/maintenance/category_parameter/project \
Rene_Robertfb177972019-07-09 14:39:47 +0200118 -H 'Content-Type: application/json' \
119 -H 'cache-control: no-cache' \
120 -d '{
121 "options": ["Test_project"]
122 }'
123
124
125
126
127Declare a customer
128------------------
129
130Each time you have a new customer, you will need to perform those operations
131
132This operation is using ONAP AAI REST API
133
134Any service instance need to be linked to a customer
135
136in the query path, you put the customer_name
137
138in the query body you put the customer name again
139
140Here after an example to declare a customer named "my_customer_name"
141
142
143::
144
145 curl -X PUT \
146 https://aai.api.sparky.simpledemo.onap.org:30233/aai/v16/business/customers/customer/my_customer_name \
147 -H 'Accept: application/json' \
148 -H 'Authorization: Basic QUFJOkFBSQ==' \
149 -H 'Content-Type: application/json' \
150 -H 'X-FromAppId: AAI' \
151 -H 'X-TransactionId: 808b54e3-e563-4144-a1b9-e24e2ed93d4f' \
152 -H 'cache-control: no-cache' \
153 -d '{
154 "global-customer-id": "my_customer_name",
155 "subscriber-name": "my_customer_name",
156 "subscriber-type": "INFRA"
157 }' -k
158
159
160check customers in ONAP AAI (you should see if everything ok in the response)
161
162::
163
164 curl -X GET \
165 https://aai.api.sparky.simpledemo.onap.org:30233/aai/v16/business/customers \
166 -H 'Accept: application/json' \
167 -H 'Authorization: Basic QUFJOkFBSQ==' \
168 -H 'Content-Type: application/json' \
169 -H 'X-FromAppId: AAI' \
170 -H 'X-TransactionId: 808b54e3-e563-4144-a1b9-e24e2ed93d4f' \
171 -H 'cache-control: no-cache' -k
172
173
174Associate Service Model to Customer
175-----------------------------------
176
177
178This operation is using ONAP AAI REST API
179
180in the query path, you put the customer_name and the service model name
181
182in the query body you put the service model UUID
183
184::
185
186 curl -X PUT \
187 https://aai.api.sparky.simpledemo.onap.org:30233/aai/v16/business/customers/customer/my_customer_name/service-subscriptions/service-subscription/my_service_model_name \
188 -H 'Accept: application/json' \
189 -H 'Authorization: Basic QUFJOkFBSQ==' \
190 -H 'Content-Type: application/json' \
191 -H 'Postman-Token: d4bc4991-a518-4d75-8a87-674ba44bf13a' \
192 -H 'X-FromAppId: AAI' \
193 -H 'X-TransactionId: 808b54e3-e563-4144-a1b9-e24e2ed93d4f' \
194 -H 'cache-control: no-cache' \
195 -d '{
196 "service-id": "11265d8c-2cc2-40e5-95d8-57cad81c18da"
197 }' -k
198
199
200
201
202Associate Cloud Site to Customer
203--------------------------------
204
205in the query path, you put the customer_name and the service model name
206
207in the query body you put the cloud owner name, the cloud site name,
208the tenant id and the tenant name
209
210
211::
212
213 curl -X PUT \
214 https://aai.api.sparky.simpledemo.onap.org:30233/aai/v16/business/customers/customer/my_customer_name/service-subscriptions/service-subscription/my_service_model_name/relationship-list/relationship \
215 -H 'Accept: application/json' \
216 -H 'Authorization: Basic QUFJOkFBSQ==' \
217 -H 'Content-Type: application/json' \
218 -H 'Postman-Token: 11ea9a9e-0dc8-4d20-8a78-c75cd6928916' \
219 -H 'X-FromAppId: AAI' \
220 -H 'X-TransactionId: 808b54e3-e563-4144-a1b9-e24e2ed93d4f' \
221 -H 'cache-control: no-cache' \
222 -d '{
223 "related-to": "tenant",
224 "related-link": "/aai/v16/cloud-infrastructure/cloud-regions/cloud-region/my_cloud_owner_name/my_cloud_site_name/tenants/tenant/234a9a2dc4b643be9812915b214cdbbb",
225 "relationship-data": [
226 {
227 "relationship-key": "cloud-region.cloud-owner",
228 "relationship-value": "my_cloud_owner_name"
229 },
230 {
231 "relationship-key": "cloud-region.cloud-region-id",
232 "relationship-value": "my_cloud_site_name"
233 },
234 {
235 "relationship-key": "tenant.tenant-id",
236 "relationship-value": "234a9a2dc4b643be9812915b214cdbbb"
237 }
238 ],
239 "related-to-property": [
240 {
241 "property-key": "tenant.tenant-name",
242 "property-value": "my_tenant_name"
243 }
244 ]
245 }' -k
246
247
248check (you should see if everything ok in the response)
249
250::
251
252 curl -X GET \
253 'https://aai.api.sparky.simpledemo.onap.org:30233/aai/v16/business/customers/customer/my_customer_name/service-subscriptions?depth=all' \
254 -H 'Accept: application/json' \
255 -H 'Authorization: Basic QUFJOkFBSQ==' \
256 -H 'Content-Type: application/json' \
257 -H 'X-FromAppId: AAI' \
258 -H 'X-TransactionId: 808b54e3-e563-4144-a1b9-e24e2ed93d4f' \
259 -H 'cache-control: no-cache' -k