Fix Spectral error and add https scheme
[externalapi/nbi.git] / docs / offeredapis / api_hub / swagger.yaml
1 #    Copyright (c) 2018 Orange
2 #
3 #    Licensed under the Apache License, Version 2.0 (the "License");
4 #    you may not use this file except in compliance with the License.
5 #    You may obtain a copy of the License at
6 #
7 #        http://www.apache.org/licenses/LICENSE-2.0
8 #
9 #    Unless required by applicable law or agreed to in writing, software
10 #    distributed under the License is distributed on an "AS IS" BASIS,
11 #    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 #    See the License for the specific language governing permissions and
13 #    limitations under the License.swagger: "2.0"
14 swagger: "2.0"
15 info:
16   description: "Provides the ability to subscribe to and unsubscribe from External\
17     \ API notifications.\n\n**Main operation**\n\n```\nPOST /hub\n```\n\nrequest sample\
18     \ 1\n\n```\n{\n  \"callback\": \"http://mydomain/notification\",\n  \"query\"\
19     : \"eventType = ServiceOrderCreationNotification\"\n}\n```\n\nrequest sample 2\n\
20     \n```\n{\n  \"callback\": \"http://mydomain/notification\",\n  \"query\": \"eventType=ServiceOrderCreationNotification,ServiceOrderStateChangeNotification\"\
21     \n}\n```\n\n**EventType for serviceOrdering**\n\n- ServiceOrderCreationNotification\n\
22     - ServiceOrderStateChangeNotification\n- ServiceOrderItemStateChangeNotification\n\
23     \n**EventType for serviceInventory**\n\n- ServiceCreationNotification\n- ServiceAttributeValueChangeNotification\n\
24     - ServiceRemoveNotification\n\n"
25   version: "4.1.0"
26   title: "Hub API"
27   contact:
28     name: "ONAP"
29     url: "https://onap.readthedocs.io"
30     email: "onap-discuss@lists.onap.org"
31   license:
32     name: "Apache 2.0"
33     url: "http://www.apache.org/licenses/LICENSE-2.0"
34   x-planned-retirement-date: "205001"
35   x-component: "NBI"
36   x-logo:
37     url: "/redoc/logo.png"
38     backgroundColor: "#FFFFFF"
39 host: "serverRoot:30274"
40 basePath: "/nbi/api/v4"
41 schemes:
42 - "http"
43 - "https"
44 produces:
45 - "application/json;charset=utf-8"
46 tags:
47 - name: "Hub"
48   description: "provided by NBI"
49 paths:
50   x-interface:
51     api-version: "4.1.0"
52     last-mod-release: "Frankfurt"
53   /hub:
54     post:
55       tags:
56       - "Hub"
57       consumes:
58       - "application/json;charset=utf-8"
59       produces:
60       - "application/json;charset=utf-8"
61       operationId: "hub_Create"
62       summary: "create hub"
63       description: ""
64       deprecated: false
65       parameters:
66       - name: "Hub"
67         required: true
68         in: "body"
69         description: ""
70         schema:
71           $ref: "#/definitions/HubIn"
72       responses:
73         "201":
74           description: "Created"
75           schema:
76             $ref: "#/definitions/Hub"
77     get:
78       tags:
79       - "Hub"
80       produces:
81       - "application/json;charset=utf-8"
82       operationId: "hub_Find"
83       summary: "find hub"
84       description: ""
85       deprecated: false
86       responses:
87         "200":
88           description: "Ok"
89           schema:
90             type: "array"
91             items:
92               $ref: "#/definitions/Hub"
93   /hub/{hubId}:
94     get:
95       tags:
96       - "Hub"
97       produces:
98       - "application/json;charset=utf-8"
99       operationId: "hub_Get"
100       summary: "get hub"
101       description: ""
102       deprecated: false
103       parameters:
104       - name: "hubId"
105         required: true
106         in: "path"
107         type: "string"
108       responses:
109         "200":
110           description: "Ok"
111           schema:
112             $ref: "#/definitions/Hub"
113     delete:
114       tags:
115       - "Hub"
116       operationId: "hub_Delete"
117       summary: "delete hub"
118       description: ""
119       deprecated: false
120       parameters:
121       - name: "hubId"
122         required: true
123         in: "path"
124         type: "string"
125       responses:
126         "204":
127           description: "No Content"
128 definitions:
129   ErrorDetail:
130     description: "Error code and message"
131     required:
132     - "code"
133     - "message"
134     type: "object"
135     properties:
136       code:
137         description: ""
138         type: "integer"
139         format: "int32"
140       message:
141         description: ""
142         type: "string"
143       description:
144         description: ""
145         type: "string"
146       infoURL:
147         description: ""
148         type: "string"
149   Error:
150     description: "Error code and description"
151     required:
152     - "code"
153     - "message"
154     type: "object"
155     properties:
156       code:
157         description: ""
158         type: "integer"
159         format: "int32"
160       message:
161         description: ""
162         type: "string"
163       description:
164         description: ""
165         type: "string"
166       infoURL:
167         description: ""
168         type: "string"
169       details:
170         type: "array"
171         items:
172           $ref: "#/definitions/ErrorDetail"
173   HubIn:
174     description: "Query and callback"
175     required:
176     - "query"
177     - "callback"
178     type: "object"
179     properties:
180       query:
181         description: "The query must have an eventType= information.\\nOptionally\
182           \ a ? could be added to reduce hub.\\nquery”:”eventType = ServiceOrderStateChangeNotification”\
183           &serviceOrder.state=COMPLETED"
184         type: "string"
185       callback:
186         description: "URL where notification must be send"
187         type: "string"
188   Hub:
189     description: "Hub id, callback and query"
190     required:
191     - "id"
192     - "query"
193     - "callback"
194     type: "object"
195     properties:
196       id:
197         description: ""
198         type: "string"
199       query:
200         description: "The query must have an eventType= information.\\nOptionally\
201           \ a ? could be added to reduce hub.\\nquery”:”eventType = ServiceOrderStateChangeNotification”\
202           &serviceOrder.state=COMPLETED"
203         type: "string"
204       callback:
205         description: "URL where notification must be send"
206         type: "string"