-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathapiary.apib
1190 lines (928 loc) · 49.2 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
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
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
FORMAT: 1A
TITLE: Policy Manager API Specification
DATE: 8 September 2016
VERSION: v1.0
APIARY_PROJECT: policymanager
HOST: policymanager.lab.fiware.org
SPEC_URL: http://telefonicaid.github.io/fiware-cloto/api/
GITHUB_SOURCE: https://github.com/telefonicaid/fiware-cloto
# Policy Manager API Specification
The Policy Manager API (PMI) 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 FIWARE-specific features extension,
which allows cloud user to extend the basic functionalities offered by Policy Manager GE
in order to cope with policies management.
# Preface
## Editors
+ Fernando López Aguilar, Telefónica I+D
+ Guillermo Jiménez Prieto, IMDEA Software Institute.
## Status
This specification is the September 2016 release candidate of the PMI API specification
corresponding to Release 5.4 of FIWARE. By "release candidate" we mean that only Minor
Changes are expected to the API described by this document. In particular, Minor Changes
may be of two types:
* Extensions to the functionality currently specified by this document. Note that in this
case there isn't any risk of breaking backward compatibility on existing software implementations.
* Slight modifications in the functionality currently specified by this document, as a
consequence of ongoing discussions. Backward compatibility will be taken into account in
this case, trying to minimize the impact on existing software implementations. In particular,
only completely justified changes impacting backward compatibility will be allowed and
"matter of taste" changes will not be allowed.
## Copyright
Copyright (c) 2013-2016 Telefónica Investigación y Desarrollo.
## License
<!--
Copyright 2015 Telefónica I+D
All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may
not use this file except in compliance with the License. You may obtain
a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations
under the License.
-->
This specification is licensed under the
[FIWARE Open Specification License (implicit patents license)](https://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/Implicit_Patents_License).
## Intended Audience
This specification is intended for both software developers and Cloud Providers.
For the former, this document provides a full specification of how to interoperate
with Cloud Platforms that implement PMI API. For the latter, this specification
indicates the interface to be provided in order to create rules with conditions
and actions associated to the facts received from cloud services. To use this information,
the reader should first have a general understanding of the [Policy Manager Generic Enabler](http://wiki.fiware.org/FIWARE.OpenSpecification.Cloud.PolicyManager)
and also be familiar with:
* RESTful web services
* [RFC2616: Hypertext Transfer Protocol -- HTTP/1.1](http://www.ietf.org/rfc/rfc2616.txt).
* [JSON data serialization formats](http://www.ietf.org/rfc/rfc4627.txt?number=4627).
## Conformance
This specification describes the "full" compliance level.
However, future iterations of this specification might define optionality in some
parts and the compliance level (or roles/profiles) corresponding to them.
## Conventions
PMI version 1.0 uses lower camel case (lowerCamelCase) syntax for naming properties
and related artifacts used by the API.
# Specification
## Introduction
The PMI API defines:
* A **rule** represents the policy or rule that will be used to infer new facts or
actions based on the facts notified by the Publish/Subscribe Context Broker GE. Usually,
rules are compound of conditions and actions
* A **condition** is some type of conditional statement of the form: x > 85% [AND y > 64.5%].
Several conditions can be connected using the AND logical operator.
* A **fact** represents the measurement of the cloud resources and will be used to
infer new facts or actions. It is the base of the reasoning process.
* An **action** represents the triggered message inferred by the rule engine based on
the execution of certain conditions defined in a rule or rules set. This message is
notified to the third parties in order to launch the proper action.
## Authentication
Each HTTP request against the **PMI** requires the inclusion of specific authentication
credentials following the same architecture of the other OpenStack projects. The specific
implementation of this API supports OAuth v2.0 authentication schemes and will be determined
by the specific provider that implements this GE and Interface. To authenticate access to
OpenStack services, you must first issue an authentication request with a payload of
credentials to OpenStack Identity to get an authentication token.
Credentials are usually a combination of your user name and password, and optionally, the
name or ID of the tenant from your FIWARE Lab account. Ask your cloud administrator for your
user name (OS_USERNAME), password (OS_PASSWORD), and tenant (OS_PROJECT_NAME) if you do not
remember them or sign up your own account in [FIWARE Lab account service](https://account.lab.fiware.org/sign_up/)
so that you can generate authentication tokens.
When you send PMI API requests, you have to include the token in the `X-Auth-Token` header. Please,
keep in mind that a token is valid for a limited time before it expires. A token can also
become invalid for other security reasons. The workflow that you have to follow is:
* Request an authentication token from the Identity Manager endpoint that your cloud
administrator gave you. Send a payload of credentials in the request as shown in Authenticate.
If the request succeeds, the server returns an authentication token. Please refer to
[FIWARE Identity Management GE](https://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/FIWARE.OpenSpecification.Security.IdentityManagement)
for more details. First, export your tenant name to the OS_PROJECT_NAME environment variable,
your user name to the OS_USERNAME environment variable, your password to the OS_PASSWORD
environment variable and the url of the Identity Management to OS_AUTH_URL environment variable
and then execute:
```
$ curl -s -X POST $OS_AUTH_URL/tokens \
-H "Content-Type: application/json" \
-d '{"auth": {"tenantName": "'"$OS_PROJECT_NAME"'", "passwordCredentials": {"username": "'"$OS_USERNAME"'", "password": "'"$OS_PASSWORD"'"}}}' \
| python -m json.tool
```
Note: In the FIWARE Lab environment the url of the Identity Management GEi is http://cloud.lab.fi-ware.org:5000/v2.0/
If the request succeeds, it returns the OK (200) response code followed by a response
body that contains a token in the form `"id":"token"` and an expiration date and time
in the form `"expires":"datetime"`. This is a normal example of the response to the
previous POST, we show only details about the token, the rest are not needed in this case.
```
{
"access": {
"token": {
"issued_at": "2016-09-02T10:03:51.159419",
"expires": "2016-09-03T10:03:51Z",
"id": "98763040c99h740i95809z2098123704",
"tenant": {
"description": "Joe Foo",
"enabled": true,
"id": "0000000000000098758734z730478503",
"name": "foo"
},
"audit_ids": [
"HsO-r_exQ9upNUMpuf4iWg"
]
},
"serviceCatalog": [ ... ],
"user": { ... },
"metadata": { ... }
}
}
```
* Send API requests and include the token in the `X-Auth-Token` header. Continue to
send API requests with that token until the service completes the request or the
Unauthorized (401) error occurs.
* If the Unauthorized (401) error occurs, go to the first point and request another
token.
The examples in this section use cURL commands. For information about cURL, see
[http://curl.haxx.se/](http://curl.haxx.se/). For information about the OpenStack
APIs, see [http://developer.openstack.org/api-ref.html](OpenStack API Reference).
## Representation Format
The **PMI API** resources are represented by hypertext that allows each resource
to reference other related resources. More concisely, JSON format are used for
resource representation and URLs are used for referencing other resources by default.
The request format is specified using the Content-Type header and is required for
operations that have a request body. The response format can be specified in requests
using either the Accept header with values application/json or adding a .json
extension to the request URI. In the following examples we can see the different
options in order to represent format.
```
POST /d3fdddc6324c439780a6fd963a9fa148/servers/15520fa6dc914f97bd1e54f8e1444d41 HTTP/1.1
Host: servers.api.openstack.org
Content-Type: application/json
Accept: application/json
X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb
```
```
POST /d3fdddc6324c439780a6fd963a9fa148/servers/15520fa6dc914f97bd1e54f8e1444d41.json HTTP/1.1
Host: servers.api.openstack.org
Content-Type: application/json
X-Auth-Token: eaaafd18-0fed-4b3a-81b4-663c99ec1cbb
```
## Representation Transport
Resource representation is transmitted between client and server by using HTTP 1.1
protocol, as defined by IETF RFC-2616. Each time an HTTP request contains payload,
a Content-Type header shall be used to specify the MIME type of wrapped representation.
In addition, both client and server may use as many HTTP headers as they consider
necessary.
## MIME Types
The API response payloads in this specification are based on `application/json`.
Clients issuing HTTP requests with accept types different than those will get a
`406 Not Acceptable` error.
## Resource Identification
API consumer must indicate the resource identifier while invoking a GET, PUT, POST
or DELETE operation. PMI API combines both identification and location by terms of
URL. Each invocation provides the URL of the target resource along the verb and any
required input data. That URL is used to identify unambiguously the resource. For
HTTP transport, this is made using the mechanisms described by HTTP protocol
specification as defined by IETF RFC-2616.
PMI API does not enforce any determined URL pattern to identify its resources. Anyway
the PMI API follows the HATEOAS principle (Hypermedia As The Engine Of
Application State). This means that resource representation contains the URLs of
the related resources (e.g., book representation contains hyperlinks to its chapters;
chapter representation contains hyperlinks to its pages...). API consumer obtains
the server representation as its following point, which in turn provides hyperlinks
that directly or indirectly take to other resources like scalability rules.
Some PMI API entities provide an instance identifier property (instance ID).
This property is used to identify unambiguously the entity but not the REST resource
used to manage it, which is identified by its URL as described above. It is common
that most implementations make use of instance ID to compose the URL (e.g., the book
with instance ID 1492 could be represented by resource http://.../book/1492),
but such an assumption should not be taken by API consumer to obtain the resource URL
from its instance ID.
Last but not least, PMI API is not involved in the instance creation. PMI API
supposes that the instance, identified by its serverId, is created in the FIWARE Lab.
## Links and References
Resources often lead to refer to other resources. In those cases, we have to provide
an ID or an URL to a remote resource. see [OpenStack Compute Developer Guide](http://docs.openstack.org/api/openstack-compute/2/content/LinksReferences.html)
on their application to infrastructural resources.
## Rules
Rules are described using JSON, and contain information about CPU and Memory usage,
in first instance. The rule is compound of three parts: name, conditions and actions.
In this case, the name will be "AlertCPU" and the defined condition expects all
server with cpu usage greater than 98.3 and memory load greater or equal to 95.
Actions will create an HTTP POST notification to an url specified on every subscription
to this rule. In this case, the notification will be that the server should be scaled up
because CPU usage is greater than certain limit. This is the rule as is expected to:
```
{
"name": "AlertCPU",
"condition": {
"cpu": {
"value": 98.3,
"operand": "greater"
},
"mem": {
"value": 95,
"operand": "greater equal"
}
},
"action": {
"actionName": "notify-scale",
"operation": "scaleUp"
}
}
```
### Rule Conditions
Rule conditions represent a boolean condition to be evaluated (e.g. `x > 10`).
A rule condition is simply a statement that is either true or false. We can have
two options:
* Simple rule conditions, which only require *one* statement.
* Complex rule conditions, which require *two* or more statements linked with a
logical operator. The only allowed operator is *AND* in Policy Manger in release 5.4
A rule condition is represented by a JSON object with the following syntax:
* The entity metric representing the cloud service metric is specified by the
object's <metric> property. These metrics are only `cpu`, `mem`, `hdd`, `net`.
* The entity value representing the cloud service value for the entity metric
is specified by the object's `value` property, whose value is a floating number
representing the percentaje of use of this metric in the cloud service.
* The logical operator used to check the entity value is specified by the
object's `operand` property. PMI API v1.0 allows values "greater", "less",
"greater equal", "less equal" for this property.
An example of a rule definition can be found in the following code:
```
"condition": {
"cpu": {
"value": 98.3,
"operand": "greater"
},
"mem": {
"value": 95,
"operand": "greater equal"
}
}
```
### Actions
Actions are the messages that we send to the user of the rule when a rule is triggered.
An action is represented by a JSON object with the following syntax:
* The action id is specified by the object's `actionName` property, whose value is
a string containing the action's name. Depending of the `actionName` we have predefined
different properties:
* If the object's `actionName` property has value `notify-email`, we have the email and
body which are represented by the object's `email` and `body` properties, whose values
are the string containing the email address to send the email and the body message of this
email. This is a possible example:
```
"action": {
"actionName": "notify-email",
"email": "foo@fighters",
"body": "You have a problem with your instance, please check it."
}
```
* If the object's `actionName` property has value `notify-scale`, we have action operation.
The action operation is specified by the object's `operation` property, whole value is a
string containing the action's operation. PMI API v1.0 allows values "scaleUp", "scaleDown"
for this property. This message is sent back to the url that is specified in the subscription
process described bellow. This is a possible example:
```
"action": {
"actionName": "notify-scale",
"operation": "scaleUp"
}
```
* Any other possible value of the object's `actionName` property will have the same
behaviour described in the previous case.
## Error Responses
Every HTTP request has a status code. 2xx codes signify the PMI API was a success.
However, sometimes is not the response that be obtained. All the error messages are
sent in JSON format with the following attributes:
* A `message`. A descriptive text of the error that was reported by the PMI API.
* A `code`. A integer value to identify the error type.
* A `title`. The error type in text format.
An example of an error message could be:
```
{
"error": {
"message": "Expecting to find valid JSON in request body - the server could not comply with the request since it is either malformed or otherwise incorrect. The client is assumed to be in error.",
"code": 400,
"title": "Bad Request"
}
```
The possible values that we have in the attributes are described bellow. Keep in mind that we give them in the format `title` (`code`). `<description>`:
* `Bad Request` (`400`). The PMI API failed to parse the request as expected. One of
the following errors occurred:
* A required attribute was missing.
* An attribute that is not allowed was specified, such as an ID on a POST request
in a basic CRUD operation.
* An attribute of an unexpected data type was specified.
* An attribute is unexpected in the body JSON message.
* `Unauthorized` (`401`). One of the following errors occurred:
* Authentication was not performed.
* The specified `X-Auth-Token` header is not valid.
* `Forbidden` (`403`). The identity was successfully authenticated but it is not authorized
to perform the requested action.
* `Not Found` (`404`). An operation failed because a referenced entity cannot be found by ID.
* `Service Unavailable` (`503`). The Policy Manager is unable to perform the operation due to
it is unavailable. One of the following errors occurred:
* Policy Manager service or some of its subcomponents (RabbitMQ, MySQL, Redis and/or Facts)
are down.
* Policy Manager cannot contact the Identity Management to authenticate the received token.
# Group Facts
Resource related to the context update of facts received from a Orion Publish/Subscribe Context
Broker following NGSI-10 specification. It is implemented in the Bosun - Facts subcomponent.
## 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
*tenantId* and *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.
Request attributes:
Context element contains different measures. Each measure is an attribute which contains:
* `name`: The name of the monitored attribute (usedMemPct, cpuLoadPct, netLoadPct,
freeSpacePct).
* `value`: The value of the attribute.
* `type`: The type of the value (this component uses string).
In addition there are three more attributes inside the context element:
* `id`: Subscription unique identifier. Automatically created at creation time in the
Context Broker.
* `isPattern`: it shows if the query is related to a regular expression for the entity
ID. (false, true)
* `type`: The type of the context element (this component uses "host").
Finally, Context element is involved into a context response, which also contains:
* `statusCode`: with the result of the context broker query.
Response in JSON:
* Succesful operation uses 200 Ok
* Errors use a non-2xx and optionally an error payload. See subsection "Error Responses" for
more details.
+ Parameters
+ tenantId (required, String, `d3fdddc6324c439780a6fd963a9fa148`) ... Alphanumeric identifier
of the Tenant to perform action with, following the OpenStack ID format.
+ serverId (required, string, `52415800-8b69-11e0-9b19-734f6af67565`) ... Alphanumeric identifier
of the Server to perform action with, following the OpenStack ID format.
+ Request (application/json)
{
"contextResponses": [
{
"contextElement": {
"attributes": [
{
"value": "0.12",
"name": "usedMemPct",
"type": "string"
},
{
"value": "0.14",
"name": "cpuLoadPct",
"type": "string"
},
{
"value": "0.856240",
"name": "freeSpacePct",
"type": "string"
},
{
"value": "0.8122",
"name": "netLoadPct",
"type": "string"
}
],
"id": "Trento:193.205.211.69",
"isPattern": "false",
"type": "host"
},
"statusCode": {
"code": "200",
"reasonPhrase": "OK"
}
}
]
}
+ Response 200 (application/json)
+ Attributes (object)
+ id: `3` (required, number) - Identifier of the received fact.
+ title: "no error." (required, string) - Brief description message of the operation.
+ Body
{
"id": 3,
"title": "no error."
}
# Group Cloto
Resources related to management of Rule besides with global information related to the service.
They are implemented in the Bosun - Cloto subcomponent. All the request to this group requires
the specification of the `X-Auth-Token` Header. See "Authentication" subsection for more details.
## General Operations [/v1.0/{tenantId}]
### Get the information of the API [GET]
This operation lists the information of the current version of the API. This operation does not
require a request body.
Response in JSON:
* Succesful operation uses 200 Ok
* Errors use a non-2xx and optionally an error payload. See subsection "Error Responses" for
more details.
+ Parameters
+ tenantId (required, String, `d3fdddc6324c439780a6fd963a9fa148`) ... Alphanumeric identifier
of the Tenant to perform action with, following the OpenStack ID format.
+ Request ()
+ Headers
X-Auth-Token: 1da5e7629654321e3c123456b89b1cct
+ Response 200 (application/json)
+ Attributes (object)
+ owner: `TELEFONICA I+D` (required, string) - It is the key whose value is the
company name that develops this API.
+ windowsize: 5 (required, number) - It is the key that represents the window
size to stabilize the values of the measures probes to checking rules and triggering actions.
This value is very important due to allow resolving false positives that could launch the
action to scaling up and down a server.
+ version: `1.0` (required, string) - It is the key whose value is the version of
the API currently in execution.
+ runningfrom: `2013-10-04 20:32:17` (required, string) - It is the key whose value is the
date of the last launch of the service. This value takes the ISO 8601.
+ doc: `http://telefonicaid.github.io/fiware-cloto/api/v1.0/` (required, string) -
It is the key whose value is the link to this API specification.
+ Body
{
"owner": "TELEFONICA I+D",
"windowsize": <windows_size>,
"version": "<API_version>",
"runningfrom": "<last_launch_date>
"doc": "http://telefonicaid.github.io/fiware-cloto/api/v1.0/"
}
### 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.
Response in JSON:
* Succesful operation uses 200 Ok
* Errors use a non-2xx and optionally an error payload. See subsection "Error Responses" for
more details.
+ Parameters
+ tenantId (required, String, `d3fdddc6324c439780a6fd963a9fa148`) ... Alphanumeric identifier
of the Tenant to perform action with, following the OpenStack ID format.
+ Request (application/json)
+ Attributes (object)
+ windowsize: 5 (required, number) - The value of the windowsize to be updated
(must be an integer between 1 and the `max_window_size` value defined in the settings file).
+ Headers
X-Auth-Token: 1da5e7629654321e3c123456b89b1cct
+ Body
{
"windowsize": <window_size>
}
+ Response 200 (application/json)
+ Attributes
+ windowsize: 5 (required, number) - The value of the windowsize updated.
+ Body
{
"windowsize": <windows_size>
}
## Tenant Generic Rules Collection [/v1.0/{tenantId}/rules]
### Create a new rule [POST]
This operation creates a new rule (General Rule) associated to a tenant or
project identified by *tenantId*.
Response in JSON:
* Succesful operation uses 200 Ok and the subscription data.
* Errors use a non-2xx and optionally an error payload. See subsection "Error Responses"
for more details.
+ Parameters
+ tenantId (required, String, `d3fdddc6324c439780a6fd963a9fa148`) ... Alphanumeric identifier
of the Tenant to perform action with, following the OpenStack ID format.
+ Request (application/json)
+ Attributes
+ name: `scale-up` (required, string) - It is the key whose value represents the name of the rule.
+ condition: `See "Rules" section for more details.` (required, string) - It is the key whose value is the description of the rule associated to this server.
+ action: `See "Rules" section for more details.` (required, string) - The action to take over the server.
+ Headers
X-Auth-Token: 1da5e7629654321e3c123456b89b1cct
+ Body
{
"name": <NAME>,
"condition": <CONDITION_DESCRIPTION>,
"action": <ACTION_ON_SERVER>
}
+ Response 200 (application/json)
+ Attributes
+ ruleId: `52415800-8b69-11e0-9b19-734f6f006e54` (required, string) - It is the key that represents the id of the rule, following the OpenStack Id format.
+ Body
{
"ruleId": <RULE_ID>
}
### Get rules [GET]
This operation gets a Genaral Rule associated to a tenant or project identified
by *tenantId*. This operation does not require any request body and the response
body is in JSON format.
Response in JSON:
* Succesful operation uses 200 Ok and the subscription data.
* Errors use a non-2xx and optionally an error payload. See subsection "Error Responses"
for more details.
+ Parameters
+ tenantId (required, String, `d3fdddc6324c439780a6fd963a9fa148`) ... Alphanumeric identifier
of the Tenant to perform action with, following the OpenStack ID format.
+ Request ()
+ Headers
X-Auth-Token: 1da5e7629654321e3c123456b89b1cct
+ Response 200 (application/json)
+ Attributes
+ name: `scale-up` (required, string) - It is the key whose value represents the name of the rule.
+ condition: `See "Rules" section for more details.` (required, string) - It is the key whose value is the description of the rule associated to this server.
+ action: `See "Rules" section for more details.` (required, string) - The action to take over the server.
+ ruleId: `See "Rules" section for more details.` (required, string) - The identifier of the rule, following the OpenStack ID format.
+ Body
{
"rules": [
{
"name": <NAME>,
"condition": <CONDITION_DESCRIPTION>,
"action": <ACTION_ON_SERVER>,
"ruleId": "<RULE_ID>"
},
{
"name": <NAME2>,
"condition": <CONDITION_DESCRIPTION>,
"action": <ACTION_ON_SERVER>,
"ruleId": "<RULE_ID>"
}
]
}
## Tenant Generic Rule Collection [/v1.0/{tenantId}/rules/{ruleId}]
### Update a rule [PUT]
This operation allows to update a General Rule condition, the action or both identified by its *ruleId* of a
specific tenant or project identified by its *tenantId*.
Response in JSON:
* Succesful operation uses 200 Ok and the data that was updated.
* Errors use a non-2xx and optionally an error payload. See subsection "Error Responses"
for more details.
+ Parameters
+ tenantId (required, String, `d3fdddc6324c439780a6fd963a9fa148`) ... Alphanumeric identifier
of the Tenant to perform action with, following the OpenStack ID format.
+ ruleId (required, string, `52415800-8b69-11e0-9b19-734f6af67565`) ... Alphanumeric identifier
of the rule, following the OpenStack ID format.
+ Request (application/json)
+ Attributes (object)
+ name: `scale-up` (required, string) - It is the key whose value represents the name of the rule.
+ condition: `See "Rules" section for more details.` (required, string) - It is the key whose value is the description of the rule associated to this server.
+ action: `See "Rules" section for more details.` (required, string) - The action to take over the server.
+ Headers
X-Auth-Token: 1da5e7629654321e3c123456b89b1cct
+ Body
{
"name": <NAME>,
"condition": <CONDITION_DESCRIPTION>,
"action": <ACTION_ON_SERVER>
}
+ Response 200 (application/json)
+ Attributes (object)
+ name: `scale-up` (required, string) - It is the key whose value represents the name of the rule that was updated.
+ condition: `See "Rules" section for more details.` (required, string) - It is the key whose value is the description of the rule associated to this server that was updated.
+ action: `See "Rules" section for more details.` (required, string) - The action to take over the server that was updated.
+ Body
{
"name": <NAME>,
"condition": <CONDITION_DESCRIPTION>,
"action": <ACTION_ON_SERVER>
}
### Delete a rule [DELETE]
This operation deletes a specific generic rule identified by its *ruleId*
and associated to a tenant or project identified by its *tenantId*. It does
require neither a request or response body.
Response:
* Succesful operation uses 200 Ok with no data.
* Errors use a non-2xx and optionally an error payload in JSON format. See subsection "Error Responses"
for more details.
+ Parameters
+ tenantId (required, String, `d3fdddc6324c439780a6fd963a9fa148`) ... Alphanumeric identifier
of the Tenant to perform action with, following the OpenStack ID format.
+ ruleId (required, string, `52415800-8b69-11e0-9b19-734f6af67565`) ... Alphanumeric identifier
of the rule, following the OpenStack ID format.
+ Request ()
+ Headers
X-Auth-Token: 1da5e7629654321e3c123456b89b1cct
+ Response 200 ()
### Get a rule [GET]
This operation gets a specific generic rule identified by its *ruleId*
and associated to the tenant or project identified by its *tenantId*.
This operation does not require a request body and the response is in
JSON format.
Response in JSON:
* Succesful operation uses 200 Ok and the data requested.
* Errors use a non-2xx and optionally an error payload. See subsection "Error Responses"
for more details.
+ Parameters
+ tenantId (required, String, `d3fdddc6324c439780a6fd963a9fa148`) ... Alphanumeric identifier
of the Tenant to perform action with, following the OpenStack ID format.
+ ruleId (required, string, `52415800-8b69-11e0-9b19-734f6af67565`) ... Alphanumeric identifier
of the rule, following the OpenStack ID format.
+ Request ()
+ Headers
X-Auth-Token: 1da5e7629654321e3c123456b89b1cct
+ Response 200 (application/json)
+ Attributes
+ name: `scale-up` (required, string) - It is the key whose value represents the name of the rule.
+ condition: `See "Rules" section for more details.` (required, string) - It is the key whose value is the description of the rule associated to this server.
+ action: `See "Rules" section for more details.` (required, string) - The action to take over the server.
+ ruleId: `See "Rules" section for more details.` (required, string) - The identifier of the rule, following the OpenStack ID format.
+ Body
{
"name": <NAME>,
"condition": <CONDITION_DESCRIPTION>,
"action": <ACTION_ON_SERVER>,
"ruleId": "<RULE_ID>"
}
## Servers Collection [/v1.0/{tenantId}/servers/]
### Get the list of all servers' rules [GET]
This operation returns a list of servers with their rules. There is no body in the request.
Response in JSON:
* Succesful operation uses 200 Ok
* Errors use a non-2xx and optionally an error payload. See subsection "Error Responses" for
more details.
+ Parameters
+ tenantId (required, String, `d3fdddc6324c439780a6fd963a9fa148`) ... Alphanumeric identifier
of the Tenant to perform action with, following the OpenStack ID format.
+ Request ()
+ Headers
X-Auth-Token: 1da5e7629654321e3c123456b89b1cct
+ Response 200 (application/json)
+ Attributes (object)
+ serverId: `52415800-8b69-11e0-9b19-734f6af67565` - The identifier of a specific server, following the OpenStack ID format.
+ condition: See "Rules" section for more details. - It is the key whose value is the description of the rule associated to this server.
+ action: See "Rules" section for more details. - The action to take over the server. See "Rules" section for more details.
+ ruleId: `52459800-ej34-91e0-0c19-634f6f006e54` - The identifier of the rule, following the OpenStack Id format.
+ Body
{
"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 [/v1.0/{tenantId}/servers/{serverId}/]
### Get the list of all rules of a server [GET]
This operation returns the rule or rules list associated with a server identified with its
*tenantId* and *serverId*. This operation does not require a body and the response
is in JSON format.
Response in JSON:
* Succesful operation uses 200 Ok
* Errors use a non-2xx and optionally an error payload. See subsection "Error Responses" for
more details.
+ Parameters
+ tenantId (required, String, `d3fdddc6324c439780a6fd963a9fa148`) ... Alphanumeric identifier
of the Tenant to perform action with, following the OpenStack ID format.
+ serverId (required, string, `52415800-8b69-11e0-9b19-734f6af67565`) ... Alphanumeric identifier
of the server, following the OpenStack ID format.
+ Request ()
+ Headers
X-Auth-Token: 1da5e7629654321e3c123456b89b1cct
+ Response 200 (application/json)
+ Attributes
+ serverId: `52415800-8b69-11e0-9b19-734f6af67565` - The identifier of a specific server, following the OpenStack ID format.
+ condition: See "Rules" section for more details. - It is the key whose value is the description of the rule associated to this server.
+ action: See "Rules" section for more details. - The action to take over the server.
+ ruleId: `52459800-ej34-91e0-0c19-634f6f006e54` - The identifier of the rule, following the OpenStack Id format.
+ Body
{
"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>"
}
]
}
## Specific Rules Collection [/v1.0/{tenantId}/servers/{serverId}/rules]
### Create a new rule [POST]
This operation creates a new rule or rules associated to a server, which is identified
by its *serverId* and its *tenantId*. The request specifies the rule to be
created and the action associated to it.
Response in JSON:
* Succesful operation uses 200 Ok and the identifier of the new rule and the server in
which is inserted the new rule.
* Errors use a non-2xx and optionally an error payload. See subsection "Error Responses"
for more details.
+ Parameters
+ tenantId (required, String, `d3fdddc6324c439780a6fd963a9fa148`) ... Alphanumeric identifier
of the Tenant to perform action with, following the OpenStack ID format.
+ serverId (required, string, `52415800-8b69-11e0-9b19-734f6af67565`) ... Alphanumeric identifier
of the server, following the OpenStack ID format.
+ Request (application/json)
+ Attributes
+ name: `scale-up` (required, string) - It is the key whose value represents the name of the rule.
+ condition: `See "Rules" section for more details.` (required, string) - It is the key whose value is the description of the rule associated to this server.
+ action: `See "Rules" section for more details.` (required, string) - The action to take over the server.
+ Headers
X-Auth-Token: 1da5e7629654321e3c123456b89b1cct
+ Body
{
"name": <NAME>,
"condition": <CONDITION_DESCRIPTION>,
"action": <ACTION_ON_SERVER>
}
+ Response 200 (application/json)
+ Attributes (object)
+ serverId: `52415800-8b69-11e0-9b19-734f6af67565` (required, string) - It is the key whose value specifies the serverId in the URI, following the OpenStack ID format.
+ ruleId: `52415800-8b69-11e0-9b19-734f6f006e54` (required, string) - It iss the key that represents the id of the rule, following the OpenStack Id format.
+ Body
{
"serverId": <serverId>,
"ruleId": <RULE_ID>
}
## Specific Rule Collection [/v1.0/{tenantId}/servers/{serverId}/rules/{ruleId}]
### Update a rule [PUT]
This operation allows to update the rule or rules conditions, the action or both or a specific
server identified by its *serverId* and *tenantId* a specific rule identified by its *ruleId*.
This operation requires a request content and we obtain the response with the updated
data.
Response in JSON:
* Succesful operation uses 200 Ok and the data that was updated.
* Errors use a non-2xx and optionally an error payload. See subsection "Error Responses"
for more details.
+ Parameters
+ tenantId (required, String, `d3fdddc6324c439780a6fd963a9fa148`) ... Alphanumeric identifier
of the Tenant to perform action with, following the OpenStack ID format.
+ serverId (required, string, `52415800-8b69-11e0-9b19-734f6af67565`) ... Alphanumeric identifier
of the server, following the OpenStack ID format.
+ ruleId (required, string, `52415800-8b69-11e0-9b19-734f6af67565`) ... Alphanumeric identifier
of the rule, following the OpenStack ID format.
+ Request (application/json)
+ Attributes
+ name: `scale-up` (required, string) - It is the key whose value represents the name of the rule.
+ condition: `See "Rules" section for more details.` (required, string) - It is the key whose value is the description of the rule associated to this server.
+ action: `See "Rules" section for more details.` (required, string) - The action to take over the server.
+ Headers
X-Auth-Token: 1da5e7629654321e3c123456b89b1cct
+ Body
{
"name": <NAME>,
"condition": <CONDITION_DESCRIPTION>,
"action": <ACTION_ON_SERVER>
}