summaryrefslogtreecommitdiffstats
path: root/docs/developer_info/instantiate/pre_instantiation/index.rst
blob: ca9af13d7d172c9d4b7e50770ebaeb7375305024 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
.. This work is licensed under a Creative Commons Attribution 4.0
.. International License. http://creativecommons.org/licenses/by/4.0
.. Copyright 2019 ONAP Contributors.  All rights reserved.

.. _doc_guide_user_pre_ser-inst:


Pre Service instantiation Operations
====================================

Several operations need to be performed after Service model distribution,
but before instantiating a service.

Those operations are only available via REST API requests.

Various tools can be used to send REST API requests.

Here after are examples using "curl" command line tool that you can use in
a Unix Terminal.


Declare owningEntity, lineOfBusiness, Platform and Project
----------------------------------------------------------

At one point during Service Instantiation, the user need to select values for
those 4 parameters

* Owning Entity
* Line Of Business
* Platform
* Project


Those parameters and values must be pre-declared in ONAP VID component
using REST API

Those informations will be available to all service instantiation
(you only need to declare them once in ONAP)


Example for "Owning Entity" named "Test"

::

  curl -X POST \
    http://vid.api.simpledemo.onap.org:30238/vid/maintenance/category_parameter/owningEntity \
    -H 'Accept-Encoding: gzip, deflate' \
    -H 'Content-Type: application/json' \
    -H 'cache-control: no-cache' \
    -d '{
      "options": ["Test"]
  }'

Example for "platform" named "Test_Platform"

::

  curl -X POST \
    http://vid.api.simpledemo.onap.org:30238/vid/maintenance/category_parameter/platform \
    -H 'Content-Type: application/json' \
    -H 'cache-control: no-cache' \
    -d '{
      "options": [""Test_Platform"]
  }'

Example for "line of business" named "Test_LOB"

::

  curl -X POST \
  http://vid.api.simpledemo.onap.org:30238/vid/maintenance/category_parameter/lineOfBusiness \
  -H 'Content-Type: application/json' \
  -H 'cache-control: no-cache' \
  -d '{
    "options": ["Test_LOB"]
  }'

Example for "project" named "Test_project"

::

  curl -X POST \
    http://vid.api.simpledemo.onap.org:30238/vid/maintenance/category_parameter/project \
    -H 'Content-Type: application/json' \
    -H 'cache-control: no-cache' \
    -d '{
      "options": ["Test_project"]
  }'




Declare a customer
------------------

Each time you have a new customer, you will need to perform those operations

This operation is using ONAP AAI REST API

Any service instance need to be linked to a customer

in the query path, you put the customer_name

in the query body you put the customer name again

Here after an example to declare a customer named "my_customer_name"


::

  curl -X PUT \
    https://aai.api.sparky.simpledemo.onap.org:30233/aai/v16/business/customers/customer/my_customer_name \
    -H 'Accept: application/json' \
    -H 'Authorization: Basic QUFJOkFBSQ==' \
    -H 'Content-Type: application/json' \
    -H 'X-FromAppId: AAI' \
    -H 'X-TransactionId: 808b54e3-e563-4144-a1b9-e24e2ed93d4f' \
    -H 'cache-control: no-cache' \
    -d '{
      "global-customer-id": "my_customer_name",
      "subscriber-name": "my_customer_name",
      "subscriber-type": "INFRA"
  }' -k


check customers in ONAP AAI (you should see if everything ok in the response)

::

  curl -X GET \
    https://aai.api.sparky.simpledemo.onap.org:30233/aai/v16/business/customers \
    -H 'Accept: application/json' \
    -H 'Authorization: Basic QUFJOkFBSQ==' \
    -H 'Content-Type: application/json' \
    -H 'X-FromAppId: AAI' \
    -H 'X-TransactionId: 808b54e3-e563-4144-a1b9-e24e2ed93d4f' \
    -H 'cache-control: no-cache' -k


Associate Service Model to Customer
-----------------------------------


This operation is using ONAP AAI REST API

in the query path, you put the customer_name and the service model name

in the query body you put the service model UUID

::

  curl -X PUT \
    https://aai.api.sparky.simpledemo.onap.org:30233/aai/v16/business/customers/customer/my_customer_name/service-subscriptions/service-subscription/my_service_model_name \
    -H 'Accept: application/json' \
    -H 'Authorization: Basic QUFJOkFBSQ==' \
    -H 'Content-Type: application/json' \
    -H 'Postman-Token: d4bc4991-a518-4d75-8a87-674ba44bf13a' \
    -H 'X-FromAppId: AAI' \
    -H 'X-TransactionId: 808b54e3-e563-4144-a1b9-e24e2ed93d4f' \
    -H 'cache-control: no-cache' \
    -d '{
      "service-id": "11265d8c-2cc2-40e5-95d8-57cad81c18da"
  }' -k




Associate Cloud Site to Customer
--------------------------------

in the query path, you put the customer_name and the service model name

in the query body you put the cloud owner name, the cloud site name,
the tenant id and the tenant name


::

  curl -X PUT \
    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 \
    -H 'Accept: application/json' \
    -H 'Authorization: Basic QUFJOkFBSQ==' \
    -H 'Content-Type: application/json' \
    -H 'Postman-Token: 11ea9a9e-0dc8-4d20-8a78-c75cd6928916' \
    -H 'X-FromAppId: AAI' \
    -H 'X-TransactionId: 808b54e3-e563-4144-a1b9-e24e2ed93d4f' \
    -H 'cache-control: no-cache' \
    -d '{
      "related-to": "tenant",
      "related-link": "/aai/v16/cloud-infrastructure/cloud-regions/cloud-region/my_cloud_owner_name/my_cloud_site_name/tenants/tenant/234a9a2dc4b643be9812915b214cdbbb",
      "relationship-data": [
          {
              "relationship-key": "cloud-region.cloud-owner",
              "relationship-value": "my_cloud_owner_name"
          },
          {
              "relationship-key": "cloud-region.cloud-region-id",
              "relationship-value": "my_cloud_site_name"
          },
          {
              "relationship-key": "tenant.tenant-id",
              "relationship-value": "234a9a2dc4b643be9812915b214cdbbb"
          }
      ],
      "related-to-property": [
          {
              "property-key": "tenant.tenant-name",
              "property-value": "my_tenant_name"
          }
      ]
  }' -k


check (you should see if everything ok in the response)

::

  curl -X GET \
    'https://aai.api.sparky.simpledemo.onap.org:30233/aai/v16/business/customers/customer/my_customer_name/service-subscriptions?depth=all' \
    -H 'Accept: application/json' \
    -H 'Authorization: Basic QUFJOkFBSQ==' \
    -H 'Content-Type: application/json' \
    -H 'X-FromAppId: AAI' \
    -H 'X-TransactionId: 808b54e3-e563-4144-a1b9-e24e2ed93d4f' \
    -H 'cache-control: no-cache' -k