This repository has been archived by the owner on Feb 14, 2023. It is now read-only.
forked from kytos/storehouse
-
Notifications
You must be signed in to change notification settings - Fork 2
/
openapi.yml
201 lines (201 loc) · 6.24 KB
/
openapi.yml
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
openapi: 3.0.0
info:
title: kytos/storehouse
version: latest
description: Persistence NApp with support to multiple backends.
paths:
/api/kytos/storehouse/v1/{namespace}:
post:
summary: Create a Box in a namespace based on JSON input.
parameters:
- name: namespace
required: true
description: Name of the namespace where the data should be stored.
in: path
requestBody:
content:
application/json:
schema:
anyOf:
- type: array
items:
type: integer
example: [1,2,3,4,5]
- type: object
properties:
key1:
type: string
example: value1
key2:
type: integer
example: 42
example:
- [1024,2048,4096]
- {
"text_data": "text_value",
"numeric_data": 42
}
responses:
201:
description: Box created sucessfully.
content:
application/json:
schema:
type: object
properties:
response:
type: string
description: Box created.
example: Box created
id:
type: string
description: ID of the created Box.
example: 742e6f874bd14a1cb5551e997f95b6d6
500:
description: Error when creating a new Box.
content:
application/json:
schema:
type: object
properties:
response:
type: string
description: Error creating Box.
example: Invalid Request
get:
summary: List all boxes in a namespace.
parameters:
- name: namespace
required: true
description: Namespace containing Boxes to be listed.
in: path
responses:
200:
description: Box list returned sucessfully (can be an empty list).
content:
application/json:
schema:
type: array
items:
type: string
description: ID of the Boxes in the namespace.
example: 742e6f874bd14a1cb5551e997f95b6d6
/api/kytos/storehouse/v1/{namespace}/{box_id}:
get:
summary: Retrieve and return a Box from a namespace.
parameters:
- name: namespace
required: true
description: Namespace containing the Box to be retrieved.
in: path
- name: box_id
required: true
description: ID of the Box to be retrieved.
in: path
responses:
200:
description: Box retrieved sucessfully.
content:
application/json:
schema:
anyOf:
- type: array
items:
type: integer
example: [1,2,3,4,5]
- type: object
properties:
key1:
type: string
example: value1
key2:
type: integer
example: 42
example:
- [1024,2048,4096]
- {
"text_data": "text_value",
"numeric_data": 42
}
404:
description: Box not found.
content:
application/json:
schema:
type: object
properties:
response:
type: string
description: Box not found.
example: Not Found
delete:
summary: Delete a box from a namespace.
parameters:
- name: namespace
required: true
description: Namespace containing the Box to be deleted.
in: path
- name: box_id
required: true
description: ID of the Box to be deleted.
in: path
responses:
200:
description: Box deleted sucessfully.
content:
application/json:
schema:
type: object
properties:
response:
type: string
description: Box deleted succesfully.
example: Box deleted
500:
description: Error when deleting a Box.
content:
application/json:
schema:
type: object
properties:
response:
type: string
description: Error creating Box.
example: Unable to complete request
/api/kytos/storehouse/v1/backup/{namespace}/{box_id}:
get:
summary: Make a dump of all boxes on a Namespace in a JSON format.
parameters:
- name: namespace
required: true
description: Namespace that will dumped.
in: path
- name: box_id
required: False
description: ID of the Box to be dumped.
in: path
responses:
200:
description: JSON with Box or Namespace dumped.
content:
application/json:
schema:
anyOf:
- type: object
properties:
key1:
type: string
example: 742e6f874bd14a1cb5551e997f95b6d6
value: {742e6f874bd14a1cb5551e997f95b6d6 :
{'value':1, 'some_string':42}}
404:
description: Namespace or Box not found.
content:
application/json:
schema:
type: object
properties:
response:
type: string
description: Namespace or Box not found.
example: Not Found