-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathapiary.apib
352 lines (271 loc) · 12.5 KB
/
apiary.apib
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
FORMAT: 1A
HOST: http://policymanager.testbed.fi-ware.org:8000/v1.0
# Policy Manager
The PMI Scalability API is a RESTful, resource-oriented API accessed via HTTP/HTTPS that uses JSON-based representations for information interchange that provide functionalities to the Policy Manager GE. This document describes the FI-WARE-specific features extension, which allows cloud user to extend the basic functionalities offered by Policy Manager GE in order to cope with elasticity management.
# Group Facts
Notes related resources of the **Facts API**
## Facts Collection [/{tenantid}/servers/{serverid}]
### Create new facts associated to a server [POST]
This operation updates the context related to a specific server, identified with its serverId. The context information contains the description of the CPU, Memory, Disk and/or Network usages. This message follows the NGSI-10 information model but using JSON format and the response has no body.
+ Parameters
+ tenantid (required, text, `d3fdddc6324c439780a6fd963a9fa148`) ... Numeric `id` of the Tenant to perform action with. Has example value.
+ serverid (required, text, `52415800-8b69-11e0-9b19-734f6af67565`) ... Numeric `id` of the
+ Request (application/json)
{
"subscriptionId": "<SubscriptionId>",
"originator": "http://localhost/test",
"contextResponses": [
{
"contextElement": {
"type": "Server",
"isPattern": "false",
"id": "<ServerId>",
"attributes": [
{
"name": "CPU",
"type": "Probe",
"contextValue": "0.75"
},
{
"name": "Memory",
"type": "Probe",
"contextValue": "0.83"
},
{
"name": "Disk",
"type": "Probe",
"contextValue": "0.83"
},
{
"name": "Network",
"type": "Probe",
"contextValue": "0.83"
}
]
},
"statusCode": {
"code": "200",
"reasonPhrase": "Ok",
"details": "a message"
}
}
]
}
+ Response 200 (application/json)
{ "id": 3, "title": "no error." }
# Group Cloto
Notes related resources of the **Cloto API**
## General Operations [/{tenantid}]
### Get the information of the API [GET]
This operation lists the information of the current version of the API.
+ Parameters
+ tenantid (required, text, `d3fdddc6324c439780a6fd963a9fa148`) ... Numeric `id` of the Tenant to perform action with. Has example value.
+ Request ()
+ Header
X-Auth-Token: 1da5e7629654321e3c123456b89b1cct
+ Response 200 (application/json)
{
"owner": "TELEFONICA I+D",
"windowsize": <windows_size>,
"version": "<API_version>",
"runningfrom": "<last_launch_date>
"doc": "https://forge.fi-ware.org/plugins/mediawiki/wiki/fiware/index.php/Policy_Manager_Open_RESTful_API_Specification"
}
### Update the window size [PUT]
This call updates the window size of the service in order to change the stabilization window size to be applied to the monitoring data received from the Monitoring GE
+ Parameters
+ tenantid (required, text, `d3fdddc6324c439780a6fd963a9fa148`) ... Numeric `id` of the Tenant to perform action with. Has example value.
+ Request (application/json)
+ Header
X-Auth-Token: 1da5e7629654321e3c123456b89b1cct
+ Body
{
"windowsize": <windows_size>
}
+ Response 200 (application/json)
{
"windowsize": <windows_size>
}
## Servers Collection [/{tenantid}/servers/]
### Get the list of all server's rules [GET]
This operation returns a list of servers with their rules.
+ Parameters
+ tenantid (required, text, `d3fdddc6324c439780a6fd963a9fa148`) ... Numeric `id` of the Tenant to perform action with. Has example value.
+ Request ()
+ Header
X-Auth-Token: 1da5e7629654321e3c123456b89b1cct
+ Response 200 (application/json)
{
"servers": [
{
"serverId": "<serverId>",
"rules": [
{
"condition": <CONDITION_DESCRIPTION>,
"action": <ACTION_ON_SERVER>,
"ruleId": "<RULE_ID>"
},
{
"condition": <CONDITION_DESCRIPTION>,
"action": <ACTION_ON_SERVER>,
"ruleId": "<RULE_ID>"
}
]
},
{
"serverId": "<serverId>",
"rules": [
{
"condition": <CONDITION_DESCRIPTION>,
"action": <ACTION_ON_SERVER>,
"ruleId": "<RULE_ID>"
},
{
"condition": <CONDITION_DESCRIPTION>,
"action": <ACTION_ON_SERVER>,
"ruleId": "<RULE_ID>"
}
]
}
]
}
## Server Collection [/{tenantid}/servers/{serverid}/]
### Get the list of all rules of a server [GET]
This operation returns the list of elasticity rules associated.
+ Parameters
+ tenantid (required, text, `d3fdddc6324c439780a6fd963a9fa148`) ... Alphanumeric `id` of the Tenant to perform action with. Has example value.
+ serverid (required, text, `52415800-8b69-11e0-9b19-734f6af67565`) ... Alphanumeric `id` of the server following the OpenStack ID format.
+ Request ()
+ Header
X-Auth-Token: 1da5e7629654321e3c123456b89b1cct
+ Response 200 (application/json)
{
"serverId": "<serverId>",
"rules": [
{
"name": <NAME>,
"condition": <CONDITION_DESCRIPTION>,
"action": <ACTION_ON_SERVER>,
"ruleId": "<RULE_ID>"
},
{
"name": <NAME>,
"condition": <CONDITION_DESCRIPTION>,
"action": <ACTION_ON_SERVER>,
"ruleId": "<RULE_ID>"
}
]
}
## Elasticity Rules Collection [/{tenantid}/servers/{serverid}/rules]
### Create a new elasticity rule [POST]
This operation creates a new elasticity rules associated to a server
+ Parameters
+ tenantid (required, text, `d3fdddc6324c439780a6fd963a9fa148`) ... Alphanumeric `id` of the Tenant to perform action with. Has example value.
+ serverid (required, text, `52415800-8b69-11e0-9b19-734f6af67565`) ... Alphanumeric `id` of the server following the OpenStack ID format.
+ Request (application/json)
+ Header
X-Auth-Token: 1da5e7629654321e3c123456b89b1cct
+ Body
{
"name": <NAME>,
"condition": <CONDITION_DESCRIPTION>,
"action": <ACTION_ON_SERVER>
}
+ Response 200 (application/json)
{
"serverId": <serverId>,
"ruleId": <RULE_ID>
}
## Elasticity Rule Collection [/{tenantid}/servers/{serverid}/rules/{ruleid}]
### Update an elasticity rule [PUT]
This operation allows to update the rule condition, the action or both or a specific server
+ Parameters
+ tenantid (required, text, `d3fdddc6324c439780a6fd963a9fa148`) ... Alphanumeric `id` of the Tenant to perform action with. Has example value.
+ serverid (required, text, `52415800-8b69-11e0-9b19-734f6af67565`) ... Alphanumeric `id` of the server following the OpenStack ID format.
+ ruleid (required, text, `52415800-8b69-11e0-9b19-734f6af67565`) ... Alphanumeric `id` of the rule following the OpenStack ID format.
+ Request (application/json)
+ Header
X-Auth-Token: 1da5e7629654321e3c123456b89b1cct
+ Body
{
"name": <NAME>,
"condition": <CONDITION_DESCRIPTION>,
"action": <ACTION_ON_SERVER>
}
+ Response 200 (application/json)
{
"name": <NAME>,
"condition": <CONDITION_DESCRIPTION>,
"action": <ACTION_ON_SERVER>
}
### Delete an elasticity rule [DELETE]
This operation deletes a specific rule.
+ Parameters
+ tenantid (required, text, `d3fdddc6324c439780a6fd963a9fa148`) ... Alphanumeric `id` of the Tenant to perform action with. Has example value.
+ serverid (required, text, `52415800-8b69-11e0-9b19-734f6af67565`) ... Alphanumeric `id` of the server following the OpenStack ID format.
+ ruleid (required, text, `52415800-8b69-11e0-9b19-734f6af67565`) ... Alphanumeric `id` of the rule following the OpenStack ID format.
+ Request ()
+ Header
X-Auth-Token: 1da5e7629654321e3c123456b89b1cct
+ Response 200 ()
### Get an elasticity rule [GET]
This operation gets a specific rule.
+ Parameters
+ tenantid (required, text, `d3fdddc6324c439780a6fd963a9fa148`) ... Alphanumeric `id` of the Tenant to perform action with. Has example value.
+ serverid (required, text, `52415800-8b69-11e0-9b19-734f6af67565`) ... Alphanumeric `id` of the server following the OpenStack ID format.
+ ruleid (required, text, `52415800-8b69-11e0-9b19-734f6af67565`) ... Alphanumeric `id` of the rule following the OpenStack ID format.
+ Request ()
+ Header
X-Auth-Token: 1da5e7629654321e3c123456b89b1cct
+ Response 200 (application/json)
{
"name": <NAME>,
"condition": <CONDITION_DESCRIPTION>,
"action": <ACTION_ON_SERVER>,
"ruleId": "<RULE_ID>"
}
## Subscriptions Collection [/{tenantid}/servers/{serverid}/subscription]
### Create a new subscription [POST]
This operation creates a new subcription associated to a rule
+ Parameters
+ tenantid (required, text, `d3fdddc6324c439780a6fd963a9fa148`) ... Alphanumeric `id` of the Tenant to perform action with. Has example value.
+ serverid (required, text, `52415800-8b69-11e0-9b19-734f6af67565`) ... Alphanumeric `id` of the server following the OpenStack ID format.
+ Request (application/json)
+ Header
X-Auth-Token: 1da5e7629654321e3c123456b89b1cct
+ Body
{
"ruleId": <RULE_ID>,
"url": <URL_TO_NOTIFY>,
}
+ Response 200 (application/json)
{
"subscriptionId": <SUBSCRIPTION_ID>
}
## Subscription Collection [/{tenantid}/servers/{serverid}/subscription/{subscriptionid}]
### Delete a subscription [DELETE]
This operation deletes a subscription.
+ Parameters
+ tenantid (required, text, `d3fdddc6324c439780a6fd963a9fa148`) ... Alphanumeric `id` of the Tenant to perform action with. Has example value.
+ serverid (required, text, `52415800-8b69-11e0-9b19-734f6af67565`) ... Alphanumeric `id` of the server following the OpenStack ID format.
+ subscriptionid (required, text, `52415800-8b69-11e0-9b19-734f6af67565`) ... Alphanumeric `id` of the subscription following the OpenStack ID format.
+ Request ()
+ Header
X-Auth-Token: 1da5e7629654321e3c123456b89b1cct
+ Response 200 ()
### Get a subscription [GET]
This operation gets a subscription.
+ Parameters
+ tenantid (required, text, `d3fdddc6324c439780a6fd963a9fa148`) ... Alphanumeric `id` of the Tenant to perform action with. Has example value.
+ serverid (required, text, `52415800-8b69-11e0-9b19-734f6af67565`) ... Alphanumeric `id` of the server following the OpenStack ID format.
+ subscriptionid (required, text, `52415800-8b69-11e0-9b19-734f6af67565`) ... Alphanumeric `id` of the subscription following the OpenStack ID format.
+ Request ()
+ Header
X-Auth-Token: 1da5e7629654321e3c123456b89b1cct
+ Response 200 (application/json)
{
"subscriptionId": <SUBSCRIPTION_ID>,
"url": <URL_TO_NOTIFY>,
"serverId": <SERVER_ID>,
"ruleId": "<RULE_ID>"
}