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