Check preformance impacts
[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/admin/dataspaces:
167     get:
168       tags:
169       - cps-admin
170       summary: Get dataspaces
171       description: "Read all dataspaces"
172       operationId: getAllDataspaces
173       responses:
174         "200":
175           description: OK
176           content:
177             application/json:
178               schema:
179                 type: array
180                 items:
181                   $ref: '#/components/schemas/DataspaceDetails'
182         "400":
183           description: Bad Request
184           content:
185             application/json:
186               schema:
187                 $ref: '#/components/schemas/ErrorMessage'
188               example:
189                 status: 400
190                 message: Bad Request
191                 details: The provided request is not valid
192         "401":
193           description: Unauthorized
194           content:
195             application/json:
196               schema:
197                 $ref: '#/components/schemas/ErrorMessage'
198               example:
199                 status: 401
200                 message: Unauthorized request
201                 details: This request is unauthorized
202         "403":
203           description: Forbidden
204           content:
205             application/json:
206               schema:
207                 $ref: '#/components/schemas/ErrorMessage'
208               example:
209                 status: 403
210                 message: Request Forbidden
211                 details: This request is forbidden
212         "500":
213           description: Internal Server Error
214           content:
215             application/json:
216               schema:
217                 $ref: '#/components/schemas/ErrorMessage'
218               example:
219                 status: 500
220                 message: Internal Server Error
221                 details: Internal Server Error occurred
222   /v1/admin/dataspaces/{dataspace-name}:
223     get:
224       tags:
225       - cps-admin
226       summary: Get a dataspace
227       description: Read an dataspace given a dataspace name
228       operationId: getDataspace
229       parameters:
230       - name: dataspace-name
231         in: path
232         description: dataspace-name
233         required: true
234         schema:
235           type: string
236           example: my-dataspace
237       responses:
238         "200":
239           description: OK
240           content:
241             application/json:
242               schema:
243                 $ref: '#/components/schemas/DataspaceDetails'
244         "400":
245           description: Bad Request
246           content:
247             application/json:
248               schema:
249                 $ref: '#/components/schemas/ErrorMessage'
250               example:
251                 status: 400
252                 message: Bad Request
253                 details: The provided request is not valid
254         "401":
255           description: Unauthorized
256           content:
257             application/json:
258               schema:
259                 $ref: '#/components/schemas/ErrorMessage'
260               example:
261                 status: 401
262                 message: Unauthorized request
263                 details: This request is unauthorized
264         "403":
265           description: Forbidden
266           content:
267             application/json:
268               schema:
269                 $ref: '#/components/schemas/ErrorMessage'
270               example:
271                 status: 403
272                 message: Request Forbidden
273                 details: This request is forbidden
274         "500":
275           description: Internal Server Error
276           content:
277             application/json:
278               schema:
279                 $ref: '#/components/schemas/ErrorMessage'
280               example:
281                 status: 500
282                 message: Internal Server Error
283                 details: Internal Server Error occurred
284   /v1/dataspaces/{dataspace-name}/anchors:
285     get:
286       tags:
287       - cps-admin
288       summary: Get anchors
289       description: "Read all anchors, given a dataspace"
290       operationId: getAnchors
291       parameters:
292       - name: dataspace-name
293         in: path
294         description: dataspace-name
295         required: true
296         schema:
297           type: string
298           example: my-dataspace
299       responses:
300         "200":
301           description: OK
302           content:
303             application/json:
304               schema:
305                 type: array
306                 items:
307                   $ref: '#/components/schemas/AnchorDetails'
308         "400":
309           description: Bad Request
310           content:
311             application/json:
312               schema:
313                 $ref: '#/components/schemas/ErrorMessage'
314               example:
315                 status: 400
316                 message: Bad Request
317                 details: The provided request is not valid
318         "401":
319           description: Unauthorized
320           content:
321             application/json:
322               schema:
323                 $ref: '#/components/schemas/ErrorMessage'
324               example:
325                 status: 401
326                 message: Unauthorized request
327                 details: This request is unauthorized
328         "403":
329           description: Forbidden
330           content:
331             application/json:
332               schema:
333                 $ref: '#/components/schemas/ErrorMessage'
334               example:
335                 status: 403
336                 message: Request Forbidden
337                 details: This request is forbidden
338         "500":
339           description: Internal Server Error
340           content:
341             application/json:
342               schema:
343                 $ref: '#/components/schemas/ErrorMessage'
344               example:
345                 status: 500
346                 message: Internal Server Error
347                 details: Internal Server Error occurred
348     post:
349       tags:
350       - cps-admin
351       summary: Create an anchor
352       description: Create a new anchor in the given dataspace
353       operationId: createAnchor
354       parameters:
355       - name: dataspace-name
356         in: path
357         description: dataspace-name
358         required: true
359         schema:
360           type: string
361           example: my-dataspace
362       - name: schema-set-name
363         in: query
364         description: schema-set-name
365         required: true
366         schema:
367           type: string
368           example: my-schema-set
369       - name: anchor-name
370         in: query
371         description: anchor-name
372         required: true
373         schema:
374           type: string
375           example: my-anchor
376       responses:
377         "201":
378           description: Created
379           content:
380             text/plain:
381               schema:
382                 type: string
383                 example: my-resource
384         "400":
385           description: Bad Request
386           content:
387             application/json:
388               schema:
389                 $ref: '#/components/schemas/ErrorMessage'
390               example:
391                 status: 400
392                 message: Bad Request
393                 details: The provided request is not valid
394         "401":
395           description: Unauthorized
396           content:
397             application/json:
398               schema:
399                 $ref: '#/components/schemas/ErrorMessage'
400               example:
401                 status: 401
402                 message: Unauthorized request
403                 details: This request is unauthorized
404         "403":
405           description: Forbidden
406           content:
407             application/json:
408               schema:
409                 $ref: '#/components/schemas/ErrorMessage'
410               example:
411                 status: 403
412                 message: Request Forbidden
413                 details: This request is forbidden
414         "409":
415           description: Conflict
416           content:
417             application/json:
418               schema:
419                 $ref: '#/components/schemas/ErrorMessage'
420               example:
421                 status: 409
422                 message: Conflicting request
423                 details: The request cannot be processed as the resource is in use.
424         "500":
425           description: Internal Server Error
426           content:
427             application/json:
428               schema:
429                 $ref: '#/components/schemas/ErrorMessage'
430               example:
431                 status: 500
432                 message: Internal Server Error
433                 details: Internal Server Error occurred
434   /v1/dataspaces/{dataspace-name}/anchors/{anchor-name}:
435     get:
436       tags:
437       - cps-admin
438       summary: Get an anchor
439       description: Read an anchor given an anchor name and a dataspace
440       operationId: getAnchor
441       parameters:
442       - name: dataspace-name
443         in: path
444         description: dataspace-name
445         required: true
446         schema:
447           type: string
448           example: my-dataspace
449       - name: anchor-name
450         in: path
451         description: anchor-name
452         required: true
453         schema:
454           type: string
455           example: my-anchor
456       responses:
457         "200":
458           description: OK
459           content:
460             application/json:
461               schema:
462                 $ref: '#/components/schemas/AnchorDetails'
463         "400":
464           description: Bad Request
465           content:
466             application/json:
467               schema:
468                 $ref: '#/components/schemas/ErrorMessage'
469               example:
470                 status: 400
471                 message: Bad Request
472                 details: The provided request is not valid
473         "401":
474           description: Unauthorized
475           content:
476             application/json:
477               schema:
478                 $ref: '#/components/schemas/ErrorMessage'
479               example:
480                 status: 401
481                 message: Unauthorized request
482                 details: This request is unauthorized
483         "403":
484           description: Forbidden
485           content:
486             application/json:
487               schema:
488                 $ref: '#/components/schemas/ErrorMessage'
489               example:
490                 status: 403
491                 message: Request Forbidden
492                 details: This request is forbidden
493         "500":
494           description: Internal Server Error
495           content:
496             application/json:
497               schema:
498                 $ref: '#/components/schemas/ErrorMessage'
499               example:
500                 status: 500
501                 message: Internal Server Error
502                 details: Internal Server Error occurred
503     delete:
504       tags:
505       - cps-admin
506       summary: Delete an anchor
507       description: Delete an anchor given an anchor name and a dataspace
508       operationId: deleteAnchor
509       parameters:
510       - name: dataspace-name
511         in: path
512         description: dataspace-name
513         required: true
514         schema:
515           type: string
516           example: my-dataspace
517       - name: anchor-name
518         in: path
519         description: anchor-name
520         required: true
521         schema:
522           type: string
523           example: my-anchor
524       responses:
525         "204":
526           description: No Content
527           content: {}
528         "400":
529           description: Bad Request
530           content:
531             application/json:
532               schema:
533                 $ref: '#/components/schemas/ErrorMessage'
534               example:
535                 status: 400
536                 message: Bad Request
537                 details: The provided request is not valid
538         "401":
539           description: Unauthorized
540           content:
541             application/json:
542               schema:
543                 $ref: '#/components/schemas/ErrorMessage'
544               example:
545                 status: 401
546                 message: Unauthorized request
547                 details: This request is unauthorized
548         "403":
549           description: Forbidden
550           content:
551             application/json:
552               schema:
553                 $ref: '#/components/schemas/ErrorMessage'
554               example:
555                 status: 403
556                 message: Request Forbidden
557                 details: This request is forbidden
558         "500":
559           description: Internal Server Error
560           content:
561             application/json:
562               schema:
563                 $ref: '#/components/schemas/ErrorMessage'
564               example:
565                 status: 500
566                 message: Internal Server Error
567                 details: Internal Server Error occurred
568   /v1/dataspaces/{dataspace-name}/schema-sets:
569     post:
570       tags:
571       - cps-admin
572       summary: Create a schema set
573       description: Create a new schema set in the given dataspace
574       operationId: createSchemaSet
575       parameters:
576       - name: dataspace-name
577         in: path
578         description: dataspace-name
579         required: true
580         schema:
581           type: string
582           example: my-dataspace
583       - name: schema-set-name
584         in: query
585         description: schema-set-name
586         required: true
587         schema:
588           type: string
589           example: my-schema-set
590       requestBody:
591         content:
592           multipart/form-data:
593             schema:
594               $ref: '#/components/schemas/MultipartFile'
595         required: true
596       responses:
597         "201":
598           description: Created
599           content:
600             text/plain:
601               schema:
602                 type: string
603                 example: my-resource
604         "400":
605           description: Bad Request
606           content:
607             application/json:
608               schema:
609                 $ref: '#/components/schemas/ErrorMessage'
610               example:
611                 status: 400
612                 message: Bad Request
613                 details: The provided request is not valid
614         "401":
615           description: Unauthorized
616           content:
617             application/json:
618               schema:
619                 $ref: '#/components/schemas/ErrorMessage'
620               example:
621                 status: 401
622                 message: Unauthorized request
623                 details: This request is unauthorized
624         "403":
625           description: Forbidden
626           content:
627             application/json:
628               schema:
629                 $ref: '#/components/schemas/ErrorMessage'
630               example:
631                 status: 403
632                 message: Request Forbidden
633                 details: This request is forbidden
634         "409":
635           description: Conflict
636           content:
637             application/json:
638               schema:
639                 $ref: '#/components/schemas/ErrorMessage'
640               example:
641                 status: 409
642                 message: Conflicting request
643                 details: The request cannot be processed as the resource is in use.
644         "500":
645           description: Internal Server Error
646           content:
647             application/json:
648               schema:
649                 $ref: '#/components/schemas/ErrorMessage'
650               example:
651                 status: 500
652                 message: Internal Server Error
653                 details: Internal Server Error occurred
654     get:
655       tags:
656       - cps-admin
657       summary: Get schema sets for a given dataspace
658       description: "Read schema sets for a given dataspace"
659       operationId: getSchemaSets
660       parameters:
661         - name: dataspace-name
662           in: path
663           description: dataspace-name
664           required: true
665           schema:
666             type: string
667             example: my-dataspace
668       responses:
669         "200":
670           description: OK
671           content:
672             application/json:
673               schema:
674                 type: array
675                 items:
676                   $ref: '#/components/schemas/SchemaSetDetails'
677         "400":
678           description: Bad Request
679           content:
680             application/json:
681               schema:
682                 $ref: '#/components/schemas/ErrorMessage'
683               example:
684                 status: 400
685                 message: Bad Request
686                 details: The provided request is not valid
687         "401":
688           description: Unauthorized
689           content:
690             application/json:
691               schema:
692                 $ref: '#/components/schemas/ErrorMessage'
693               example:
694                 status: 401
695                 message: Unauthorized request
696                 details: This request is unauthorized
697         "403":
698           description: Forbidden
699           content:
700             application/json:
701               schema:
702                 $ref: '#/components/schemas/ErrorMessage'
703               example:
704                 status: 403
705                 message: Request Forbidden
706                 details: This request is forbidden
707         "500":
708           description: Internal Server Error
709           content:
710             application/json:
711               schema:
712                 $ref: '#/components/schemas/ErrorMessage'
713               example:
714                 status: 500
715                 message: Internal Server Error
716                 details: Internal Server Error occurred
717   /v1/dataspaces/{dataspace-name}/schema-sets/{schema-set-name}:
718     get:
719       tags:
720       - cps-admin
721       summary: Get a schema set
722       description: Read a schema set given a schema set name and a dataspace
723       operationId: getSchemaSet
724       parameters:
725       - name: dataspace-name
726         in: path
727         description: dataspace-name
728         required: true
729         schema:
730           type: string
731           example: my-dataspace
732       - name: schema-set-name
733         in: path
734         description: schema-set-name
735         required: true
736         schema:
737           type: string
738           example: my-schema-set
739       responses:
740         "200":
741           description: OK
742           content:
743             application/json:
744               schema:
745                 $ref: '#/components/schemas/SchemaSetDetails'
746         "400":
747           description: Bad Request
748           content:
749             application/json:
750               schema:
751                 $ref: '#/components/schemas/ErrorMessage'
752               example:
753                 status: 400
754                 message: Bad Request
755                 details: The provided request is not valid
756         "401":
757           description: Unauthorized
758           content:
759             application/json:
760               schema:
761                 $ref: '#/components/schemas/ErrorMessage'
762               example:
763                 status: 401
764                 message: Unauthorized request
765                 details: This request is unauthorized
766         "403":
767           description: Forbidden
768           content:
769             application/json:
770               schema:
771                 $ref: '#/components/schemas/ErrorMessage'
772               example:
773                 status: 403
774                 message: Request Forbidden
775                 details: This request is forbidden
776         "500":
777           description: Internal Server Error
778           content:
779             application/json:
780               schema:
781                 $ref: '#/components/schemas/ErrorMessage'
782               example:
783                 status: 500
784                 message: Internal Server Error
785                 details: Internal Server Error occurred
786     delete:
787       tags:
788       - cps-admin
789       summary: Delete a schema set
790       description: Delete a schema set given a schema set name and a dataspace
791       operationId: deleteSchemaSet
792       parameters:
793       - name: dataspace-name
794         in: path
795         description: dataspace-name
796         required: true
797         schema:
798           type: string
799           example: my-dataspace
800       - name: schema-set-name
801         in: path
802         description: schema-set-name
803         required: true
804         schema:
805           type: string
806           example: my-schema-set
807       responses:
808         "204":
809           description: No Content
810           content: {}
811         "400":
812           description: Bad Request
813           content:
814             application/json:
815               schema:
816                 $ref: '#/components/schemas/ErrorMessage'
817               example:
818                 status: 400
819                 message: Bad Request
820                 details: The provided request is not valid
821         "401":
822           description: Unauthorized
823           content:
824             application/json:
825               schema:
826                 $ref: '#/components/schemas/ErrorMessage'
827               example:
828                 status: 401
829                 message: Unauthorized request
830                 details: This request is unauthorized
831         "403":
832           description: Forbidden
833           content:
834             application/json:
835               schema:
836                 $ref: '#/components/schemas/ErrorMessage'
837               example:
838                 status: 403
839                 message: Request Forbidden
840                 details: This request is forbidden
841         "409":
842           description: Conflict
843           content:
844             application/json:
845               schema:
846                 $ref: '#/components/schemas/ErrorMessage'
847               example:
848                 status: 409
849                 message: Conflicting request
850                 details: The request cannot be processed as the resource is in use.
851         "500":
852           description: Internal Server Error
853           content:
854             application/json:
855               schema:
856                 $ref: '#/components/schemas/ErrorMessage'
857               example:
858                 status: 500
859                 message: Internal Server Error
860                 details: Internal Server Error occurred
861   /v1/dataspaces/{dataspace-name}/anchors/{anchor-name}/node:
862     get:
863       tags:
864       - cps-data
865       summary: Get a node
866       description: Get a node with an option to retrieve all the children for a given
867         anchor and dataspace
868       operationId: getNodeByDataspaceAndAnchor
869       parameters:
870       - name: dataspace-name
871         in: path
872         description: dataspace-name
873         required: true
874         schema:
875           type: string
876           example: my-dataspace
877       - name: anchor-name
878         in: path
879         description: anchor-name
880         required: true
881         schema:
882           type: string
883           example: my-anchor
884       - name: xpath
885         in: query
886         description: "For more details on xpath, please refer https://docs.onap.org/projects/onap-cps/en/latest/cps-path.html"
887         required: false
888         schema:
889           type: string
890           default: /
891         examples:
892           container xpath:
893             value: /shops/bookstore
894           list attributes xpath:
895             value: "/shops/bookstore/categories[@code=1]"
896       - name: include-descendants
897         in: query
898         description: include-descendants
899         required: false
900         schema:
901           type: boolean
902           example: false
903           default: false
904       responses:
905         "200":
906           description: OK
907           content:
908             application/json:
909               schema:
910                 type: object
911               examples:
912                 dataSample:
913                   $ref: '#/components/examples/dataSample'
914         "400":
915           description: Bad Request
916           content:
917             application/json:
918               schema:
919                 $ref: '#/components/schemas/ErrorMessage'
920               example:
921                 status: 400
922                 message: Bad Request
923                 details: The provided request is not valid
924         "401":
925           description: Unauthorized
926           content:
927             application/json:
928               schema:
929                 $ref: '#/components/schemas/ErrorMessage'
930               example:
931                 status: 401
932                 message: Unauthorized request
933                 details: This request is unauthorized
934         "403":
935           description: Forbidden
936           content:
937             application/json:
938               schema:
939                 $ref: '#/components/schemas/ErrorMessage'
940               example:
941                 status: 403
942                 message: Request Forbidden
943                 details: This request is forbidden
944         "500":
945           description: Internal Server Error
946           content:
947             application/json:
948               schema:
949                 $ref: '#/components/schemas/ErrorMessage'
950               example:
951                 status: 500
952                 message: Internal Server Error
953                 details: Internal Server Error occurred
954       x-codegen-request-body-name: xpath
955   /v1/dataspaces/{dataspace-name}/anchors/{anchor-name}/nodes:
956     put:
957       tags:
958       - cps-data
959       summary: Replace a node with descendants
960       description: "Replace a node with descendants for a given dataspace, anchor\
961         \ and a parent node xpath"
962       operationId: replaceNode
963       parameters:
964       - name: dataspace-name
965         in: path
966         description: dataspace-name
967         required: true
968         schema:
969           type: string
970           example: my-dataspace
971       - name: anchor-name
972         in: path
973         description: anchor-name
974         required: true
975         schema:
976           type: string
977           example: my-anchor
978       - name: xpath
979         in: query
980         description: "For more details on xpath, please refer https://docs.onap.org/projects/onap-cps/en/latest/cps-path.html"
981         required: false
982         schema:
983           type: string
984           default: /
985         examples:
986           container xpath:
987             value: /shops/bookstore
988           list attributes xpath:
989             value: "/shops/bookstore/categories[@code=1]"
990       - name: observed-timestamp
991         in: query
992         description: observed-timestamp
993         required: false
994         schema:
995           type: string
996           example: 2021-03-21T00:10:34.030-0100
997       requestBody:
998         content:
999           application/json:
1000             schema:
1001               type: object
1002             examples:
1003               dataSample:
1004                 $ref: '#/components/examples/dataSample'
1005         required: true
1006       responses:
1007         "200":
1008           description: OK
1009           content:
1010             application/json:
1011               schema:
1012                 type: object
1013               examples:
1014                 dataSample:
1015                   value: ""
1016         "400":
1017           description: Bad Request
1018           content:
1019             application/json:
1020               schema:
1021                 $ref: '#/components/schemas/ErrorMessage'
1022               example:
1023                 status: 400
1024                 message: Bad Request
1025                 details: The provided request is not valid
1026         "401":
1027           description: Unauthorized
1028           content:
1029             application/json:
1030               schema:
1031                 $ref: '#/components/schemas/ErrorMessage'
1032               example:
1033                 status: 401
1034                 message: Unauthorized request
1035                 details: This request is unauthorized
1036         "403":
1037           description: Forbidden
1038           content:
1039             application/json:
1040               schema:
1041                 $ref: '#/components/schemas/ErrorMessage'
1042               example:
1043                 status: 403
1044                 message: Request Forbidden
1045                 details: This request is forbidden
1046         "500":
1047           description: Internal Server Error
1048           content:
1049             application/json:
1050               schema:
1051                 $ref: '#/components/schemas/ErrorMessage'
1052               example:
1053                 status: 500
1054                 message: Internal Server Error
1055                 details: Internal Server Error occurred
1056     post:
1057       tags:
1058       - cps-data
1059       summary: Create a node
1060       description: Create a node for a given anchor and dataspace
1061       operationId: createNode
1062       parameters:
1063       - name: dataspace-name
1064         in: path
1065         description: dataspace-name
1066         required: true
1067         schema:
1068           type: string
1069           example: my-dataspace
1070       - name: anchor-name
1071         in: path
1072         description: anchor-name
1073         required: true
1074         schema:
1075           type: string
1076           example: my-anchor
1077       - name: xpath
1078         in: query
1079         description: "For more details on xpath, please refer https://docs.onap.org/projects/onap-cps/en/latest/cps-path.html"
1080         required: false
1081         schema:
1082           type: string
1083           default: /
1084         examples:
1085           container xpath:
1086             value: /shops/bookstore
1087           list attributes xpath:
1088             value: "/shops/bookstore/categories[@code=1]"
1089       - name: observed-timestamp
1090         in: query
1091         description: observed-timestamp
1092         required: false
1093         schema:
1094           type: string
1095           example: 2021-03-21T00:10:34.030-0100
1096       requestBody:
1097         content:
1098           application/json:
1099             schema:
1100               type: object
1101             examples:
1102               dataSample:
1103                 $ref: '#/components/examples/dataSample'
1104         required: true
1105       responses:
1106         "201":
1107           description: Created
1108           content:
1109             text/plain:
1110               schema:
1111                 type: string
1112                 example: my-resource
1113         "400":
1114           description: Bad Request
1115           content:
1116             application/json:
1117               schema:
1118                 $ref: '#/components/schemas/ErrorMessage'
1119               example:
1120                 status: 400
1121                 message: Bad Request
1122                 details: The provided request is not valid
1123         "401":
1124           description: Unauthorized
1125           content:
1126             application/json:
1127               schema:
1128                 $ref: '#/components/schemas/ErrorMessage'
1129               example:
1130                 status: 401
1131                 message: Unauthorized request
1132                 details: This request is unauthorized
1133         "403":
1134           description: Forbidden
1135           content:
1136             application/json:
1137               schema:
1138                 $ref: '#/components/schemas/ErrorMessage'
1139               example:
1140                 status: 403
1141                 message: Request Forbidden
1142                 details: This request is forbidden
1143         "409":
1144           description: Conflict
1145           content:
1146             application/json:
1147               schema:
1148                 $ref: '#/components/schemas/ErrorMessage'
1149               example:
1150                 status: 409
1151                 message: Conflicting request
1152                 details: The request cannot be processed as the resource is in use.
1153         "500":
1154           description: Internal Server Error
1155           content:
1156             application/json:
1157               schema:
1158                 $ref: '#/components/schemas/ErrorMessage'
1159               example:
1160                 status: 500
1161                 message: Internal Server Error
1162                 details: Internal Server Error occurred
1163     delete:
1164       tags:
1165       - cps-data
1166       summary: Delete a data node
1167       description: Delete a datanode for a given dataspace and anchor given a node
1168         xpath.
1169       operationId: deleteDataNode
1170       parameters:
1171       - name: dataspace-name
1172         in: path
1173         description: dataspace-name
1174         required: true
1175         schema:
1176           type: string
1177           example: my-dataspace
1178       - name: anchor-name
1179         in: path
1180         description: anchor-name
1181         required: true
1182         schema:
1183           type: string
1184           example: my-anchor
1185       - name: xpath
1186         in: query
1187         description: "For more details on xpath, please refer https://docs.onap.org/projects/onap-cps/en/latest/cps-path.html"
1188         required: false
1189         schema:
1190           type: string
1191           default: /
1192         examples:
1193           container xpath:
1194             value: /shops/bookstore
1195           list attributes xpath:
1196             value: "/shops/bookstore/categories[@code=1]"
1197       - name: observed-timestamp
1198         in: query
1199         description: observed-timestamp
1200         required: false
1201         schema:
1202           type: string
1203           example: 2021-03-21T00:10:34.030-0100
1204       responses:
1205         "204":
1206           description: No Content
1207           content: {}
1208         "400":
1209           description: Bad Request
1210           content:
1211             application/json:
1212               schema:
1213                 $ref: '#/components/schemas/ErrorMessage'
1214               example:
1215                 status: 400
1216                 message: Bad Request
1217                 details: The provided request is not valid
1218         "401":
1219           description: Unauthorized
1220           content:
1221             application/json:
1222               schema:
1223                 $ref: '#/components/schemas/ErrorMessage'
1224               example:
1225                 status: 401
1226                 message: Unauthorized request
1227                 details: This request is unauthorized
1228         "403":
1229           description: Forbidden
1230           content:
1231             application/json:
1232               schema:
1233                 $ref: '#/components/schemas/ErrorMessage'
1234               example:
1235                 status: 403
1236                 message: Request Forbidden
1237                 details: This request is forbidden
1238         "500":
1239           description: Internal Server Error
1240           content:
1241             application/json:
1242               schema:
1243                 $ref: '#/components/schemas/ErrorMessage'
1244               example:
1245                 status: 500
1246                 message: Internal Server Error
1247                 details: Internal Server Error occurred
1248     patch:
1249       tags:
1250       - cps-data
1251       summary: Update node leaves
1252       description: Update a data node leaves for a given dataspace and anchor and
1253         a parent node xpath
1254       operationId: updateNodeLeaves
1255       parameters:
1256       - name: dataspace-name
1257         in: path
1258         description: dataspace-name
1259         required: true
1260         schema:
1261           type: string
1262           example: my-dataspace
1263       - name: anchor-name
1264         in: path
1265         description: anchor-name
1266         required: true
1267         schema:
1268           type: string
1269           example: my-anchor
1270       - name: xpath
1271         in: query
1272         description: "For more details on xpath, please refer https://docs.onap.org/projects/onap-cps/en/latest/cps-path.html"
1273         required: false
1274         schema:
1275           type: string
1276           default: /
1277         examples:
1278           container xpath:
1279             value: /shops/bookstore
1280           list attributes xpath:
1281             value: "/shops/bookstore/categories[@code=1]"
1282       - name: observed-timestamp
1283         in: query
1284         description: observed-timestamp
1285         required: false
1286         schema:
1287           type: string
1288           example: 2021-03-21T00:10:34.030-0100
1289       requestBody:
1290         content:
1291           application/json:
1292             schema:
1293               type: object
1294             examples:
1295               dataSample:
1296                 $ref: '#/components/examples/dataSample'
1297         required: true
1298       responses:
1299         "200":
1300           description: OK
1301           content:
1302             application/json:
1303               schema:
1304                 type: object
1305               examples:
1306                 dataSample:
1307                   value: ""
1308         "400":
1309           description: Bad Request
1310           content:
1311             application/json:
1312               schema:
1313                 $ref: '#/components/schemas/ErrorMessage'
1314               example:
1315                 status: 400
1316                 message: Bad Request
1317                 details: The provided request is not valid
1318         "401":
1319           description: Unauthorized
1320           content:
1321             application/json:
1322               schema:
1323                 $ref: '#/components/schemas/ErrorMessage'
1324               example:
1325                 status: 401
1326                 message: Unauthorized request
1327                 details: This request is unauthorized
1328         "403":
1329           description: Forbidden
1330           content:
1331             application/json:
1332               schema:
1333                 $ref: '#/components/schemas/ErrorMessage'
1334               example:
1335                 status: 403
1336                 message: Request Forbidden
1337                 details: This request is forbidden
1338         "500":
1339           description: Internal Server Error
1340           content:
1341             application/json:
1342               schema:
1343                 $ref: '#/components/schemas/ErrorMessage'
1344               example:
1345                 status: 500
1346                 message: Internal Server Error
1347                 details: Internal Server Error occurred
1348   /v1/dataspaces/{dataspace-name}/anchors/{anchor-name}/list-nodes:
1349     put:
1350       tags:
1351       - cps-data
1352       summary: Replace list content
1353       description: "Replace list content under a given parent, anchor and dataspace"
1354       operationId: replaceListContent
1355       parameters:
1356       - name: dataspace-name
1357         in: path
1358         description: dataspace-name
1359         required: true
1360         schema:
1361           type: string
1362           example: my-dataspace
1363       - name: anchor-name
1364         in: path
1365         description: anchor-name
1366         required: true
1367         schema:
1368           type: string
1369           example: my-anchor
1370       - name: xpath
1371         in: query
1372         description: "For more details on xpath, please refer https://docs.onap.org/projects/onap-cps/en/latest/cps-path.html"
1373         required: true
1374         schema:
1375           type: string
1376         examples:
1377           container xpath:
1378             value: /shops/bookstore
1379           list attributes xpath:
1380             value: "/shops/bookstore/categories[@code=1]"
1381       - name: observed-timestamp
1382         in: query
1383         description: observed-timestamp
1384         required: false
1385         schema:
1386           type: string
1387           example: 2021-03-21T00:10:34.030-0100
1388       requestBody:
1389         content:
1390           application/json:
1391             schema:
1392               type: object
1393             examples:
1394               dataSample:
1395                 $ref: '#/components/examples/dataSample'
1396         required: true
1397       responses:
1398         "200":
1399           description: OK
1400           content:
1401             application/json:
1402               schema:
1403                 type: object
1404               examples:
1405                 dataSample:
1406                   value: ""
1407         "400":
1408           description: Bad Request
1409           content:
1410             application/json:
1411               schema:
1412                 $ref: '#/components/schemas/ErrorMessage'
1413               example:
1414                 status: 400
1415                 message: Bad Request
1416                 details: The provided request is not valid
1417         "401":
1418           description: Unauthorized
1419           content:
1420             application/json:
1421               schema:
1422                 $ref: '#/components/schemas/ErrorMessage'
1423               example:
1424                 status: 401
1425                 message: Unauthorized request
1426                 details: This request is unauthorized
1427         "403":
1428           description: Forbidden
1429           content:
1430             application/json:
1431               schema:
1432                 $ref: '#/components/schemas/ErrorMessage'
1433               example:
1434                 status: 403
1435                 message: Request Forbidden
1436                 details: This request is forbidden
1437         "500":
1438           description: Internal Server Error
1439           content:
1440             application/json:
1441               schema:
1442                 $ref: '#/components/schemas/ErrorMessage'
1443               example:
1444                 status: 500
1445                 message: Internal Server Error
1446                 details: Internal Server Error occurred
1447     post:
1448       tags:
1449       - cps-data
1450       summary: Add list element(s)
1451       description: Add list element(s) to a list for a given anchor and dataspace
1452       operationId: addListElements
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: xpath
1469         in: query
1470         description: "For more details on xpath, please refer https://docs.onap.org/projects/onap-cps/en/latest/cps-path.html"
1471         required: true
1472         schema:
1473           type: string
1474         examples:
1475           container xpath:
1476             value: /shops/bookstore
1477           list attributes xpath:
1478             value: "/shops/bookstore/categories[@code=1]"
1479       - name: observed-timestamp
1480         in: query
1481         description: observed-timestamp
1482         required: false
1483         schema:
1484           type: string
1485           example: 2021-03-21T00:10:34.030-0100
1486       requestBody:
1487         content:
1488           application/json:
1489             schema:
1490               type: object
1491             examples:
1492               dataSample:
1493                 $ref: '#/components/examples/dataSample'
1494         required: true
1495       responses:
1496         "201":
1497           description: Created
1498           content:
1499             text/plain:
1500               schema:
1501                 type: string
1502                 example: my-resource
1503         "400":
1504           description: Bad Request
1505           content:
1506             application/json:
1507               schema:
1508                 $ref: '#/components/schemas/ErrorMessage'
1509               example:
1510                 status: 400
1511                 message: Bad Request
1512                 details: The provided request is not valid
1513         "401":
1514           description: Unauthorized
1515           content:
1516             application/json:
1517               schema:
1518                 $ref: '#/components/schemas/ErrorMessage'
1519               example:
1520                 status: 401
1521                 message: Unauthorized request
1522                 details: This request is unauthorized
1523         "403":
1524           description: Forbidden
1525           content:
1526             application/json:
1527               schema:
1528                 $ref: '#/components/schemas/ErrorMessage'
1529               example:
1530                 status: 403
1531                 message: Request Forbidden
1532                 details: This request is forbidden
1533         "500":
1534           description: Internal Server Error
1535           content:
1536             application/json:
1537               schema:
1538                 $ref: '#/components/schemas/ErrorMessage'
1539               example:
1540                 status: 500
1541                 message: Internal Server Error
1542                 details: Internal Server Error occurred
1543     delete:
1544       tags:
1545       - cps-data
1546       summary: Delete one or all list element(s)
1547       description: Delete one or all list element(s) for a given anchor and dataspace
1548       operationId: deleteListOrListElement
1549       parameters:
1550       - name: dataspace-name
1551         in: path
1552         description: dataspace-name
1553         required: true
1554         schema:
1555           type: string
1556           example: my-dataspace
1557       - name: anchor-name
1558         in: path
1559         description: anchor-name
1560         required: true
1561         schema:
1562           type: string
1563           example: my-anchor
1564       - name: xpath
1565         in: query
1566         description: "For more details on xpath, please refer https://docs.onap.org/projects/onap-cps/en/latest/cps-path.html"
1567         required: true
1568         schema:
1569           type: string
1570         examples:
1571           container xpath:
1572             value: /shops/bookstore
1573           list attributes xpath:
1574             value: "/shops/bookstore/categories[@code=1]"
1575       - name: observed-timestamp
1576         in: query
1577         description: observed-timestamp
1578         required: false
1579         schema:
1580           type: string
1581           example: 2021-03-21T00:10:34.030-0100
1582       responses:
1583         "204":
1584           description: No Content
1585           content: {}
1586         "400":
1587           description: Bad Request
1588           content:
1589             application/json:
1590               schema:
1591                 $ref: '#/components/schemas/ErrorMessage'
1592               example:
1593                 status: 400
1594                 message: Bad Request
1595                 details: The provided request is not valid
1596         "401":
1597           description: Unauthorized
1598           content:
1599             application/json:
1600               schema:
1601                 $ref: '#/components/schemas/ErrorMessage'
1602               example:
1603                 status: 401
1604                 message: Unauthorized request
1605                 details: This request is unauthorized
1606         "403":
1607           description: Forbidden
1608           content:
1609             application/json:
1610               schema:
1611                 $ref: '#/components/schemas/ErrorMessage'
1612               example:
1613                 status: 403
1614                 message: Request Forbidden
1615                 details: This request is forbidden
1616         "500":
1617           description: Internal Server Error
1618           content:
1619             application/json:
1620               schema:
1621                 $ref: '#/components/schemas/ErrorMessage'
1622               example:
1623                 status: 500
1624                 message: Internal Server Error
1625                 details: Internal Server Error occurred
1626       deprecated: true
1627   /v1/dataspaces/{dataspace-name}/anchors/{anchor-name}/nodes/query:
1628     get:
1629       tags:
1630       - cps-query
1631       summary: Query data nodes
1632       description: Query data nodes for the given dataspace and anchor using CPS path
1633       operationId: getNodesByDataspaceAndAnchorAndCpsPath
1634       parameters:
1635       - name: dataspace-name
1636         in: path
1637         description: dataspace-name
1638         required: true
1639         schema:
1640           type: string
1641           example: my-dataspace
1642       - name: anchor-name
1643         in: path
1644         description: anchor-name
1645         required: true
1646         schema:
1647           type: string
1648           example: my-anchor
1649       - name: cps-path
1650         in: query
1651         description: "For more details on cps path, please refer https://docs.onap.org/projects/onap-cps/en/latest/cps-path.html"
1652         required: false
1653         schema:
1654           type: string
1655           default: /
1656         examples:
1657           container cps path:
1658             value: //bookstore
1659           list attributes cps path:
1660             value: "//categories[@code=1]"
1661       - name: include-descendants
1662         in: query
1663         description: include-descendants
1664         required: false
1665         schema:
1666           type: boolean
1667           example: false
1668           default: false
1669       responses:
1670         "200":
1671           description: OK
1672           content:
1673             application/json:
1674               schema:
1675                 type: object
1676               examples:
1677                 dataSample:
1678                   $ref: '#/components/examples/dataSample'
1679         "400":
1680           description: Bad Request
1681           content:
1682             application/json:
1683               schema:
1684                 $ref: '#/components/schemas/ErrorMessage'
1685               example:
1686                 status: 400
1687                 message: Bad Request
1688                 details: The provided request is not valid
1689         "401":
1690           description: Unauthorized
1691           content:
1692             application/json:
1693               schema:
1694                 $ref: '#/components/schemas/ErrorMessage'
1695               example:
1696                 status: 401
1697                 message: Unauthorized request
1698                 details: This request is unauthorized
1699         "403":
1700           description: Forbidden
1701           content:
1702             application/json:
1703               schema:
1704                 $ref: '#/components/schemas/ErrorMessage'
1705               example:
1706                 status: 403
1707                 message: Request Forbidden
1708                 details: This request is forbidden
1709         "500":
1710           description: Internal Server Error
1711           content:
1712             application/json:
1713               schema:
1714                 $ref: '#/components/schemas/ErrorMessage'
1715               example:
1716                 status: 500
1717                 message: Internal Server Error
1718                 details: Internal Server Error occurred
1719       x-codegen-request-body-name: xpath
1720 components:
1721   securitySchemes:
1722     basicAuth:
1723       type: http
1724       scheme: basic
1725   schemas:
1726     ErrorMessage:
1727       title: Error
1728       type: object
1729       properties:
1730         status:
1731           type: string
1732         message:
1733           type: string
1734         details:
1735           type: string
1736     AnchorDetails:
1737       title: Anchor details by anchor Name
1738       type: object
1739       properties:
1740         name:
1741           type: string
1742           example: my-anchor
1743         dataspaceName:
1744           type: string
1745           example: my-dataspace
1746         schemaSetName:
1747           type: string
1748           example: my-schema-set
1749     DataspaceDetails:
1750       title: Dataspace details by dataspace Name
1751       type: object
1752       properties:
1753         name:
1754           type: string
1755           example: my-dataspace
1756     MultipartFile:
1757       required:
1758       - file
1759       type: object
1760       properties:
1761         file:
1762           type: string
1763           description: multipartFile
1764           format: binary
1765     SchemaSetDetails:
1766       title: Schema set details by dataspace and schemasetName
1767       required:
1768       - moduleReferences
1769       type: object
1770       properties:
1771         dataspaceName:
1772           type: string
1773           example: my-dataspace
1774         moduleReferences:
1775           type: array
1776           items:
1777             $ref: '#/components/schemas/ModuleReferences'
1778         name:
1779           type: string
1780           example: my-schema-set
1781     ModuleReferences:
1782       title: Module reference object
1783       type: object
1784       properties:
1785         name:
1786           type: string
1787           example: my-module-reference-name
1788         namespace:
1789           type: string
1790           example: my-module-reference-namespace
1791         revision:
1792           type: string
1793           example: my-module-reference-revision
1794   examples:
1795     dataSample:
1796       value:
1797         test:bookstore:
1798           bookstore-name: Chapters
1799           categories:
1800           - code: 1
1801             name: SciFi
1802           - code: 2
1803             name: kids
1804
1805 security:
1806   - basicAuth: []