Blazar REST API v2 (deprecated)

Blazar REST API v2 (deprecated)

NOTE: This version is deprecated. Please use the Blazar REST API v1.

1 General API information

This section contains base information about the Blazar REST API design, including operations with different Blazar resource types and examples of possible requests and responses. Blazar supports JSON data serialization format, which means that requests with non empty body have to contain “application/json” Content-Type header or it should be added “.json” extension to the resource name in the request.

This should look like the following:

GET /v2/leases.json

or

GET /v2/leases
Accept: application/json

2 Leases

Description

Lease is the main abstraction for the user in the Blazar case. Lease means some kind of contract where start time, end time and resources to be reserved are mentioned.

type Lease

Data samples:

Json
{
    "before_end_date": "2014-02-01 10:37",
    "end_date": "2014-02-01 13:37",
    "events": [],
    "id": "2bb8720a-0873-4d97-babf-0d906851a1eb",
    "name": "lease_test",
    "project_id": "bd9431c18d694ad3803a8d4a6b89fd36",
    "reservations": [
        {
            "resource_id": "1234",
            "resource_type": "physical:host"
        }
    ],
    "start_date": "2014-01-01 01:23",
    "status": "ACTIVE",
    "trust_id": "35b17138b3644e6aa1318f3099c5be68",
    "user_id": "efd8780712d24b389c705f5c2ac427ff"
}
XML
<value>
  <id>2bb8720a-0873-4d97-babf-0d906851a1eb</id>
  <name>lease_test</name>
  <start_date>2014-01-01 01:23</start_date>
  <end_date>2014-02-01 13:37</end_date>
  <user_id>efd8780712d24b389c705f5c2ac427ff</user_id>
  <project_id>bd9431c18d694ad3803a8d4a6b89fd36</project_id>
  <trust_id>35b17138b3644e6aa1318f3099c5be68</trust_id>
  <reservations>
    <item>
      <item>
        <key>resource_type</key>
        <value>physical:host</value>
      </item>
      <item>
        <key>resource_id</key>
        <value>1234</value>
      </item>
    </item>
  </reservations>
  <events />
  <before_end_date>2014-02-01 10:37</before_end_date>
  <status>ACTIVE</status>
</value>
before_end_date
Type:datetime

Datetime when some actions will be taken before lease ending

end_date
Type:datetime

Datetime when the lease should end

events
Type:list(dict(unicode: unicode))

The list of events attached to the lease

id
Type:uuid

The UUID of the lease

name
Type:unicode

The name of the lease

project_id
Type:uuid

The ID of the project or tenant the lease belongs to

reservations
Type:list(dict(unicode: unicode))

The list of reservations belonging to the lease

start_date
Type:datetime

Datetime when the lease should start

status
Type:unicode

The status of the lease

trust_id
Type:uuid

The ID of the trust created for delegating the rights of the user

user_id
Type:uuid

The ID of the user who creates the lease

3 Hosts

Description

Host is the abstraction for a computehost in the Blazar case. Host means a specific type of resource to be allocated.

type Host

Data samples:

Json
{
    "cpu_info": "{\"vendor\": \"Intel\", \"model\": \"qemu32\", \"arch\": \"x86_64\", \"features\": [], \"topology\": {\"cores\": 1}}",
    "extra_capas": {
        "fruits": "bananas",
        "vgpus": 2
    },
    "hypervisor_hostname": "host01",
    "hypervisor_type": "QEMU",
    "hypervisor_version": 1000000,
    "id": "1",
    "local_gb": 50,
    "memory_mb": 8192,
    "vcpus": 1
}
XML
<value>
  <id>1</id>
  <hypervisor_hostname>host01</hypervisor_hostname>
  <hypervisor_type>QEMU</hypervisor_type>
  <vcpus>1</vcpus>
  <hypervisor_version>1000000</hypervisor_version>
  <memory_mb>8192</memory_mb>
  <local_gb>50</local_gb>
  <cpu_info>{"vendor": "Intel", "model": "qemu32", "arch": "x86_64", "features": [], "topology": {"cores": 1}}</cpu_info>
  <extra_capas>
    <item>
      <key>vgpus</key>
      <value>2</value>
    </item>
    <item>
      <key>fruits</key>
      <value>bananas</value>
    </item>
  </extra_capas>
</value>
cpu_info
Type:cpuinfo as JSON formated str

The CPU info JSON data given by the hypervisor

extra_capas
Type:dict(unicode: textorinteger)

Extra capabilities for the host

hypervisor_hostname
Type:unicode

The hostname of the host

hypervisor_type
Type:unicode

The type of the hypervisor

hypervisor_version
Type:integer

The version of the hypervisor

id
Type:integer

The ID of the host

local_gb
Type:integer

The disk size (in Gb) of the host

memory_mb
Type:integer

The memory size (in Mb) of the host

trust_id
Type:uuid

The ID of the trust created for delegating the rights of the user

vcpus
Type:integer

The number of VCPUs of the host

Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.