Add API Documentation for Casablanca
[externalapi/nbi.git] / docs / offeredapis / swaggers / serviceCatalog_3_0_0.yaml
1 swagger: "2.0"
2 info:
3   description: "serviceCatalog API designed for ONAP Casablanca Release.\nThis API is\
4     \ build from TMF open API17.5. \nOnly operation GET (by id & byList) for resource\
5     \ serviceSpecification is available"
6   version: "3.0.0"
7   title: "API ServiceCatalog"
8   x-logo:
9     url: "/redoc/logo.png"
10     backgroundColor: "#FFFFFF"
11 host: "serverRoot"
12 basePath: "/nbi/api/v3"
13 schemes:
14 - "https"
15 produces:
16 - "application/json;charset=utf-8"
17 tags:
18 - name: "ServiceSpecification"
19   description: ""
20 paths:
21   /serviceSpecification:
22     get:
23       tags:
24       - "ServiceSpecification"
25       produces:
26       - "application/json;charset=utf-8"
27       operationId: "serviceSpecificationFind"
28       summary: "List service specifications"
29       description: "This operation returns service specifications from a catalog.\n\
30         Only a predefined set of attribute is proposed : Based on SDC limitations,\
31         \ only attributes category and distributionStatus are available for serviceSpecification\
32         \ filtering\nFields attribute could be used to filter attributes retrieved\n\
33         \nSpecific business errors for current operation will be encapsulated in\n\
34         \nHTTP Response 422 Unprocessable entity\n"
35       deprecated: false
36       parameters:
37       - name: "fields"
38         required: false
39         in: "query"
40         description: "Field selection - used to filtering the attributes to be retreived"
41         type: "string"
42       - name: "category"
43         required: false
44         in: "query"
45         description: "Service Category (filter)"
46         type: "string"
47       - name: "distributionStatus"
48         required: false
49         in: "query"
50         description: "Service distribution status (filter)"
51         type: "string"
52       responses:
53         200:
54           description: "Success"
55           schema:
56             type: "array"
57             items:
58               $ref: "#/definitions/ServiceSpecification"
59         400:
60           description: "Bad Request\n\nList of supported error codes:\n- 20: Invalid\
61             \ URL parameter value\n- 21: Missing body\n- 22: Invalid body\n- 23: Missing\
62             \ body field\n- 24: Invalid body field\n- 25: Missing header\n- 26: Invalid\
63             \ header value\n- 27: Missing query-string parameter\n- 28: Invalid query-string\
64             \ parameter value"
65           schema:
66             $ref: "#/definitions/ErrorRepresentation"
67         401:
68           description: "Unauthorized\n\nList of supported error codes:\n- 40: Missing\
69             \ credentials\n- 41: Invalid credentials\n- 42: Expired credentials"
70           schema:
71             $ref: "#/definitions/ErrorRepresentation"
72         403:
73           description: "Forbidden\n\nList of supported error codes:\n- 50: Access\
74             \ denied\n- 51: Forbidden requester\n- 52: Forbidden user\n- 53: Too many\
75             \ requests"
76           schema:
77             $ref: "#/definitions/ErrorRepresentation"
78         404:
79           description: "Not Found\n\nList of supported error codes:\n- 60: Resource\
80             \ not found"
81           schema:
82             $ref: "#/definitions/ErrorRepresentation"
83         422:
84           description: "Unprocessable entity\n\nFunctional error"
85           schema:
86             $ref: "#/definitions/ErrorRepresentation"
87         500:
88           description: "Internal Server Error\n\nList of supported error codes:\n\
89             - 1: Internal error"
90           schema:
91             $ref: "#/definitions/ErrorRepresentation"
92         503:
93           description: "Service Unavailable\n\nList of supported error codes:\n- 5:\
94             \ The service is temporarily unavailable\n- 6: Orange API is over capacity,\
95             \ retry later !"
96           schema:
97             $ref: "#/definitions/ErrorRepresentation"
98   /serviceSpecification/{id}:
99     get:
100       tags:
101       - "ServiceSpecification"
102       produces:
103       - "application/json;charset=utf-8"
104       operationId: "serviceSpecificationGet"
105       summary: "Retrieve a service specification"
106       description: "This operation returns a service specification by its id from\
107         \ a catalog. Attribute selection is enabled using the fields attribute.\n\n\
108         Specific business errors for current operation will be encapsulated in\n\n\
109         HTTP Response 422 Unprocessable entity\n"
110       deprecated: false
111       parameters:
112       - name: "id"
113         in: "path"
114         required: true
115         type: "string"
116         description: ""
117       - name: "fields"
118         required: false
119         in: "query"
120         description: "Attribute selection"
121         type: "string"
122       responses:
123         200:
124           description: "Success"
125           schema:
126             $ref: "#/definitions/ServiceSpecification"
127         400:
128           description: "Bad Request\n\nList of supported error codes:\n- 20: Invalid\
129             \ URL parameter value\n- 21: Missing body\n- 22: Invalid body\n- 23: Missing\
130             \ body field\n- 24: Invalid body field\n- 25: Missing header\n- 26: Invalid\
131             \ header value\n- 27: Missing query-string parameter\n- 28: Invalid query-string\
132             \ parameter value"
133           schema:
134             $ref: "#/definitions/ErrorRepresentation"
135         401:
136           description: "Unauthorized\n\nList of supported error codes:\n- 40: Missing\
137             \ credentials\n- 41: Invalid credentials\n- 42: Expired credentials"
138           schema:
139             $ref: "#/definitions/ErrorRepresentation"
140         403:
141           description: "Forbidden\n\nList of supported error codes:\n- 50: Access\
142             \ denied\n- 51: Forbidden requester\n- 52: Forbidden user\n- 53: Too many\
143             \ requests"
144           schema:
145             $ref: "#/definitions/ErrorRepresentation"
146         404:
147           description: "Not Found\n\nList of supported error codes:\n- 60: Resource\
148             \ not found"
149           schema:
150             $ref: "#/definitions/ErrorRepresentation"
151         422:
152           description: "Unprocessable entity\n\nFunctional error"
153           schema:
154             $ref: "#/definitions/ErrorRepresentation"
155         500:
156           description: "Internal Server Error\n\nList of supported error codes:\n\
157             - 1: Internal error"
158           schema:
159             $ref: "#/definitions/ErrorRepresentation"
160         503:
161           description: "Service Unavailable\n\nList of supported error codes:\n- 5:\
162             \ The service is temporarily unavailable\n- 6: Orange API is over capacity,\
163             \ retry later !"
164           schema:
165             $ref: "#/definitions/ErrorRepresentation"
166 definitions:
167   LifecycleStatusValues:
168     description: "Service lifecycle value from ONAP SDC"
169     type: "string"
170     enum:
171     - "NOT_CERTIFIED_CHECKOUT"
172     - "NOT_CERTIFIED_CHECKIN"
173     - "READY_FOR_CERTIFICATION"
174     - "CERTIFICATION_IN_PROGRESS"
175     - "CERTIFIED"
176   DistributionStatus:
177     description: "Service distribution status from ONAP."
178     type: "string"
179     enum:
180     - "DISTRIBUTION_NOT_APPROVED"
181     - "DISTRIBUTION_APPROVED"
182     - "DISTRIBUTED"
183     - "DISTRIBUTION_REJECTED"
184   ErrorRepresentation:
185     description: "This class is used to describe error.\nfor nbi Beijing release we\
186       \ do not manage additional error for serviceCatalog"
187     required:
188     - "code"
189     - "reason"
190     type: "object"
191     properties:
192       code:
193         description: "Application related code (as defined in the API or from a common\
194           \ list)"
195         type: "integer"
196         format: "int32"
197       reason:
198         description: "Text that explains the reason for error. This can be shown to\
199           \ a client user."
200         type: "string"
201       message:
202         description: "Text that provide more details and corrective actions related\
203           \ to the error. This can be shown to a client user"
204         type: "string"
205       status:
206         description: "http error code extension like 400-2"
207         type: "string"
208       referenceErrror:
209         description: "url pointing to documentation describing the error"
210         type: "string"
211       '@type':
212         description: "The class type of a REST resource."
213         type: "string"
214       '@schemaLocation':
215         description: "it provides a link to the schema describing a REST resource."
216         type: "string"
217   TimePeriod:
218     description: "A time period"
219     type: "object"
220     properties:
221       startDateTime:
222         description: "Start date and time of the period"
223         type: "string"
224         format: "date-time"
225       endDateTime:
226         description: "End date and time of the period"
227         type: "string"
228         format: "date-time"
229   RelatedPartyRef:
230     description: "Party linked to the service catalog.\nin nbi we retrieve information\
231       \ about last updater of the service in SDC"
232     type: "object"
233     properties:
234       id:
235         description: "Unique identifier of the related party. Filled with lastUpdaterUserId"
236         type: "string"
237       role:
238         description: "Role payed by the related party\nOnly role 'lastUpdater' is\
239           \ retrieved in Beijing release"
240         type: "string"
241       name:
242         description: "Name of the related party - Filled with lastUpdatedFullName"
243         type: "string"
244   ServiceSpecification:
245     description: "ServiceSpecification is a class that offers characteristics to describe\
246       \ a type of service. Functionally, it acts as a template by which Services may\
247       \ be instantiated. By sharing the same specification, these services would therefore\
248       \ share the same set of characteristics.\nthe service information are retrieved\
249       \ in SDC"
250     required:
251     - "invariantUUID"
252     type: "object"
253     properties:
254       id:
255         description: "Unique identifier of the service specification. Filled with\
256           \ SDC Service uuid"
257         type: "string"
258       href:
259         description: "Reference of the service specification- not mapped in Beijing"
260         type: "string"
261       name:
262         description: "Name of the service specification- Filled with SDC Service name"
263         type: "string"
264       description:
265         description: "A narrative that explains in detail what the service specification\
266           \ is - Filled with SDC Service description"
267         type: "string"
268       '@type':
269         description: "This attribute allows to dynamically extends TMF class. Valued\
270           \ with 'ONAPservice'. We used this features to add following attributes:\n\
271           invariantUUID\ntoscaModelURL\ntoscaResourceName\ncategory (1)\nsubcategory\
272           \ (1)\ndistributionStatus"
273         type: "string"
274         default: "ONAPservice"
275       '@schemaLocation':
276         description: "Not used for Beijing release"
277         type: "string"
278       '@baseType':
279         description: "Not used for Beijing release"
280         type: "string"
281       invariantUUID:
282         description: "Additional attribute (not in the TMF API) - extended through\
283           \ @type - invariantUUID"
284         type: "string"
285       toscaModelURL:
286         description: "Additional attribute (not in the TMF API) - extended through\
287           \ @type - toscaModelURL"
288         type: "string"
289       toscaResourceName:
290         description: "Additional attribute (not in the TMF API) - extended through\
291           \ @type - toscaResourceName"
292         type: "string"
293       category:
294         description: "Additional attribute - extended through @type - category\nPlease\
295           \ note that this attribute is managed in TMF - in future release we'll introduce\
296           \ category resource"
297         type: "string"
298       subcategory:
299         description: "Additional attribute - extended through @type - category\nPlease\
300           \ note that this attribute is managed in TMF - in future release we'll introduce\
301           \ category resourc"
302         type: "string"
303       distributionStatus:
304         $ref: "#/definitions/DistributionStatus"
305       version:
306         description: "Service specification version - Filled with SDC Service version"
307         type: "string"
308       lifecycleStatus:
309         $ref: "#/definitions/LifecycleStatusValues"
310       targetServiceSchema:
311         $ref: "#/definitions/TargetServiceSchemaRef"
312       attachment:
313         type: "array"
314         items:
315           $ref: "#/definitions/Attachment"
316       relatedParty:
317         type: "array"
318         items:
319           $ref: "#/definitions/RelatedPartyRef"
320       resourceSpecification:
321         type: "array"
322         items:
323           $ref: "#/definitions/ResourceSpecificationRef"
324       serviceSpecCharacteristic:
325         type: "array"
326         items:
327           $ref: "#/definitions/ServiceSpecCharacteristic"
328   ServiceSpecCharacteristic:
329     description: "A characteristic quality or distinctive feature of a ServiceSpecification.\
330       \ \nServiceSpecCharacteristic are retrieved in the serviceTosca file in the\
331       \ topology_template section in the inputs section."
332     type: "object"
333     properties:
334       name:
335         description: "Name of the characteristic - Filled with parameter_name"
336         type: "string"
337       description:
338         description: "A narrative that explains in detail what the characteristic\
339           \ is - Filled with parameter_description"
340         type: "string"
341       valueType:
342         description: "A kind of value that the characteristic can take on, such as\
343           \ numeric, text and so forth - Filled with parameter_type"
344         type: "string"
345       '@type':
346         description: "This attribute allows to dynamically extends TMF class. Valued\
347           \ with: 'ONAPserviceCharacteristic'. We do not used this features in nbi\
348           \ Beijing release."
349         type: "string"
350       '@schemaLocation':
351         description: "An url pointing to type description - we do not use it in nbi\
352           \ Beijing release"
353         type: "string"
354       required:
355         description: "A parameter to define if the characteristic is mandatory - Filled\
356           \ from parameter_required – if not fielded by default ‘true’"
357         type: "boolean"
358         default: true
359       status:
360         description: "Status of the characteristic - filled with status_value"
361         type: "string"
362       serviceSpecCharacteristicValue:
363         type: "array"
364         items:
365           $ref: "#/definitions/ServiceSpecCharacteristicValue"
366   Attachment:
367     description: "An attachment is a file uses to describe the service.\nIn nbi we\
368       \ use attachment to retrieve ONAP artifacts."
369     type: "object"
370     properties:
371       id:
372         description: "Unique identifier of the attachment - filled with artifactUUID."
373         type: "string"
374       name:
375         description: "Name of the attachment - filled with artifactName"
376         type: "string"
377       description:
378         description: "Description of the attachment - filled with artifactDescription"
379         type: "string"
380       '@type':
381         description: "This attribute allows to dynamically extends TMF class. Valued\
382           \ with 'ONAPartifact'. We used this features to add following attributes:\
383           \ \nartifactLabel\nartifactGroupType\nartifactTimeout\nartifactChecksum\n\
384           artifactVersion\ngeneratedFromUUID"
385         type: "string"
386         default: "ONAPartifact"
387       artifactLabel:
388         description: "Additional attribute (not in the TMF API) - extended through\
389           \ @type - artifactLabel"
390         type: "string"
391       artifactGroupType:
392         description: "Additional attribute (not in the TMF API) - extended through\
393           \ @type - artifactGroupType"
394         type: "string"
395       artifactTimeout:
396         description: "Additional attribute (not in the TMF API) - extended through\
397           \ @type - artifactTimeout"
398         type: "string"
399       artifactChecksum:
400         description: "Additional attribute (not in the TMF API) - extended through\
401           \ @type - artifactChecksum"
402         type: "string"
403       artifactVersion:
404         description: "Additional attribute (not in the TMF API) - extended through\
405           \ @type - artifactVersion"
406         type: "string"
407       generatedFromUUID:
408         description: "Additional attribute (not in the TMF API) - extended through\
409           \ @type - generatedFromUUID"
410         type: "string"
411       url:
412         description: "Uniform Resource Locator, is a web page address - filled with\
413           \ artifactURL"
414         type: "string"
415       mimeType:
416         description: "Filled with artifactType"
417         type: "string"
418   ServiceSpecCharacteristicValue:
419     description: "A number or text that can be assigned to a service specification\
420       \ characteristic.\nServiceSpecCharacteristicValue are retrieved in the service\
421       \ Tosca file"
422     type: "object"
423     properties:
424       valueType:
425         description: "A kind of value that the characteristic can take on, such as\
426           \ numeric, text, and so forth\nRetrieved in the Tosca in the topology_template\
427           \ section in the inputs section - parameter_type. \nWe do not manage parameter_type=\
428           \ list or map for Beijing release"
429         type: "string"
430       isDefault:
431         description: "Information calculated from parameter default in the Tosca file"
432         type: "boolean"
433       value:
434         description: "A discrete value that the characteristic can take on"
435         type: "string"
436   ResourceSpecificationRef:
437     description: "A list of resourceSpec identified to deliver the service.\nfor nbi\
438       \ we retrieve resource information available in service description (through\
439       \ SDC api) bu as well information retrieved in the TOSCA file."
440     type: "object"
441     properties:
442       id:
443         description: "Unique identifier of the resource specification - filled with\
444           \ resourceUUID"
445         type: "string"
446       version:
447         description: "Version for this resource specification - filled with resourceVersion"
448         type: "string"
449       name:
450         description: "Name of the resource specification - filled with resourceName"
451         type: "string"
452       '@type':
453         description: "This attribute allows to dynamically extends TMF class. Valued\
454           \ with: 'ONAPresource'. We used this features to add following attributes:\n\
455           resourceInstanceName\nresourceInvariantUUID\nresourceType\nmodelCustomizationName\n\
456           modelCustomizationId"
457         type: "string"
458         default: "ONAPresource"
459       resourceInstanceName:
460         description: "Additional attribute (not in the TMF API) - extended through\
461           \ @type - resourceInstanceName"
462         type: "string"
463       resourceInvariantUUID:
464         description: "Additional attribute (not in the TMF API) - extended through\
465           \ @type - resourceInvariantUUID"
466         type: "string"
467       resourceType:
468         description: "Additional attribute (not in the TMF API) - extended through\
469           \ @type - resoucreType"
470         type: "string"
471       modelCustomizationName:
472         description: "Additional attribute (not in the TMF API) - extended through\
473           \ @type - Retrieved in the TOSCA file : attribute name in topology_template/node_template\
474           \ for the resource"
475         type: "string"
476       modelCustomizationId:
477         description: "Additional attribute (not in the TMF API) - extended through\
478           \ @type - Retrieved in the TOSCA file : attribute customizationUUID in topology_template/node_template\
479           \ for the resource"
480         type: "string"
481   TargetServiceSchemaRef:
482     description: ""
483     required:
484     - "@type"
485     - "@schemaLocation"
486     type: "object"
487     properties:
488       '@type':
489         description: ""
490         type: "string"
491       '@schemaLocation':
492         description: ""
493         type: "string"