Programmatic interface

Fogbow provides its own RESTful API that can be used to manage resources in any of the clouds that belong to the federation. All calls to the RESTful API require a token that is used to authenticate the user, and check if she/he is authorized to execute the requested operation. These tokens are acquired from the Federation Identity Provider (FIdP) that is used in the federation. In the following there is a description of all the requests that can be issued to the most important services that can be deployed in a Fogbow site.

RAS

Compute resources management

Endpoint Method Header fields Description
/computes POST X-Auth-Token: Authentication token
X-OCCI-Attributes: Attributes
Link: Links
Category: Categories.
Requests the creation of a new Compute resource at the indicated cloud provider, with the hardware and software requirements specified. It returns the Compute resource identification created.
/computes GET X-Auth-Token: Authentication token Returns all the active Compute resources whose creation has been requested by the user at the indicated cloud provider.
/computes/status GET X-Auth-Token: Authentication token Returns a list with the identifications of all active Compute resources whose creation has been requested by the user at the indicated cloud provider, together with their respective status.
/computes/{computer_id} GET X-Auth-Token: Authentication token Returns the Compute resource at the specified provider, whose identification is the one specified in the request.
/computes/{computer_id} DELETE X-Auth-Token: Authentication token Releases the Compute resource at the specified provider, whose identification is the one specified in the request.
/computes//quota/{memberId:.+} GET X-Auth-Token: Authentication token Returns the Compute quota associated to the user at the specified provider.
/computes/allocation GET X-Auth-Token: Authentication token Returns the amount of Compute resources that has been allocated to the user at the indicated provider.

Volume resources management

Endpoint Method Header fields Description
/volumes POST X-Auth-Token: Authentication token
X-OCCI-Attributes: Attributes
Link: Links
Category: Categories.
Requests the creation of a new Volume resource at the indicated cloud provider, with the size and, optionally, the name specified. It returns the Volume resource identification created.
/volumes GET X-Auth-Token: Authentication token Returns all the active Volume resources whose creation has been requested by the user at the indicated cloud provider.
/volumes/status GET X-Auth-Token: Authentication token Returns a list with the identifications of all active Volume resources whose creation has been requested by the user at the indicated cloud provider, together with their respective status.
/volumes/{computer_id} GET X-Auth-Token: Authentication token Returns the Volume resource at the specified provider, whose identification is the one specified in the request.
/volumes/{computer_id} DELETE X-Auth-Token: Authentication token Releases the Volume resource at the specified provider, whose identification is the one specified in the request.
/volumes//quota/{memberId:.+} GET X-Auth-Token: Authentication token Returns the Volume quota associated to the user at the specified provider.
/volumes/allocation GET X-Auth-Token: Authentication token Returns the amount of Volume resources that has been allocated to the user at the indicated provider.

Network resource management

Endpoint Method Header fields Description
/networks POST X-Auth-Token: Authentication token
X-OCCI-Attributes: Attributes
Link: Links
Category: Categories.
Requests the creation of a new Network resource at the indicated cloud provider, with the requirements specified. It returns the Network resource identification created.
/networks GET X-Auth-Token: Authentication token Returns all the active Network resources whose creation has been requested by the user at the indicated cloud provider.
/networks/status GET X-Auth-Token: Authentication token Returns a list with the identifications of all active Network resources whose creation has been requested by the user at the indicated cloud provider, together with their respective status.
/networks/{computer_id} GET X-Auth-Token: Authentication token Returns the Network resource at the specified provider, whose identification is the one specified in the request.
/networks/{computer_id} DELETE X-Auth-Token: Authentication token Releases the Network resource at the specified provider, whose identification is the one specified in the request.
/networks//quota/{memberId:.+} GET X-Auth-Token: Authentication token Returns the Network quota associated to the user at the specified provider.
/networks/allocation GET X-Auth-Token: Authentication token Returns the amount of Network resources that has been allocated to the user at the indicated provider.

OCCI Categories for Order

