[DCAE] INFO.yaml update
[dcaegen2/platform/inventory-api.git] / swagger_inventory.yaml
1 # ================================================================================
2 # Copyright (c) 2017-2018 AT&T Intellectual Property. All rights reserved.
3 # ================================================================================
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #     http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 # ============LICENSE_END=========================================================
16 #
17 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
18 swagger: '2.0'
19 info:
20   version: "3.2.0"
21   title: DCAE Inventory API
22   description: |
23     DCAE Inventory is a web service that provides the following:
24
25     1. Real-time data on all DCAE services and their components
26     2. Comprehensive details on available DCAE service types
27   contact:
28     email: dcae@lists.openecomp.org
29 externalDocs:
30   description: DCAE Inventory
31   url: https://gerrit.onap.org/r/#/admin/projects/dcae/dcae-inventory
32 paths:
33   /dcae-service-types:
34     get:
35       summary: ""
36       description: "Get a list of `DCAEServiceType` objects."
37       operationId: "dcaeServiceTypesGet"
38       consumes:
39       - "application/json"
40       - "application/vnd.dcae.inventory.v1+json"
41       produces:
42       - "application/json"
43       - "application/vnd.dcae.inventory.v1+json"
44       parameters:
45       - name: "typeName"
46         in: "query"
47         description: "Filter by service type name"
48         required: false
49         type: "string"
50       - name: "onlyLatest"
51         in: "query"
52         description: "If set to true, query returns just the latest versions of DCAE\
53           \ service types. If set to false, then all versions are returned. Default\
54           \ is true"
55         required: false
56         type: "boolean"
57         default: true
58       - name: "onlyActive"
59         in: "query"
60         description: "If set to true, query returns only *active* DCAE service types.\
61           \ If set to false, then all DCAE service types are returned. Default is\
62           \ true"
63         required: false
64         type: "boolean"
65         default: true
66       - name: "vnfType"
67         in: "query"
68         description: "Filter by associated vnf type. No wildcards, matches are explicit.\
69           \ This field is treated case insensitive."
70         required: false
71         type: "string"
72       - name: "serviceId"
73         in: "query"
74         description: "Filter by assocaited service id. Instances with service id null\
75           \ or empty is always returned."
76         required: false
77         type: "string"
78       - name: "serviceLocation"
79         in: "query"
80         description: "Filter by associated service location. Instances with service\
81           \ location null or empty is always returned."
82         required: false
83         type: "string"
84       - name: "asdcServiceId"
85         in: "query"
86         description: "Filter by associated asdc design service id. Setting this to\
87           \ `NONE` will return instances that have asdc service id set to null"
88         required: false
89         type: "string"
90       - name: "asdcResourceId"
91         in: "query"
92         description: "Filter by associated asdc design resource id. Setting this to\
93           \ `NONE` will return instances that have asdc resource id set to null"
94         required: false
95         type: "string"
96       - name: "offset"
97         in: "query"
98         description: "Query resultset offset used for pagination (zero-based)"
99         required: false
100         type: "integer"
101         format: "int32"
102       - name: "owner"
103         in: "query"
104         description: "Filter by owner name"
105         required: false
106         type: "string"  
107       - name: "application"
108         in: "query"
109         description: "Filter by application name"
110         required: false
111         type: "string"
112       - name: "component"
113         in: "query"
114         description: "Filter by component name"
115         required: false
116         type: "string"    
117       responses:
118         200:
119           description: "List of `DCAEServiceType` objects"
120           schema:
121             $ref: "#/definitions/InlineResponse200"
122     post:
123       summary: ""
124       description: "Inserts a new `DCAEServiceType` or updates an existing instance.\
125         \ Updates are only allowed iff there are no running DCAE services of the requested\
126         \ type,"
127       operationId: "dcaeServiceTypesTypeNamePut"
128       consumes:
129       - "application/json"
130       produces:
131       - "application/json"
132       parameters:
133       - in: "body"
134         name: "body"
135         required: true
136         schema:
137           $ref: "#/definitions/DCAEServiceTypeRequest"
138       responses:
139         200:
140           description: "Single `DCAEServiceType` object."
141           schema:
142             $ref: "#/definitions/DCAEServiceType"
143         400:
144           description: "Bad request provided."
145           schema:
146             $ref: "#/definitions/ApiResponseMessage"
147         409:
148           description: "Failed to update because there are still DCAE services of\
149             \ the requested type running."
150           schema:
151             $ref: "#/definitions/ApiResponseMessage"
152   /dcae-service-types/{typeId}:
153     get:
154       summary: ""
155       description: "Get a `DCAEServiceType` object."
156       operationId: "dcaeServiceTypesTypeIdGet"
157       consumes:
158       - "application/json"
159       produces:
160       - "application/json"
161       parameters:
162       - name: "typeId"
163         in: "path"
164         required: true
165         type: "string"
166       responses:
167         200:
168           description: "Single `DCAEServiceType` object"
169           schema:
170             $ref: "#/definitions/DCAEServiceType"
171         404:
172           description: "Resource not found"
173           schema:
174             $ref: "#/definitions/DCAEServiceType"
175     delete:
176       summary: ""
177       description: "Deactivates existing `DCAEServiceType` instances"
178       operationId: "dcaeServiceTypesTypeIdDelete"
179       consumes:
180       - "application/vnd.dcae.inventory.v1+json"
181       - "application/json"
182       produces:
183       - "application/vnd.dcae.inventory.v1+json"
184       - "application/json"
185       parameters:
186       - name: "typeId"
187         in: "path"
188         required: true
189         type: "string"
190       responses:
191         200:
192           description: "`DCAEServiceType` has been deactivated"
193           schema:
194             $ref: "#/definitions/ApiResponseMessage"
195         410:
196           description: "`DCAEServiceType` already gone"
197           schema:
198             $ref: "#/definitions/ApiResponseMessage"
199         404:
200           description: "`DCAEServiceType` not found"
201           schema:
202             $ref: "#/definitions/ApiResponseMessage"
203   /dcae-services:
204     get:
205       summary: ""
206       description: "Get a list of `DCAEService` objects."
207       operationId: "dcaeServicesGet"
208       consumes:
209       - "application/json"
210       - "application/vnd.dcae.inventory.v1+json"
211       produces:
212       - "application/json"
213       - "application/vnd.dcae.inventory.v1+json"
214       parameters:
215       - name: "typeId"
216         in: "query"
217         description: "DCAE service type name"
218         required: false
219         type: "string"
220       - name: "vnfId"
221         in: "query"
222         required: false
223         type: "string"
224       - name: "vnfType"
225         in: "query"
226         description: "Filter by associated vnf type. This field is treated case insensitive."
227         required: false
228         type: "string"
229       - name: "vnfLocation"
230         in: "query"
231         required: false
232         type: "string"
233       - name: "componentType"
234         in: "query"
235         description: "Use to filter by a specific DCAE service component type"
236         required: false
237         type: "string"
238       - name: "shareable"
239         in: "query"
240         description: "Use to filter by DCAE services that have shareable components\
241           \ or not"
242         required: false
243         type: "boolean"
244       - name: "created"
245         in: "query"
246         description: "Use to filter by created time"
247         required: false
248         type: "string"
249       - name: "offset"
250         in: "query"
251         description: "Query resultset offset used for pagination (zero-based)"
252         required: false
253         type: "integer"
254         format: "int32"
255       responses:
256         200:
257           description: "List of `DCAEService` objects"
258           schema:
259             $ref: "#/definitions/InlineResponse2001"
260   /dcae-services-groupby/{propertyName}:
261     get:
262       summary: ""
263       description: "Get a list of unique values for the given `propertyName`"
264       operationId: "dcaeServicesGroupbyPropertyNameGet"
265       consumes:
266       - "application/json"
267       - "application/vnd.dcae.inventory.v1+json"
268       produces:
269       - "application/json"
270       - "application/vnd.dcae.inventory.v1+json"
271       parameters:
272       - name: "propertyName"
273         in: "path"
274         description: "Property to find unique values. Restricted to `type`, `vnfType`,\
275           \ `vnfLocation`"
276         required: true
277         type: "string"
278       responses:
279         200:
280           description: "List of unique property values"
281           schema:
282             $ref: "#/definitions/DCAEServiceGroupByResults"
283   /dcae-services/{serviceId}:
284     get:
285       summary: ""
286       description: "Get a `DCAEService` object."
287       operationId: "dcaeServicesServiceIdGet"
288       consumes:
289       - "application/json"
290       - "application/vnd.dcae.inventory.v1+json"
291       produces:
292       - "application/json"
293       - "application/vnd.dcae.inventory.v1+json"
294       parameters:
295       - name: "serviceId"
296         in: "path"
297         required: true
298         type: "string"
299       responses:
300         200:
301           description: "Single `DCAEService` object"
302           schema:
303             $ref: "#/definitions/DCAEService"
304         404:
305           description: "DCAE service not found"
306           schema:
307             $ref: "#/definitions/ApiResponseMessage"
308     put:
309       summary: ""
310       description: "Put a new or update an existing `DCAEService` object."
311       operationId: "dcaeServicesServiceIdPut"
312       consumes:
313       - "application/json"
314       - "application/vnd.dcae.inventory.v1+json"
315       produces:
316       - "application/json"
317       - "application/vnd.dcae.inventory.v1+json"
318       parameters:
319       - name: "serviceId"
320         in: "path"
321         required: true
322         type: "string"
323       - in: "body"
324         name: "body"
325         required: true
326         schema:
327           $ref: "#/definitions/DCAEServiceRequest"
328       responses:
329         200:
330           description: "Single `DCAEService` object"
331           schema:
332             $ref: "#/definitions/DCAEService"
333         422:
334           description: "Bad request provided"
335           schema:
336             $ref: "#/definitions/ApiResponseMessage"
337     delete:
338       summary: ""
339       description: "Remove an existing `DCAEService` object."
340       operationId: "dcaeServicesServiceIdDelete"
341       consumes:
342       - "application/vnd.dcae.inventory.v1+json"
343       - "application/json"
344       produces:
345       - "application/json"
346       - "application/vnd.dcae.inventory.v1+json"
347       parameters:
348       - name: "serviceId"
349         in: "path"
350         required: true
351         type: "string"
352       responses:
353         200:
354           description: "DCAE service has been removed"
355         404:
356           description: "Unknown DCAE service"
357           schema:
358             $ref: "#/definitions/ApiResponseMessage"
359   /servicehealth:
360     get:
361       summary: "Check for external dependencies for inventory."
362       description: "Get a list of `DCAEServiceType` objects."
363       operationId: "dcaeServiceTypesGet"
364       consumes:
365       - "application/json"
366       - "application/vnd.dcae.inventory.v1+json"
367       produces:
368       - "application/json"
369       - "application/vnd.dcae.inventory.v1+json"   
370       responses:
371         200:
372           description: "List of `DCAEServiceType` objects"
373           schema:
374             $ref: "#/definitions/InlineResponse200"    
375   /healthcheck:
376     get:
377       summary: ""
378       description: "Basic test to check inventory internals, that process and web api are running."
379       produces:
380       - "text/plain"
381       responses:
382         200:
383           description: "OK response to indicate success"                 
384 definitions:
385   DCAEServiceTypeRequest:
386     type: "object"
387     required:
388     - "blueprintTemplate"
389     - "owner"
390     - "typeName"
391     - "typeVersion"
392     properties:
393       owner:
394         type: "string"
395       application:
396         type: "string"
397       component:
398         type: "string"    
399       typeName:
400         type: "string"
401         description: "Descriptive name for this DCAE service type"
402       typeVersion:
403         type: "integer"
404         format: "int32"
405         description: "Version number for this DCAE service type"
406       blueprintTemplate:
407         type: "string"
408         description: "String representation of a Cloudify blueprint with unbound variables"
409       serviceIds:
410         type: "array"
411         description: "List of service ids that are used to associate with DCAE service\
412           \ type. DCAE service types with this propery as null or empty means them\
413           \ apply for every service id."
414         items:
415           type: "string"
416       vnfTypes:
417         type: "array"
418         items:
419           type: "string"
420       serviceLocations:
421         type: "array"
422         description: "List of service locations that are used to associate with DCAE\
423           \ service type. DCAE service types with this propery as null or empty means\
424           \ them apply for every service location."
425         items:
426           type: "string"
427       asdcServiceId:
428         type: "string"
429         description: "Id of service this DCAE service type is associated with. Value\
430           \ source is from ASDC's notification event's field `serviceInvariantUUID`."
431       asdcResourceId:
432         type: "string"
433         description: "Id of vf/vnf instance this DCAE service type is associated with.\
434           \ Value source is from ASDC's notification event's field `resourceInvariantUUID`."
435       asdcServiceURL:
436         type: "string"
437         description: "URL to the ASDC service model"
438   DCAEServiceComponentRequest:
439     type: "object"
440     required:
441     - "componentId"
442     - "componentSource"
443     - "componentType"
444     - "shareable"
445     properties:
446       componentId:
447         type: "string"
448         description: "The id format is unique to the source"
449       componentType:
450         type: "string"
451       componentSource:
452         type: "string"
453         description: "Specifies the name of the underying source service that is responsible\
454           \ for this components"
455         enum:
456         - "DMaaPController"
457       shareable:
458         type: "integer"
459         format: "int32"
460         description: "Used to determine if this component can be shared amongst different\
461           \ DCAE services"
462   DCAEServiceGroupByResultsPropertyValues:
463     type: "object"
464     properties:
465       count:
466         type: "integer"
467         format: "int32"
468       propertyValue:
469         type: "string"
470       dcaeServiceQueryLink:
471         description: "Link.title is the DCAE service property value. Following this\
472           \ link will provide a list of DCAE services that all have this property\
473           \ value."
474         $ref: "#/definitions/Link"
475   DCAEServiceGroupByResults:
476     type: "object"
477     properties:
478       propertyName:
479         type: "string"
480         description: "Property name of DCAE service that the group by operation was\
481           \ performed on"
482       propertyValues:
483         type: "array"
484         items:
485           $ref: "#/definitions/DCAEServiceGroupByResultsPropertyValues"
486   InlineResponse200:
487     type: "object"
488     properties:
489       links:
490         $ref: "#/definitions/InlineResponse200Links"
491       totalCount:
492         type: "integer"
493         format: "int32"
494       items:
495         type: "array"
496         items:
497           $ref: "#/definitions/DCAEServiceType"
498   DCAEServiceRequest:
499     type: "object"
500     required:
501     - "components"
502     - "typeId"
503     - "vnfId"
504     - "vnfLocation"
505     - "vnfType"
506     properties:
507       typeId:
508         type: "string"
509         description: "Id of the associated DCAE service type"
510       vnfId:
511         type: "string"
512         description: "Id of the associated VNF that this service is monitoring"
513       vnfType:
514         type: "string"
515         description: "The type of the associated VNF that this service is monitoring"
516       vnfLocation:
517         type: "string"
518         description: "Location identifier of the associated VNF that this service\
519           \ is monitoring"
520       deploymentRef:
521         type: "string"
522         description: "Reference to a Cloudify deployment"
523       components:
524         type: "array"
525         description: "List of DCAE service components that this service is composed\
526           \ of"
527         items:
528           $ref: "#/definitions/DCAEServiceComponentRequest"
529   InlineResponse200Links:
530     type: "object"
531     properties:
532       previousLink:
533         $ref: "#/definitions/Link"
534       nextLink:
535         $ref: "#/definitions/Link"
536     description: "Pagination links"
537   ApiResponseMessage:
538     type: "object"
539     properties:
540       code:
541         type: "integer"
542         format: "int32"
543       type:
544         type: "string"
545       message:
546         type: "string"
547   DCAEService:
548     type: "object"
549     properties:
550       serviceId:
551         type: "string"
552       selfLink:
553         description: "Link.title is serviceId"
554         $ref: "#/definitions/Link"
555       created:
556         type: "string"
557         format: "date-time"
558       modified:
559         type: "string"
560         format: "date-time"
561       typeLink:
562         description: "Link.title is typeId"
563         $ref: "#/definitions/Link"
564       vnfId:
565         type: "string"
566       vnfLink:
567         description: "Link.title is vnfId"
568         $ref: "#/definitions/Link"
569       vnfType:
570         type: "string"
571       vnfLocation:
572         type: "string"
573         description: "Location information of the associated VNF"
574       deploymentRef:
575         type: "string"
576         description: "Reference to a Cloudify deployment"
577       components:
578         type: "array"
579         items:
580           $ref: "#/definitions/DCAEServiceComponent"
581   InlineResponse2001:
582     type: "object"
583     properties:
584       links:
585         $ref: "#/definitions/InlineResponse200Links"
586       totalCount:
587         type: "integer"
588         format: "int32"
589       items:
590         type: "array"
591         items:
592           $ref: "#/definitions/DCAEService"
593   UriBuilder:
594     type: "object"
595   Link:
596     type: "object"
597     properties:
598       title:
599         type: "string"
600       rel:
601         type: "string"
602       uri:
603         type: "string"
604         format: "uri"
605       uriBuilder:
606         $ref: "#/definitions/UriBuilder"
607       rels:
608         type: "array"
609         items:
610           type: "string"
611       params:
612         type: "object"
613         additionalProperties:
614           type: "string"
615       type:
616         type: "string"
617   DCAEServiceComponent:
618     type: "object"
619     required:
620     - "componentId"
621     - "componentLink"
622     - "componentSource"
623     - "componentType"
624     - "created"
625     - "modified"
626     - "shareable"
627     properties:
628       componentId:
629         type: "string"
630         description: "The id format is unique to the source"
631       componentLink:
632         description: "Link to the underlying resource of this component"
633         $ref: "#/definitions/Link"
634       created:
635         type: "string"
636         format: "date-time"
637       modified:
638         type: "string"
639         format: "date-time"
640       componentType:
641         type: "string"
642       componentSource:
643         type: "string"
644         description: "Specifies the name of the underying source service that is responsible\
645           \ for this components"
646         enum:
647         - "DCAEController"
648         - "DMaaPController"
649       status:
650         type: "string"
651       location:
652         type: "string"
653         description: "Location information of the component"
654       shareable:
655         type: "integer"
656         format: "int32"
657         description: "Used to determine if this component can be shared amongst different\
658           \ DCAE services"
659   DCAEServiceType:
660     type: "object"
661     required:
662     - "blueprintTemplate"
663     - "created"
664     - "owner"
665     - "selfLink"
666     - "typeId"
667     - "typeName"
668     - "typeVersion"
669     properties:
670       owner:
671         type: "string"
672       application:
673         type: "string"
674       component:
675         type: "string"    
676       typeName:
677         type: "string"
678         description: "Descriptive name for this DCAE service type"
679       typeVersion:
680         type: "integer"
681         format: "int32"
682         description: "Version number for this DCAE service type"
683       blueprintTemplate:
684         type: "string"
685         description: "String representation of a Cloudify blueprint with unbound variables"
686       serviceIds:
687         type: "array"
688         description: "List of service ids that are used to associate with DCAE service\
689           \ type. DCAE service types with this propery as null or empty means them\
690           \ apply for every service id."
691         items:
692           type: "string"
693       vnfTypes:
694         type: "array"
695         items:
696           type: "string"
697       serviceLocations:
698         type: "array"
699         description: "List of service locations that are used to associate with DCAE\
700           \ service type. DCAE service types with this propery as null or empty means\
701           \ them apply for every service location."
702         items:
703           type: "string"
704       asdcServiceId:
705         type: "string"
706         description: "Id of service this DCAE service type is associated with. Value\
707           \ source is from ASDC's notification event's field `serviceInvariantUUID`."
708       asdcResourceId:
709         type: "string"
710         description: "Id of vf/vnf instance this DCAE service type is associated with.\
711           \ Value source is from ASDC's notification event's field `resourceInvariantUUID`."
712       asdcServiceURL:
713         type: "string"
714         description: "URL to the ASDC service model"
715       typeId:
716         type: "string"
717         description: "Unique identifier for this DCAE service type"
718       selfLink:
719         description: "Link to self where the Link.title is typeName"
720         $ref: "#/definitions/Link"
721       created:
722         type: "string"
723         format: "date-time"
724         description: "Created timestamp for this DCAE service type in epoch time"
725       deactivated:
726         type: "string"
727         format: "date-time"
728         description: "Deactivated timestamp for this DCAE service type in epoch time"