Add docs directory and NSLCM api document
[vfc/nfvo/lcm.git] / docs / NSLCM_API_Specification_v0.1.rst
1 .. contents::\r
2    :depth: 1\r
3 ..\r
4 \r
5 NL LCM API\r
6 ==========\r
7 \r
8  {\r
9    "swagger": "2.0",\r
10    "info": {\r
11      "version": "1.0.0",\r
12      "title": "ONAP VFC Network Service Lifecycle Management API",\r
13      "description": "VFC Network Service Lifecycle Management Rest API.",\r
14      "contact": {\r
15        "name": "ONAP VFC team",\r
16        "email": "onap-discuss@lists.onap.org",\r
17        "url": "https://gerrit.onap.org/r/#/admin/projects/vfc/nfvo/lcm"\r
18      }\r
19    },\r
20    "basePath": "/api/nslcm/v1",\r
21    "schemes": [\r
22      "http",\r
23      "https"\r
24    ],\r
25    "consumes": [\r
26      "application/json"\r
27    ],\r
28    "produces": [\r
29      "application/json"\r
30    ],\r
31    "paths": {\r
32      "/ns": {\r
33        "post": {\r
34          "tags": [\r
35            "ns"\r
36          ],\r
37          "summary": "ns create",\r
38          "description": "ns create",\r
39          "operationId": "ns_create",\r
40          "parameters": [\r
41            {\r
42              "in": "body",\r
43              "name": "NSCreateRequest",\r
44              "description": "NS Instance Create Request",\r
45              "required": true,\r
46              "schema": {\r
47                "$ref": "#/definitions/NsCreateRequest"\r
48              }\r
49            }\r
50          ],\r
51          "responses": {\r
52            "200": {\r
53              "description": "successful operation",\r
54              "schema": {\r
55                "$ref": "#/definitions/NsCreateResponse"\r
56              }\r
57            }\r
58          }\r
59        },\r
60        "get": {\r
61          "tags": [\r
62            "ns"\r
63          ],\r
64          "summary": "ns get",\r
65          "description": "ns get",\r
66          "operationId": "ns_get",\r
67          "parameters": [],\r
68          "responses": {\r
69            "200": {\r
70              "description": "successful operation",\r
71              "schema": {\r
72                "$ref": "#/definitions/NsInfo"\r
73              }\r
74            }\r
75          }\r
76        }\r
77      },\r
78      "/ns/{nsInstanceId}/Instantiate": {\r
79        "post": {\r
80          "tags": [\r
81            "ns"\r
82          ],\r
83          "summary": "ns Instantiate",\r
84          "description": "ns Instantiate",\r
85          "operationId": "ns_Instantiate",\r
86          "parameters": [\r
87            {\r
88              "required": true,\r
89              "type": "string",\r
90              "description": "",\r
91              "name": "nsInstanceId",\r
92              "in": "path"\r
93            },\r
94            {\r
95              "in": "body",\r
96              "name": "NSInstantiateRequest",\r
97              "description": "NS Instantiate Request Body",\r
98              "required": true,\r
99              "schema": {\r
100                "$ref": "#/definitions/NsInstantiateRequest"\r
101              }\r
102            }\r
103          ],\r
104          "responses": {\r
105            "200": {\r
106              "description": "",\r
107              "schema": {\r
108                "$ref": "#/definitions/JobInfo"\r
109              }\r
110            },\r
111            "201": {\r
112              "description": "Invalid Request"\r
113            }\r
114          }\r
115        }\r
116      },\r
117      "/ns/{nsInstanceId}/scale": {\r
118        "post": {\r
119          "tags": [\r
120            "ns"\r
121          ],\r
122          "summary": "ns scale",\r
123          "description": "ns scale",\r
124          "operationId": "ns_scale",\r
125          "parameters": [\r
126            {\r
127              "required": true,\r
128              "type": "string",\r
129              "description": "",\r
130              "name": "nsInstanceId",\r
131              "in": "path"\r
132            },\r
133            {\r
134              "in": "body",\r
135              "name": "ScaleNSRequest",\r
136              "description": "Scale NS Request Body",\r
137              "required": true,\r
138              "schema": {\r
139                "$ref": "#/definitions/NsScaleRequest"\r
140              }\r
141            }\r
142          ],\r
143          "responses": {\r
144            "200": {\r
145              "description": "",\r
146              "schema": {\r
147                "$ref": "#/definitions/JobInfo"\r
148              }\r
149            },\r
150            "201": {\r
151              "description": "Invalid Request"\r
152            }\r
153          }\r
154        }\r
155      },\r
156      "/ns/{ns_instance_id}/heal": {\r
157        "post": {\r
158          "tags": [\r
159            "ns"\r
160          ],\r
161          "summary": "ns heal",\r
162          "description": "ns heal",\r
163          "operationId": "ns_heal",\r
164          "parameters": [\r
165            {\r
166              "required": true,\r
167              "type": "string",\r
168              "description": "Identifier of the NS instance.",\r
169              "name": "ns_instance_id",\r
170              "in": "path"\r
171            },\r
172            {\r
173              "in": "body",\r
174              "name": "healVnfData",\r
175              "description": "healVnfData",\r
176              "required": true,\r
177              "schema": {\r
178                "$ref": "#/definitions/NsHealRequest"\r
179              }\r
180            }\r
181          ],\r
182          "responses": {\r
183            "202": {\r
184              "description": "",\r
185              "schema": {\r
186                "$ref": "#/definitions/JobInfo"\r
187              }\r
188            },\r
189            "500": {\r
190              "description": "the url is invalid"\r
191            }\r
192          }\r
193        }\r
194      },\r
195      "/ns/{ns_instance_id}/terminate": {\r
196        "post": {\r
197          "tags": [\r
198            "ns"\r
199          ],\r
200          "summary": "ns terminate",\r
201          "description": "ns terminate",\r
202          "operationId": "ns_terminate",\r
203          "parameters": [\r
204            {\r
205              "required": true,\r
206              "type": "string",\r
207              "description": "Identifier of the NS instance.",\r
208              "name": "ns_instance_id",\r
209              "in": "path"\r
210            },\r
211            {\r
212              "in": "body",\r
213              "name": "NsTerminateRequest",\r
214              "description": "NsTerminateRequest",\r
215              "required": true,\r
216              "schema": {\r
217                "$ref": "#/definitions/NsTerminateRequest"\r
218              }\r
219            }\r
220          ],\r
221          "responses": {\r
222            "202": {\r
223              "description": "",\r
224              "schema": {\r
225                "$ref": "#/definitions/JobInfo"\r
226              }\r
227            },\r
228            "500": {\r
229              "description": "the url is invalid"\r
230            }\r
231          }\r
232        }\r
233      },\r
234      "/ns/{ns_instance_id}": {\r
235        "delete": {\r
236          "tags": [\r
237            "ns"\r
238          ],\r
239          "summary": "ns delete",\r
240          "description": "ns delete",\r
241          "operationId": "ns_delete",\r
242          "parameters": [\r
243            {\r
244              "required": true,\r
245              "type": "string",\r
246              "description": "Identifier of the NS instance.",\r
247              "name": "ns_instance_id",\r
248              "in": "path"\r
249            }\r
250          ],\r
251          "responses": {\r
252            "204": {\r
253              "description": "The NS instance resource and the associated NS identifier were deleted successfully."\r
254            }\r
255          }\r
256        }\r
257      },\r
258      "/jobs/{jobId}": {\r
259        "post": {\r
260          "tags": [\r
261            "job"\r
262          ],\r
263          "summary": "jobstatus",\r
264          "description": "",\r
265          "operationId": "jobstatus",\r
266          "parameters": [\r
267            {\r
268              "required": true,\r
269              "type": "string",\r
270              "description": "",\r
271              "name": "jobId",\r
272              "in": "path"\r
273            },\r
274            {\r
275              "in": "body",\r
276              "name": "body",\r
277              "description": "request param",\r
278              "required": true,\r
279              "schema": {\r
280                "$ref": "#/definitions/JobProgressRequest"\r
281              }\r
282            }\r
283          ],\r
284          "responses": {\r
285            "202": {\r
286              "description": ""\r
287            }\r
288          }\r
289        }\r
290      }\r
291    },\r
292    "definitions": {\r
293      "NsCreateRequest": {\r
294        "type": "object",\r
295        "properties": {\r
296          "csarId": {\r
297            "type": "string",\r
298            "description": "the NS package ID"\r
299          },\r
300          "nsName": {\r
301            "type": "string"\r
302          },\r
303          "description": {\r
304            "type": "string"\r
305          }\r
306        }\r
307      },\r
308      "NsCreateResponse": {\r
309        "type": "object",\r
310        "properties": {\r
311          "nsInstanceId": {\r
312            "type": "string"\r
313          }\r
314        }\r
315      },\r
316      "NsInstantiateRequest": {\r
317        "type": "object",\r
318        "properties": {\r
319          "LocationConstraints": {\r
320            "type": "array",\r
321            "items": {\r
322              "$ref": "#/definitions/LocationConstraint"\r
323            }\r
324          },\r
325          "additionalParamForNs": {\r
326            "type": "string"\r
327          }\r
328        }\r
329      },\r
330      "LocationConstraint": {\r
331        "type": "object",\r
332        "properties": {\r
333          "vnfProfileId": {\r
334            "type": "string"\r
335          },\r
336          "locationConstraints": {\r
337            "type": "object",\r
338            "properties": {\r
339              "vimid": {\r
340                "type": "string"\r
341              }\r
342            }\r
343          }\r
344        }\r
345      },\r
346      "NsScaleRequest": {\r
347        "type": "object",\r
348        "properties": {\r
349          "scaleType": {\r
350            "type": "string"\r
351          },\r
352          "scaleNsByStepsData": {\r
353            "$ref": "#/definitions/NsScaleByStepsData"\r
354          }\r
355        }\r
356      },\r
357      "NsScaleByStepsData": {\r
358        "type": "object",\r
359        "properties": {\r
360          "scalingDirection": {\r
361            "type": "string"\r
362          },\r
363          "aspectId": {\r
364            "type": "string"\r
365          },\r
366          "numberOfSteps": {\r
367            "type": "integer"\r
368          }\r
369        }\r
370      },\r
371      "NsHealRequest": {\r
372        "type": "object",\r
373        "properties": {\r
374          "vnfInstanceId": {\r
375            "type": "string"\r
376          },\r
377          "cause": {\r
378            "type": "string"\r
379          },\r
380          "additionalParams": {\r
381            "type": "object",\r
382            "properties": {\r
383              "action": {\r
384                "type": "string"\r
385              },\r
386              "actionvminfo": {\r
387                "type": "object",\r
388                "properties": {\r
389                  "vmid": {\r
390                    "type": "string"\r
391                  },\r
392                  "vmname": {\r
393                    "type": "string"\r
394                  }\r
395                }\r
396              }\r
397            }\r
398          }\r
399        }\r
400      },\r
401      "NsTerminateRequest": {\r
402        "type": "object",\r
403        "properties": {\r
404          "terminationType": {\r
405            "type": "string"\r
406          },\r
407          "gracefulTerminationTimeout": {\r
408            "type": "string"\r
409          }\r
410        }\r
411      },\r
412      "JobInfo": {\r
413        "type": "object",\r
414        "properties": {\r
415          "jobId": {\r
416            "type": "string"\r
417          }\r
418        }\r
419      },\r
420      "JobProgressRequest": {\r
421        "type": "object",\r
422        "properties": {\r
423          "progress": {\r
424            "type": "string"\r
425          },\r
426          "desc": {\r
427            "type": "string"\r
428          },\r
429          "errcode": {\r
430            "type": "string"\r
431          }\r
432        }\r
433      },\r
434      "NsInfo": {\r
435        "type": "object",\r
436        "properties": {\r
437          "nsInstanceId": {\r
438            "type": "string"\r
439          },\r
440          "nsName": {\r
441            "type": "string"\r
442          },\r
443          "description": {\r
444            "type": "string"\r
445          },\r
446          "nsdId": {\r
447            "type": "string"\r
448          },\r
449          "vnfInfo": {\r
450            "type": "array",\r
451            "items": {\r
452              "$ref": "#/definitions/vnfInfo"\r
453            }\r
454          },\r
455          "vlInfo": {\r
456            "type": "array",\r
457            "items": {\r
458              "$ref": "#/definitions/vlInfo"\r
459            }\r
460          },\r
461          "vnffgInfo": {\r
462            "type": "array",\r
463            "items": {\r
464              "$ref": "#/definitions/vnffgInfo"\r
465            }\r
466          },\r
467          "nsState": {\r
468            "type": "string"\r
469          }\r
470        }\r
471      },\r
472      "vnfInfo": {\r
473        "type": "object",\r
474        "properties": {\r
475          "vnfInstanceId": {\r
476            "type": "string"\r
477          },\r
478          "vnfInstanceName": {\r
479            "type": "string"\r
480          },\r
481          "vnfdId": {\r
482            "type": "string"\r
483          }\r
484        }\r
485      },\r
486      "vlInfo": {\r
487        "type": "object",\r
488        "properties": {\r
489          "vlInstanceId": {\r
490            "type": "string"\r
491          },\r
492          "vlInstanceName": {\r
493            "type": "string"\r
494          },\r
495          "vldId": {\r
496            "type": "string"\r
497          },\r
498          "relatedCpInstanceId": {\r
499            "type": "array",\r
500            "items": {\r
501              "$ref": "#/definitions/cpInfo"\r
502            }\r
503          }\r
504        }\r
505      },\r
506      "cpInfo": {\r
507        "type": "object",\r
508        "properties": {\r
509          "cpInstanceId": {\r
510            "type": "string"\r
511          },\r
512          "cpInstanceName": {\r
513            "type": "string"\r
514          },\r
515          "cpdId": {\r
516            "type": "string"\r
517          }\r
518        }\r
519      },\r
520      "vnffgInfo": {\r
521        "type": "object",\r
522        "properties": {\r
523          "vnffgInstanceId": {\r
524            "type": "string"\r
525          },\r
526          "vnfId": {\r
527            "type": "string"\r
528          },\r
529          "pnfId": {\r
530            "type": "string"\r
531          },\r
532          "virtualLinkId": {\r
533            "type": "string"\r
534          },\r
535          "cpId": {\r
536            "type": "string"\r
537          },\r
538          "nfp": {\r
539            "type": "string"\r
540          }\r
541        }\r
542      }\r
543    }\r
544  }