summaryrefslogtreecommitdiffstats
path: root/docs/requirements/supported_apis.rst
blob: 658b44879a9f298a909ca303f3bb894d51ebcf6f (plain)
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
ANNEX C: Supported APIS
=======================

Add Provider
------------

Register a new resource provider (e.g. OpenStack) into reservation system.

Request parameters

============================ =========== ==============================================
Name                         Type        Description
============================ =========== ==============================================
provider-type                Enumeration Name of the resource provider
endpoint                     URI         Targer URL end point for the resource provider
username                     String      User name
password                     String      Password
region                       String      Specified region for the provider
tenant.id                    String      Id of the tenant
tenant.name                  String      Name of the tenant
============================ =========== ==============================================

Response parameters

============================ =========== ==============================================
Name                         Type        Description
============================ =========== ==============================================
provider-id                  String      Id of the new resource provider
result                       Enumeration Result info
============================ =========== ==============================================

.. http:post:: /add-provider
   :noindex:

   **Example request**:

   .. sourcecode:: http

      POST /add-provider HTTP/1.1
      Accept: application/json

      {
        "provider-type": "openstack",
        "endpoint": "http://10.0.2.15:5000/v2.0/tokens",
        "username": "promise_user",
        "password": "******",
        "tenant": {
           "name": "promise"
        }
      }

   **Example response**:

   .. sourcecode:: http

      HTTP/1.1 200 OK
      Content-Type: application/json

      {
        "provider-id": "f25ed9cb-de57-43d5-9b4a-a389a1397302",
        "result": "ok"
      }

Create Reservation
------------------

Make a request to the reservation system to reserve resources.

Request parameters

============================ =============== ==============================================
Name                         Type            Description
============================ =============== ==============================================
zone                         String          Id to an availability zone
start                        DateTime        Timestamp when the consumption of reserved
                                             resources can begin
end                          DateTime        Timestamp when the consumption of reserved
                                             resources should end
capacity.cores               int16           Amount of cores to be reserved
capacity.ram                 int32           Amount of RAM to be reserved
capacity.instances           int16           Amount of instances to be reserved
capacity.addresses           int32           Amount of public IP addresses to be reserved
elements                     ResourceElement List of pre-existing resource elements
                                             to be reserved
============================ =============== ==============================================

Response parameters

============================ =========== ==============================================
Name                         Type        Description
============================ =========== ==============================================
reservation-id               String      Id of the reservation
result                       Enumeration Result info
message                      String      Output message
============================ =========== ==============================================

.. http:post:: /create-reservation
   :noindex:

   **Example request**:

   .. sourcecode:: http

      POST /create-reservation HTTP/1.1
      Accept: application/json

      {
         "capacity": {
            "cores": "5",
            "ram": "25600",
            "addresses": "3",
            "instances": "3"
         },
         "start": "2016-02-02T00:00:00Z",
         "end": "2016-02-03T00:00:00Z"
      }

   **Example response**:

   .. sourcecode:: http

      HTTP/1.1 200 OK
      Content-Type: application/json

      {
        "reservation-id": "269b2944-9efc-41e0-b067-6898221e8619",
        "result": "ok",
        "message": "reservation request accepted"
      }

Update Reservation
------------------

Update reservation details for an existing reservation.

Request parameters

============================ =============== ==============================================
Name                         Type            Description
============================ =============== ==============================================
reservation-id               String          Id of the reservation to be updated
zone                         String          Id to an availability zone
start                        DateTime        Updated timestamp when the consumption of
                                             reserved resources can begin
end                          DateTime        Updated timestamp when the consumption of
                                             reserved resources should end
capacity.cores               int16           Updated amount of cores to be reserved
capacity.ram                 int32           Updated amount of RAM to be reserved
capacity.instances           int16           Updated amount of instances to be reserved
capacity.addresses           int32           Updated amount of public IP addresses
                                             to be reserved
elements                     ResourceElement Updated list of pre-existing resource elements
                                             to be reserved
============================ =============== ==============================================

Response parameters

============================ =========== ==============================================
Name                         Type        Description
============================ =========== ==============================================
result                       Enumeration Result info
message                      String      Output message
============================ =========== ==============================================

.. http:post:: /update-reservation
   :noindex:

   **Example request**:

   .. sourcecode:: http

      POST /update-reservation HTTP/1.1
      Accept: application/json

      {
         "reservation-id": "269b2944-9efv-41e0-b067-6898221e8619",
         "capacity": {
            "cores": "1",
            "ram": "5120",
            "addresses": "1",
            "instances": "1"
         }
      }

   **Example response**:

   .. sourcecode:: http

      HTTP/1.1 200 OK
      Content-Type: application/json

      {
        "result": "ok",
        "message": "reservation update successful"
      }

