-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathswagger.json
377 lines (377 loc) · 12.5 KB
/
swagger.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
{
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"schemes": [
"http",
"https"
],
"swagger": "2.0",
"info": {
"description": "REST API Spec.",
"title": "O-RAN Compliant REST API",
"version": "2.0.0"
},
"host": "localhost:9043",
"basePath": "/api/ocloudNotifications/v2",
"paths": {
"/health": {
"get": {
"description": "Returns the health status for the ocloudNotifications REST API.",
"tags": [
"HealthCheck"
],
"summary": "(Extensions to O-RAN API) Returns the health status of API.",
"operationId": "getHealth",
"responses": {
"200": {
"$ref": "#/responses/statusOK"
}
}
}
},
"/publishers": {
"get": {
"description": "Returns a list of publisher details for the cluster node.",
"tags": [
"Publishers"
],
"summary": "(Extensions to O-RAN API) Get publishers.",
"operationId": "getPublishers",
"responses": {
"200": {
"$ref": "#/responses/publishers"
},
"404": {
"description": "Publishers not found"
}
}
}
},
"/subscriptions": {
"get": {
"description": "Get a list of subscription object(s) and their associated properties.",
"tags": [
"Subscriptions"
],
"summary": "Retrieves a list of subscriptions.",
"operationId": "getSubscriptions",
"responses": {
"200": {
"$ref": "#/responses/subscriptions"
},
"400": {
"description": "Bad request by the client."
}
}
},
"post": {
"description": "Creates a new subscription for the required event by passing the appropriate payload.",
"tags": [
"Subscriptions"
],
"summary": "Creates a subscription resource for the Event Consumer.",
"operationId": "createSubscription",
"parameters": [
{
"description": "The payload will include an event notification request, endpointUri and ResourceAddress. The SubscriptionId and UriLocation are ignored in the POST body (these will be sent to the client after the resource is created).",
"name": "SubscriptionInfo",
"in": "body",
"schema": {
"$ref": "#/definitions/SubscriptionInfo"
}
}
],
"responses": {
"201": {
"$ref": "#/responses/pubSubResp"
},
"400": {
"description": "Bad request. For example, the endpoint URI is not correctly formatted."
},
"404": {
"description": "Not Found. Subscription resource is not available."
},
"409": {
"description": "Conflict. The subscription resource already exists."
}
}
},
"delete": {
"description": "Delete all subscriptions.",
"tags": [
"Subscriptions"
],
"summary": "(Extensions to O-RAN API) Delete all subscriptions.",
"operationId": "deleteAllSubscriptions",
"responses": {
"204": {
"description": "Deleted all subscriptions."
}
}
}
},
"/subscriptions/{subscriptionId}": {
"get": {
"description": "Returns details for the subscription with ID subscriptionId.",
"tags": [
"Subscriptions"
],
"summary": "Returns details for a specific subscription.",
"operationId": "getSubscriptionByID",
"parameters": [
{
"type": "string",
"x-go-name": "ID",
"description": "Identifier for subscription resource, created after a successful subscription.",
"name": "subscriptionId",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"$ref": "#/responses/subscription"
},
"404": {
"description": "Not Found. Subscription resources are not available (not created)."
}
}
},
"delete": {
"description": "Deletes an individual subscription resource object and its associated properties.",
"tags": [
"Subscriptions"
],
"summary": "Delete a specific subscription.",
"operationId": "deleteSubscription",
"parameters": [
{
"type": "string",
"x-go-name": "ID",
"description": "Identifier for subscription resource, created after a successful subscription.",
"name": "subscriptionId",
"in": "path",
"required": true
}
],
"responses": {
"204": {
"description": "Success."
},
"404": {
"description": "Not Found. Subscription resources are not available (not created)."
}
}
}
},
"/{ResourceAddress}/CurrentState": {
"get": {
"description": "As a result of successful execution of this method the Event Consumer will receive the current event status notifications of the node that the Event Consumer resides on.",
"tags": [
"Events"
],
"summary": "Pulls the event status notifications for specified ResourceAddress.",
"operationId": "getCurrentState",
"parameters": [
{
"type": "string",
"x-go-name": "Resource",
"description": "Identifier for subscription resource",
"name": "ResourceAddress",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"$ref": "#/responses/eventResp"
},
"404": {
"description": "Not Found. Event notification resource is not available on this node."
}
}
}
}
},
"definitions": {
"Data": {
"description": "Array of JSON objects defining the information for the event.\n\nExample:\n```go\n\n{\n\"version\": \"v1.0\",\n\"values\": [{\n\"ResourceAddress\": \"/sync/sync-status/sync-state\",\n\"data_type\": \"notification\",\n\"value_type\": \"enumeration\",\n\"value\": \"ACQUIRING-SYNC\"\n}, {\n\"ResourceAddress\": \"/sync/sync-status/sync-state\",\n\"data_type\": \"metric\",\n\"value_type\": \"decimal64.3\",\n\"value\": 100.3\n}\n}]\n}\n\n```",
"type": "object",
"title": "Data",
"properties": {
"values": {
"type": "array",
"items": {
"$ref": "#/definitions/DataValue"
},
"x-go-name": "Values"
},
"version": {
"type": "string",
"x-go-name": "Version",
"example": "1.0"
}
},
"x-go-package": "github.com/redhat-cne/sdk-go/pkg/event"
},
"DataValue": {
"description": "A json array of values defining the event.\n\nExample:\n```go\n\n{\n\"ResourceAddress\": \"/cluster/node/ptp\",\n\"data_type\": \"notification\",\n\"value_type\": \"enumeration\",\n\"value\": \"ACQUIRING-SYNC\"\n}\n\n```",
"type": "object",
"title": "DataValue",
"properties": {
"ResourceAddress": {
"description": "The resource address specifies the Event Producer with a hierarchical path. Currently hierarchical paths with wild cards are not supported.",
"type": "string",
"x-go-name": "Resource",
"example": "/east-edge-10/Node3/sync/sync-status/sync-state"
},
"data_type": {
"description": "Type of value object. ( notification | metric)",
"type": "string",
"x-go-name": "DataType",
"example": "notification"
},
"value": {
"description": "value in value_type format.",
"x-go-name": "Value",
"example": "HOLDOVER"
},
"value_type": {
"description": "The type format of the value property.",
"type": "string",
"x-go-name": "ValueType",
"example": "enumeration"
}
},
"x-go-package": "github.com/redhat-cne/sdk-go/pkg/event"
},
"EventData": {
"description": "Event Data Model specifies the event Status Notification data model supported by the API. The current model supports JSON encoding of the CloudEvents.io specification for the event payload.",
"type": "object",
"title": "Event Data Model",
"properties": {
"data": {
"$ref": "#/definitions/Data"
},
"id": {
"description": "Identifies the event. The Event Producer SHALL ensure that source + id is unique for each distinct event",
"type": "string",
"x-go-name": "ID",
"example": "e0dcb68b-2541-4d21-ab73-a222e42373c2"
},
"source": {
"description": "Identifies the context in which an event happened.",
"type": "string",
"x-go-name": "Source",
"example": "/sync/sync-status/sync-state"
},
"specversion": {
"description": "The version of the CloudEvents specification which the event uses. This enables the interpretation of the context.",
"type": "string",
"x-go-name": "SpecVersion",
"example": "1.0"
},
"time": {
"description": "Time at which the event occurred.",
"type": "string",
"x-go-name": "Time",
"example": "2021-03-05T20:59:00.999999999Z"
},
"type": {
"description": "This attribute contains a value describing the type of event related to the originating occurrence.",
"type": "string",
"x-go-name": "Type",
"example": "event.sync.sync-status.synchronization-state-change"
}
},
"x-go-package": "github.com/redhat-cne/rest-api/v2"
},
"SubscriptionInfo": {
"description": "SubscriptionInfo defines data types used for subscription.",
"type": "object",
"title": "SubscriptionInfo",
"properties": {
"EndpointUri": {
"description": "Endpoint URI (a.k.a callback URI), e.g. http://localhost:8080/resourcestatus/ptp",
"type": "string",
"x-go-name": "EndPointURI",
"example": "http://event-receiver/endpoint"
},
"ResourceAddress": {
"description": "The resource address specifies the Event Producer with a hierarchical path.\nFormat /{clusterName}/{siteName}(/optional/hierarchy/..)/{nodeName}/{(/optional/hierarchy)/resource}",
"type": "string",
"x-go-name": "Resource",
"example": "/east-edge-10/vdu3/o-ran-sync/sync-group/sync-status/sync-state"
},
"SubscriptionId": {
"description": "Identifier for the created subscription resource.",
"type": "string",
"x-go-name": "ID",
"example": "d1dd1770-e718-401e-ba32-cef05a286164"
},
"UriLocation": {
"description": "The URI location for querying the subscription created.",
"type": "string",
"x-go-name": "URILocation",
"example": "http://localhost:9043/api/ocloudNotifications/v2/publishers/d1dd1770-e718-401e-ba32-cef05a286164"
}
},
"x-go-package": "github.com/redhat-cne/rest-api/v2"
}
},
"responses": {
"eventResp": {
"description": "Return the pull event status",
"schema": {
"$ref": "#/definitions/EventData"
}
},
"pubSubResp": {
"description": "Shall be returned when the subscription resource is created successfully.",
"schema": {
"$ref": "#/definitions/SubscriptionInfo"
}
},
"publishers": {
"description": "",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/SubscriptionInfo"
}
}
},
"statusOK": {
"description": "OK"
},
"subscription": {
"description": "Returns the subscription resource object and its associated properties.",
"schema": {
"$ref": "#/definitions/SubscriptionInfo"
}
},
"subscriptions": {
"description": "Returns the subscription resources and their associated properties that already exist.",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/SubscriptionInfo"
}
}
}
},
"tags": [
{
"description": "Manage Subscriptions",
"name": "Subscriptions"
},
{
"description": "Event Pull Status Notification",
"name": "Events"
}
]
}