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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
|
.. This work is licensed under a Creative Commons Attribution 4.0 International License.
.. http://creativecommons.org/licenses/by/4.0
.. Copyright (c) 2017-2018 Intel, Inc.
===============================
MultiCloud infra_workload API
===============================
We have two purposes for this API:
#. Integrate SO and Multicloud.
#. Generic API for SO to talk to different Multicloud plugins.
Problem Description
===================
Currently HPA flavors are returned by OOF to SO and SO copies these flavors in
the Heat template before sending the Heat template to Multicloud. In Casablanca
instead of SO making changes in the Heat template the flavor information will be
provided to Multicloud and Multicloud will pass this as parameters to HEAT
command line. In Dublin, instead of SO transferring the content of HEAT and HEAT_ENV
to Multicloud, Mutlicloud will download these information/artifacts.
For further detailed design, please refer to https://wiki.onap.org/display/DW/SO+Casablanca+HPA+Design
Propose Change
==============
Multi-Tenant Support
--------------------
Request Headers:
>>>>>>>>>>>>>>>>
To support multi-tenants over the same cloud region, all APIs defined below
should support to accept the following optional headers which are used to
specify a tenant other than the default one associated with the cloud region.
::
"Project" : Tenant/Project ID or Name specified by API consumer, Optional
Example 1:
::
"Project: tenant1"
Example 2:
::
"Project: fcca3cc49d5e42caae15459e27103efc"
Add infrastructure workload
---------------------------
API URL: POST http://{msb IP}:{msb port}/api/multicloud/v1/{cloud-owner}/{cloud-region-id}/infra_workload
Request Body:
>>>>>>>>>>>>>
::
{
"generic-vnf-id":"<generic-vnf-id>",
"vf-module-id":"<vf-module-id>",
"vf-module-model-invariant-id":"<uuid>",
"vf-module-model-version-id":"<uuid>",
"vf-module-model-customization-id":"<uuid>",
"oof_directives":{},
"sdnc_directives":{},
"user_directives":{},
"template_type":"<heat/tosca/etc.>",
"template_data":{}
}
The 'vf-module-model-"*"-id’s will be used by the Multicloud plugin to retrieve the associated cloud artifacts.
The 'oof_directives' is to convey oof’s input to multicloud.
The 'sdnc_directives' for SDNC input to MultiCloud.
The 'user_directives' is the parameter to convey input from VID portal to mutlicloud.
They are all about how to populate data to template parameters.
The precedence of the three directives are user_directives and oof_directives the sdnc_directives.
oof_directives:
:::::::::::::::
::
"directives":[
{
"id":"<ID of VNFC>",
"type": "vnfc",
"directives":[
{
"type":"<flavor_directive>",
"attributes":[
{
"attribute_name":"<name of attribute, such as flavor label>",
"attribute_value":"<value such as cloud specific flavor>"
}
]
}
]
},
{
"id":"<ID of VNF>",
"type": "vnf",
"directives":[
{
"type":"<Name of directive>",
"attributes":[
{
"attribute_name":"<name of attribute>",
"attribute_value":"<value>"
}
]
}
]
}
]
Heat examples
:::::::::::::
::
"template_type":"heat",
"template_data":{
"files":{ },
"disable_rollback":true,
"parameters":{
"flavor":"m1.heat"
},
"stack_name":"teststack",
"template":{
"heat_template_version":"2013-05-23",
"description":"Simple template to test heat commands",
"parameters":
{
"flavor":{
"default":"m1.tiny",
"type":"string"
}
},
"resources":{
"hello_world":{
"type":"OS::Nova::Server",
"properties":{
"key_name":"heat_key",
"flavor":{
"get_param":"flavor"
},
"image":"40be8d1a-3eb9-40de-8abd-43237517384f",
"user_data":"#!/bin/bash -xv\necho \"hello world\" > /root/hello-world.txt\n"
}
}
}
},
"timeout_mins":60
}
Response:
>>>>>>>>>
Response Codes
::::::::::::::
Success
.......
+--------------------+----------------------------------------------------------------------+
| Code | Reason |
+====================+======================================================================+
| 201 - Created | Resource was created and is ready to use. |
+--------------------+----------------------------------------------------------------------+
Error
.....
+--------------------+----------------------------------------------------------------------+
| Code | Reason |
+====================+======================================================================+
| 400 - Bad Request | Some content in the request was invalid. |
+--------------------+----------------------------------------------------------------------+
| 401 - Unauthorized | User must authenticate before making a request. |
+--------------------+----------------------------------------------------------------------+
| 409 - Conflict | This operation conflicted with another operation on this resource. |
+--------------------+----------------------------------------------------------------------+
Response Body
:::::::::::::
::
{
"template_type":"heat",
"workload_id": "<The ID of infrastructure workload resource>"
"template_response":
{
"stack": {
"id": "<The UUID of stack>",
"links": [
{
"href": "<A list of URLs for the stack>",
"rel": "self"
}
]
}
}
Update infrastructure workload information in AAI (i.e. Heatbridge)
-------------------------------------------------------------------
API URL: POST http://{msb IP}:{msb port}/api/multicloud/v1/{cloud-owner}/{cloud-region-id}/infra_workload/{workload-id}
Request Body:
>>>>>>>>>>>>>
::
{
"generic-vnf-id":"<generic-vnf-id>",
"vf-module-id":"<vf-module-id>"
}
Response:
>>>>>>>>>
Response Codes
::::::::::::::
Success
.......
+--------------------+----------------------------------------------------------------------+
| Code | Reason |
+====================+======================================================================+
| 202 - Accepted | The request was accepted. |
+--------------------+----------------------------------------------------------------------+
Error
.....
+--------------------+----------------------------------------------------------------------+
| Code | Reason |
+====================+======================================================================+
| 400 - Bad Request | Some content in the request was invalid. |
+--------------------+----------------------------------------------------------------------+
| 401 - Unauthorized | User must authenticate before making a request. |
+--------------------+----------------------------------------------------------------------+
| 409 - Conflict | This operation conflicted with another operation on this resource. |
+--------------------+----------------------------------------------------------------------+
Response Body
:::::::::::::
Delete infrastructure workload
------------------------------
API DELETE URL: http://{msb IP}:{msb port}/api/multicloud/v1/{cloud-owner}/{cloud-region-id}/infra_workload/{workload-id}
Response:
>>>>>>>>>
Response Codes
::::::::::::::
Success
.......
+--------------------+----------------------------------------------------------------------+
| Code | Reason |
+====================+======================================================================+
| 204 - No Content | The server has fulfilled the request by deleting the resource. |
+--------------------+----------------------------------------------------------------------+
Error
.....
+--------------------+----------------------------------------------------------------------+
| Code | Reason |
+====================+======================================================================+
| 400 - Bad Request | Some content in the request was invalid. |
+--------------------+----------------------------------------------------------------------+
| 401 - Unauthorized | User must authenticate before making a request. |
+--------------------+----------------------------------------------------------------------+
| 404 - Not Found | The requested resource could not be found. |
+--------------------+----------------------------------------------------------------------+
| 500 - Internal | Something went wrong inside the service. This should not happen |
| Server Error | usually. If it does happen, it means the server has experienced |
| | some serious problems. |
+--------------------+----------------------------------------------------------------------+
Response Body
:::::::::::::
This request does not return anything in the response body.
Get infrastructure workload
----------------------------
API GET URL: http://{msb IP}:{msb port}/api/multicloud/v1/{cloud-owner}/{cloud-region-id}/infra_workload/{workload-id}
Response:
>>>>>>>>>
Response Codes
::::::::::::::
Success
.......
+--------------------+----------------------------------------------------------------------+
| Code | Reason |
+====================+======================================================================+
| 200 - OK | Request was successful. |
+--------------------+----------------------------------------------------------------------+
Error
.....
+--------------------+----------------------------------------------------------------------+
| Code | Reason |
+====================+======================================================================+
| 400 - Bad Request | Some content in the request was invalid. |
+--------------------+----------------------------------------------------------------------+
| 401 - Unauthorized | User must authenticate before making a request. |
+--------------------+----------------------------------------------------------------------+
| 404 - Not Found | The requested resource could not be found. |
+--------------------+----------------------------------------------------------------------+
| 500 - Internal | Something went wrong inside the service. This should not happen |
| Server Error | usually. If it does happen, it means the server has experienced |
| | some serious problems. |
+--------------------+----------------------------------------------------------------------+
Response Body
:::::::::::::
::
{
"template_type":"<heat/tosca/etc.>",
"workload_id": "<The ID of infrastructure workload resource>",
"workload_status":"CREATE_IN_PROCESS/CREATE_COMPLETE/DELETE_IN_PROCESS/AAI_IN_PROGRESS/AAI_COMPLETE/etc"
}
Work Items
==========
#. Work with SO.
#. Work with OOF team for oof_directive form.
#. Work with SDNC team for sdc_directive form.
#. Expose API by broker and each plugin.
Tests
=====
#. Unit Tests with tox.
#. Pairwise test with SO project.
#. Integration test with vCPE HPA test.
#. CSIT Tests, the input/ouput of broker and each plugin see API design above.
|