509adf469ee4f1993c60b0a35feefd39e24bd294
[cps.git] / docs / api / swagger / ncmp / openapi.yaml
1 openapi: 3.0.1
2 info:
3   title: NCMP to CPS Proxy API
4   description: NCMP to CPS Proxy API
5   version: "1.0"
6 servers:
7   - url: /ncmp
8 paths:
9   /v1/cm-handles/{cm-handle}/node:
10     get:
11       tags:
12         - network-cm-proxy
13       summary: Get a node given a cm Handle and xpath
14       description: Get a node with an option to retrieve all the children for a given
15         cm Handle
16       operationId: getNodeByCmHandleAndXpath
17       parameters:
18         - name: cm-handle
19           in: path
20           description: "The identifier for a network function, network element, subnetwork\
21           \ or any other cm object by managed Network CM Proxy"
22           required: true
23           schema:
24             type: string
25         - name: xpath
26           in: query
27           description: xpath
28           required: false
29           schema:
30             type: string
31             default: /
32         - name: include-descendants
33           in: query
34           description: include-descendants
35           required: false
36           schema:
37             type: boolean
38             default: false
39       responses:
40         "200":
41           description: OK
42           content:
43             application/json:
44               schema:
45                 type: object
46         "400":
47           description: Bad Request
48           content:
49             application/json:
50               schema:
51                 $ref: '#/components/schemas/ErrorMessage'
52         "401":
53           description: Unauthorized
54           content:
55             application/json:
56               schema:
57                 $ref: '#/components/schemas/ErrorMessage'
58         "403":
59           description: Forbidden
60           content:
61             application/json:
62               schema:
63                 $ref: '#/components/schemas/ErrorMessage'
64         "404":
65           description: The specified resource was not found
66           content:
67             application/json:
68               schema:
69                 $ref: '#/components/schemas/ErrorMessage'
70       deprecated: true
71   /v1/cm-handles/{cm-handle}/list-node:
72     post:
73       tags:
74         - network-cm-proxy
75       summary: Add list-node child element(s)
76       description: Add one or more list-node child elements under existing node for
77         the given CM Handle
78       operationId: addListNodeElements
79       parameters:
80         - name: cm-handle
81           in: path
82           description: "The identifier for a network function, network element, subnetwork\
83           \ or any other cm object by managed Network CM Proxy"
84           required: true
85           schema:
86             type: string
87         - name: xpath
88           in: query
89           description: xpath
90           required: true
91           schema:
92             type: string
93       requestBody:
94         content:
95           application/json:
96             schema:
97               type: string
98         required: true
99       responses:
100         "201":
101           description: Created
102           content: {}
103         "400":
104           description: Bad Request
105           content:
106             application/json:
107               schema:
108                 $ref: '#/components/schemas/ErrorMessage'
109         "401":
110           description: Unauthorized
111           content:
112             application/json:
113               schema:
114                 $ref: '#/components/schemas/ErrorMessage'
115         "403":
116           description: Forbidden
117           content:
118             application/json:
119               schema:
120                 $ref: '#/components/schemas/ErrorMessage'
121         "404":
122           description: The specified resource was not found
123           content:
124             application/json:
125               schema:
126                 $ref: '#/components/schemas/ErrorMessage'
127       deprecated: true
128   /v1/cm-handles/{cm-handle}/nodes/query:
129     get:
130       tags:
131         - network-cm-proxy
132       summary: Query data nodes
133       description: Query nodes for the given cps path and cm Handle
134       operationId: queryNodesByCmHandleAndCpsPath
135       parameters:
136         - name: cm-handle
137           in: path
138           description: "The identifier for a network function, network element, subnetwork\
139           \ or any other cm object by managed Network CM Proxy"
140           required: true
141           schema:
142             type: string
143         - name: cps-path
144           in: query
145           description: cps-path
146           required: false
147           schema:
148             type: string
149             default: /
150         - name: include-descendants
151           in: query
152           description: include-descendants
153           required: false
154           schema:
155             type: boolean
156             default: false
157       responses:
158         "200":
159           description: OK
160           content:
161             application/json:
162               schema:
163                 type: object
164         "400":
165           description: Bad Request
166           content:
167             application/json:
168               schema:
169                 $ref: '#/components/schemas/ErrorMessage'
170         "401":
171           description: Unauthorized
172           content:
173             application/json:
174               schema:
175                 $ref: '#/components/schemas/ErrorMessage'
176         "403":
177           description: Forbidden
178           content:
179             application/json:
180               schema:
181                 $ref: '#/components/schemas/ErrorMessage'
182         "404":
183           description: The specified resource was not found
184           content:
185             application/json:
186               schema:
187                 $ref: '#/components/schemas/ErrorMessage'
188       deprecated: true
189   /v1/cm-handles/{cm-handle}/nodes:
190     put:
191       tags:
192         - network-cm-proxy
193       summary: Replace a node with descendants
194       description: Replace a node with descendants for the given cps path and cm Handle
195       operationId: replaceNode
196       parameters:
197         - name: cm-handle
198           in: path
199           description: "The identifier for a network function, network element, subnetwork\
200           \ or any other cm object by managed Network CM Proxy"
201           required: true
202           schema:
203             type: string
204         - name: xpath
205           in: query
206           description: xpath
207           required: false
208           schema:
209             type: string
210             default: /
211       requestBody:
212         content:
213           application/json:
214             schema:
215               type: string
216         required: true
217       responses:
218         "200":
219           description: OK
220           content:
221             application/json:
222               schema:
223                 type: object
224         "400":
225           description: Bad Request
226           content:
227             application/json:
228               schema:
229                 $ref: '#/components/schemas/ErrorMessage'
230         "401":
231           description: Unauthorized
232           content:
233             application/json:
234               schema:
235                 $ref: '#/components/schemas/ErrorMessage'
236         "403":
237           description: Forbidden
238           content:
239             application/json:
240               schema:
241                 $ref: '#/components/schemas/ErrorMessage'
242         "404":
243           description: The specified resource was not found
244           content:
245             application/json:
246               schema:
247                 $ref: '#/components/schemas/ErrorMessage'
248       deprecated: true
249     post:
250       tags:
251         - network-cm-proxy
252       summary: Create a node with descendants
253       description: Create a node with descendants for the given CM Handle; top level
254         or under existing node (requires xpath)
255       operationId: createNode
256       parameters:
257         - name: cm-handle
258           in: path
259           description: "The identifier for a network function, network element, subnetwork\
260           \ or any other cm object by managed Network CM Proxy"
261           required: true
262           schema:
263             type: string
264         - name: xpath
265           in: query
266           description: xpath
267           required: false
268           schema:
269             type: string
270             default: /
271       requestBody:
272         content:
273           application/json:
274             schema:
275               type: string
276         required: true
277       responses:
278         "201":
279           description: Created
280           content: {}
281         "400":
282           description: Bad Request
283           content:
284             application/json:
285               schema:
286                 $ref: '#/components/schemas/ErrorMessage'
287         "401":
288           description: Unauthorized
289           content:
290             application/json:
291               schema:
292                 $ref: '#/components/schemas/ErrorMessage'
293         "403":
294           description: Forbidden
295           content:
296             application/json:
297               schema:
298                 $ref: '#/components/schemas/ErrorMessage'
299         "404":
300           description: The specified resource was not found
301           content:
302             application/json:
303               schema:
304                 $ref: '#/components/schemas/ErrorMessage'
305       deprecated: true
306     patch:
307       tags:
308         - network-cm-proxy
309       summary: Update node leaves
310       description: Update node leaves for the given cps path and cm Handle
311       operationId: updateNodeLeaves
312       parameters:
313         - name: cm-handle
314           in: path
315           description: "The identifier for a network function, network element, subnetwork\
316           \ or any other cm object by managed Network CM Proxy"
317           required: true
318           schema:
319             type: string
320         - name: xpath
321           in: query
322           description: xpath
323           required: false
324           schema:
325             type: string
326             default: /
327       requestBody:
328         content:
329           application/json:
330             schema:
331               type: string
332         required: true
333       responses:
334         "200":
335           description: OK
336           content:
337             application/json:
338               schema:
339                 type: object
340         "400":
341           description: Bad Request
342           content:
343             application/json:
344               schema:
345                 $ref: '#/components/schemas/ErrorMessage'
346         "401":
347           description: Unauthorized
348           content:
349             application/json:
350               schema:
351                 $ref: '#/components/schemas/ErrorMessage'
352         "403":
353           description: Forbidden
354           content:
355             application/json:
356               schema:
357                 $ref: '#/components/schemas/ErrorMessage'
358         "404":
359           description: The specified resource was not found
360           content:
361             application/json:
362               schema:
363                 $ref: '#/components/schemas/ErrorMessage'
364       deprecated: true
365   /v1/ch/{cm-handle}/data/ds/ncmp-datastore:passthrough-operational:
366     get:
367       tags:
368         - network-cm-proxy
369       summary: Get resource data from pass-through operational for cm handle
370       description: Get resource data from pass-through operational for given cm handle
371       operationId: getResourceDataOperationalForCmHandle
372       parameters:
373         - name: cm-handle
374           in: path
375           description: "The identifier for a network function, network element, subnetwork\
376           \ or any other cm object by managed Network CM Proxy"
377           required: true
378           schema:
379             type: string
380         - name: resourceIdentifier
381           in: query
382           description: The format of resource identifier depend on the associated DMI
383             Plugin implementation. For ONAP DMI Plugin it will be RESTConf paths but
384             it can really be anything.
385           required: true
386           allowReserved: true
387           schema:
388             type: string
389           examples:
390             sample1:
391               value:
392                 resourceIdentifier: \parent\child
393             sample2:
394               value:
395                 resourceIdentifier: "\\parent\\listElement[key=value]"
396             sample3:
397               value:
398                 resourceIdentifier: "\\parent\\listElement[key=value]\\grandChild"
399             sample4:
400               value:
401                 resourceIdentifier: "parent=1,child=abc"
402         - name: Accept
403           in: header
404           description: "Accept parameter for response, if accept parameter is null,\
405           \ that means client can accept any format."
406           required: false
407           schema:
408             type: string
409             enum:
410               - application/json
411               - application/yang-data+json
412         - name: options
413           in: query
414           description: "options parameter in query, it is mandatory to wrap key(s)=value(s)\
415           \ in parenthesis'()'."
416           required: false
417           allowReserved: true
418           schema:
419             type: string
420           examples:
421             sample1:
422               value:
423                 options: "(key1=value1,key2=value2)"
424             sample2:
425               value:
426                 options: "(key1=value1,key2=value1/value2)"
427             sample3:
428               value:
429                 options: "(key1=10,key2=value2,key3=[val31;val32])"
430       responses:
431         "200":
432           description: OK
433           content:
434             application/json:
435               schema:
436                 type: object
437         "400":
438           description: Bad Request
439           content:
440             application/json:
441               schema:
442                 $ref: '#/components/schemas/ErrorMessage'
443         "401":
444           description: Unauthorized
445           content:
446             application/json:
447               schema:
448                 $ref: '#/components/schemas/ErrorMessage'
449         "403":
450           description: Forbidden
451           content:
452             application/json:
453               schema:
454                 $ref: '#/components/schemas/ErrorMessage'
455         "404":
456           description: The specified resource was not found
457           content:
458             application/json:
459               schema:
460                 $ref: '#/components/schemas/ErrorMessage'
461   /v1/ch/{cm-handle}/data/ds/ncmp-datastore:passthrough-running:
462     get:
463       tags:
464         - network-cm-proxy
465       summary: Get resource data from pass-through running for cm handle
466       description: Get resource data from pass-through running for given cm handle
467       operationId: getResourceDataRunningForCmHandle
468       parameters:
469         - name: cm-handle
470           in: path
471           description: "The identifier for a network function, network element, subnetwork\
472           \ or any other cm object by managed Network CM Proxy"
473           required: true
474           schema:
475             type: string
476         - name: resourceIdentifier
477           in: query
478           description: The format of resource identifier depend on the associated DMI
479             Plugin implementation. For ONAP DMI Plugin it will be RESTConf paths but
480             it can really be anything.
481           required: true
482           allowReserved: true
483           schema:
484             type: string
485           examples:
486             sample1:
487               value:
488                 resourceIdentifier: \parent\child
489             sample2:
490               value:
491                 resourceIdentifier: "\\parent\\listElement[key=value]"
492             sample3:
493               value:
494                 resourceIdentifier: "\\parent\\listElement[key=value]\\grandChild"
495             sample4:
496               value:
497                 resourceIdentifier: "parent=1,child=abc"
498         - name: Accept
499           in: header
500           description: "Accept parameter for response, if accept parameter is null,\
501           \ that means client can accept any format."
502           required: false
503           schema:
504             type: string
505             enum:
506               - application/json
507               - application/yang-data+json
508         - name: options
509           in: query
510           description: "options parameter in query, it is mandatory to wrap key(s)=value(s)\
511           \ in parenthesis'()'."
512           required: false
513           allowReserved: true
514           schema:
515             type: string
516           examples:
517             sample1:
518               value:
519                 options: "(key1=value1,key2=value2)"
520             sample2:
521               value:
522                 options: "(key1=value1,key2=value1/value2)"
523             sample3:
524               value:
525                 options: "(key1=10,key2=value2,key3=[val31;val32])"
526       responses:
527         "200":
528           description: OK
529           content:
530             application/json:
531               schema:
532                 type: object
533         "400":
534           description: Bad Request
535           content:
536             application/json:
537               schema:
538                 $ref: '#/components/schemas/ErrorMessage'
539         "401":
540           description: Unauthorized
541           content:
542             application/json:
543               schema:
544                 $ref: '#/components/schemas/ErrorMessage'
545         "403":
546           description: Forbidden
547           content:
548             application/json:
549               schema:
550                 $ref: '#/components/schemas/ErrorMessage'
551         "404":
552           description: The specified resource was not found
553           content:
554             application/json:
555               schema:
556                 $ref: '#/components/schemas/ErrorMessage'
557     post:
558       tags:
559         - network-cm-proxy
560       summary: create resource data from pass-through running for cm handle
561       description: create resource data from pass-through running for given cm handle
562       operationId: createResourceDataRunningForCmHandle
563       parameters:
564         - name: cm-handle
565           in: path
566           description: "The identifier for a network function, network element, subnetwork\
567           \ or any other cm object by managed Network CM Proxy"
568           required: true
569           schema:
570             type: string
571         - name: resourceIdentifier
572           in: query
573           description: The format of resource identifier depend on the associated DMI
574             Plugin implementation. For ONAP DMI Plugin it will be RESTConf paths but
575             it can really be anything.
576           required: true
577           allowReserved: true
578           schema:
579             type: string
580           examples:
581             sample1:
582               value:
583                 resourceIdentifier: \parent\child
584             sample2:
585               value:
586                 resourceIdentifier: "\\parent\\listElement[key=value]"
587             sample3:
588               value:
589                 resourceIdentifier: "\\parent\\listElement[key=value]\\grandChild"
590             sample4:
591               value:
592                 resourceIdentifier: "parent=1,child=abc"
593         - name: Content-Type
594           in: header
595           description: "Content parameter for request, if content parameter is null,\
596           \ default value is application/json."
597           required: false
598           schema:
599             type: string
600             default: application/json
601       requestBody:
602         content:
603           application/json:
604             schema:
605               type: string
606           application/yang-data+json:
607             schema:
608               type: string
609         required: true
610       responses:
611         "201":
612           description: Created
613           content: {}
614         "400":
615           description: Bad Request
616           content:
617             application/json:
618               schema:
619                 $ref: '#/components/schemas/ErrorMessage'
620         "401":
621           description: Unauthorized
622           content:
623             application/json:
624               schema:
625                 $ref: '#/components/schemas/ErrorMessage'
626         "403":
627           description: Forbidden
628           content:
629             application/json:
630               schema:
631                 $ref: '#/components/schemas/ErrorMessage'
632         "404":
633           description: The specified resource was not found
634           content:
635             application/json:
636               schema:
637                 $ref: '#/components/schemas/ErrorMessage'
638   /v1/ch/{cm-handle}/modules:
639     get:
640       tags:
641         - network-cm-proxy
642       summary: Fetch all module references (name and revision) for a given cm handle
643       description: fetch all module references (name and revision) for a given cm
644         handle
645       operationId: getModuleReferencesByCmHandle
646       parameters:
647         - name: cm-handle
648           in: path
649           description: "The identifier for a network function, network element, subnetwork\
650           \ or any other cm object by managed Network CM Proxy"
651           required: true
652           schema:
653             type: string
654       responses:
655         "200":
656           description: OK
657           content:
658             application/json:
659               schema:
660                 type: object
661         "400":
662           description: Bad Request
663           content:
664             application/json:
665               schema:
666                 $ref: '#/components/schemas/ErrorMessage'
667         "401":
668           description: Unauthorized
669           content:
670             application/json:
671               schema:
672                 $ref: '#/components/schemas/ErrorMessage'
673         "403":
674           description: Forbidden
675           content:
676             application/json:
677               schema:
678                 $ref: '#/components/schemas/ErrorMessage'
679         "404":
680           description: The specified resource was not found
681           content:
682             application/json:
683               schema:
684                 $ref: '#/components/schemas/ErrorMessage'
685 components:
686   schemas:
687     ErrorMessage:
688       title: Error
689       type: object
690       properties:
691         status:
692           type: string
693         message:
694           type: string
695         details:
696           type: string