Category name Required Description
order; scheme="http://schemas.fogbowcloud.org/request#"; class="kind" required Compute category
{flavor_name}; scheme="http://schemas.fogbowcloud.org/template/resource#"; class="mixin" optional Flavor name category
{image_name}; scheme="http://schemas.fogbowcloud.org/template/os#"; class="mixin" required for compute Image name category
fogbow_public_key; scheme="http://schemas.fogbowcloud/credentials#"; class="mixin" optional Public key category

OCCI Link for Order

Link name Required Description
</network/{network_id}>; rel="http://schemas.ogf.org/occi/infrastructure#network"; category="http://schemas.ogf.org/occi/infrastructure#network" optional Link

OCCI Attributes for Order

Attribute name Type Required Description
org.fogbowcloud.request.instance-count int required Number of instances to be created
org.fogbowcloud.request.type string optional Type of the request: one-time or persistent
org.fogbowcloud.request.extra-user-data string optional User data in cloud-init format. Base64 encoded
org.fogbowcloud.request.extra-user-data-content-type string optional Type of the user data as specified in cloud-init documentation
org.fogbowcloud.order.storage-size int required for storage Storage size in GB
occi.network.address string required for network Network address in CIDR notation
occi.network.gateway string optional Network gateway
occi.network.allocation string optional Accepted values: dynamic or static
org.fogbowcloud.order.resource-kind string required Kind of resource to be created: compute, storage or network
org.fogbowcloud.request.requirements string optional Expression with minimum requirements to create resources
(See below)
org.openstack.credentials.publickey.data string optional Public key data
org.openstack.credentials.publickey.name string optional Public key name

Requirements

Requirements is an expression containing information used on the creation of an instance. The requirements are separated by &&.

Requirement Used in order of type Description
Glue2CloudComputeManagerID compute
storage
network
Sets on which manager the order is to be used
Glue2vCPU compute Sets the number of vCPUs
Glue2RAM compute Sets the amount of vRAM

Example

"Glue2CloudComputeManagerID=="manager-id" && Glue2vCPU >= 1 && Glue2RAM >= 1024"


Examples:

Create order type compute.

POST /order
Category: order; scheme="http://schemas.fogbowcloud.org/request#"; class="kind"   
Category: fogbow_small; scheme="http://schemas.fogbowcloud.org/template/resource#"; class="mixin"
Category: fogbow-ubuntu; scheme="http://schemas.fogbowcloud.org/template/os#"; class="mixin"   
Category: fogbow_public_key; scheme="http://schemas.fogbowcloud.org/credentials#"; class="mixin"   
X-OCCI-Attribute: org.fogbowcloud.request.instance-count=1
X-OCCI-Attribute: org.fogbowcloud.request.type=one-time
X-OCCI-Attribute: org.fogbowcloud.request.extra-user-data={base64 encoded script}
X-OCCI-Attribute: org.fogbowcloud.request.extra-user-data-content-type=text/x-shellscript
X-OCCI-Attribute: org.fogbowcloud.order.resource-kind=compute
X-OCCI-Attribute: org.fogbowcloud.request.requirements="Glue2CloudComputeManagerID==\"manager.one.member.com\"" 
X-OCCI-Attribute: org.openstack.credentials.publickey.data={public_key}
X-OCCI-Attribute: org.openstack.credentials.publickey.name=mypublickey
Link: </network/network00>; rel="http://schemas.ogf.org/occi/infrastructure#network"; category="http://schemas.ogf.org/occi/infrastructure#network"

Create order type storage.

POST /order
Category: order; scheme="http://schemas.fogbowcloud.org/request#"; class="kind"
X-OCCI-Attribute: org.fogbowcloud.request.instance-count=1
X-OCCI-Attribute: org.fogbowcloud.request.type=one-time
X-OCCI-Attribute: org.fogbowcloud.order.resource-kind=storage
X-OCCI-Attribute: org.fogbowcloud.order.storage-size=10

Create order type network.

POST /order
Category: order; scheme="http://schemas.fogbowcloud.org/request#"; class="kind"
X-OCCI-Attribute: org.fogbowcloud.request.instance-count=1
X-OCCI-Attribute: org.fogbowcloud.request.type=one-time
X-OCCI-Attribute: org.fogbowcloud.order.resource-kind=network
X-OCCI-Attribute: occi.network.address=10.10.10.10/24
X-OCCI-Attribute: occi.network.gateway=10.10.10.1
X-OCCI-Attribute: occi.network.allocation=dynamic

