Fix for SSL certificate issue
[doc.git] / docs / guides / onap-user / instantiate / pre_instantiation / index.rst
1 .. 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
8 Pre Service instantiation Operations
9 ====================================
10
11 Several operations need to be performed after Service model distribution,
12 but before instantiating a service.
13
14 Those operations are only available via REST API requests.
15
16 Various tools can be used to send REST API requests.
17
18 Here after are examples using "curl" command line tool that you can use in
19 a Unix Terminal.
20
21
22 Declare owningEntity, lineOfBusiness, Platform and Project
23 ----------------------------------------------------------
24
25 At one point during Service Instantiation, the user need to select values for
26 those 4 parameters
27
28 * Owning Entity
29 * Line Of Business
30 * Platform
31 * Project
32
33
34 Those parameters and values must be pre-declared in ONAP VID component
35 using REST API
36
37 Those informations will be available to all service instantiation
38 (you only need to declare them once in ONAP)
39
40
41 Example for "Owning Entity" named "OE-Generic"
42
43 For Owning_Entity, it is important to declare the information in AAI
44 with a UUID value for "owning-entity-id". That value will be necessary
45 to instantiate a service with SO using GR_API.
46
47 ::
48
49   curl -k -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 -k -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
74 To declare the Owning Entity in VID:
75
76 ::
77
78   curl -k -X POST \
79     https://vid.api.simpledemo.onap.org:30200/vid/maintenance/category_parameter/owningEntity \
80     -H 'Accept-Encoding: gzip, deflate' \
81     -H 'Content-Type: application/json' \
82     -H 'cache-control: no-cache' \
83     -d '{
84       "options": ["OE-Generic"]
85   }'
86
87
88 Example for "platform" named "Test_Platform"
89
90 ::
91
92   curl -k -X POST \
93     https://vid.api.simpledemo.onap.org:30200/vid/maintenance/category_parameter/platform \
94     -H 'Content-Type: application/json' \
95     -H 'cache-control: no-cache' \
96     -d '{
97       "options": ["Test_Platform"]
98   }'
99
100 Example for "line of business" named "Test_LOB"
101
102 ::
103
104   curl -k -X POST \
105   https://vid.api.simpledemo.onap.org:30200/vid/maintenance/category_parameter/lineOfBusiness \
106   -H 'Content-Type: application/json' \
107   -H 'cache-control: no-cache' \
108   -d '{
109     "options": ["Test_LOB"]
110   }'
111
112 Example for "project" named "Test_project"
113
114 ::
115
116   curl -k -X POST \
117     https://vid.api.simpledemo.onap.org:30200/vid/maintenance/category_parameter/project \
118     -H 'Content-Type: application/json' \
119     -H 'cache-control: no-cache' \
120     -d '{
121       "options": ["Test_project"]
122   }'
123
124
125
126
127 Declare a customer
128 ------------------
129
130 Each time you have a new customer, you will need to perform those operations
131
132 This operation is using ONAP AAI REST API
133
134 Any service instance need to be linked to a customer
135
136 in the query path, you put the customer_name
137
138 in the query body you put the customer name again
139
140 Here 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
160 check 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
174 Associate Service Model to Customer
175 -----------------------------------
176
177
178 This operation is using ONAP AAI REST API
179
180 in the query path, you put the customer_name and the service model name
181
182 in 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
202 Associate Cloud Site to Customer
203 --------------------------------
204
205 in the query path, you put the customer_name and the service model name
206
207 in the query body you put the cloud owner name, the cloud site name,
208 the 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
248 check (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