Release notes structure
[optf/has.git] / docs / sections / swaggerdoc / oof-has-api.json
1 {
2   "swagger" : "2.0",
3   "info" : {
4     "description" : "This is the ONAP OOF HAS (Homing and Allocation Service) API",
5     "version" : "1.0.0",
6     "title" : "HAS API",
7     "contact" : {
8       "email" : "frank.sandoval@oamtechnologies.com"
9     },
10     "license" : {
11       "name" : "Apache 2.0",
12       "url" : "http://www.apache.org/licenses/LICENSE-2.0.html"
13     }
14   },
15   "securityDefinitions" : {
16     "basicAuth" : {
17       "type" : "basic",
18       "description" : "HTTP Basic Auth"
19     }
20   },
21   "security" : [ {
22     "basicAuth" : [ ]
23   } ],
24   "paths" : {
25     "/" : {
26       "get" : {
27         "summary" : "retrieve versions",
28         "operationId" : "retrieveVersions",
29         "description" : "retrieve supported versions of the API",
30         "security" : [ ],
31         "produces" : [ "application/json" ],
32         "responses" : {
33           "200" : {
34             "description" : "list of supported versions",
35             "schema" : {
36               "type" : "array",
37               "items" : {
38                 "$ref" : "#/definitions/Versions"
39               }
40             }
41           },
42           "400" : {
43             "description" : "bad request",
44             "schema" : {
45               "$ref" : "#/definitions/Error"
46             }
47           },
48           "401" : {
49             "description" : "unauthorized request"
50           }
51         }
52       }
53     },
54     "/v1/plans" : {
55       "post" : {
56         "summary" : "create a plan",
57         "operationId" : "createPlan",
58         "description" : "creates a plan from one or more service demands",
59         "consumes" : [ "application/json" ],
60         "produces" : [ "application/json" ],
61         "parameters" : [ {
62           "in" : "body",
63           "name" : "demand",
64           "description" : "service demand",
65           "schema" : {
66             "$ref" : "#/definitions/Demand"
67           }
68         } ],
69         "responses" : {
70           "201" : {
71             "description" : "plan created",
72             "schema" : {
73               "items" : {
74                 "$ref" : "#/definitions/Plan"
75               }
76             }
77           },
78           "400" : {
79             "description" : "bad request",
80             "schema" : {
81               "$ref" : "#/definitions/Error"
82             }
83           },
84           "401" : {
85             "description" : "unauthorized request"
86           }
87         }
88       }
89     },
90     "/v1/plans/{plan_id}" : {
91       "get" : {
92         "summary" : "retreive a plan",
93         "operationId" : "getPlan",
94         "description" : "retrieve a plan",
95         "produces" : [ "application/json" ],
96         "parameters" : [ {
97           "in" : "path",
98           "name" : "plan_id",
99           "description" : "UUID of plan identifier",
100           "required" : true,
101           "type" : "string",
102           "format" : "uuid"
103         } ],
104         "responses" : {
105           "200" : {
106             "description" : "retrieve a plan",
107             "schema" : {
108               "type" : "array",
109               "items" : {
110                 "$ref" : "#/definitions/Plan"
111               }
112             }
113           },
114           "400" : {
115             "description" : "bad request",
116             "schema" : {
117               "$ref" : "#/definitions/Error"
118             }
119           },
120           "401" : {
121             "description" : "unauthorized request"
122           },
123           "500" : {
124             "description" : "Internal Server Error"
125           }
126         }
127       },
128       "delete" : {
129         "summary" : "delete a plan",
130         "operationId" : "deletePlan",
131         "description" : "delete a plan",
132         "produces" : [ "application/json" ],
133         "parameters" : [ {
134           "in" : "path",
135           "name" : "plan_id",
136           "description" : "UUID of plan identifier",
137           "required" : true,
138           "type" : "string",
139           "format" : "uuid"
140         } ],
141         "responses" : {
142           "204" : {
143             "description" : "deleted a plan"
144           },
145           "400" : {
146             "description" : "bad request",
147             "schema" : {
148               "$ref" : "#/definitions/Error"
149             }
150           },
151           "401" : {
152             "description" : "unauthorized request"
153           }
154         }
155       }
156     }
157   },
158   "definitions" : {
159     "Demand" : {
160       "type" : "object",
161       "required" : [ "transaction_id", "template" ],
162       "properties" : {
163         "name" : {
164           "type" : "string"
165         },
166         "id" : {
167           "type" : "string",
168           "format" : "uuid"
169         },
170         "transaction_id" : {
171           "type" : "string",
172           "format" : "uuid",
173           "example" : "d290f1ee-6c54-4b01-90e6-d701748f0851"
174         },
175         "template" : {
176           "type" : "string",
177           "externalDocs" : {
178             "description" : "See here for template format",
179             "url" : "http://onap.readthedocs.io/en/latest/submodules/optf/has.git/docs/sections/homingspecification.html"
180           }
181         }
182       }
183     },
184     "Plan" : {
185       "type" : "object",
186       "required" : [ "plan", "id", "transaction_id", "name", "status", "message", "links", "recommendations" ],
187       "properties" : {
188         "plan" : {
189           "type" : "string",
190           "example" : "JSON string describing plan",
191           "externalDocs" : {
192             "description" : "See here for plan format",
193             "url" : "http://onap.readthedocs.io/en/latest/submodules/optf/has.git/docs/sections/offeredapis.html"
194           }
195         },
196         "id" : {
197           "type" : "string",
198           "format" : "uuid",
199           "example" : "d290f1ee-6c54-4b01-90e6-d701748f0851"
200         },
201         "transaction_id" : {
202           "type" : "string",
203           "format" : "uuid",
204           "example" : "d290f1ee-6c54-4b01-90e6-d701748f0851"
205         },
206         "name" : {
207           "type" : "string",
208           "example" : "name of plan"
209         },
210         "status" : {
211           "type" : "string",
212           "enum" : [ "template", "translated", "solving", "solved", "not found", "error" ]
213         },
214         "message" : {
215           "type" : "string",
216           "example" : "Additional context, if any, around the message status"
217         },
218         "links" : {
219           "type" : "array",
220           "items" : {
221             "$ref" : "#/definitions/Link"
222           },
223           "externalDocs" : {
224             "description" : "See here for links description",
225             "url" : "http://onap.readthedocs.io/en/latest/submodules/optf/has.git/docs/sections/offeredapis.html"
226           }
227         },
228         "recommendations" : {
229           "type" : "array",
230           "items" : {
231             "$ref" : "#/definitions/Recommendation"
232           },
233           "externalDocs" : {
234             "description" : "Refer to the Demand candidate schema in the Homing Template Guide for further details",
235             "url" : "http://onap.readthedocs.io/en/latest/submodules/optf/has.git/docs/sections/homingspecification.html"
236           }
237         }
238       }
239     },
240     "Link" : {
241       "required" : [ "href", "rel" ],
242       "properties" : {
243         "href" : {
244           "type" : "string",
245           "example" : "http://localhost:8091/v1"
246         },
247         "rel" : {
248           "type" : "string",
249           "example" : "self"
250         }
251       }
252     },
253     "Recommendation" : {
254       "required" : [ "recommendation" ],
255       "properties" : {
256         "recommendation" : {
257           "type" : "string",
258           "description" : "JSON string, see description of Plan.recommendations",
259           "example" : "JSON string describing recommendation"
260         }
261       }
262     },
263     "MediaTypes" : {
264       "required" : [ "base", "type" ],
265       "properties" : {
266         "base" : {
267           "type" : "string",
268           "example" : "application/json"
269         },
270         "rel" : {
271           "type" : "string",
272           "example" : "application/vnd.onap.has-v1+json"
273         }
274       }
275     },
276     "Versions" : {
277       "required" : [ "name", "links", "media_types", "status", "updated" ],
278       "properties" : {
279         "id" : {
280           "type" : "string",
281           "example" : "v1"
282         },
283         "links" : {
284           "type" : "array",
285           "items" : {
286             "$ref" : "#/definitions/Link"
287           }
288         },
289         "media-types" : {
290           "type" : "array",
291           "items" : {
292             "$ref" : "#/definitions/MediaTypes"
293           }
294         },
295         "status" : {
296           "type" : "string",
297           "example" : "EXPERIMENTAL"
298         },
299         "updated" : {
300           "type" : "string",
301           "example" : "2016-11-01T00:00:00Z"
302         }
303       }
304     },
305     "Error" : {
306       "properties" : {
307         "title" : {
308           "type" : "string",
309           "example" : "Bad Request"
310         },
311         "explanation" : {
312           "type" : "string",
313           "example" : "pl an did not pass validation against callable"
314         },
315         "code" : {
316           "type" : "integer",
317           "example" : 400
318         },
319         "error" : {
320           "properties" : {
321             "message" : {
322               "type" : "string",
323               "example" : "message"
324             },
325             "traceback" : {
326               "type" : "string",
327               "example" : "traceback"
328             },
329             "errortype" : {
330               "type" : "string",
331               "example" : "type"
332             }
333           }
334         }
335       }
336     }
337   },
338   "schemes" : [ "https" ],
339   "host" : "virtserver.swaggerhub.com",
340   "basePath" : "/onap_oof/has/1.0.0"
341 }