866472ac2d6e1a009110f859a4b711398676d9ac
[policy/parent.git] / docs / api / swagger / guard-policy-api.json
1 {
2   "swagger" : "2.0",
3   "basePath" : "/",
4   "tags" : [ {
5     "name" : "Legacy Guard Policy"
6   } ],
7   "schemes" : [ "http", "https" ],
8   "paths" : {
9     "/policy/api/v1/policytypes/onap.policies.controlloop.Guard/versions/1.0.0/policies/{policyId}/versions/latest" : {
10       "get" : {
11         "tags" : [ "Legacy Guard Policy" ],
12         "summary" : "Retrieve the latest version of a particular guard policy",
13         "description" : "Returns the latest version of the specified guard policy",
14         "operationId" : "getLatestVersionOfGuardPolicy",
15         "produces" : [ "application/json" ],
16         "parameters" : [ {
17           "name" : "policyId",
18           "in" : "path",
19           "description" : "ID of policy",
20           "required" : true,
21           "type" : "string"
22         }, {
23           "name" : "X-ONAP-RequestID",
24           "in" : "header",
25           "description" : "RequestID for http transaction",
26           "required" : false,
27           "type" : "string",
28           "format" : "uuid"
29         } ],
30         "responses" : {
31           "200" : {
32             "description" : "successful operation; Latest version of specified guard policy will be returned.",
33             "headers" : {
34               "X-MinorVersion" : {
35                 "type" : "string",
36                 "description" : "Used to request or communicate a MINOR version back from the client to the server, and from the server back to the client"
37               },
38               "X-PatchVersion" : {
39                 "type" : "string",
40                 "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"
41               },
42               "X-LatestVersion" : {
43                 "type" : "string",
44                 "description" : "Used only to communicate an API's latest version"
45               },
46               "X-ONAP-RequestID" : {
47                 "type" : "string",
48                 "format" : "uuid",
49                 "description" : "Used to track REST transactions for logging purpose"
50               }
51             },
52             "schema" : {
53               "type" : "object",
54               "additionalProperties" : {
55                 "$ref" : "#/definitions/LegacyGuardPolicyOutput"
56               }
57             }
58           },
59           "401" : {
60             "description" : "Authentication Error"
61           },
62           "403" : {
63             "description" : "Authorization Error"
64           },
65           "404" : {
66             "description" : "Resource Not Found"
67           },
68           "500" : {
69             "description" : "Internal Server Error"
70           }
71         },
72         "security" : [ {
73           "basicAuth" : [ ]
74         } ],
75         "x-interface info" : {
76           "api-version" : "1.0.0",
77           "last-mod-release" : "Dublin"
78         }
79       }
80     },
81     "/policy/api/v1/policytypes/onap.policies.controlloop.Guard/versions/1.0.0/policies/{policyId}/versions/{policyVersion}" : {
82       "get" : {
83         "tags" : [ "Legacy Guard Policy" ],
84         "summary" : "Retrieve one version of a particular guard policy",
85         "description" : "Returns a particular version of a specified guard policy",
86         "operationId" : "getSpecificVersionOfGuardPolicy",
87         "produces" : [ "application/json" ],
88         "parameters" : [ {
89           "name" : "policyId",
90           "in" : "path",
91           "description" : "ID of policy",
92           "required" : true,
93           "type" : "string"
94         }, {
95           "name" : "policyVersion",
96           "in" : "path",
97           "description" : "Version of policy",
98           "required" : true,
99           "type" : "string"
100         }, {
101           "name" : "X-ONAP-RequestID",
102           "in" : "header",
103           "description" : "RequestID for http transaction",
104           "required" : false,
105           "type" : "string",
106           "format" : "uuid"
107         } ],
108         "responses" : {
109           "200" : {
110             "description" : "successful operation; Specified version of guard policy will be returned.",
111             "headers" : {
112               "X-MinorVersion" : {
113                 "type" : "string",
114                 "description" : "Used to request or communicate a MINOR version back from the client to the server, and from the server back to the client"
115               },
116               "X-PatchVersion" : {
117                 "type" : "string",
118                 "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"
119               },
120               "X-LatestVersion" : {
121                 "type" : "string",
122                 "description" : "Used only to communicate an API's latest version"
123               },
124               "X-ONAP-RequestID" : {
125                 "type" : "string",
126                 "format" : "uuid",
127                 "description" : "Used to track REST transactions for logging purpose"
128               }
129             },
130             "schema" : {
131               "type" : "object",
132               "additionalProperties" : {
133                 "$ref" : "#/definitions/LegacyGuardPolicyOutput"
134               }
135             }
136           },
137           "401" : {
138             "description" : "Authentication Error"
139           },
140           "403" : {
141             "description" : "Authorization Error"
142           },
143           "404" : {
144             "description" : "Resource Not Found"
145           },
146           "500" : {
147             "description" : "Internal Server Error"
148           }
149         },
150         "security" : [ {
151           "basicAuth" : [ ]
152         } ],
153         "x-interface info" : {
154           "api-version" : "1.0.0",
155           "last-mod-release" : "Dublin"
156         }
157       },
158       "delete" : {
159         "tags" : [ "Legacy Guard Policy" ],
160         "summary" : "Delete a particular version of a guard policy",
161         "description" : "Delete a particular version of a guard policy. It must follow one rule. Rule: the version that has been deployed in PDP group(s) cannot be deleted",
162         "operationId" : "deleteSpecificVersionOfGuardPolicy",
163         "consumes" : [ "application/json" ],
164         "produces" : [ "application/json" ],
165         "parameters" : [ {
166           "name" : "policyId",
167           "in" : "path",
168           "description" : "ID of policy",
169           "required" : true,
170           "type" : "string"
171         }, {
172           "name" : "policyVersion",
173           "in" : "path",
174           "description" : "Version of policy",
175           "required" : true,
176           "type" : "string"
177         }, {
178           "name" : "X-ONAP-RequestID",
179           "in" : "header",
180           "description" : "RequestID for http transaction",
181           "required" : false,
182           "type" : "string",
183           "format" : "uuid"
184         } ],
185         "responses" : {
186           "200" : {
187             "description" : "successful operation; Newly deleted guard policy will be returned.",
188             "headers" : {
189               "X-MinorVersion" : {
190                 "type" : "string",
191                 "description" : "Used to request or communicate a MINOR version back from the client to the server, and from the server back to the client"
192               },
193               "X-PatchVersion" : {
194                 "type" : "string",
195                 "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"
196               },
197               "X-LatestVersion" : {
198                 "type" : "string",
199                 "description" : "Used only to communicate an API's latest version"
200               },
201               "X-ONAP-RequestID" : {
202                 "type" : "string",
203                 "format" : "uuid",
204                 "description" : "Used to track REST transactions for logging purpose"
205               }
206             },
207             "schema" : {
208               "type" : "object",
209               "additionalProperties" : {
210                 "$ref" : "#/definitions/LegacyGuardPolicyOutput"
211               }
212             }
213           },
214           "401" : {
215             "description" : "Authentication Error"
216           },
217           "403" : {
218             "description" : "Authorization Error"
219           },
220           "404" : {
221             "description" : "Resource Not Found"
222           },
223           "409" : {
224             "description" : "Delete Conflict, Rule Violation"
225           },
226           "500" : {
227             "description" : "Internal Server Error"
228           }
229         },
230         "security" : [ {
231           "basicAuth" : [ ]
232         } ],
233         "x-interface info" : {
234           "api-version" : "1.0.0",
235           "last-mod-release" : "Dublin"
236         }
237       }
238     },
239     "/policy/api/v1/policytypes/onap.policies.controlloop.Guard/versions/1.0.0/policies" : {
240       "post" : {
241         "tags" : [ "Legacy Guard Policy" ],
242         "summary" : "Create a new guard policy",
243         "description" : "Create a new guard policy. Client should provide entity body of the new guard policy",
244         "operationId" : "createGuardPolicy",
245         "consumes" : [ "application/json" ],
246         "produces" : [ "application/json" ],
247         "parameters" : [ {
248           "name" : "X-ONAP-RequestID",
249           "in" : "header",
250           "description" : "RequestID for http transaction",
251           "required" : false,
252           "type" : "string",
253           "format" : "uuid"
254         }, {
255           "in" : "body",
256           "name" : "body",
257           "description" : "Entity body of policy",
258           "required" : true,
259           "type" : "ToscaServiceTemplate",
260           "schema" : {
261             "$ref" : "#/definitions/LegacyGuardPolicyInput"
262           }
263         } ],
264         "responses" : {
265           "200" : {
266             "description" : "successful operation; Newly created guard policy will be returned.",
267             "headers" : {
268               "X-MinorVersion" : {
269                 "type" : "string",
270                 "description" : "Used to request or communicate a MINOR version back from the client to the server, and from the server back to the client"
271               },
272               "X-PatchVersion" : {
273                 "type" : "string",
274                 "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"
275               },
276               "X-LatestVersion" : {
277                 "type" : "string",
278                 "description" : "Used only to communicate an API's latest version"
279               },
280               "X-ONAP-RequestID" : {
281                 "type" : "string",
282                 "format" : "uuid",
283                 "description" : "Used to track REST transactions for logging purpose"
284               }
285             },
286             "schema" : {
287               "type" : "object",
288               "additionalProperties" : {
289                 "$ref" : "#/definitions/LegacyGuardPolicyOutput"
290               }
291             }
292           },
293           "400" : {
294             "description" : "Invalid Body"
295           },
296           "401" : {
297             "description" : "Authentication Error"
298           },
299           "403" : {
300             "description" : "Authorization Error"
301           },
302           "500" : {
303             "description" : "Internal Server Error"
304           }
305         },
306         "security" : [ {
307           "basicAuth" : [ ]
308         } ],
309         "x-interface info" : {
310           "api-version" : "1.0.0",
311           "last-mod-release" : "Dublin"
312         }
313       }
314     }
315   },
316   "securityDefinitions" : {
317     "basicAuth" : {
318       "description" : "",
319       "type" : "basic"
320     }
321   },
322   "definitions" : {
323     "LegacyGuardPolicyContent" : {
324       "type" : "object",
325       "properties" : {
326         "actor" : {
327           "type" : "string"
328         },
329         "recipe" : {
330           "type" : "string"
331         },
332         "targets" : {
333           "type" : "string"
334         },
335         "clname" : {
336           "type" : "string"
337         },
338         "limit" : {
339           "type" : "string"
340         },
341         "timeWindow" : {
342           "type" : "string"
343         },
344         "timeUnits" : {
345           "type" : "string"
346         },
347         "min" : {
348           "type" : "string"
349         },
350         "max" : {
351           "type" : "string"
352         },
353         "guardActiveStart" : {
354           "type" : "string"
355         },
356         "guardActiveEnd" : {
357           "type" : "string"
358         },
359         "asPropertyMap" : {
360           "type" : "object",
361           "additionalProperties" : {
362             "type" : "string"
363           }
364         }
365       }
366     },
367     "LegacyGuardPolicyOutput" : {
368       "type" : "object",
369       "properties" : {
370         "type" : {
371           "type" : "string"
372         },
373         "version" : {
374           "type" : "string"
375         },
376         "metadata" : {
377           "type" : "object",
378           "additionalProperties" : {
379             "type" : "object"
380           }
381         },
382         "properties" : {
383           "type" : "object",
384           "additionalProperties" : {
385             "$ref" : "#/definitions/LegacyGuardPolicyContent"
386           }
387         }
388       }
389     },
390     "LegacyGuardPolicyInput" : {
391       "type" : "object",
392       "properties" : {
393         "policy-id" : {
394           "type" : "string"
395         },
396         "policy-version" : {
397           "type" : "string"
398         },
399         "content" : {
400           "$ref" : "#/definitions/LegacyGuardPolicyContent"
401         }
402       }
403     }
404   }
405 }