blob: 79acd7e7fa883f9b3101797c75f811f103cf3b0b [file] [log] [blame]
Lukasz Rajewski0cfbc572021-02-24 16:51:59 +01001{
2 "swagger": "2.0",
3 "info": {
4 "description": "K8s Plugin v1 API for ONAP Honolulu release",
5 "version": "0.8.0",
6 "title": "K8s Plugin v1 API",
7 "contact": {
8 "email": "ritu.sood@intel.com"
9 }
10 },
11 "host": "multicloud-k8s:9015",
12 "basePath": "/v1",
13 "tags": [
14 {
15 "name": "definition",
16 "description": "RB Definition management"
17 },
18 {
19 "name": "profile",
20 "description": "RB Definition profile management"
21 },
22 {
23 "name": "instance",
24 "description": "RB Instance management"
25 }
26 ],
27 "schemes": [
28 "http"
29 ],
30 "paths": {
31 "/rb/definition": {
32 "post": {
33 "tags": [
34 "definition"
35 ],
36 "summary": "Add a new RB Definition",
37 "description": "",
38 "operationId": "addRbDefinition",
39 "consumes": [
40 "application/json"
41 ],
42 "produces": [
43 "application/json"
44 ],
45 "parameters": [
46 {
47 "in": "body",
48 "name": "body",
49 "description": "RB Definition object to create",
50 "required": true,
51 "schema": {
52 "$ref": "#/definitions/RbDefinition"
53 }
54 }
55 ],
56 "responses": {
57 "200": {
58 "description": "successful operation",
59 "schema": {
60 "type": "array",
61 "items": {
62 "$ref": "#/definitions/RbDefinition"
63 }
64 }
65 },
66 "405": {
67 "description": "Invalid input"
68 }
69 }
70 },
71 "get": {
72 "tags": [
73 "definition"
74 ],
75 "summary": "Get all RB Definitions",
76 "description": "Multiple RB Definitions",
77 "operationId": "getRbDefinitions",
78 "produces": [
79 "application/json"
80 ],
81 "responses": {
82 "200": {
83 "description": "successful operation",
84 "schema": {
85 "type": "array",
86 "items": {
87 "$ref": "#/definitions/RbDefinition"
88 }
89 }
90 },
91 "400": {
92 "description": "Invalid status value"
93 }
94 }
95 }
96 },
97 "/rb/definition/{rbName}": {
98 "get": {
99 "tags": [
100 "definition"
101 ],
102 "summary": "Get all RB Definitions of specified name",
103 "description": "Multiple RB Definitions",
104 "operationId": "getRbDefinitionsByName",
105 "produces": [
106 "application/json"
107 ],
108 "parameters": [
109 {
110 "name": "rbName",
111 "in": "path",
112 "description": "Name of the RB Definition to return",
113 "required": true,
114 "type": "string"
115 }
116 ],
117 "responses": {
118 "200": {
119 "description": "successful operation",
120 "schema": {
121 "type": "array",
122 "items": {
123 "$ref": "#/definitions/RbDefinition"
124 }
125 }
126 },
127 "400": {
128 "description": "Invalid status value"
129 }
130 }
131 },
132 "delete": {
133 "tags": [
134 "definition"
135 ],
136 "summary": "Deletes RB Definitions of specified RB Name",
137 "description": "",
138 "operationId": "deleteRbDefinitionsByRbName",
139 "produces": [
140 "application/json"
141 ],
142 "parameters": [
143 {
144 "name": "rbName",
145 "in": "path",
146 "description": "Name of the RB Definition to return",
147 "required": true,
148 "type": "string"
149 }
150 ],
151 "responses": {
152 "400": {
153 "description": "Invalid identifiers supplied"
154 },
155 "404": {
156 "description": "RB Definition not found"
157 }
158 }
159 }
160 },
161 "/rb/definition/{rbName}/{rbVersion}": {
162 "get": {
163 "tags": [
164 "definition"
165 ],
166 "summary": "Get RB Definition by Name and Version",
167 "description": "Returns a single RB Definition object",
168 "operationId": "getRbDefinitionByRbName",
169 "produces": [
170 "application/json"
171 ],
172 "parameters": [
173 {
174 "name": "rbName",
175 "in": "path",
176 "description": "Name of the RB Definition to return",
177 "required": true,
178 "type": "string"
179 },
180 {
181 "name": "rbVersion",
182 "in": "path",
183 "description": "Version of the RB Definition to return",
184 "required": true,
185 "type": "string"
186 }
187 ],
188 "responses": {
189 "200": {
190 "description": "successful operation",
191 "schema": {
192 "$ref": "#/definitions/RbDefinition"
193 }
194 },
195 "400": {
196 "description": "Invalid identifiers supplied"
197 },
198 "404": {
199 "description": "RB Definition not found"
200 }
201 }
202 },
203 "delete": {
204 "tags": [
205 "definition"
206 ],
207 "summary": "Deletes RB Definition",
208 "description": "",
209 "operationId": "deleteRbDefinitionByRbNameAndRbVersion",
210 "produces": [
211 "application/json"
212 ],
213 "parameters": [
214 {
215 "name": "rbName",
216 "in": "path",
217 "description": "Name of the RB Definition to return",
218 "required": true,
219 "type": "string"
220 },
221 {
222 "name": "rbVersion",
223 "in": "path",
224 "description": "Version of the RB Definition to return",
225 "required": true,
226 "type": "string"
227 }
228 ],
229 "responses": {
230 "400": {
231 "description": "Invalid identifiers supplied"
232 },
233 "404": {
234 "description": "RB Definition not found"
235 }
236 }
237 }
238 },
239 "/rb/definition/{rbName}/{rbVersion}/content": {
240 "post": {
241 "tags": [
242 "definition"
243 ],
244 "summary": "Uploads Helm package associated with RB Definition",
245 "description": "",
246 "operationId": "uploadRbDefnitionContent",
247 "consumes": [
248 "application/gzip"
249 ],
250 "produces": [
251 "application/json"
252 ],
253 "parameters": [
254 {
255 "name": "rbName",
256 "in": "path",
257 "description": "Name of the RB Definition to return",
258 "required": true,
259 "type": "string"
260 },
261 {
262 "name": "rbVersion",
263 "in": "path",
264 "description": "Version of the RB Definition to return",
265 "required": true,
266 "type": "string"
267 }
268 ],
269 "responses": {
270 "200": {
271 "description": "successful operation",
272 "schema": {
273 "$ref": "#/definitions/ApiResponse"
274 }
275 }
276 }
277 }
278 },
279 "/rb/definition/{rbName}/{rbVersion}/profile": {
280 "post": {
281 "tags": [
282 "profile"
283 ],
284 "summary": "Add a new profile for RB Definition",
285 "description": "",
286 "operationId": "addProfileForDefinition",
287 "consumes": [
288 "application/json"
289 ],
290 "produces": [
291 "application/json"
292 ],
293 "parameters": [
294 {
295 "name": "rbName",
296 "in": "path",
297 "description": "Name of the RB Definition to return",
298 "required": true,
299 "type": "string"
300 },
301 {
302 "name": "rbVersion",
303 "in": "path",
304 "description": "Version of the RB Definition to return",
305 "required": true,
306 "type": "string"
307 },
308 {
309 "in": "body",
310 "name": "body",
311 "description": "RB Profile object to create",
312 "required": true,
313 "schema": {
314 "$ref": "#/definitions/RbProfile"
315 }
316 }
317 ],
318 "responses": {
319 "200": {
320 "description": "successful operation",
321 "schema": {
322 "type": "array",
323 "items": {
324 "$ref": "#/definitions/RbProfile"
325 }
326 }
327 },
328 "405": {
329 "description": "Invalid input"
330 }
331 }
332 },
333 "get": {
334 "tags": [
335 "profile"
336 ],
337 "summary": "Get all RB Profiles for RB Definition",
338 "description": "Multiple RB Definitions",
339 "operationId": "getProfilesforRbDefinitions",
340 "produces": [
341 "application/json"
342 ],
343 "parameters": [
344 {
345 "name": "rbName",
346 "in": "path",
347 "description": "Name of the RB Definition to return",
348 "required": true,
349 "type": "string"
350 },
351 {
352 "name": "rbVersion",
353 "in": "path",
354 "description": "Version of the RB Definition to return",
355 "required": true,
356 "type": "string"
357 }
358 ],
359 "responses": {
360 "200": {
361 "description": "successful operation",
362 "schema": {
363 "type": "array",
364 "items": {
365 "$ref": "#/definitions/RbProfile"
366 }
367 }
368 },
369 "400": {
370 "description": "Invalid status value"
371 }
372 }
373 }
374 },
375 "/rb/definition/{rbName}/{rbVersion}/profile/{profileName}": {
376 "get": {
377 "tags": [
378 "profile"
379 ],
380 "summary": "Get RB Profile by Name",
381 "description": "Returns a single RB Profile object",
382 "operationId": "getRbProfileForRbDefinition",
383 "produces": [
384 "application/json"
385 ],
386 "parameters": [
387 {
388 "name": "rbName",
389 "in": "path",
390 "description": "Name of the RB Definition to return",
391 "required": true,
392 "type": "string"
393 },
394 {
395 "name": "rbVersion",
396 "in": "path",
397 "description": "Version of the RB Definition to return",
398 "required": true,
399 "type": "string"
400 },
401 {
402 "name": "profileName",
403 "in": "path",
404 "description": "Name of the RB profile",
405 "required": true,
406 "type": "string"
407 }
408 ],
409 "responses": {
410 "200": {
411 "description": "successful operation",
412 "schema": {
413 "$ref": "#/definitions/RbProfile"
414 }
415 },
416 "400": {
417 "description": "Invalid identifiers supplied"
418 },
419 "404": {
420 "description": "RB Profile not found"
421 }
422 }
423 },
424 "delete": {
425 "tags": [
426 "profile"
427 ],
428 "summary": "Deletes RB Profile",
429 "description": "",
430 "operationId": "deleteRbProfileForRbDefinition",
431 "produces": [
432 "application/json"
433 ],
434 "parameters": [
435 {
436 "name": "rbName",
437 "in": "path",
438 "description": "Name of the RB Definition",
439 "required": true,
440 "type": "string"
441 },
442 {
443 "name": "rbVersion",
444 "in": "path",
445 "description": "Version of the RB Definition",
446 "required": true,
447 "type": "string"
448 },
449 {
450 "name": "profileName",
451 "in": "path",
452 "description": "Name of the RB profile",
453 "required": true,
454 "type": "string"
455 }
456 ],
457 "responses": {
458 "400": {
459 "description": "Invalid identifiers supplied"
460 },
461 "404": {
462 "description": "RB Definition of RB profile not found"
463 }
464 }
465 }
466 },
467 "/rb/definition/{rbName}/{rbVersion}/profile/{profileName}/content": {
468 "post": {
469 "tags": [
470 "profile"
471 ],
472 "summary": "Uploads tgz package associated with RB Profile",
473 "description": "",
474 "operationId": "uploadRbProfileContent",
475 "consumes": [
476 "application/gzip"
477 ],
478 "produces": [
479 "application/json"
480 ],
481 "parameters": [
482 {
483 "name": "rbName",
484 "in": "path",
485 "description": "Name of the RB Definition",
486 "required": true,
487 "type": "string"
488 },
489 {
490 "name": "rbVersion",
491 "in": "path",
492 "description": "Version of the RB Definition",
493 "required": true,
494 "type": "string"
495 },
496 {
497 "name": "profileName",
498 "in": "path",
499 "description": "Name of the RB profile",
500 "required": true,
501 "type": "string"
502 }
503 ],
504 "responses": {
505 "200": {
506 "description": "successful operation",
507 "schema": {
508 "$ref": "#/definitions/ApiResponse"
509 }
510 }
511 }
512 }
513 },
514 "/instance": {
515 "post": {
516 "tags": [
517 "instance"
518 ],
519 "summary": "Create new RB Instance",
520 "description": "",
521 "operationId": "createRbInstance",
522 "consumes": [
523 "application/json"
524 ],
525 "produces": [
526 "application/json"
527 ],
528 "parameters": [
529 {
530 "in": "body",
531 "name": "body",
532 "description": "RB Instance properties to create",
533 "required": true,
534 "schema": {
535 "$ref": "#/definitions/RbInstanceRequest"
536 }
537 }
538 ],
539 "responses": {
540 "405": {
541 "description": "Invalid input"
542 }
543 }
544 },
545 "get": {
546 "tags": [
547 "instance"
548 ],
549 "summary": "Get all RB Instances",
550 "description": "Multiple RB Instances",
551 "operationId": "getRbInstances",
552 "produces": [
553 "application/json"
554 ],
555 "responses": {
556 "200": {
557 "description": "successful operation",
558 "schema": {
559 "type": "array",
560 "items": {
561 "$ref": "#/definitions/RbInstance"
562 }
563 }
564 },
565 "400": {
566 "description": "Invalid status value"
567 }
568 }
569 }
570 },
571 "/instance/{instanceId}": {
572 "get": {
573 "tags": [
574 "instance"
575 ],
576 "summary": "Get RB Instance by ID",
577 "description": "Returns a single RB Instance object",
578 "operationId": "getRbInstanceById",
579 "produces": [
580 "application/json"
581 ],
582 "parameters": [
583 {
584 "name": "instanceId",
585 "in": "path",
586 "description": "ID of the instance",
587 "required": true,
588 "type": "string"
589 }
590 ],
591 "responses": {
592 "200": {
593 "description": "successful operation",
594 "schema": {
595 "$ref": "#/definitions/RbInstance"
596 }
597 },
598 "400": {
599 "description": "Invalid identifiers supplied"
600 },
601 "404": {
602 "description": "RB Definition not found"
603 }
604 }
605 },
606 "delete": {
607 "tags": [
608 "instance"
609 ],
610 "summary": "Deletes RB Instance",
611 "description": "",
612 "operationId": "deleteRbInstanceById",
613 "produces": [
614 "application/json"
615 ],
616 "parameters": [
617 {
618 "name": "instanceId",
619 "in": "path",
620 "description": "ID of the instance",
621 "required": true,
622 "type": "string"
623 }
624 ],
625 "responses": {
626 "400": {
627 "description": "Invalid identifiers supplied"
628 },
629 "404": {
630 "description": "Rb Instance not found"
631 }
632 }
633 }
634 },
635 "/instance/{instanceId}/status": {
636 "get": {
637 "tags": [
638 "instance"
639 ],
640 "summary": "Get RB Instance Status",
641 "description": "Returns status of a single RB Instance object",
642 "operationId": "getRbInstanceStatus",
643 "produces": [
644 "application/json"
645 ],
646 "parameters": [
647 {
648 "name": "instanceId",
649 "in": "path",
650 "description": "ID of the instance",
651 "required": true,
652 "type": "string"
653 }
654 ],
655 "responses": {
656 "200": {
657 "description": "successful operation",
658 "schema": {
659 "$ref": "#/definitions/RbInstanceStatus"
660 }
661 },
662 "400": {
663 "description": "Invalid identifiers supplied"
664 },
665 "404": {
666 "description": "RB Instance not found"
667 }
668 }
669 }
670 },
671 "/instance/{instanceId}/query": {
672 "get": {
673 "tags": [
674 "instance"
675 ],
676 "summary": "Get filtered out RB Instance status",
677 "description": "Returns filtered status of a single RB Instance object",
678 "operationId": "queryRbInstanceStatus",
679 "produces": [
680 "application/json"
681 ],
682 "parameters": [
683 {
684 "name": "instanceId",
685 "in": "path",
686 "description": "ID of the instance",
687 "required": true,
688 "type": "string"
689 },
690 {
691 "in": "query",
692 "name": "ApiVersion",
693 "type": "string",
694 "description": "Resource ApiVersion like 'apps/v1'",
695 "required": true
696 },
697 {
698 "in": "query",
699 "name": "Kind",
700 "type": "string",
701 "description": "Resource Kind like 'Deployment'",
702 "required": true
703 },
704 {
705 "in": "query",
706 "name": "Name",
707 "type": "string",
708 "description": "Name of Resource like 'my-pod-1'",
709 "required": false
710 },
711 {
712 "in": "query",
713 "name": "Labels",
714 "type": "string",
715 "description": "One or many pairs of label name/value data for filtering Resources like 'app=test,version=prod'",
716 "required": false
717 }
718 ],
719 "responses": {
720 "200": {
721 "description": "successful operation",
722 "schema": {
723 "$ref": "#/definitions/RbInstanceStatus"
724 }
725 },
726 "400": {
727 "description": "Invalid identifiers supplied"
728 },
729 "404": {
730 "description": "RB Instance not found"
731 }
732 }
733 }
734 }
735 },
736 "definitions": {
737 "RbDefinition": {
738 "type": "object",
739 "properties": {
740 "rb-name": {
741 "type": "string"
742 },
743 "rb-version": {
744 "type": "string"
745 },
746 "chart-name": {
747 "type": "string"
748 },
749 "description": {
750 "type": "string"
751 },
752 "labels": {
753 "type": "array",
754 "items": {
755 "type": "string"
756 }
757 }
758 },
759 "example": {
760 "rb-name": "test",
761 "rb-version": "v1",
762 "chart-name": "nginx",
763 "description": "nginx definition",
764 "labels": [
765 "some label"
766 ]
767 }
768 },
769 "RbProfile": {
770 "type": "object",
771 "properties": {
772 "rb-name": {
773 "type": "string"
774 },
775 "rb-version": {
776 "type": "string"
777 },
778 "profile-name": {
779 "type": "string"
780 },
781 "release-name": {
782 "type": "string"
783 },
784 "namespace": {
785 "type": "string"
786 },
787 "kubernetes-version": {
788 "type": "string"
789 }
790 },
791 "example": {
792 "rb-name": "test",
793 "rb-version": "v1",
794 "profile-name": "p1",
795 "release-name": "r1",
796 "namespace": "default",
797 "kubernetes-version": "12.0.1"
798 }
799 },
800 "RbInstance": {
801 "type": "object",
802 "properties": {
803 "id": {
804 "type": "string"
805 },
806 "release-name": {
807 "type": "string"
808 },
809 "namespace": {
810 "type": "string"
811 },
812 "request": {
813 "$ref": "#/definitions/RbInstanceRequest"
814 },
815 "resources": {
816 "type": "array",
817 "items": {
818 "$ref": "#/definitions/RbInstanceResource"
819 }
820 }
821 }
822 },
823 "RbInstanceStatus": {
824 "type": "object",
825 "properties": {
826 "ready": {
827 "type": "boolean"
828 },
829 "request": {
830 "$ref": "#/definitions/RbInstanceRequest"
831 },
832 "resourcesCount": {
833 "type": "integer"
834 },
835 "resourcesStatus": {
836 "type": "array",
837 "items": {
838 "$ref": "#/definitions/RbInstanceResourceStatus"
839 }
840 }
841 }
842 },
843 "RbInstanceResource": {
844 "type": "object",
845 "properties": {
846 "Name": {
847 "type": "string"
848 },
849 "GVK": {
850 "$ref": "#/definitions/GVK"
851 }
852 },
853 "example": {
854 "GVK": {
855 "Group": "apps",
856 "Kind": "Deployment",
857 "Version": "v1"
858 },
859 "Name": "test-dep"
860 }
861 },
862 "RbInstanceResourceStatus": {
863 "type": "object",
864 "properties": {
865 "name": {
866 "type": "string"
867 },
868 "GVK": {
869 "$ref": "#/definitions/GVK"
870 },
871 "status": {
872 "type": "object"
873 }
874 },
875 "example": {
876 "GVK": {
877 "Group": "apps",
878 "Kind": "Deployment",
879 "Version": "v1"
880 },
881 "Name": "test-dep"
882 }
883 },
884 "GVK": {
885 "type": "object",
886 "properties": {
887 "Group": {
888 "type": "string"
889 },
890 "Version": {
891 "type": "string"
892 },
893 "Kind": {
894 "type": "string"
895 }
896 },
897 "example": {
898 "Group": "apps",
899 "Version": "v1",
900 "Kind": "Deployment"
901 }
902 },
903 "RbInstanceRequest": {
904 "type": "object",
905 "properties": {
906 "rb-name": {
907 "type": "string"
908 },
909 "rb-version": {
910 "type": "string"
911 },
912 "profile-name": {
913 "type": "string"
914 },
915 "release-name": {
916 "type": "string"
917 },
918 "cloud-region": {
919 "type": "string"
920 },
921 "labels": {
922 "type": "object"
923 },
924 "override-values": {
925 "type": "object"
926 }
927 },
928 "example": {
929 "cloud-region": "kus",
930 "profile-name": "p1",
931 "release-name": "release-x",
932 "rb-name": "test",
933 "rb-version": "v1",
934 "override-parameters": {
935 "optionalDictOfParameters": "andTheirValues, like",
936 "global.name": "dummy-name"
937 },
938 "labels": {
939 "optionalLabelForInternalK8spluginInstancesMetadata": "dummy-value"
940 }
941 }
942 },
943 "ApiResponse": {
944 "type": "string"
945 }
946 },
947 "externalDocs": {
948 "description": "K8s Plugin v1 API - ONAP wiki",
949 "url": "https://wiki.onap.org/display/DW/MultiCloud+K8s-Plugin-service+API"
950 }
951}