Cancel Reservation
------------------

Cancel the reservation.

Request parameters

============================ =============== ==============================================
Name                         Type            Description
============================ =============== ==============================================
reservation-id               String          Id of the reservation to be canceled
============================ =============== ==============================================

Response parameters

============================ =========== ==============================================
Name                         Type        Description
============================ =========== ==============================================
result                       Enumeration Result info
message                      String      Output message
============================ =========== ==============================================

.. http:post:: /cancel-reservation
   :noindex:

   **Example request**:

   .. sourcecode:: http

      POST /cancel-reservation HTTP/1.1
      Accept: application/json

      {
        "reservation-id": "269b2944-9efv-41e0-b067-6898221e8619"
      }

   **Example response**:

   .. sourcecode:: http

      HTTP/1.1 200 OK
      Content-Type: application/json

      {
        "result": "ok",
        "message": "reservation canceled"
      }

Query Reservation
-----------------

Query the reservation system to return matching reservation(s).

Request parameters

============================ ================== ==============================================
Name                         Type               Description
============================ ================== ==============================================
zone                         String             Id to an availability zone
show-utilization             Boolean            Show capacity utilization
without                      ResourceCollection Excludes specified collection identifiers
                                                from the result
elements.some                ResourceElement    Query for ResourceCollection(s) that contain
                                                some or more of these element(s)
elements.every               ResourceElement    Query for ResourceCollection(s) that contain
                                                all of these element(s)
window.start                 DateTime           Matches entries that are within the specified
                                                start/end window
window.end                   DateTime
wndow.scope                  Enumeration        Matches entries that start {and/or} end
                                                within the time window
============================ ================== ==============================================

Response parameters

============================ =================== ================================
Name                         Type                Description
============================ =================== ================================
reservations                 ResourceReservation List of matching reservations
utilization                  CapacityUtilization Capacity utilization over time
============================ =================== ================================

.. http:post:: /query-reservation
   :noindex:

   **Example request**:

   .. sourcecode:: http

      POST /query-reservation HTTP/1.1
      Accept: application/json

      {
         "show-utilization": false,
         "window": {
            "start": "2016-02-01T00:00:00Z",
            "end": "2016-02-04T00:00:00Z"
         }
      }

   **Example response**:

   .. sourcecode:: http

      HTTP/1.1 200 OK
      Content-Type: application/json

      {
        "reservations": [
          "269b2944-9efv-41e0-b067-6898221e8619"
        ],
        "utilization": []
      }

Create Instance
---------------

Create an instance of specified resource(s) utilizing capacity from the pool.

Request parameters

============================ =============== ==============================================
Name                         Type            Description
============================ =============== ==============================================
provider-id                  String          Id of the resource provider
reservation-id               String          Id of the resource reservation
name                         String          Name of the instance
image                        String          Id of the image
flavor                       String          Id of the flavor
networks                     Uuid            List of network uuids
============================ =============== ==============================================

Response parameters

============================ =========== ==============================================
Name                         Type        Description
============================ =========== ==============================================
instance-id                  String      Id of the instance
result                       Enumeration Result info
message                      String      Output message
============================ =========== ==============================================

.. http:post:: /create-instance
   :noindex:

   **Example request**:

   .. sourcecode:: http

      POST /create-instance HTTP/1.1
      Accept: application/json

      {
        "provider-id": "f25ed9cb-de57-43d5-9b4a-a389a1397302",
        "name": "vm1",
        "image": "ddffc6f5-5c86-4126-b0fb-2c71678633f8",
        "flavor": "91bfdf57-863b-4b73-9d93-fc311894b902"
      }

   **Example response**:

   .. sourcecode:: http

      HTTP/1.1 200 OK
      Content-Type: application/json

      {
        "instance-id": "82572779-896b-493f-92f6-a63008868250",
        "result": "ok",
        "message": "created-instance request accepted"
      }

Destroy Instance
----------------

Destroy an instance of resource utilization and release it back to the pool.

Request parameters

============================ =============== ==============================================
Name                         Type            Description
============================ =============== ==============================================
instance-id                  String          Id of the instance to be destroyed
============================ =============== ==============================================

Response parameters

============================ =========== ==============================================
Name                         Type        Description
============================ =========== ==============================================
result                       Enumeration Result info
message                      String      Output message
============================ =========== ==============================================

.. http:post:: /destroy-instance
   :noindex:

   **Example request**:

   .. sourcecode:: http

      POST /destroy-instance HTTP/1.1
      Accept: application/json

      {
         "instance-id": "82572779-896b-493f-92f6-a63008868250"
      }

   **Example response**:

   .. sourcecode:: http

      HTTP/1.1 200 OK
      Content-Type: application/json

      {
        "result": "ok",
        "message": "instance destroyed and resource released back to pool"
      }

