blob: 0037fd5d9c8e82fb96a801ea959adf9539b8fda9 [file] [log] [blame]
Chenfei Gao55e1f552019-05-21 13:32:30 -04001{
2 "swagger" : "2.0",
3 "basePath" : "/",
4 "tags" : [ {
5 "name" : "Policy"
6 } ],
7 "schemes" : [ "http", "https" ],
8 "paths" : {
9 "/policy/api/v1/policytypes/{policyTypeId}/versions/{policyTypeVersion}/policies" : {
10 "get" : {
11 "tags" : [ "Policy" ],
12 "summary" : "Retrieve all versions of a policy created for a particular policy type version",
13 "description" : "Returns a list of all versions of specified policy created for the specified policy type version",
14 "operationId" : "getAllPolicies",
15 "produces" : [ "application/json" ],
16 "parameters" : [ {
17 "name" : "policyTypeId",
18 "in" : "path",
19 "description" : "ID of policy type",
20 "required" : true,
21 "type" : "string"
22 }, {
23 "name" : "policyTypeVersion",
24 "in" : "path",
25 "description" : "Version of policy type",
26 "required" : true,
27 "type" : "string"
28 }, {
29 "name" : "X-ONAP-RequestID",
30 "in" : "header",
31 "description" : "RequestID for http transaction",
32 "required" : false,
33 "type" : "string",
34 "format" : "uuid"
35 } ],
36 "responses" : {
37 "200" : {
38 "description" : "successful operation; All policies matching specified policy type will be returned.",
39 "headers" : {
40 "X-MinorVersion" : {
41 "type" : "string",
42 "description" : "Used to request or communicate a MINOR version back from the client to the server, and from the server back to the client"
43 },
44 "X-PatchVersion" : {
45 "type" : "string",
46 "description" : "Used only to communicate a PATCH version in a response for troubleshooting purposes only, and will not be provided by the client on request"
47 },
48 "X-LatestVersion" : {
49 "type" : "string",
50 "description" : "Used only to communicate an API's latest version"
51 },
52 "X-ONAP-RequestID" : {
53 "type" : "string",
54 "format" : "uuid",
55 "description" : "Used to track REST transactions for logging purpose"
56 }
57 },
58 "schema" : {
59 "$ref" : "#/definitions/ToscaServiceTemplate"
60 }
61 },
62 "401" : {
63 "description" : "Authentication Error"
64 },
65 "403" : {
66 "description" : "Authorization Error"
67 },
68 "404" : {
69 "description" : "Resource Not Found"
70 },
71 "500" : {
72 "description" : "Internal Server Error"
73 }
74 },
75 "security" : [ {
76 "basicAuth" : [ ]
77 } ],
78 "x-interface info" : {
79 "api-version" : "1.0.0",
80 "last-mod-release" : "Dublin"
81 }
82 },
83 "post" : {
84 "tags" : [ "Policy" ],
85 "summary" : "Create a new policy for a policy type version",
86 "description" : "Create a new policy for a policy type. Client should provide TOSCA body of the new policy",
87 "operationId" : "createPolicy",
88 "consumes" : [ "application/json" ],
89 "produces" : [ "application/json" ],
90 "parameters" : [ {
91 "name" : "policyTypeId",
92 "in" : "path",
93 "description" : "ID of policy type",
94 "required" : true,
95 "type" : "string"
96 }, {
97 "name" : "policyTypeVersion",
98 "in" : "path",
99 "description" : "Version of policy type",
100 "required" : true,
101 "type" : "string"
102 }, {
103 "name" : "X-ONAP-RequestID",
104 "in" : "header",
105 "description" : "RequestID for http transaction",
106 "required" : false,
107 "type" : "string",
108 "format" : "uuid"
109 }, {
110 "in" : "body",
111 "name" : "body",
112 "description" : "Entity body of policy",
113 "required" : true,
114 "type" : "ToscaServiceTemplate",
115 "schema" : {
116 "$ref" : "#/definitions/ToscaServiceTemplate"
117 }
118 } ],
119 "responses" : {
120 "200" : {
121 "description" : "successful operation; Newly created policy matching specified policy type will be returned.",
122 "headers" : {
123 "X-MinorVersion" : {
124 "type" : "string",
125 "description" : "Used to request or communicate a MINOR version back from the client to the server, and from the server back to the client"
126 },
127 "X-PatchVersion" : {
128 "type" : "string",
129 "description" : "Used only to communicate a PATCH version in a response for troubleshooting purposes only, and will not be provided by the client on request"
130 },
131 "X-LatestVersion" : {
132 "type" : "string",
133 "description" : "Used only to communicate an API's latest version"
134 },
135 "X-ONAP-RequestID" : {
136 "type" : "string",
137 "format" : "uuid",
138 "description" : "Used to track REST transactions for logging purpose"
139 }
140 },
141 "schema" : {
142 "$ref" : "#/definitions/ToscaServiceTemplate"
143 }
144 },
145 "400" : {
146 "description" : "Invalid Body"
147 },
148 "401" : {
149 "description" : "Authentication Error"
150 },
151 "403" : {
152 "description" : "Authorization Error"
153 },
154 "404" : {
155 "description" : "Resource Not Found"
156 },
157 "500" : {
158 "description" : "Internal Server Error"
159 }
160 },
161 "security" : [ {
162 "basicAuth" : [ ]
163 } ],
164 "x-interface info" : {
165 "api-version" : "1.0.0",
166 "last-mod-release" : "Dublin"
167 }
168 }
169 },
170 "/policy/api/v1/policytypes/{policyTypeId}/versions/{policyTypeVersion}/policies/{policyId}" : {
171 "get" : {
172 "tags" : [ "Policy" ],
173 "summary" : "Retrieve all version details of a policy created for a particular policy type version",
174 "description" : "Returns a list of all version details of the specified policy",
175 "operationId" : "getAllVersionsOfPolicy",
176 "produces" : [ "application/json" ],
177 "parameters" : [ {
178 "name" : "policyTypeId",
179 "in" : "path",
180 "description" : "ID of policy type",
181 "required" : true,
182 "type" : "string"
183 }, {
184 "name" : "policyTypeVersion",
185 "in" : "path",
186 "description" : "Version of policy type",
187 "required" : true,
188 "type" : "string"
189 }, {
190 "name" : "policyId",
191 "in" : "path",
192 "description" : "ID of policy",
193 "required" : true,
194 "type" : "string"
195 }, {
196 "name" : "X-ONAP-RequestID",
197 "in" : "header",
198 "description" : "RequestID for http transaction",
199 "required" : false,
200 "type" : "string",
201 "format" : "uuid"
202 } ],
203 "responses" : {
204 "200" : {
205 "description" : "successful operation; All versions of specified policy matching specified policy type will be returned.",
206 "headers" : {
207 "X-MinorVersion" : {
208 "type" : "string",
209 "description" : "Used to request or communicate a MINOR version back from the client to the server, and from the server back to the client"
210 },
211 "X-PatchVersion" : {
212 "type" : "string",
213 "description" : "Used only to communicate a PATCH version in a response for troubleshooting purposes only, and will not be provided by the client on request"
214 },
215 "X-LatestVersion" : {
216 "type" : "string",
217 "description" : "Used only to communicate an API's latest version"
218 },
219 "X-ONAP-RequestID" : {
220 "type" : "string",
221 "format" : "uuid",
222 "description" : "Used to track REST transactions for logging purpose"
223 }
224 },
225 "schema" : {
226 "$ref" : "#/definitions/ToscaServiceTemplate"
227 }
228 },
229 "401" : {
230 "description" : "Authentication Error"
231 },
232 "403" : {
233 "description" : "Authorization Error"
234 },
235 "404" : {
236 "description" : "Resource Not Found"
237 },
238 "500" : {
239 "description" : "Internal Server Error"
240 }
241 },
242 "security" : [ {
243 "basicAuth" : [ ]
244 } ],
245 "x-interface info" : {
246 "api-version" : "1.0.0",
247 "last-mod-release" : "Dublin"
248 }
249 }
250 },
251 "/policy/api/v1/policytypes/{policyTypeId}/versions/{policyTypeVersion}/policies/{policyId}/versions/{policyVersion}" : {
252 "get" : {
253 "tags" : [ "Policy" ],
254 "summary" : "Retrieve one version of a policy created for a particular policy type version",
255 "description" : "Returns a particular version of specified policy created for the specified policy type version",
256 "operationId" : "getSpecificVersionOfPolicy",
257 "produces" : [ "application/json" ],
258 "parameters" : [ {
259 "name" : "policyTypeId",
260 "in" : "path",
261 "description" : "ID of policy type",
262 "required" : true,
263 "type" : "string"
264 }, {
265 "name" : "policyTypeVersion",
266 "in" : "path",
267 "description" : "Version of policy type",
268 "required" : true,
269 "type" : "string"
270 }, {
271 "name" : "policyId",
272 "in" : "path",
273 "description" : "ID of policy",
274 "required" : true,
275 "type" : "string"
276 }, {
277 "name" : "policyVersion",
278 "in" : "path",
279 "description" : "Version of policy",
280 "required" : true,
281 "type" : "string"
282 }, {
283 "name" : "X-ONAP-RequestID",
284 "in" : "header",
285 "description" : "RequestID for http transaction",
286 "required" : false,
287 "type" : "string",
288 "format" : "uuid"
289 } ],
290 "responses" : {
291 "200" : {
292 "description" : "successful operation; The specified policy matching specified policy type will be returned.",
293 "headers" : {
294 "X-MinorVersion" : {
295 "type" : "string",
296 "description" : "Used to request or communicate a MINOR version back from the client to the server, and from the server back to the client"
297 },
298 "X-PatchVersion" : {
299 "type" : "string",
300 "description" : "Used only to communicate a PATCH version in a response for troubleshooting purposes only, and will not be provided by the client on request"
301 },
302 "X-LatestVersion" : {
303 "type" : "string",
304 "description" : "Used only to communicate an API's latest version"
305 },
306 "X-ONAP-RequestID" : {
307 "type" : "string",
308 "format" : "uuid",
309 "description" : "Used to track REST transactions for logging purpose"
310 }
311 },
312 "schema" : {
313 "$ref" : "#/definitions/ToscaServiceTemplate"
314 }
315 },
316 "401" : {
317 "description" : "Authentication Error"
318 },
319 "403" : {
320 "description" : "Authorization Error"
321 },
322 "404" : {
323 "description" : "Resource Not Found"
324 },
325 "500" : {
326 "description" : "Internal Server Error"
327 }
328 },
329 "security" : [ {
330 "basicAuth" : [ ]
331 } ],
332 "x-interface info" : {
333 "api-version" : "1.0.0",
334 "last-mod-release" : "Dublin"
335 }
336 },
337 "delete" : {
338 "tags" : [ "Policy" ],
339 "summary" : "Delete a particular version of a policy",
340 "description" : "Delete a particular version of a policy. It must follow one rule. Rule: the version that has been deployed in PDP group(s) cannot be deleted",
341 "operationId" : "deleteSpecificVersionOfPolicy",
342 "produces" : [ "application/json" ],
343 "parameters" : [ {
344 "name" : "policyTypeId",
345 "in" : "path",
346 "description" : "PolicyType ID",
347 "required" : true,
348 "type" : "string"
349 }, {
350 "name" : "policyTypeVersion",
351 "in" : "path",
352 "description" : "Version of policy type",
353 "required" : true,
354 "type" : "string"
355 }, {
356 "name" : "policyId",
357 "in" : "path",
358 "description" : "ID of policy",
359 "required" : true,
360 "type" : "string"
361 }, {
362 "name" : "policyVersion",
363 "in" : "path",
364 "description" : "Version of policy",
365 "required" : true,
366 "type" : "string"
367 }, {
368 "name" : "X-ONAP-RequestID",
369 "in" : "header",
370 "description" : "RequestID for http transaction",
371 "required" : false,
372 "type" : "string",
373 "format" : "uuid"
374 } ],
375 "responses" : {
376 "200" : {
377 "description" : "successful operation; Newly deleted policy matching specified policy type will be returned.",
378 "headers" : {
379 "X-MinorVersion" : {
380 "type" : "string",
381 "description" : "Used to request or communicate a MINOR version back from the client to the server, and from the server back to the client"
382 },
383 "X-PatchVersion" : {
384 "type" : "string",
385 "description" : "Used only to communicate a PATCH version in a response for troubleshooting purposes only, and will not be provided by the client on request"
386 },
387 "X-LatestVersion" : {
388 "type" : "string",
389 "description" : "Used only to communicate an API's latest version"
390 },
391 "X-ONAP-RequestID" : {
392 "type" : "string",
393 "format" : "uuid",
394 "description" : "Used to track REST transactions for logging purpose"
395 }
396 },
397 "schema" : {
398 "$ref" : "#/definitions/ToscaServiceTemplate"
399 }
400 },
401 "401" : {
402 "description" : "Authentication Error"
403 },
404 "403" : {
405 "description" : "Authorization Error"
406 },
407 "404" : {
408 "description" : "Resource Not Found"
409 },
410 "409" : {
411 "description" : "Delete Conflict, Rule Violation"
412 },
413 "500" : {
414 "description" : "Internal Server Error"
415 }
416 },
417 "security" : [ {
418 "basicAuth" : [ ]
419 } ],
420 "x-interface info" : {
421 "api-version" : "1.0.0",
422 "last-mod-release" : "Dublin"
423 }
424 }
425 },
426 "/policy/api/v1/policytypes/{policyTypeId}/versions/{policyTypeVersion}/policies/{policyId}/versions/latest" : {
427 "get" : {
428 "tags" : [ "Policy" ],
429 "summary" : "Retrieve the latest version of a particular policy",
430 "description" : "Returns the latest version of specified policy",
431 "operationId" : "getLatestVersionOfPolicy",
432 "produces" : [ "application/json" ],
433 "parameters" : [ {
434 "name" : "policyTypeId",
435 "in" : "path",
436 "description" : "ID of policy type",
437 "required" : true,
438 "type" : "string"
439 }, {
440 "name" : "policyTypeVersion",
441 "in" : "path",
442 "description" : "Version of policy type",
443 "required" : true,
444 "type" : "string"
445 }, {
446 "name" : "policyId",
447 "in" : "path",
448 "description" : "ID of policy",
449 "required" : true,
450 "type" : "string"
451 }, {
452 "name" : "X-ONAP-RequestID",
453 "in" : "header",
454 "description" : "RequestID for http transaction",
455 "required" : false,
456 "type" : "string",
457 "format" : "uuid"
458 } ],
459 "responses" : {
460 "200" : {
461 "description" : "successful operation; Latest version of specified policy matching specified policy type will be returned.",
462 "headers" : {
463 "X-MinorVersion" : {
464 "type" : "string",
465 "description" : "Used to request or communicate a MINOR version back from the client to the server, and from the server back to the client"
466 },
467 "X-PatchVersion" : {
468 "type" : "string",
469 "description" : "Used only to communicate a PATCH version in a response for troubleshooting purposes only, and will not be provided by the client on request"
470 },
471 "X-LatestVersion" : {
472 "type" : "string",
473 "description" : "Used only to communicate an API's latest version"
474 },
475 "X-ONAP-RequestID" : {
476 "type" : "string",
477 "format" : "uuid",
478 "description" : "Used to track REST transactions for logging purpose"
479 }
480 },
481 "schema" : {
482 "$ref" : "#/definitions/ToscaServiceTemplate"
483 }
484 },
485 "401" : {
486 "description" : "Authentication Error"
487 },
488 "403" : {
489 "description" : "Authorization Error"
490 },
491 "404" : {
492 "description" : "Resource Not Found"
493 },
494 "500" : {
495 "description" : "Internal Server Error"
496 }
497 },
498 "security" : [ {
499 "basicAuth" : [ ]
500 } ],
501 "x-interface info" : {
502 "api-version" : "1.0.0",
503 "last-mod-release" : "Dublin"
504 }
505 }
506 },
507 "/policy/api/v1/policytypes/{policyTypeId}/versions/{policyTypeVersion}/policies/{policyId}/versions/deployed" : {
508 "get" : {
509 "tags" : [ "Policy" ],
510 "summary" : "Retrieve deployed versions of a particular policy in pdp groups",
511 "description" : "Returns deployed versions of specified policy in pdp groups",
512 "operationId" : "getDeployedVersionsOfPolicy",
513 "produces" : [ "application/json" ],
514 "parameters" : [ {
515 "name" : "policyTypeId",
516 "in" : "path",
517 "description" : "ID of policy type",
518 "required" : true,
519 "type" : "string"
520 }, {
521 "name" : "policyTypeVersion",
522 "in" : "path",
523 "description" : "Version of policy type",
524 "required" : true,
525 "type" : "string"
526 }, {
527 "name" : "policyId",
528 "in" : "path",
529 "description" : "ID of policy",
530 "required" : true,
531 "type" : "string"
532 }, {
533 "name" : "X-ONAP-RequestID",
534 "in" : "header",
535 "description" : "RequestID for http transaction",
536 "required" : false,
537 "type" : "string",
538 "format" : "uuid"
539 } ],
540 "responses" : {
541 "200" : {
542 "description" : "successful operation; Deployed versions of specified policy matching specified policy type will be returned.",
543 "headers" : {
544 "X-MinorVersion" : {
545 "type" : "string",
546 "description" : "Used to request or communicate a MINOR version back from the client to the server, and from the server back to the client"
547 },
548 "X-PatchVersion" : {
549 "type" : "string",
550 "description" : "Used only to communicate a PATCH version in a response for troubleshooting purposes only, and will not be provided by the client on request"
551 },
552 "X-LatestVersion" : {
553 "type" : "string",
554 "description" : "Used only to communicate an API's latest version"
555 },
556 "X-ONAP-RequestID" : {
557 "type" : "string",
558 "format" : "uuid",
559 "description" : "Used to track REST transactions for logging purpose"
560 }
561 },
562 "schema" : {
563 "type" : "array",
564 "items" : {
565 "$ref" : "#/definitions/ToscaPolicy"
566 }
567 }
568 },
569 "401" : {
570 "description" : "Authentication Error"
571 },
572 "403" : {
573 "description" : "Authorization Error"
574 },
575 "404" : {
576 "description" : "Resource Not Found"
577 },
578 "500" : {
579 "description" : "Internal Server Error"
580 }
581 },
582 "security" : [ {
583 "basicAuth" : [ ]
584 } ],
585 "x-interface info" : {
586 "api-version" : "1.0.0",
587 "last-mod-release" : "Dublin"
588 }
589 }
590 }
591 },
592 "securityDefinitions" : {
593 "basicAuth" : {
594 "description" : "",
595 "type" : "basic"
596 }
597 },
598 "definitions" : {
599 "ToscaConstraint" : {
600 "type" : "object",
601 "properties" : {
602 "valid_values" : {
603 "type" : "array",
604 "items" : {
605 "type" : "string"
606 }
607 },
608 "equal" : {
609 "type" : "string"
610 },
611 "greater_than" : {
612 "type" : "string"
613 },
614 "greater_or_equal" : {
615 "type" : "string"
616 },
617 "less_than" : {
618 "type" : "string"
619 },
620 "less_or_equal" : {
621 "type" : "string"
622 }
623 }
624 },
625 "ToscaDataType" : {
626 "type" : "object",
627 "properties" : {
628 "name" : {
629 "type" : "string"
630 },
631 "version" : {
632 "type" : "string"
633 },
634 "derived_from" : {
635 "type" : "string"
636 },
637 "metadata" : {
638 "type" : "object",
639 "additionalProperties" : {
640 "type" : "string"
641 }
642 },
643 "description" : {
644 "type" : "string"
645 },
646 "constraints" : {
647 "type" : "array",
648 "items" : {
649 "$ref" : "#/definitions/ToscaConstraint"
650 }
651 },
652 "properties" : {
653 "type" : "object",
654 "additionalProperties" : {
655 "$ref" : "#/definitions/ToscaProperty"
656 }
657 }
658 }
659 },
660 "ToscaEntrySchema" : {
661 "type" : "object",
662 "properties" : {
663 "name" : {
664 "type" : "string"
665 },
666 "type" : {
667 "type" : "string"
668 },
669 "typeVersion" : {
670 "type" : "string"
671 },
672 "description" : {
673 "type" : "string"
674 },
675 "constraints" : {
676 "type" : "array",
677 "items" : {
678 "$ref" : "#/definitions/ToscaConstraint"
679 }
680 }
681 }
682 },
683 "ToscaPolicyType" : {
684 "type" : "object",
685 "properties" : {
686 "name" : {
687 "type" : "string"
688 },
689 "version" : {
690 "type" : "string"
691 },
692 "derived_from" : {
693 "type" : "string"
694 },
695 "metadata" : {
696 "type" : "object",
697 "additionalProperties" : {
698 "type" : "string"
699 }
700 },
701 "description" : {
702 "type" : "string"
703 },
704 "properties" : {
705 "type" : "object",
706 "additionalProperties" : {
707 "$ref" : "#/definitions/ToscaProperty"
708 }
709 }
710 }
711 },
712 "ToscaPolicyTypeIdentifier" : {
713 "type" : "object",
714 "properties" : {
715 "name" : {
716 "type" : "string"
717 },
718 "version" : {
719 "type" : "string"
720 }
721 }
722 },
723 "ToscaProperty" : {
724 "type" : "object",
725 "properties" : {
726 "name" : {
727 "type" : "string"
728 },
729 "type" : {
730 "type" : "string"
731 },
732 "typeVersion" : {
733 "type" : "string"
734 },
735 "description" : {
736 "type" : "string"
737 },
738 "default" : {
739 "type" : "string"
740 },
741 "required" : {
742 "type" : "boolean"
743 },
744 "status" : {
745 "type" : "string",
746 "enum" : [ "SUPPORTED", "UNSUPPORTED", "EXPERIMENTAL", "DEPRECATED" ]
747 },
748 "constraints" : {
749 "type" : "array",
750 "items" : {
751 "$ref" : "#/definitions/ToscaConstraint"
752 }
753 },
754 "entry_schema" : {
755 "$ref" : "#/definitions/ToscaEntrySchema"
756 }
757 }
758 },
759 "ToscaServiceTemplate" : {
760 "type" : "object",
761 "properties" : {
762 "name" : {
763 "type" : "string"
764 },
765 "version" : {
766 "type" : "string"
767 },
768 "derived_from" : {
769 "type" : "string"
770 },
771 "metadata" : {
772 "type" : "object",
773 "additionalProperties" : {
774 "type" : "string"
775 }
776 },
777 "description" : {
778 "type" : "string"
779 },
780 "tosca_definitions_version" : {
781 "type" : "string"
782 },
783 "topology_template" : {
784 "$ref" : "#/definitions/ToscaTopologyTemplate"
785 },
786 "policy_types" : {
787 "type" : "array",
788 "items" : {
789 "type" : "object",
790 "additionalProperties" : {
791 "$ref" : "#/definitions/ToscaPolicyType"
792 }
793 }
794 },
795 "data_types" : {
796 "type" : "array",
797 "items" : {
798 "type" : "object",
799 "additionalProperties" : {
800 "$ref" : "#/definitions/ToscaDataType"
801 }
802 }
803 }
804 }
805 },
806 "ToscaTopologyTemplate" : {
807 "type" : "object",
808 "properties" : {
809 "description" : {
810 "type" : "string"
811 },
812 "policies" : {
813 "type" : "array",
814 "items" : {
815 "type" : "object",
816 "additionalProperties" : {
817 "$ref" : "#/definitions/ToscaPolicy"
818 }
819 }
820 }
821 }
822 }
823 }
824}