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