2fe2b974b1e532db76e7af6ca0baef63437c0f61
[optf/osdf.git] / docs / sections / swaggerdoc / oof-osdf-has-api.json
1 {
2   "swagger" : "2.0",
3   "info" : {
4     "description" : "This is the ONAP OOF OSDF (Optimization Service Design Framework) API",
5     "version" : "1.0.0",
6     "title" : "OSDF 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     "/v2/placement" : {
26       "post" : {
27         "summary" : "create/update a placement",
28         "operationId" : "createPlacement",
29         "description" : "create/update a placement",
30         "consumes" : [ "application/json" ],
31         "produces" : [ "application/json" ],
32         "parameters" : [ {
33           "in" : "body",
34           "name" : "placementRequest",
35           "description" : "placement request",
36           "schema" : {
37             "$ref" : "#/definitions/PlacementRequest"
38           }
39         } ],
40         "responses" : {
41           "201" : {
42             "description" : "An optimization solution is found."
43           },
44           "202" : {
45             "description" : "An optimization request is accepted"
46           },
47           "400" : {
48             "description" : "bad request"
49           },
50           "401" : {
51             "description" : "Request body is not compliant with the API definition"
52           },
53           "404" : {
54             "description" : "The server cannot find the requested URI"
55           },
56           "405" : {
57             "description" : "The requested method is not supported by a server."
58           },
59           "500" : {
60             "description" : "The server encountered an internal server error or timed out"
61           }
62         }
63       }
64     }
65   },
66   "definitions" : {
67     "PlacementRequest" : {
68       "type" : "object",
69       "required" : [ "requestInfo", "placementInfo", "licenseInfo", "serviceInfo" ],
70       "properties" : {
71         "requestInfo" : {
72           "$ref" : "#/definitions/RequestInfo"
73         },
74         "placementInfo" : {
75           "$ref" : "#/definitions/PlacementInfo"
76         },
77         "licenseInfo" : {
78           "$ref" : "#/definitions/LicenseInfo"
79         },
80         "serviceInfo" : {
81           "$ref" : "#/definitions/ServiceInfo"
82         }
83       }
84     },
85     "RequestInfo" : {
86       "type" : "object",
87       "required" : [ "transactionId", "requestId", "callbackUrl", "sourceId", "requestType", "optimizers", "timeout" ],
88       "properties" : {
89         "transactionId" : {
90           "type" : "string",
91           "format" : "uuid",
92           "description" : "unique ID to track an ONAP transaction",
93           "example" : "d290f1ee-6c54-4b01-90e6-d701748f0851"
94         },
95         "requestId" : {
96           "type" : "string",
97           "format" : "uuid",
98           "description" : "A unique ID to track multiple requests associated with a transaction",
99           "example" : "d290f1ee-6c54-4b01-90e6-d701748f0851"
100         },
101         "callbackUrl" : {
102           "type" : "string",
103           "format" : "url",
104           "description" : "The end point of a callback service where recommendations are posted.",
105           "example" : "myDomain.com/myCallback"
106         },
107         "callbackHeader" : {
108           "type" : "string",
109           "description" : "JSON blob. The header information a client expecting in a async callback.",
110           "example" : {
111             "blob" : "content"
112           }
113         },
114         "sourceId" : {
115           "type" : "string",
116           "description" : "The unique ID of a client making an optimization call.",
117           "example" : "d290f1ee-6c54-4b01-90e6-d701748f0851"
118         },
119         "requestType" : {
120           "type" : "string",
121           "enum" : [ "create", "update", "delete" ],
122           "description" : "The type of a request",
123           "example" : "create"
124         },
125         "numSolutions" : {
126           "type" : "integer",
127           "description" : "Expected number of solutions.",
128           "example" : 1
129         },
130         "optimizers" : {
131           "type" : "array",
132           "items" : {
133             "type" : "string",
134             "enum" : [ "placement" ]
135           },
136           "description" : "A list of optimization services.",
137           "example" : "placement"
138         },
139         "timeout" : {
140           "type" : "integer",
141           "description" : "A tolerance window (in second) for expecting solutions.",
142           "example" : 5
143         }
144       }
145     },
146     "PlacementInfo" : {
147       "type" : "object",
148       "required" : [ "requestParameters", "placementDemands" ],
149       "properties" : {
150         "requestParameters" : {
151           "type" : "string",
152           "description" : "JSON blob. A service ordering information",
153           "example" : {
154             "blob" : "content"
155           }
156         },
157         "placementDemands" : {
158           "type" : "array",
159           "items" : {
160             "$ref" : "#/definitions/PlacementDemand"
161           },
162           "description" : "The resource information for a placement service"
163         },
164         "subscriberInfo" : {
165           "type" : "object",
166           "items" : {
167             "$ref" : "#/definitions/SubscriberInfo"
168           },
169           "description" : "The information of a service subscriber."
170         }
171       }
172     },
173     "PlacementDemand" : {
174       "type" : "object",
175       "required" : [ "resourceModuleName", "serviceResourceId", "resourceModelInfo" ],
176       "properties" : {
177         "resourceModuleName" : {
178           "type" : "string",
179           "description" : "A resource name as defined in a service mode",
180           "example" : "myResourceName"
181         },
182         "serviceResourceId" : {
183           "type" : "string",
184           "description" : "A unique resource Id with a local scope between client and OOF.",
185           "example" : "myResourceId"
186         },
187         "givenPlacement" : {
188           "type" : "object",
189           "additionalProperties" : {
190             "type" : "object",
191             "properties" : {
192               "key" : {
193                 "type" : "string"
194               },
195               "value" : {
196                 "type" : "string"
197               }
198             }
199           },
200           "description" : "placement parameters defined in the ordering system, keyname include tenantId",
201           "example" : {
202             "tenantId" : "1"
203           }
204         },
205         "resourceModelInfo" : {
206           "$ref" : "#/definitions/ModelMetaData",
207           "description" : "Resource model information as defined in SDC"
208         },
209         "existingCandidates" : {
210           "$ref" : "#/definitions/Candidates",
211           "description" : "The existing placement information of a resource."
212         },
213         "excludedCandidates" : {
214           "$ref" : "#/definitions/Candidates",
215           "description" : "Candidates that need to be excluded from solutions."
216         },
217         "requiredCandidates" : {
218           "$ref" : "#/definitions/Candidates",
219           "description" : "Candidates that must be included in solutions."
220         }
221       }
222     },
223     "ModelMetaData" : {
224       "type" : "object",
225       "required" : [ "modelInvariantId", "modelVersionId" ],
226       "properties" : {
227         "modelInvariantId" : {
228           "type" : "string",
229           "description" : "A model invariant Id as defined in a service model.",
230           "example" : "my model invariant Id"
231         },
232         "modelVersionId" : {
233           "type" : "string",
234           "description" : "A unique model Id as defined in a service model.",
235           "example" : "my unique model Id"
236         },
237         "modelName" : {
238           "type" : "string",
239           "description" : "A model name as defined in a service model",
240           "example" : "my model name"
241         },
242         "modelType" : {
243           "type" : "string",
244           "description" : "A model type as defined in a service model.",
245           "example" : "my model type"
246         },
247         "modelVersion" : {
248           "type" : "string",
249           "description" : "A model version as defined in a service model.",
250           "example" : "my model version"
251         },
252         "modelCustomizationName" : {
253           "type" : "string",
254           "description" : "A model customization name as defined in a service model.",
255           "example" : "my model customization"
256         }
257       }
258     },
259     "Candidates" : {
260       "type" : "object",
261       "required" : [ "identifierType", "identifiers" ],
262       "properties" : {
263         "identifierType" : {
264           "type" : "string",
265           "enum" : [ "service_instance_id", "vnf_name", "cloud_region_id" ],
266           "description" : "The type of a candidate.",
267           "example" : "service_instance_id"
268         },
269         "identifiers" : {
270           "type" : "array",
271           "items" : {
272             "type" : "string"
273           },
274           "description" : "A list of identifiers.",
275           "example" : "candidateId"
276         },
277         "cloudOwner" : {
278           "type" : "string",
279           "description" : "The name of a cloud owner. Only required if identifierType is cloud_region_id",
280           "example" : "cloud_owner"
281         }
282       }
283     },
284     "SubscriberInfo" : {
285       "type" : "object",
286       "required" : [ "globalSubscriberId", "subscriberName", "subscriberCommonSiteId" ],
287       "properties" : {
288         "globalSubscriberId" : {
289           "type" : "string",
290           "description" : "An ID of a subscriber.",
291           "example" : "subscriber_id"
292         },
293         "subscriberName" : {
294           "type" : "string",
295           "description" : "The name of a subscriber. If the name is not known, the value must be 'unknown'",
296           "example" : "subscriber_name"
297         },
298         "subscriberCommonSiteId" : {
299           "type" : "string",
300           "description" : "Id representing a subscriber location",
301           "example" : "subscriber_location_id"
302         }
303       }
304     },
305     "LicenseInfo" : {
306       "type" : "object",
307       "required" : [ "licenseDemands" ],
308       "properties" : {
309         "licenseDemands" : {
310           "type" : "array",
311           "items" : {
312             "$ref" : "#/definitions/LicenseDemands"
313           },
314           "description" : "A list of resources for license selection"
315         }
316       }
317     },
318     "LicenseDemands" : {
319       "type" : "object",
320       "required" : [ "resourceModuleName", "serviceResourceId", "resourceModelInfo" ],
321       "properties" : {
322         "resourceModuleName" : {
323           "type" : "string",
324           "description" : "A resource name as defined in a service model.",
325           "example" : "service_instance_id"
326         },
327         "serviceResourceId" : {
328           "type" : "string",
329           "description" : "A unique resource Id with a local scope between client and OOF.",
330           "example" : "service_instance_id"
331         },
332         "resourceModelInfo" : {
333           "$ref" : "#/definitions/ModelMetaData",
334           "description" : "Resource model information as defined in a service model."
335         },
336         "existingLicenses" : {
337           "$ref" : "#/definitions/LicenseModel",
338           "description" : "Existing license information assigned to a resource."
339         }
340       }
341     },
342     "LicenseModel" : {
343       "type" : "object",
344       "required" : [ "entitlementPoolUUID", "licenseKeyGroupUUID" ],
345       "properties" : {
346         "entitlementPoolUUID" : {
347           "type" : "array",
348           "items" : {
349             "type" : "string",
350             "format" : "uuid"
351           },
352           "description" : "Entitlement pool UUIDs associated with a resource.",
353           "example" : "candidateId"
354         },
355         "licenseKeyGroupUUID" : {
356           "type" : "array",
357           "items" : {
358             "type" : "string",
359             "format" : "uuid"
360           },
361           "description" : "License key groups associated with a resource",
362           "example" : "candidateId"
363         }
364       }
365     },
366     "SynchronousResponse" : {
367       "type" : "object",
368       "required" : [ "requestId", "transactionId", "requestStatus" ],
369       "properties" : {
370         "requestId" : {
371           "type" : "string",
372           "format" : "uuid",
373           "description" : "A unique Id for an ONAP transaction",
374           "example" : "ONAP transaction id"
375         },
376         "transactionId" : {
377           "type" : "string",
378           "format" : "uuid",
379           "description" : "A unique ID to track multiple requests associated with a transaction.",
380           "example" : "requests id"
381         },
382         "statusMessage" : {
383           "type" : "string",
384           "description" : "Reasoning if a requestStatus is failure.",
385           "example" : "requestStatus"
386         },
387         "requestStatus" : {
388           "type" : "string",
389           "enum" : [ "success", "failure" ],
390           "description" : "The status of a request.",
391           "example" : "success"
392         }
393       }
394     },
395     "AsynchronousResponse" : {
396       "type" : "object",
397       "required" : [ "requestId", "transactionId", "requestStatus", "solutions" ],
398       "properties" : {
399         "requestId" : {
400           "type" : "string",
401           "format" : "uuid",
402           "description" : "A unique Id for an ONAP transaction",
403           "example" : "ONAP transaction id"
404         },
405         "transactionId" : {
406           "type" : "string",
407           "format" : "uuid",
408           "description" : "A unique ID to track multiple requests associated with a transaction.",
409           "example" : "requests id"
410         },
411         "statusMessage" : {
412           "type" : "string",
413           "description" : "Reasoning if a requestStatus is failure.",
414           "example" : "requestStatus"
415         },
416         "requestStatus" : {
417           "type" : "string",
418           "enum" : [ "success", "failure" ],
419           "description" : "The status of a request.",
420           "example" : "success"
421         },
422         "solutions" : {
423           "$ref" : "#/definitions/Solutions",
424           "description" : "Solutions related to a request."
425         }
426       }
427     },
428     "Solutions" : {
429       "type" : "object",
430       "required" : [ "placementSolutions", "licenseSolutions" ],
431       "properties" : {
432         "placementSolutions" : {
433           "type" : "array",
434           "items" : {
435             "$ref" : "#/definitions/ComprehensiveSolution"
436           },
437           "description" : "A list of placement solutions."
438         },
439         "licenseSolutions" : {
440           "type" : "array",
441           "items" : {
442             "$ref" : "#/definitions/LicenseSolution"
443           },
444           "description" : "A list of license solutions."
445         }
446       }
447     },
448     "ComprehensiveSolution" : {
449       "type" : "object",
450       "required" : [ "placementSolutions" ],
451       "properties" : {
452         "placementSolutions" : {
453           "type" : "array",
454           "items" : {
455             "$ref" : "#/definitions/PlacementSolution"
456           },
457           "description" : "A list of placement solutions."
458         }
459       }
460     },
461     "PlacementSolution" : {
462       "type" : "object",
463       "required" : [ "resourceModuleName", "serviceResourceId", "identifierType", "identifier" ],
464       "properties" : {
465         "resourceModuleName" : {
466           "type" : "string",
467           "description" : "The name of a resource as defined in the service model",
468           "example" : "resource name"
469         },
470         "serviceResourceId" : {
471           "type" : "string",
472           "description" : "A resource Id as defined in a service model.",
473           "example" : "resource id"
474         },
475         "identifierType" : {
476           "type" : "string",
477           "enum" : [ "service_instance_id" ],
478           "description" : "The type of a candidate.",
479           "example" : "candidate type"
480         },
481         "identifier" : {
482           "type" : "string",
483           "description" : "The id of a candidate.",
484           "example" : "candidate id"
485         },
486         "assignmentInfo" : {
487           "type" : "array",
488           "items" : {
489             "$ref" : "#/definitions/AssignmentInfo"
490           },
491           "description" : "Additional information related to a candidate."
492         }
493       }
494     },
495     "AssignmentInfo" : {
496       "type" : "object",
497       "required" : [ "key", "value" ],
498       "properties" : {
499         "key" : {
500           "type" : "string",
501           "description" : "An attribute name",
502           "example" : "attribute name"
503         },
504         "value" : {
505           "type" : "string",
506           "description" : "An attribute value.",
507           "example" : "attribute value"
508         }
509       }
510     },
511     "LicenseSolution" : {
512       "type" : "object",
513       "required" : [ "resourceModuleName", "serviceResourceId", "entitlementPoolUUID", "licenseKeyGroupUUID", "entitlementPoolInvariantUUID", "licenseKeyGroupInvariantUUID" ],
514       "properties" : {
515         "resourceModuleName" : {
516           "type" : "string",
517           "description" : "A resource name as defined in a service",
518           "example" : "resource name"
519         },
520         "serviceResourceId" : {
521           "type" : "string",
522           "description" : "A resource Id as defined in a service.",
523           "example" : "resource Id"
524         },
525         "entitlementPoolUUID" : {
526           "type" : "array",
527           "items" : {
528             "type" : "string",
529             "format" : "uuid"
530           },
531           "description" : "A list of entitlementPoolUUIDs",
532           "example" : "entitlementPoolUUID"
533         },
534         "licenseKeyGroupUUID" : {
535           "type" : "array",
536           "items" : {
537             "type" : "string",
538             "format" : "uuid"
539           },
540           "description" : "A list of licenseKeyGroupUUID.",
541           "example" : "licenseKeyGroupUUID"
542         },
543         "entitlementPoolInvariantUUID" : {
544           "type" : "array",
545           "items" : {
546             "type" : "string",
547             "format" : "uuid"
548           },
549           "description" : "A list of entitlementPoolInvariantUUID",
550           "example" : "entitlementPoolInvariantUUID"
551         },
552         "licenseKeyGroupInvariantUUID" : {
553           "type" : "array",
554           "items" : {
555             "type" : "string",
556             "format" : "uuid"
557           },
558           "description" : "A list of licenseKeyGroupInvariantUUID",
559           "example" : "licenseKeyGroupInvariantUUID"
560         }
561       }
562     },
563     "ServiceInfo" : {
564       "type" : "object",
565       "required" : [ "serviceInstanceId", "modelInfo", "serviceName" ],
566       "properties" : {
567         "serviceInstanceId" : {
568           "type" : "string",
569           "description" : "A service instance id associated with a request.",
570           "example" : "service_instance_id"
571         },
572         "modelInfo" : {
573           "$ref" : "#/definitions/ModelMetaData",
574           "description" : "A list of identifiers."
575         },
576         "serviceName" : {
577           "type" : "string",
578           "description" : "The name of a service",
579           "example" : "service_name"
580         }
581       }
582     }
583   },
584   "schemes" : [ "https" ],
585   "host" : "virtserver.swaggerhub.com",
586   "basePath" : "/oof-osdf/v1"
587 }