874f2a0774acc29d31a25299050dcd3887f1d1ac
[cps.git] / docs / api / swagger / cps / openapi.yaml
1 openapi: 3.0.1
2 info:
3   title: ONAP Open API v3 Configuration Persistence Service
4   description: Configuration Persistence Service is a Model Driven Generic Database
5   contact:
6     name: ONAP
7     url: https://onap.readthedocs.io
8     email: onap-discuss@lists.onap.org
9   license:
10     name: Apache 2.0
11     url: http://www.apache.org/licenses/LICENSE-2.0
12   version: 1.0.0
13   x-planned-retirement-date: "202212"
14   x-component: Modeling
15   x-logo:
16     url: cps_logo.png
17 servers:
18 - url: /cps/api
19 tags:
20 - name: cps-admin
21   description: cps Admin
22 - name: cps-data
23   description: cps Data
24 paths:
25   /v1/dataspaces:
26     post:
27       tags:
28       - cps-admin
29       summary: Create a dataspace
30       description: Create a new dataspace
31       operationId: createDataspace
32       parameters:
33       - name: dataspace-name
34         in: query
35         description: dataspace-name
36         required: true
37         schema:
38           type: string
39           example: my-dataspace
40       responses:
41         "201":
42           description: Created
43           content:
44             text/plain:
45               schema:
46                 type: string
47                 example: my-resource
48         "400":
49           description: Bad Request
50           content:
51             application/json:
52               schema:
53                 $ref: '#/components/schemas/ErrorMessage'
54               example:
55                 status: 400
56                 message: Bad Request
57                 details: The provided request is not valid
58         "401":
59           description: Unauthorized
60           content:
61             application/json:
62               schema:
63                 $ref: '#/components/schemas/ErrorMessage'
64               example:
65                 status: 401
66                 message: Unauthorized request
67                 details: This request is unauthorized
68         "403":
69           description: Forbidden
70           content:
71             application/json:
72               schema:
73                 $ref: '#/components/schemas/ErrorMessage'
74               example:
75                 status: 403
76                 message: Request Forbidden
77                 details: This request is forbidden
78         "409":
79           description: Conflict
80           content:
81             application/json:
82               schema:
83                 $ref: '#/components/schemas/ErrorMessage'
84               example:
85                 status: 409
86                 message: Conflicting request
87                 details: The request cannot be processed as the resource is in use.
88         "500":
89           description: Internal Server Error
90           content:
91             application/json:
92               schema:
93                 $ref: '#/components/schemas/ErrorMessage'
94               example:
95                 status: 500
96                 message: Internal Server Error
97                 details: Internal Server Error occurred
98     delete:
99       tags:
100       - cps-admin
101       summary: Delete a dataspace
102       description: Delete a dataspace
103       operationId: deleteDataspace
104       parameters:
105       - name: dataspace-name
106         in: query
107         description: dataspace-name
108         required: true
109         schema:
110           type: string
111           example: my-dataspace
112       responses:
113         "204":
114           description: No Content
115           content: {}
116         "400":
117           description: Bad Request
118           content:
119             application/json:
120               schema:
121                 $ref: '#/components/schemas/ErrorMessage'
122               example:
123                 status: 400
124                 message: Bad Request
125                 details: The provided request is not valid
126         "401":
127           description: Unauthorized
128           content:
129             application/json:
130               schema:
131                 $ref: '#/components/schemas/ErrorMessage'
132               example:
133                 status: 401
134                 message: Unauthorized request
135                 details: This request is unauthorized
136         "403":
137           description: Forbidden
138           content:
139             application/json:
140               schema:
141                 $ref: '#/components/schemas/ErrorMessage'
142               example:
143                 status: 403
144                 message: Request Forbidden
145                 details: This request is forbidden
146         "409":
147           description: Conflict
148           content:
149             application/json:
150               schema:
151                 $ref: '#/components/schemas/ErrorMessage'
152               example:
153                 status: 409
154                 message: Conflicting request
155                 details: The request cannot be processed as the resource is in use.
156         "500":
157           description: Internal Server Error
158           content:
159             application/json:
160               schema:
161                 $ref: '#/components/schemas/ErrorMessage'
162               example:
163                 status: 500
164                 message: Internal Server Error
165                 details: Internal Server Error occurred
166   /v1/dataspaces/{dataspace-name}/anchors:
167     get:
168       tags:
169       - cps-admin
170       summary: Get anchors
171       description: "Read all anchors, given a dataspace"
172       operationId: getAnchors
173       parameters:
174       - name: dataspace-name
175         in: path
176         description: dataspace-name
177         required: true
178         schema:
179           type: string
180           example: my-dataspace
181       responses:
182         "200":
183           description: OK
184           content:
185             application/json:
186               schema:
187                 type: array
188                 items:
189                   $ref: '#/components/schemas/AnchorDetails'
190         "400":
191           description: Bad Request
192           content:
193             application/json:
194               schema:
195                 $ref: '#/components/schemas/ErrorMessage'
196               example:
197                 status: 400
198                 message: Bad Request
199                 details: The provided request is not valid
200         "401":
201           description: Unauthorized
202           content:
203             application/json:
204               schema:
205                 $ref: '#/components/schemas/ErrorMessage'
206               example:
207                 status: 401
208                 message: Unauthorized request
209                 details: This request is unauthorized
210         "403":
211           description: Forbidden
212           content:
213             application/json:
214               schema:
215                 $ref: '#/components/schemas/ErrorMessage'
216               example:
217                 status: 403
218                 message: Request Forbidden
219                 details: This request is forbidden
220         "500":
221           description: Internal Server Error
222           content:
223             application/json:
224               schema:
225                 $ref: '#/components/schemas/ErrorMessage'
226               example:
227                 status: 500
228                 message: Internal Server Error
229                 details: Internal Server Error occurred
230     post:
231       tags:
232       - cps-admin
233       summary: Create an anchor
234       description: Create a new anchor in the given dataspace
235       operationId: createAnchor
236       parameters:
237       - name: dataspace-name
238         in: path
239         description: dataspace-name
240         required: true
241         schema:
242           type: string
243           example: my-dataspace
244       - name: schema-set-name
245         in: query
246         description: schema-set-name
247         required: true
248         schema:
249           type: string
250           example: my-schema-set
251       - name: anchor-name
252         in: query
253         description: anchor-name
254         required: true
255         schema:
256           type: string
257           example: my-anchor
258       responses:
259         "201":
260           description: Created
261           content:
262             text/plain:
263               schema:
264                 type: string
265                 example: my-resource
266         "400":
267           description: Bad Request
268           content:
269             application/json:
270               schema:
271                 $ref: '#/components/schemas/ErrorMessage'
272               example:
273                 status: 400
274                 message: Bad Request
275                 details: The provided request is not valid
276         "401":
277           description: Unauthorized
278           content:
279             application/json:
280               schema:
281                 $ref: '#/components/schemas/ErrorMessage'
282               example:
283                 status: 401
284                 message: Unauthorized request
285                 details: This request is unauthorized
286         "403":
287           description: Forbidden
288           content:
289             application/json:
290               schema:
291                 $ref: '#/components/schemas/ErrorMessage'
292               example:
293                 status: 403
294                 message: Request Forbidden
295                 details: This request is forbidden
296         "409":
297           description: Conflict
298           content:
299             application/json:
300               schema:
301                 $ref: '#/components/schemas/ErrorMessage'
302               example:
303                 status: 409
304                 message: Conflicting request
305                 details: The request cannot be processed as the resource is in use.
306         "500":
307           description: Internal Server Error
308           content:
309             application/json:
310               schema:
311                 $ref: '#/components/schemas/ErrorMessage'
312               example:
313                 status: 500
314                 message: Internal Server Error
315                 details: Internal Server Error occurred
316   /v1/dataspaces/{dataspace-name}/anchors/{anchor-name}:
317     get:
318       tags:
319       - cps-admin
320       summary: Get an anchor
321       description: Read an anchor given an anchor name and a dataspace
322       operationId: getAnchor
323       parameters:
324       - name: dataspace-name
325         in: path
326         description: dataspace-name
327         required: true
328         schema:
329           type: string
330           example: my-dataspace
331       - name: anchor-name
332         in: path
333         description: anchor-name
334         required: true
335         schema:
336           type: string
337           example: my-anchor
338       responses:
339         "200":
340           description: OK
341           content:
342             application/json:
343               schema:
344                 $ref: '#/components/schemas/AnchorDetails'
345         "400":
346           description: Bad Request
347           content:
348             application/json:
349               schema:
350                 $ref: '#/components/schemas/ErrorMessage'
351               example:
352                 status: 400
353                 message: Bad Request
354                 details: The provided request is not valid
355         "401":
356           description: Unauthorized
357           content:
358             application/json:
359               schema:
360                 $ref: '#/components/schemas/ErrorMessage'
361               example:
362                 status: 401
363                 message: Unauthorized request
364                 details: This request is unauthorized
365         "403":
366           description: Forbidden
367           content:
368             application/json:
369               schema:
370                 $ref: '#/components/schemas/ErrorMessage'
371               example:
372                 status: 403
373                 message: Request Forbidden
374                 details: This request is forbidden
375         "500":
376           description: Internal Server Error
377           content:
378             application/json:
379               schema:
380                 $ref: '#/components/schemas/ErrorMessage'
381               example:
382                 status: 500
383                 message: Internal Server Error
384                 details: Internal Server Error occurred
385     delete:
386       tags:
387       - cps-admin
388       summary: Delete an anchor
389       description: Delete an anchor given an anchor name and a dataspace
390       operationId: deleteAnchor
391       parameters:
392       - name: dataspace-name
393         in: path
394         description: dataspace-name
395         required: true
396         schema:
397           type: string
398           example: my-dataspace
399       - name: anchor-name
400         in: path
401         description: anchor-name
402         required: true
403         schema:
404           type: string
405           example: my-anchor
406       responses:
407         "204":
408           description: No Content
409           content: {}
410         "400":
411           description: Bad Request
412           content:
413             application/json:
414               schema:
415                 $ref: '#/components/schemas/ErrorMessage'
416               example:
417                 status: 400
418                 message: Bad Request
419                 details: The provided request is not valid
420         "401":
421           description: Unauthorized
422           content:
423             application/json:
424               schema:
425                 $ref: '#/components/schemas/ErrorMessage'
426               example:
427                 status: 401
428                 message: Unauthorized request
429                 details: This request is unauthorized
430         "403":
431           description: Forbidden
432           content:
433             application/json:
434               schema:
435                 $ref: '#/components/schemas/ErrorMessage'
436               example:
437                 status: 403
438                 message: Request Forbidden
439                 details: This request is forbidden
440         "500":
441           description: Internal Server Error
442           content:
443             application/json:
444               schema:
445                 $ref: '#/components/schemas/ErrorMessage'
446               example:
447                 status: 500
448                 message: Internal Server Error
449                 details: Internal Server Error occurred
450   /v1/dataspaces/{dataspace-name}/schema-sets:
451     post:
452       tags:
453       - cps-admin
454       summary: Create a schema set
455       description: Create a new schema set in the given dataspace
456       operationId: createSchemaSet
457       parameters:
458       - name: dataspace-name
459         in: path
460         description: dataspace-name
461         required: true
462         schema:
463           type: string
464           example: my-dataspace
465       - name: schema-set-name
466         in: query
467         description: schema-set-name
468         required: true
469         schema:
470           type: string
471           example: my-schema-set
472       requestBody:
473         content:
474           multipart/form-data:
475             schema:
476               $ref: '#/components/schemas/MultipartFile'
477         required: true
478       responses:
479         "201":
480           description: Created
481           content:
482             text/plain:
483               schema:
484                 type: string
485                 example: my-resource
486         "400":
487           description: Bad Request
488           content:
489             application/json:
490               schema:
491                 $ref: '#/components/schemas/ErrorMessage'
492               example:
493                 status: 400
494                 message: Bad Request
495                 details: The provided request is not valid
496         "401":
497           description: Unauthorized
498           content:
499             application/json:
500               schema:
501                 $ref: '#/components/schemas/ErrorMessage'
502               example:
503                 status: 401
504                 message: Unauthorized request
505                 details: This request is unauthorized
506         "403":
507           description: Forbidden
508           content:
509             application/json:
510               schema:
511                 $ref: '#/components/schemas/ErrorMessage'
512               example:
513                 status: 403
514                 message: Request Forbidden
515                 details: This request is forbidden
516         "409":
517           description: Conflict
518           content:
519             application/json:
520               schema:
521                 $ref: '#/components/schemas/ErrorMessage'
522               example:
523                 status: 409
524                 message: Conflicting request
525                 details: The request cannot be processed as the resource is in use.
526         "500":
527           description: Internal Server Error
528           content:
529             application/json:
530               schema:
531                 $ref: '#/components/schemas/ErrorMessage'
532               example:
533                 status: 500
534                 message: Internal Server Error
535                 details: Internal Server Error occurred
536   /v1/dataspaces/{dataspace-name}/schema-sets/{schema-set-name}:
537     get:
538       tags:
539       - cps-admin
540       summary: Get a schema set
541       description: Read a schema set given a schema set name and a dataspace
542       operationId: getSchemaSet
543       parameters:
544       - name: dataspace-name
545         in: path
546         description: dataspace-name
547         required: true
548         schema:
549           type: string
550           example: my-dataspace
551       - name: schema-set-name
552         in: path
553         description: schema-set-name
554         required: true
555         schema:
556           type: string
557           example: my-schema-set
558       responses:
559         "200":
560           description: OK
561           content:
562             application/json:
563               schema:
564                 $ref: '#/components/schemas/SchemaSetDetails'
565         "400":
566           description: Bad Request
567           content:
568             application/json:
569               schema:
570                 $ref: '#/components/schemas/ErrorMessage'
571               example:
572                 status: 400
573                 message: Bad Request
574                 details: The provided request is not valid
575         "401":
576           description: Unauthorized
577           content:
578             application/json:
579               schema:
580                 $ref: '#/components/schemas/ErrorMessage'
581               example:
582                 status: 401
583                 message: Unauthorized request
584                 details: This request is unauthorized
585         "403":
586           description: Forbidden
587           content:
588             application/json:
589               schema:
590                 $ref: '#/components/schemas/ErrorMessage'
591               example:
592                 status: 403
593                 message: Request Forbidden
594                 details: This request is forbidden
595         "500":
596           description: Internal Server Error
597           content:
598             application/json:
599               schema:
600                 $ref: '#/components/schemas/ErrorMessage'
601               example:
602                 status: 500
603                 message: Internal Server Error
604                 details: Internal Server Error occurred
605     delete:
606       tags:
607       - cps-admin
608       summary: Delete a schema set
609       description: Delete a schema set given a schema set name and a dataspace
610       operationId: deleteSchemaSet
611       parameters:
612       - name: dataspace-name
613         in: path
614         description: dataspace-name
615         required: true
616         schema:
617           type: string
618           example: my-dataspace
619       - name: schema-set-name
620         in: path
621         description: schema-set-name
622         required: true
623         schema:
624           type: string
625           example: my-schema-set
626       responses:
627         "204":
628           description: No Content
629           content: {}
630         "400":
631           description: Bad Request
632           content:
633             application/json:
634               schema:
635                 $ref: '#/components/schemas/ErrorMessage'
636               example:
637                 status: 400
638                 message: Bad Request
639                 details: The provided request is not valid
640         "401":
641           description: Unauthorized
642           content:
643             application/json:
644               schema:
645                 $ref: '#/components/schemas/ErrorMessage'
646               example:
647                 status: 401
648                 message: Unauthorized request
649                 details: This request is unauthorized
650         "403":
651           description: Forbidden
652           content:
653             application/json:
654               schema:
655                 $ref: '#/components/schemas/ErrorMessage'
656               example:
657                 status: 403
658                 message: Request Forbidden
659                 details: This request is forbidden
660         "409":
661           description: Conflict
662           content:
663             application/json:
664               schema:
665                 $ref: '#/components/schemas/ErrorMessage'
666               example:
667                 status: 409
668                 message: Conflicting request
669                 details: The request cannot be processed as the resource is in use.
670         "500":
671           description: Internal Server Error
672           content:
673             application/json:
674               schema:
675                 $ref: '#/components/schemas/ErrorMessage'
676               example:
677                 status: 500
678                 message: Internal Server Error
679                 details: Internal Server Error occurred
680   /v1/dataspaces/{dataspace-name}/anchors/{anchor-name}/node:
681     get:
682       tags:
683       - cps-data
684       summary: Get a node
685       description: Get a node with an option to retrieve all the children for a given
686         anchor and dataspace
687       operationId: getNodeByDataspaceAndAnchor
688       parameters:
689       - name: dataspace-name
690         in: path
691         description: dataspace-name
692         required: true
693         schema:
694           type: string
695           example: my-dataspace
696       - name: anchor-name
697         in: path
698         description: anchor-name
699         required: true
700         schema:
701           type: string
702           example: my-anchor
703       - name: xpath
704         in: query
705         description: "For more details on xpath, please refer https://docs.onap.org/projects/onap-cps/en/latest/cps-path.html"
706         required: false
707         schema:
708           type: string
709           default: /
710         examples:
711           container xpath:
712             value: /shops/bookstore
713           list attributes xpath:
714             value: "/shops/bookstore/categories[@code=1]"
715       - name: include-descendants
716         in: query
717         description: include-descendants
718         required: false
719         schema:
720           type: boolean
721           example: false
722           default: false
723       responses:
724         "200":
725           description: OK
726           content:
727             application/json:
728               schema:
729                 type: object
730               examples:
731                 dataSample:
732                   $ref: '#/components/examples/dataSample'
733         "400":
734           description: Bad Request
735           content:
736             application/json:
737               schema:
738                 $ref: '#/components/schemas/ErrorMessage'
739               example:
740                 status: 400
741                 message: Bad Request
742                 details: The provided request is not valid
743         "401":
744           description: Unauthorized
745           content:
746             application/json:
747               schema:
748                 $ref: '#/components/schemas/ErrorMessage'
749               example:
750                 status: 401
751                 message: Unauthorized request
752                 details: This request is unauthorized
753         "403":
754           description: Forbidden
755           content:
756             application/json:
757               schema:
758                 $ref: '#/components/schemas/ErrorMessage'
759               example:
760                 status: 403
761                 message: Request Forbidden
762                 details: This request is forbidden
763         "500":
764           description: Internal Server Error
765           content:
766             application/json:
767               schema:
768                 $ref: '#/components/schemas/ErrorMessage'
769               example:
770                 status: 500
771                 message: Internal Server Error
772                 details: Internal Server Error occurred
773       x-codegen-request-body-name: xpath
774   /v1/dataspaces/{dataspace-name}/anchors/{anchor-name}/nodes:
775     put:
776       tags:
777       - cps-data
778       summary: Replace a node with descendants
779       description: "Replace a node with descendants for a given dataspace, anchor\
780         \ and a parent node xpath"
781       operationId: replaceNode
782       parameters:
783       - name: dataspace-name
784         in: path
785         description: dataspace-name
786         required: true
787         schema:
788           type: string
789           example: my-dataspace
790       - name: anchor-name
791         in: path
792         description: anchor-name
793         required: true
794         schema:
795           type: string
796           example: my-anchor
797       - name: xpath
798         in: query
799         description: "For more details on xpath, please refer https://docs.onap.org/projects/onap-cps/en/latest/cps-path.html"
800         required: false
801         schema:
802           type: string
803           default: /
804         examples:
805           container xpath:
806             value: /shops/bookstore
807           list attributes xpath:
808             value: "/shops/bookstore/categories[@code=1]"
809       - name: observed-timestamp
810         in: query
811         description: observed-timestamp
812         required: false
813         schema:
814           type: string
815           example: 2021-03-21T00:10:34.030-0100
816       requestBody:
817         content:
818           application/json:
819             schema:
820               type: object
821             examples:
822               dataSample:
823                 $ref: '#/components/examples/dataSample'
824         required: true
825       responses:
826         "200":
827           description: OK
828           content:
829             application/json:
830               schema:
831                 type: object
832               examples:
833                 dataSample:
834                   value: ""
835         "400":
836           description: Bad Request
837           content:
838             application/json:
839               schema:
840                 $ref: '#/components/schemas/ErrorMessage'
841               example:
842                 status: 400
843                 message: Bad Request
844                 details: The provided request is not valid
845         "401":
846           description: Unauthorized
847           content:
848             application/json:
849               schema:
850                 $ref: '#/components/schemas/ErrorMessage'
851               example:
852                 status: 401
853                 message: Unauthorized request
854                 details: This request is unauthorized
855         "403":
856           description: Forbidden
857           content:
858             application/json:
859               schema:
860                 $ref: '#/components/schemas/ErrorMessage'
861               example:
862                 status: 403
863                 message: Request Forbidden
864                 details: This request is forbidden
865         "500":
866           description: Internal Server Error
867           content:
868             application/json:
869               schema:
870                 $ref: '#/components/schemas/ErrorMessage'
871               example:
872                 status: 500
873                 message: Internal Server Error
874                 details: Internal Server Error occurred
875     post:
876       tags:
877       - cps-data
878       summary: Create a node
879       description: Create a node for a given anchor and dataspace
880       operationId: createNode
881       parameters:
882       - name: dataspace-name
883         in: path
884         description: dataspace-name
885         required: true
886         schema:
887           type: string
888           example: my-dataspace
889       - name: anchor-name
890         in: path
891         description: anchor-name
892         required: true
893         schema:
894           type: string
895           example: my-anchor
896       - name: xpath
897         in: query
898         description: "For more details on xpath, please refer https://docs.onap.org/projects/onap-cps/en/latest/cps-path.html"
899         required: false
900         schema:
901           type: string
902           default: /
903         examples:
904           container xpath:
905             value: /shops/bookstore
906           list attributes xpath:
907             value: "/shops/bookstore/categories[@code=1]"
908       - name: observed-timestamp
909         in: query
910         description: observed-timestamp
911         required: false
912         schema:
913           type: string
914           example: 2021-03-21T00:10:34.030-0100
915       requestBody:
916         content:
917           application/json:
918             schema:
919               type: object
920             examples:
921               dataSample:
922                 $ref: '#/components/examples/dataSample'
923         required: true
924       responses:
925         "201":
926           description: Created
927           content:
928             text/plain:
929               schema:
930                 type: string
931                 example: my-resource
932         "400":
933           description: Bad Request
934           content:
935             application/json:
936               schema:
937                 $ref: '#/components/schemas/ErrorMessage'
938               example:
939                 status: 400
940                 message: Bad Request
941                 details: The provided request is not valid
942         "401":
943           description: Unauthorized
944           content:
945             application/json:
946               schema:
947                 $ref: '#/components/schemas/ErrorMessage'
948               example:
949                 status: 401
950                 message: Unauthorized request
951                 details: This request is unauthorized
952         "403":
953           description: Forbidden
954           content:
955             application/json:
956               schema:
957                 $ref: '#/components/schemas/ErrorMessage'
958               example:
959                 status: 403
960                 message: Request Forbidden
961                 details: This request is forbidden
962         "409":
963           description: Conflict
964           content:
965             application/json:
966               schema:
967                 $ref: '#/components/schemas/ErrorMessage'
968               example:
969                 status: 409
970                 message: Conflicting request
971                 details: The request cannot be processed as the resource is in use.
972         "500":
973           description: Internal Server Error
974           content:
975             application/json:
976               schema:
977                 $ref: '#/components/schemas/ErrorMessage'
978               example:
979                 status: 500
980                 message: Internal Server Error
981                 details: Internal Server Error occurred
982     delete:
983       tags:
984       - cps-data
985       summary: Delete a data node
986       description: Delete a datanode for a given dataspace and anchor given a node
987         xpath.
988       operationId: deleteDataNode
989       parameters:
990       - name: dataspace-name
991         in: path
992         description: dataspace-name
993         required: true
994         schema:
995           type: string
996           example: my-dataspace
997       - name: anchor-name
998         in: path
999         description: anchor-name
1000         required: true
1001         schema:
1002           type: string
1003           example: my-anchor
1004       - name: xpath
1005         in: query
1006         description: "For more details on xpath, please refer https://docs.onap.org/projects/onap-cps/en/latest/cps-path.html"
1007         required: false
1008         schema:
1009           type: string
1010           default: /
1011         examples:
1012           container xpath:
1013             value: /shops/bookstore
1014           list attributes xpath:
1015             value: "/shops/bookstore/categories[@code=1]"
1016       - name: observed-timestamp
1017         in: query
1018         description: observed-timestamp
1019         required: false
1020         schema:
1021           type: string
1022           example: 2021-03-21T00:10:34.030-0100
1023       responses:
1024         "204":
1025           description: No Content
1026           content: {}
1027         "400":
1028           description: Bad Request
1029           content:
1030             application/json:
1031               schema:
1032                 $ref: '#/components/schemas/ErrorMessage'
1033               example:
1034                 status: 400
1035                 message: Bad Request
1036                 details: The provided request is not valid
1037         "401":
1038           description: Unauthorized
1039           content:
1040             application/json:
1041               schema:
1042                 $ref: '#/components/schemas/ErrorMessage'
1043               example:
1044                 status: 401
1045                 message: Unauthorized request
1046                 details: This request is unauthorized
1047         "403":
1048           description: Forbidden
1049           content:
1050             application/json:
1051               schema:
1052                 $ref: '#/components/schemas/ErrorMessage'
1053               example:
1054                 status: 403
1055                 message: Request Forbidden
1056                 details: This request is forbidden
1057         "500":
1058           description: Internal Server Error
1059           content:
1060             application/json:
1061               schema:
1062                 $ref: '#/components/schemas/ErrorMessage'
1063               example:
1064                 status: 500
1065                 message: Internal Server Error
1066                 details: Internal Server Error occurred
1067     patch:
1068       tags:
1069       - cps-data
1070       summary: Update node leaves
1071       description: Update a data node leaves for a given dataspace and anchor and
1072         a parent node xpath
1073       operationId: updateNodeLeaves
1074       parameters:
1075       - name: dataspace-name
1076         in: path
1077         description: dataspace-name
1078         required: true
1079         schema:
1080           type: string
1081           example: my-dataspace
1082       - name: anchor-name
1083         in: path
1084         description: anchor-name
1085         required: true
1086         schema:
1087           type: string
1088           example: my-anchor
1089       - name: xpath
1090         in: query
1091         description: "For more details on xpath, please refer https://docs.onap.org/projects/onap-cps/en/latest/cps-path.html"
1092         required: false
1093         schema:
1094           type: string
1095           default: /
1096         examples:
1097           container xpath:
1098             value: /shops/bookstore
1099           list attributes xpath:
1100             value: "/shops/bookstore/categories[@code=1]"
1101       - name: observed-timestamp
1102         in: query
1103         description: observed-timestamp
1104         required: false
1105         schema:
1106           type: string
1107           example: 2021-03-21T00:10:34.030-0100
1108       requestBody:
1109         content:
1110           application/json:
1111             schema:
1112               type: object
1113             examples:
1114               dataSample:
1115                 $ref: '#/components/examples/dataSample'
1116         required: true
1117       responses:
1118         "200":
1119           description: OK
1120           content:
1121             application/json:
1122               schema:
1123                 type: object
1124               examples:
1125                 dataSample:
1126                   value: ""
1127         "400":
1128           description: Bad Request
1129           content:
1130             application/json:
1131               schema:
1132                 $ref: '#/components/schemas/ErrorMessage'
1133               example:
1134                 status: 400
1135                 message: Bad Request
1136                 details: The provided request is not valid
1137         "401":
1138           description: Unauthorized
1139           content:
1140             application/json:
1141               schema:
1142                 $ref: '#/components/schemas/ErrorMessage'
1143               example:
1144                 status: 401
1145                 message: Unauthorized request
1146                 details: This request is unauthorized
1147         "403":
1148           description: Forbidden
1149           content:
1150             application/json:
1151               schema:
1152                 $ref: '#/components/schemas/ErrorMessage'
1153               example:
1154                 status: 403
1155                 message: Request Forbidden
1156                 details: This request is forbidden
1157         "500":
1158           description: Internal Server Error
1159           content:
1160             application/json:
1161               schema:
1162                 $ref: '#/components/schemas/ErrorMessage'
1163               example:
1164                 status: 500
1165                 message: Internal Server Error
1166                 details: Internal Server Error occurred
1167   /v1/dataspaces/{dataspace-name}/anchors/{anchor-name}/list-nodes:
1168     put:
1169       tags:
1170       - cps-data
1171       summary: Replace list content
1172       description: "Replace list content under a given parent, anchor and dataspace"
1173       operationId: replaceListContent
1174       parameters:
1175       - name: dataspace-name
1176         in: path
1177         description: dataspace-name
1178         required: true
1179         schema:
1180           type: string
1181           example: my-dataspace
1182       - name: anchor-name
1183         in: path
1184         description: anchor-name
1185         required: true
1186         schema:
1187           type: string
1188           example: my-anchor
1189       - name: xpath
1190         in: query
1191         description: "For more details on xpath, please refer https://docs.onap.org/projects/onap-cps/en/latest/cps-path.html"
1192         required: true
1193         schema:
1194           type: string
1195         examples:
1196           container xpath:
1197             value: /shops/bookstore
1198           list attributes xpath:
1199             value: "/shops/bookstore/categories[@code=1]"
1200       - name: observed-timestamp
1201         in: query
1202         description: observed-timestamp
1203         required: false
1204         schema:
1205           type: string
1206           example: 2021-03-21T00:10:34.030-0100
1207       requestBody:
1208         content:
1209           application/json:
1210             schema:
1211               type: object
1212             examples:
1213               dataSample:
1214                 $ref: '#/components/examples/dataSample'
1215         required: true
1216       responses:
1217         "200":
1218           description: OK
1219           content:
1220             application/json:
1221               schema:
1222                 type: object
1223               examples:
1224                 dataSample:
1225                   value: ""
1226         "400":
1227           description: Bad Request
1228           content:
1229             application/json:
1230               schema:
1231                 $ref: '#/components/schemas/ErrorMessage'
1232               example:
1233                 status: 400
1234                 message: Bad Request
1235                 details: The provided request is not valid
1236         "401":
1237           description: Unauthorized
1238           content:
1239             application/json:
1240               schema:
1241                 $ref: '#/components/schemas/ErrorMessage'
1242               example:
1243                 status: 401
1244                 message: Unauthorized request
1245                 details: This request is unauthorized
1246         "403":
1247           description: Forbidden
1248           content:
1249             application/json:
1250               schema:
1251                 $ref: '#/components/schemas/ErrorMessage'
1252               example:
1253                 status: 403
1254                 message: Request Forbidden
1255                 details: This request is forbidden
1256         "500":
1257           description: Internal Server Error
1258           content:
1259             application/json:
1260               schema:
1261                 $ref: '#/components/schemas/ErrorMessage'
1262               example:
1263                 status: 500
1264                 message: Internal Server Error
1265                 details: Internal Server Error occurred
1266     post:
1267       tags:
1268       - cps-data
1269       summary: Add list element(s)
1270       description: Add list element(s) to a list for a given anchor and dataspace
1271       operationId: addListElements
1272       parameters:
1273       - name: dataspace-name
1274         in: path
1275         description: dataspace-name
1276         required: true
1277         schema:
1278           type: string
1279           example: my-dataspace
1280       - name: anchor-name
1281         in: path
1282         description: anchor-name
1283         required: true
1284         schema:
1285           type: string
1286           example: my-anchor
1287       - name: xpath
1288         in: query
1289         description: "For more details on xpath, please refer https://docs.onap.org/projects/onap-cps/en/latest/cps-path.html"
1290         required: true
1291         schema:
1292           type: string
1293         examples:
1294           container xpath:
1295             value: /shops/bookstore
1296           list attributes xpath:
1297             value: "/shops/bookstore/categories[@code=1]"
1298       - name: observed-timestamp
1299         in: query
1300         description: observed-timestamp
1301         required: false
1302         schema:
1303           type: string
1304           example: 2021-03-21T00:10:34.030-0100
1305       requestBody:
1306         content:
1307           application/json:
1308             schema:
1309               type: object
1310             examples:
1311               dataSample:
1312                 $ref: '#/components/examples/dataSample'
1313         required: true
1314       responses:
1315         "201":
1316           description: Created
1317           content:
1318             text/plain:
1319               schema:
1320                 type: string
1321                 example: my-resource
1322         "400":
1323           description: Bad Request
1324           content:
1325             application/json:
1326               schema:
1327                 $ref: '#/components/schemas/ErrorMessage'
1328               example:
1329                 status: 400
1330                 message: Bad Request
1331                 details: The provided request is not valid
1332         "401":
1333           description: Unauthorized
1334           content:
1335             application/json:
1336               schema:
1337                 $ref: '#/components/schemas/ErrorMessage'
1338               example:
1339                 status: 401
1340                 message: Unauthorized request
1341                 details: This request is unauthorized
1342         "403":
1343           description: Forbidden
1344           content:
1345             application/json:
1346               schema:
1347                 $ref: '#/components/schemas/ErrorMessage'
1348               example:
1349                 status: 403
1350                 message: Request Forbidden
1351                 details: This request is forbidden
1352         "500":
1353           description: Internal Server Error
1354           content:
1355             application/json:
1356               schema:
1357                 $ref: '#/components/schemas/ErrorMessage'
1358               example:
1359                 status: 500
1360                 message: Internal Server Error
1361                 details: Internal Server Error occurred
1362     delete:
1363       tags:
1364       - cps-data
1365       summary: Delete one or all list element(s)
1366       description: Delete one or all list element(s) for a given anchor and dataspace
1367       operationId: deleteListOrListElement
1368       parameters:
1369       - name: dataspace-name
1370         in: path
1371         description: dataspace-name
1372         required: true
1373         schema:
1374           type: string
1375           example: my-dataspace
1376       - name: anchor-name
1377         in: path
1378         description: anchor-name
1379         required: true
1380         schema:
1381           type: string
1382           example: my-anchor
1383       - name: xpath
1384         in: query
1385         description: "For more details on xpath, please refer https://docs.onap.org/projects/onap-cps/en/latest/cps-path.html"
1386         required: true
1387         schema:
1388           type: string
1389         examples:
1390           container xpath:
1391             value: /shops/bookstore
1392           list attributes xpath:
1393             value: "/shops/bookstore/categories[@code=1]"
1394       - name: observed-timestamp
1395         in: query
1396         description: observed-timestamp
1397         required: false
1398         schema:
1399           type: string
1400           example: 2021-03-21T00:10:34.030-0100
1401       responses:
1402         "204":
1403           description: No Content
1404           content: {}
1405         "400":
1406           description: Bad Request
1407           content:
1408             application/json:
1409               schema:
1410                 $ref: '#/components/schemas/ErrorMessage'
1411               example:
1412                 status: 400
1413                 message: Bad Request
1414                 details: The provided request is not valid
1415         "401":
1416           description: Unauthorized
1417           content:
1418             application/json:
1419               schema:
1420                 $ref: '#/components/schemas/ErrorMessage'
1421               example:
1422                 status: 401
1423                 message: Unauthorized request
1424                 details: This request is unauthorized
1425         "403":
1426           description: Forbidden
1427           content:
1428             application/json:
1429               schema:
1430                 $ref: '#/components/schemas/ErrorMessage'
1431               example:
1432                 status: 403
1433                 message: Request Forbidden
1434                 details: This request is forbidden
1435         "500":
1436           description: Internal Server Error
1437           content:
1438             application/json:
1439               schema:
1440                 $ref: '#/components/schemas/ErrorMessage'
1441               example:
1442                 status: 500
1443                 message: Internal Server Error
1444                 details: Internal Server Error occurred
1445       deprecated: true
1446   /v1/dataspaces/{dataspace-name}/anchors/{anchor-name}/nodes/query:
1447     get:
1448       tags:
1449       - cps-query
1450       summary: Query data nodes
1451       description: Query data nodes for the given dataspace and anchor using CPS path
1452       operationId: getNodesByDataspaceAndAnchorAndCpsPath
1453       parameters:
1454       - name: dataspace-name
1455         in: path
1456         description: dataspace-name
1457         required: true
1458         schema:
1459           type: string
1460           example: my-dataspace
1461       - name: anchor-name
1462         in: path
1463         description: anchor-name
1464         required: true
1465         schema:
1466           type: string
1467           example: my-anchor
1468       - name: cps-path
1469         in: query
1470         description: "For more details on cps path, please refer https://docs.onap.org/projects/onap-cps/en/latest/cps-path.html"
1471         required: false
1472         schema:
1473           type: string
1474           default: /
1475         examples:
1476           container cps path:
1477             value: //bookstore
1478           list attributes cps path:
1479             value: "//categories[@code=1]"
1480       - name: include-descendants
1481         in: query
1482         description: include-descendants
1483         required: false
1484         schema:
1485           type: boolean
1486           example: false
1487           default: false
1488       responses:
1489         "200":
1490           description: OK
1491           content:
1492             application/json:
1493               schema:
1494                 type: object
1495               examples:
1496                 dataSample:
1497                   $ref: '#/components/examples/dataSample'
1498         "400":
1499           description: Bad Request
1500           content:
1501             application/json:
1502               schema:
1503                 $ref: '#/components/schemas/ErrorMessage'
1504               example:
1505                 status: 400
1506                 message: Bad Request
1507                 details: The provided request is not valid
1508         "401":
1509           description: Unauthorized
1510           content:
1511             application/json:
1512               schema:
1513                 $ref: '#/components/schemas/ErrorMessage'
1514               example:
1515                 status: 401
1516                 message: Unauthorized request
1517                 details: This request is unauthorized
1518         "403":
1519           description: Forbidden
1520           content:
1521             application/json:
1522               schema:
1523                 $ref: '#/components/schemas/ErrorMessage'
1524               example:
1525                 status: 403
1526                 message: Request Forbidden
1527                 details: This request is forbidden
1528         "500":
1529           description: Internal Server Error
1530           content:
1531             application/json:
1532               schema:
1533                 $ref: '#/components/schemas/ErrorMessage'
1534               example:
1535                 status: 500
1536                 message: Internal Server Error
1537                 details: Internal Server Error occurred
1538       x-codegen-request-body-name: xpath
1539 components:
1540   schemas:
1541     ErrorMessage:
1542       title: Error
1543       type: object
1544       properties:
1545         status:
1546           type: string
1547         message:
1548           type: string
1549         details:
1550           type: string
1551     AnchorDetails:
1552       title: Anchor details by anchor Name
1553       type: object
1554       properties:
1555         name:
1556           type: string
1557           example: my-anchor
1558         dataspaceName:
1559           type: string
1560           example: my-dataspace
1561         schemaSetName:
1562           type: string
1563           example: my-schema-set
1564     MultipartFile:
1565       required:
1566       - file
1567       type: object
1568       properties:
1569         file:
1570           type: string
1571           description: multipartFile
1572           format: binary
1573     SchemaSetDetails:
1574       title: Schema set details by dataspace and schemasetName
1575       required:
1576       - moduleReferences
1577       type: object
1578       properties:
1579         dataspaceName:
1580           type: string
1581           example: my-dataspace
1582         moduleReferences:
1583           type: array
1584           items:
1585             $ref: '#/components/schemas/ModuleReferences'
1586         name:
1587           type: string
1588           example: my-schema-set
1589     ModuleReferences:
1590       title: Module reference object
1591       type: object
1592       properties:
1593         name:
1594           type: string
1595           example: my-module-reference-name
1596         namespace:
1597           type: string
1598           example: my-module-reference-namespace
1599         revision:
1600           type: string
1601           example: my-module-reference-revision
1602   examples:
1603     dataSample:
1604       value:
1605         test:bookstore:
1606           bookstore-name: Chapters
1607           categories:
1608           - code: 1
1609             name: SciFi
1610           - code: 2
1611             name: kids