Compute: /compute

Endpoint Method Header fields Description
/compute GET X-Auth-Token: User's authentication token Fetch the list of user's computes
/compute/{compute_id} GET X-Auth-Token: User's authentication token Fetch an compute by its ID
/compute/{compute_id} DELETE X-Auth-Token: User's authentication token Delete a specific compute by ID
/compute
(DEPRECATED)
POST X-Auth-Token: User's authentication token
X-OCCI-Attributes: Attributes
Categories: Categories
Create a compute

OCCI Categories for Compute

Category name required Description
compute; scheme="http://schemas.ogf.org/occi/infrastructure#"; class="kind" required Compute category
flavor_name; scheme="http://schemas.fogbowcloud.org/template/resource#"; class="mixin" required Flavor name category
image_name; scheme="http://schemas.fogbowcloud.org/template/os#"; class="mixin" required Image name category

OCCI Attributes for Compute

Attribute name Type required Description
org.fogbowcloud.request.extra-user-data string optional User data in cloud-init format. Base64 encoded
org.fogbowcloud.request.extra-user-data-content-type string optional Type of the user data as specified in cloud-init documentation
org.openstack.credentials.publickey.data string optional Public key data
org.openstack.credentials.publickey.name string optional Public key name

Storage: /storage

Endpoint Method Header fields Description
/storage GET X-Auth-Token: User's authentication token Fetch the list of user's storages
/storage/{storage_id} GET X-Auth-Token: User's authentication token Fetch an storage by its ID
/storage/{storage_id} DELETE X-Auth-Token: User's authentication token Delete a specific storage by ID
/storage POST X-Auth-Token: User's authentication token
X-OCCI-Attributes: Attributes
Categories: Categories
Create a storage

OCCI Categories for Storage

Category name required Description
storage; scheme="http://schemas.ogf.org/occi/infrastructure#"; class="kind" required Storage category

OCCI Attributes for Storage

Attribute name Type required Description
occi.storage.size int required Storage size

Network: /network

Endpoint Method Header fields Description
/network GET X-Auth-Token: User's authentication token Fetch the list of user's networks
/network/{network_id} GET X-Auth-Token: User's authentication token Fetch an network by its ID
/network/{network_id} DELETE X-Auth-Token: User's authentication token Delete a specific network by ID
/network POST X-Auth-Token: User's authentication token
X-OCCI-Attributes: Attributes
Categories: Categories
Create a network

OCCI Categories for Network

Category name required Description
network; scheme="http://schemas.ogf.org/occi/infrastructure#"; class="kind" required Storage category

OCCI Attributes for Network

Attribute name Type required Description
occi.network.address String required IP address in CIDR notation
occi.network.gateway String optional IP address of network gateway

Attachment: /storage/link

Endpoint Method Header fields Description
/storage/link GET X-Auth-Token: User's authentication token Fetch the list of user's attachments
/storage/link/{storagelink_id} GET X-Auth-Token: User's authentication token Fetch an attachment by its ID
/storage/link/{storagelink_id} DELETE X-Auth-Token: User's authentication token Delete a specific attachment by ID
/storage/link/ POST X-Auth-Token: User's authentication token
X-OCCI-Attributes: Attributes
Categories: Categories
Create a attachment

OCCI Categories for attachment

Category name required Description
storagelink; scheme="http://schemas.ogf.org/occi/infrastructure#"; class="kind" required Storage category

OCCI Attributes for attachment

Attribute name Type required Description
occi.core.source String required Compute id
occi.core.target String required Storage id

Members: /member

Endpoint Method Header fields Description
/member GET X-Auth-Token: User's authentication token
Content-Type: 'text/occi'
Fetch the list of federation members
/member/{member_id}/quota GET X-Auth-Token: User's authentication token Fetch an quota of member by it's ID
/member/{member_id}/usage GET X-Auth-Token: User's authentication token Fetch an usage of member by it's ID
/member/accounting/compute GET X-Auth-Token: User's authentication token Fetch a accounting of compute
/member/accounting/storage GET X-Auth-Token: User's authentication token Fetch a accounting of storage