Decrease Capacity
-----------------

Decrease total capacity for the reservation system for a given time window.

Request parameters

============================ =============== ==============================================
Name                         Type            Description
============================ =============== ==============================================
source                       String          Id of the resource container
start                        DateTime        Start/end defines the time window when total
                                             capacity is decreased
end                          DateTime
capacity.cores               int16           Decreased amount of cores
capacity.ram                 int32           Decreased amount of RAM
capacity.instances           int16           Decreased amount of instances
capacity.addresses           int32           Decreased amount of public IP addresses
============================ =============== ==============================================

Response parameters

============================ =========== ==============================================
Name                         Type        Description
============================ =========== ==============================================
pool-id                      String      Id of the resource pool
result                       Enumeration Result info
message                      String      Output message
============================ =========== ==============================================

.. http:post:: /decrease-capacity
   :noindex:

   **Example request**:

   .. sourcecode:: http

      POST /decrease-capacity HTTP/1.1
      Accept: application/json

      {
         "source": "ResourcePool:4085f0da-8030-4252-a0ff-c6f93870eb5f",
         "capacity": {
            "cores": "3",
            "ram": "5120",
            "addresses": "1"
         }
      }

   **Example response**:

   .. sourcecode:: http

      HTTP/1.1 200 OK
      Content-Type: application/json

      {
         "pool-id": "c63b2a41-bcc6-42f6-8254-89d633e1bd0b",
         "result": "ok",
         "message": "capacity decrease successful"
      }

Increase Capacity
-----------------

Increase total capacity for the reservation system for a given time window.

Request parameters

============================ =============== ==============================================
Name                         Type            Description
============================ =============== ==============================================
source                       String          Id of the resource container
start                        DateTime        Start/end defines the time window when total
                                             capacity is increased
end                          DateTime
capacity.cores               int16           Increased amount of cores
capacity.ram                 int32           Increased amount of RAM
capacity.instances           int16           Increased amount of instances
capacity.addresses           int32           Increased amount of public IP addresses
============================ =============== ==============================================

Response parameters

============================ =========== ==============================================
Name                         Type        Description
============================ =========== ==============================================
pool-id                      String      Id of the resource pool
result                       Enumeration Result info
message                      String      Output message
============================ =========== ==============================================

.. http:post:: /increase-capacity
   :noindex:

   **Example request**:

   .. sourcecode:: http

      POST /increase-capacity HTTP/1.1
      Accept: application/json

      {
         "source": "ResourceProvider:f6f13fe3-0126-4c6d-a84f-15f1ab685c4f",
         "capacity": {
             "cores": "20",
             "ram": "51200",
             "instances": "10",
             "addresses": "10"
         }
      }

   **Example response**:

   .. sourcecode:: http

      HTTP/1.1 200 OK
      Content-Type: application/json

      {
         "pool-id": "279217a4-7461-4176-bf9d-66770574ca6a",
         "result": "ok",
         "message": "capacity increase successful"
      }

Query Capacity
--------------

Query for capacity information about a specified resource collection.

Request parameters

============================ ================== ==============================================
Name                         Type               Description
============================ ================== ==============================================
capacity                     Enumeration        Return total or reserved or available or
                                                usage capacity information
zone                         String             Id to an availability zone
show-utilization             Boolean            Show capacity utilization
without                      ResourceCollection Excludes specified collection identifiers
                                                from the result
elements.some                ResourceElement    Query for ResourceCollection(s) that contain
                                                some or more of these element(s)
elements.every               ResourceElement    Query for ResourceCollection(s) that contain
                                                all of these element(s)
window.start                 DateTime           Matches entries that are within the specified
                                                start/end window
window.end                   DateTime
window.scope                 Enumeration        Matches entries that start {and/or} end
                                                within the time window
============================ ================== ==============================================

Response parameters

============================ =================== ================================
Name                         Type                Description
============================ =================== ================================
collections                  ResourceCollection  List of matching collections
utilization                  CapacityUtilization Capacity utilization over time
============================ =================== ================================

.. http:post:: /query-capacity
   :noindex:

   **Example request**:

   .. sourcecode:: http

      POST /query-capacity HTTP/1.1
      Accept: application/json

      {
        "show-utilization": false
      }

   **Example response**:

   .. sourcecode:: http

      HTTP/1.1 201 CREATED
      Content-Type: application/json

      {
        "collections": [
          "ResourcePool:279217a4-7461-4176-bf9d-66770574ca6a"
        ],
        "utilization": []
      }