User Tools

Site Tools


promise:apis_b_release

This is an old revision of the document!


Supported APIs for B-Release

1. Add Provider

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

Request parameters

Parameters Types Description
provider-type Enumeration Name of the resource provider
endpoint URI Target URL endpoint 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

Parameters Types Description
provider-id String Id of the new resource provider
result Enumeration Result info

Example request

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

Example response

  {
    "provider-id": "1bc96b9c-c316-4854-aa10-9d2bea35508f",
    "result": "ok"
  }
 

2. Create Reservation

Make a request to the reservation system to reserve resources.

Request parameters

Parameters Types 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.networks int16 Amount of networks to be reserved
capacity.ports int16 Amount of ports to be reserved
capacity.routers int16 Amount of routers to be reserved
capacity.subnets int16 Amount of subnets to be reserved
capacity.addresses int32 Amount of public IP addresses to be reserved
capacity.gigabytes int32 Amount of gigabytes to be reserved
capacity.snapshots int16 Amount of snapshots to be reserved
capacity.volumes int16 Amount of volumes to be reserved
elements ResourceElement List of pre-existing resource elements to be reserved

Response parameters

Parameters Types Description
reservation-id String Id of the reservation
result Enumeration Result info
message String Output message

Example request

  {
     "capacity": {
        "cores": "5",
        "ram": 0
        "instances": 0
        "networks": 0,
        "ports": 0,
        "routers": 0,
        "subnets": 0,
        "addresses": "3",
        "gigabytes": "10,
        "snapshots": 0,
        "volumes": 0
    },
    "elements": []
  }
  

Example response

  {
     "reservation-id": "f6f7d56a-4740-48fe-b197-42a7001beb95",
     "result": "ok",
     "message": "reservation request accepted"
  }

3. Update Reservation

Update reservation details for an existing reservation.

Request parameters

Parameters Types 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.networks int16 Updated amount of networks to be reserved
capacity.ports int16 Updated amount of ports to be reserved
capacity.routers int16 Updated amount of routers to be reserved
capacity.subnets int16 Updated amount of subnets to be reserved
capacity.addresses int32 Updated amount of public IP addresses to be reserved
capacity.gigabytes int32 Updated amount of gigabytes to be reserved
capacity.snapshots int16 Updated amount of snapshots to be reserved
capacity.volumes int16 Updated amount of volumes to be reserved
elements ResourceElement Updated list of pre-existing resource elements to be reserved

Response parameters

Parameters Types Description
result Enumeration Result info
message String Output message

Example request

  {
     "reservation-id": "f6f7d56a-4740-48fe-b197-42a7001beb95",
     "end": "2015-12-24T11:37:55.329Z",
     "capacity": {
        "cores": "3",
        ...
     },
     "elements": [] 
  }
  

Example response

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

4. Cancel Reservation

Cancel the reservation.

Request parameters

Parameters Types Description
reservation-id String Id of the reservation to be canceled

Response parameters

Parameters Types Description
result Enumeration Result info
message String Output message

Example request

{

     "reservation-id": "f6f7d56a-4740-48fe-b197-42a7001beb95"
  }
 

Example response

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

5. Query Reservation

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

Request parameters

Parameters Types 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
window.scope Enumeration Matches entries that start {and/or} end within the time window

Response parameters

Parameters Types Description
reservations ResourceReservation List of matching reservations
utilization CapacityUtilization Capacity utilization over time

Example request

{

   "show-utilization": false,
   "without": [],
   "elements": {
     "some": [],
     "every": []
   },
   "window": {
      "start": "2015-12-23T12:04:31.509Z",
      "scope": "inclusive"
   }
 }

Example response

  {
     "reservations": [
       "f6f7d56a-4740-48fe-b197-42a7001beb95",
       "e3ed0f9f-27b5-4b61-91cc-f4d541bcbadf"
     ],
     "utilization": []
  }
  

6. Create Instance (WIP)

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

7. Destroy Instance (WIP)

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

8. Decrease Capacity

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

Request parameters

Parameters Types 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.networks int16 Decreased amount of networks
capacity.ports int16 Decreased amount of ports
capacity.routers int16 Decreased amount of routers
capacity.subnets int16 Decreased amount of subnets
capacity.addresses int32 Decreased amount of public IP addresses
capacity.gigabytes int32 Decreased amount of gigabytes
capacity.snapshots int16 Decreased amount of snapshots
capacity.volumes int16 Decreased amount of volumes
elements ResourceElement

Response parameters

Parameters Types Description
pool-id String Id of the resource pool
result Enumeration Result info
message String Output message

Example request

{

   "source": "ResourcePool:6bb6ba9e-f577-4ade-b15e-4d11395fca3d",
   "capacity": {
        "cores": "3",
        ...
    },
    "elements": [] 
 }

Example response

  {
     "pool-id": "4085f0da-8030-4252-a0ff-c6f93870eb5f",
     "result": "ok",
     "message": "capacity decrease successful"
  }

9. Increase Capacity

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

Request parameters

Parameters Types 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.networks int16 Increased amount of networks
capacity.ports int16 Increased amount of ports
capacity.routers int16 Increased amount of routers
capacity.subnets int16 Increased amount of subnets
capacity.addresses int32 Increased amount of public IP addresses
capacity.gigabytes int32 Increased amount of gigabytes
capacity.snapshots int16 Increased amount of snapshots
capacity.volumes int16 Increased amount of volumes
elements ResourceElement

Response parameters

Parameters Types Description
pool-id String Id of the resource pool
result Enumeration Result info
message String Output message

Example request

{

   "source": "ResourcePool:4085f0da-8030-4252-a0ff-c6f93870eb5f",
   "capacity": {
        "cores": "3",
        ...
    },
    "elements": [] 
 }

Example response

  {
     "pool-id": "49d2b4f1-823c-4932-88ee-5f38839dc543",
     "result": "ok",
     "message": "capacity increase successful"
  }

10. Query Capacity

Query for capacity information about a specified resource collection.

Request parameters

Parameters Types 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

Parameters Types Description
collections ResourceCollection List of matching collections
utilization CapacityUtilization Capacity utilization over time

Example request

{

   "capacity": "available",
   "show-utilization": false,
   "without": [],
   "elements": {
     "some": [],
     "every": []
   },
   "window": {
      "scope": "inclusive"
   }
 }

Example response

  {
     "collections": [
       "ResourcePool:6bb6ba9e-f577-4ade-b15e-4d11395fca3d",
       "ResourcePool:4085f0da-8030-4252-a0ff-c6f93870eb5f",
       "ResourcePool:49d2b4f1-823c-4932-88ee-5f38839dc543"
     ],
     "utilization": []
  }
promise/apis_b_release.1448634709.txt.gz · Last modified: 2015/11/27 14:31 by Bertrand Souville