627f318e06f24e81bff5ebcf10e9cf781ce33530
[policy/parent.git] / docs / api / swagger / policytype-api.json
1 {
2   "swagger" : "2.0",
3   "basePath" : "/",
4   "tags" : [ {
5     "name" : "PolicyType"
6   } ],
7   "schemes" : [ "http", "https" ],
8   "paths" : {
9     "/policy/api/v1/policytypes" : {
10       "get" : {
11         "tags" : [ "PolicyType" ],
12         "summary" : "Retrieve existing policy types",
13         "description" : "Returns a list of existing policy types stored in Policy Framework",
14         "operationId" : "getAllPolicyTypes",
15         "produces" : [ "application/json", "application/yaml" ],
16         "parameters" : [ {
17           "name" : "X-ONAP-RequestID",
18           "in" : "header",
19           "description" : "RequestID for http transaction",
20           "required" : false,
21           "type" : "string",
22           "format" : "uuid"
23         } ],
24         "responses" : {
25           "200" : {
26             "description" : "successful operation; All policy types will be returned.",
27             "headers" : {
28               "X-MinorVersion" : {
29                 "type" : "string",
30                 "description" : "Used to request or communicate a MINOR version back from the client to the server, and from the server back to the client"
31               },
32               "X-PatchVersion" : {
33                 "type" : "string",
34                 "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"
35               },
36               "X-LatestVersion" : {
37                 "type" : "string",
38                 "description" : "Used only to communicate an API's latest version"
39               },
40               "X-ONAP-RequestID" : {
41                 "type" : "string",
42                 "format" : "uuid",
43                 "description" : "Used to track REST transactions for logging purpose"
44               }
45             },
46             "schema" : {
47               "$ref" : "#/definitions/ToscaServiceTemplate"
48             }
49           },
50           "401" : {
51             "description" : "Authentication Error"
52           },
53           "403" : {
54             "description" : "Authorization Error"
55           },
56           "500" : {
57             "description" : "Internal Server Error"
58           }
59         },
60         "security" : [ {
61           "basicAuth" : [ ]
62         } ],
63         "x-interface info" : {
64           "api-version" : "1.0.0",
65           "last-mod-release" : "Dublin"
66         }
67       },
68       "post" : {
69         "tags" : [ "PolicyType" ],
70         "summary" : "Create a new policy type",
71         "description" : "Create a new policy type. Client should provide TOSCA body of the new policy type",
72         "operationId" : "createPolicyType",
73         "consumes" : [ "application/json", "application/yaml" ],
74         "produces" : [ "application/json", "application/yaml" ],
75         "parameters" : [ {
76           "in" : "body",
77           "name" : "body",
78           "description" : "Entity body of policy type",
79           "required" : true,
80           "type" : "ToscaServiceTemplate",
81           "schema" : {
82             "$ref" : "#/definitions/ToscaServiceTemplate"
83           }
84         }, {
85           "name" : "X-ONAP-RequestID",
86           "in" : "header",
87           "description" : "RequestID for http transaction",
88           "required" : false,
89           "type" : "string",
90           "format" : "uuid"
91         } ],
92         "responses" : {
93           "200" : {
94             "description" : "successful operation; The newly created policy type will be returned.",
95             "headers" : {
96               "X-MinorVersion" : {
97                 "type" : "string",
98                 "description" : "Used to request or communicate a MINOR version back from the client to the server, and from the server back to the client"
99               },
100               "X-PatchVersion" : {
101                 "type" : "string",
102                 "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"
103               },
104               "X-LatestVersion" : {
105                 "type" : "string",
106                 "description" : "Used only to communicate an API's latest version"
107               },
108               "X-ONAP-RequestID" : {
109                 "type" : "string",
110                 "format" : "uuid",
111                 "description" : "Used to track REST transactions for logging purpose"
112               }
113             },
114             "schema" : {
115               "$ref" : "#/definitions/ToscaServiceTemplate"
116             }
117           },
118           "400" : {
119             "description" : "Invalid Body"
120           },
121           "401" : {
122             "description" : "Authentication Error"
123           },
124           "403" : {
125             "description" : "Authorization Error"
126           },
127           "406" : {
128             "description" : "Not Acceptable Version"
129           },
130           "500" : {
131             "description" : "Internal Server Error"
132           }
133         },
134         "security" : [ {
135           "basicAuth" : [ ]
136         } ],
137         "x-interface info" : {
138           "api-version" : "1.0.0",
139           "last-mod-release" : "Dublin"
140         }
141       }
142     },
143     "/policy/api/v1/policytypes/{policyTypeId}" : {
144       "get" : {
145         "tags" : [ "PolicyType" ],
146         "summary" : "Retrieve all available versions of a policy type",
147         "description" : "Returns a list of all available versions for the specified policy type",
148         "operationId" : "getAllVersionsOfPolicyType",
149         "produces" : [ "application/json", "application/yaml" ],
150         "parameters" : [ {
151           "name" : "policyTypeId",
152           "in" : "path",
153           "description" : "ID of policy type",
154           "required" : true,
155           "type" : "string"
156         }, {
157           "name" : "X-ONAP-RequestID",
158           "in" : "header",
159           "description" : "RequestID for http transaction",
160           "required" : false,
161           "type" : "string",
162           "format" : "uuid"
163         } ],
164         "responses" : {
165           "200" : {
166             "description" : "successful operation; All versions of specified policy type will be returned.",
167             "headers" : {
168               "X-MinorVersion" : {
169                 "type" : "string",
170                 "description" : "Used to request or communicate a MINOR version back from the client to the server, and from the server back to the client"
171               },
172               "X-PatchVersion" : {
173                 "type" : "string",
174                 "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"
175               },
176               "X-LatestVersion" : {
177                 "type" : "string",
178                 "description" : "Used only to communicate an API's latest version"
179               },
180               "X-ONAP-RequestID" : {
181                 "type" : "string",
182                 "format" : "uuid",
183                 "description" : "Used to track REST transactions for logging purpose"
184               }
185             },
186             "schema" : {
187               "$ref" : "#/definitions/ToscaServiceTemplate"
188             }
189           },
190           "401" : {
191             "description" : "Authentication Error"
192           },
193           "403" : {
194             "description" : "Authorization Error"
195           },
196           "404" : {
197             "description" : "Resource Not Found"
198           },
199           "500" : {
200             "description" : "Internal Server Error"
201           }
202         },
203         "security" : [ {
204           "basicAuth" : [ ]
205         } ],
206         "x-interface info" : {
207           "api-version" : "1.0.0",
208           "last-mod-release" : "Dublin"
209         }
210       }
211     },
212     "/policy/api/v1/policytypes/{policyTypeId}/versions/{versionId}" : {
213       "get" : {
214         "tags" : [ "PolicyType" ],
215         "summary" : "Retrieve one particular version of a policy type",
216         "description" : "Returns a particular version for the specified policy type",
217         "operationId" : "getSpecificVersionOfPolicyType",
218         "produces" : [ "application/json", "application/yaml" ],
219         "parameters" : [ {
220           "name" : "policyTypeId",
221           "in" : "path",
222           "description" : "ID of policy type",
223           "required" : true,
224           "type" : "string"
225         }, {
226           "name" : "versionId",
227           "in" : "path",
228           "description" : "Version of policy type",
229           "required" : true,
230           "type" : "string"
231         }, {
232           "name" : "X-ONAP-RequestID",
233           "in" : "header",
234           "description" : "RequestID for http transaction",
235           "required" : false,
236           "type" : "string",
237           "format" : "uuid"
238         } ],
239         "responses" : {
240           "200" : {
241             "description" : "successful operation; One specified version of specified policy type will be returned.",
242             "headers" : {
243               "X-MinorVersion" : {
244                 "type" : "string",
245                 "description" : "Used to request or communicate a MINOR version back from the client to the server, and from the server back to the client"
246               },
247               "X-PatchVersion" : {
248                 "type" : "string",
249                 "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"
250               },
251               "X-LatestVersion" : {
252                 "type" : "string",
253                 "description" : "Used only to communicate an API's latest version"
254               },
255               "X-ONAP-RequestID" : {
256                 "type" : "string",
257                 "format" : "uuid",
258                 "description" : "Used to track REST transactions for logging purpose"
259               }
260             },
261             "schema" : {
262               "$ref" : "#/definitions/ToscaServiceTemplate"
263             }
264           },
265           "401" : {
266             "description" : "Authentication Error"
267           },
268           "403" : {
269             "description" : "Authorization Error"
270           },
271           "404" : {
272             "description" : "Resource Not Found"
273           },
274           "500" : {
275             "description" : "Internal Server Error"
276           }
277         },
278         "security" : [ {
279           "basicAuth" : [ ]
280         } ],
281         "x-interface info" : {
282           "api-version" : "1.0.0",
283           "last-mod-release" : "Dublin"
284         }
285       },
286       "delete" : {
287         "tags" : [ "PolicyType" ],
288         "summary" : "Delete one version of a policy type",
289         "description" : "Delete one version of a policy type. It must follow two rules. Rule 1: pre-defined policy types cannot be deleted; Rule 2: policy types that are in use (parameterized by a TOSCA policy) cannot be deleted. The parameterizing TOSCA policies must be deleted first.",
290         "operationId" : "deleteSpecificVersionOfPolicyType",
291         "produces" : [ "application/json", "application/yaml" ],
292         "parameters" : [ {
293           "name" : "policyTypeId",
294           "in" : "path",
295           "description" : "ID of policy type",
296           "required" : true,
297           "type" : "string"
298         }, {
299           "name" : "versionId",
300           "in" : "path",
301           "description" : "Version of policy type",
302           "required" : true,
303           "type" : "string"
304         }, {
305           "name" : "X-ONAP-RequestID",
306           "in" : "header",
307           "description" : "RequestID for http transaction",
308           "required" : false,
309           "type" : "string",
310           "format" : "uuid"
311         } ],
312         "responses" : {
313           "200" : {
314             "description" : "successful operation; Newly deleted policy type will be returned.",
315             "headers" : {
316               "X-MinorVersion" : {
317                 "type" : "string",
318                 "description" : "Used to request or communicate a MINOR version back from the client to the server, and from the server back to the client"
319               },
320               "X-PatchVersion" : {
321                 "type" : "string",
322                 "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"
323               },
324               "X-LatestVersion" : {
325                 "type" : "string",
326                 "description" : "Used only to communicate an API's latest version"
327               },
328               "X-ONAP-RequestID" : {
329                 "type" : "string",
330                 "format" : "uuid",
331                 "description" : "Used to track REST transactions for logging purpose"
332               }
333             },
334             "schema" : {
335               "$ref" : "#/definitions/ToscaServiceTemplate"
336             }
337           },
338           "401" : {
339             "description" : "Authentication Error"
340           },
341           "403" : {
342             "description" : "Authorization Error"
343           },
344           "404" : {
345             "description" : "Resource Not Found"
346           },
347           "409" : {
348             "description" : "Delete Conflict, Rule Violation"
349           },
350           "500" : {
351             "description" : "Internal Server Error"
352           }
353         },
354         "security" : [ {
355           "basicAuth" : [ ]
356         } ],
357         "x-interface info" : {
358           "api-version" : "1.0.0",
359           "last-mod-release" : "Dublin"
360         }
361       }
362     },
363     "/policy/api/v1/policytypes/{policyTypeId}/versions/latest" : {
364       "get" : {
365         "tags" : [ "PolicyType" ],
366         "summary" : "Retrieve latest version of a policy type",
367         "description" : "Returns latest version for the specified policy type",
368         "operationId" : "getLatestVersionOfPolicyType",
369         "produces" : [ "application/json", "application/yaml" ],
370         "parameters" : [ {
371           "name" : "policyTypeId",
372           "in" : "path",
373           "description" : "ID of policy type",
374           "required" : true,
375           "type" : "string"
376         }, {
377           "name" : "X-ONAP-RequestID",
378           "in" : "header",
379           "description" : "RequestID for http transaction",
380           "required" : false,
381           "type" : "string",
382           "format" : "uuid"
383         } ],
384         "responses" : {
385           "200" : {
386             "description" : "successful operation; Latest version of specified policy type will be returned.",
387             "headers" : {
388               "X-MinorVersion" : {
389                 "type" : "string",
390                 "description" : "Used to request or communicate a MINOR version back from the client to the server, and from the server back to the client"
391               },
392               "X-PatchVersion" : {
393                 "type" : "string",
394                 "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"
395               },
396               "X-LatestVersion" : {
397                 "type" : "string",
398                 "description" : "Used only to communicate an API's latest version"
399               },
400               "X-ONAP-RequestID" : {
401                 "type" : "string",
402                 "format" : "uuid",
403                 "description" : "Used to track REST transactions for logging purpose"
404               }
405             },
406             "schema" : {
407               "$ref" : "#/definitions/ToscaServiceTemplate"
408             }
409           },
410           "401" : {
411             "description" : "Authentication Error"
412           },
413           "403" : {
414             "description" : "Authorization Error"
415           },
416           "404" : {
417             "description" : "Resource Not Found"
418           },
419           "500" : {
420             "description" : "Internal Server Error"
421           }
422         },
423         "security" : [ {
424           "basicAuth" : [ ]
425         } ],
426         "x-interface info" : {
427           "api-version" : "1.0.0",
428           "last-mod-release" : "Dublin"
429         }
430       }
431     }
432   }, 
433   "securityDefinitions" : {
434     "basicAuth" : {
435       "description" : "",
436       "type" : "basic"
437     }
438   },
439   "definitions" : {
440     "ToscaConstraint" : {
441       "type" : "object",
442       "properties" : {
443         "valid_values" : {
444           "type" : "array",
445           "items" : {
446             "type" : "string"
447           }
448         },
449         "equal" : {
450           "type" : "string"
451         },
452         "greater_than" : {
453           "type" : "string"
454         },
455         "greater_or_equal" : {
456           "type" : "string"
457         },
458         "less_than" : {
459           "type" : "string"
460         },
461         "less_or_equal" : {
462           "type" : "string"
463         }
464       }
465     },
466     "ToscaDataType" : {
467       "type" : "object",
468       "properties" : {
469         "name" : {
470           "type" : "string"
471         },
472         "version" : {
473           "type" : "string"
474         },
475         "derived_from" : {
476           "type" : "string"
477         },
478         "metadata" : {
479           "type" : "object",
480           "additionalProperties" : {
481             "type" : "string"
482           }
483         },
484         "description" : {
485           "type" : "string"
486         },
487         "constraints" : {
488           "type" : "array",
489           "items" : {
490             "$ref" : "#/definitions/ToscaConstraint"
491           }
492         },
493         "properties" : {
494           "type" : "object",
495           "additionalProperties" : {
496             "$ref" : "#/definitions/ToscaProperty"
497           }
498         }
499       }
500     },
501     "ToscaEntrySchema" : {
502       "type" : "object",
503       "properties" : {
504         "name" : {
505           "type" : "string"
506         },
507         "type" : {
508           "type" : "string"
509         },
510         "typeVersion" : {
511           "type" : "string"
512         },
513         "description" : {
514           "type" : "string"
515         },
516         "constraints" : {
517           "type" : "array",
518           "items" : {
519             "$ref" : "#/definitions/ToscaConstraint"
520           }
521         }
522       }
523     },
524     "ToscaPolicyType" : {
525       "type" : "object",
526       "properties" : {
527         "name" : {
528           "type" : "string"
529         },
530         "version" : {
531           "type" : "string"
532         },
533         "derived_from" : {
534           "type" : "string"
535         },
536         "metadata" : {
537           "type" : "object",
538           "additionalProperties" : {
539             "type" : "string"
540           }
541         },
542         "description" : {
543           "type" : "string"
544         },
545         "properties" : {
546           "type" : "object",
547           "additionalProperties" : {
548             "$ref" : "#/definitions/ToscaProperty"
549           }
550         }
551       }
552     },
553     "ToscaPolicyTypeIdentifier" : {
554       "type" : "object",
555       "properties" : {
556         "name" : {
557           "type" : "string"
558         },
559         "version" : {
560           "type" : "string"
561         }
562       }
563     },
564     "ToscaProperty" : {
565       "type" : "object",
566       "properties" : {
567         "name" : {
568           "type" : "string"
569         },
570         "type" : {
571           "type" : "string"
572         },
573         "typeVersion" : {
574           "type" : "string"
575         },
576         "description" : {
577           "type" : "string"
578         },
579         "default" : {
580           "type" : "string"
581         },
582         "required" : {
583           "type" : "boolean"
584         },
585         "status" : {
586           "type" : "string",
587           "enum" : [ "SUPPORTED", "UNSUPPORTED", "EXPERIMENTAL", "DEPRECATED" ]
588         },
589         "constraints" : {
590           "type" : "array",
591           "items" : {
592             "$ref" : "#/definitions/ToscaConstraint"
593           }
594         },
595         "entry_schema" : {
596           "$ref" : "#/definitions/ToscaEntrySchema"
597         }
598       }
599     },
600     "ToscaServiceTemplate" : {
601       "type" : "object",
602       "properties" : {
603         "name" : {
604           "type" : "string"
605         },
606         "version" : {
607           "type" : "string"
608         },
609         "derived_from" : {
610           "type" : "string"
611         },
612         "metadata" : {
613           "type" : "object",
614           "additionalProperties" : {
615             "type" : "string"
616           }
617         },
618         "description" : {
619           "type" : "string"
620         },
621         "tosca_definitions_version" : {
622           "type" : "string"
623         },
624         "topology_template" : {
625           "$ref" : "#/definitions/ToscaTopologyTemplate"
626         },
627         "policy_types" : {
628           "type" : "array",
629           "items" : {
630             "type" : "object",
631             "additionalProperties" : {
632               "$ref" : "#/definitions/ToscaPolicyType"
633             }
634           }
635         },
636         "data_types" : {
637           "type" : "array",
638           "items" : {
639             "type" : "object",
640             "additionalProperties" : {
641               "$ref" : "#/definitions/ToscaDataType"
642             }
643           }
644         }
645       }
646     },
647     "ToscaTopologyTemplate" : {
648       "type" : "object",
649       "properties" : {
650         "description" : {
651           "type" : "string"
652         },
653         "policies" : {
654           "type" : "array",
655           "items" : {
656             "type" : "object",
657             "additionalProperties" : {
658               "$ref" : "#/definitions/ToscaPolicy"
659             }
660           }
661         }
662       }
663     }
664   }
665 }