Reservation API v1

Reservation API v1

This is a reference for the OpenStack Reservation API which is provided by the Blazar project.

Leases

A date and time format for *_date parameters is CCYY-MM-DD hh:mm. For example, 2017-12-26 12:00.

GET
v1/leases

List Leases

List leases.

Response codes

Normal response code: 200

Error response codes: Bad Request(400), Unauthorized(401), Forbidden(403), Internal Server Error(500)

Request

No body content, path, nor query option.

Response

General Parameters

Name In Type Description
leases body array A list of lease objects.
id body string The UUID of the lease.
name body string The name of the lease.
start_date body string The start date and time of the lease.
end_date body string The end date and time of the lease.
status body string The status of the lease.
degraded body boolean The flag for reserved resources of the lease. This is set True while missing_resources or resources_changed of reservations is set True.
user_id body string The UUID of the lease owner.
project_id body string The UUID the project which owns the lease.
trust_id body string The UUID of the trust of the lease owner.
created_at body string The date and time when the object was created.
updated_at body string The date and time when the object was updated.
reservations body array A list of reservation objects.
reservation.id body string The UUID of the reservation.
reservation.lease_id body string The UUID of the lease to which the reservation belongs.
reservation.status body string The status of the reservation.
reservation.missing_resources body boolean The flag for the capacity of reserved resources. It is set True while the amount of reserved resources is less than the request.
reservation.resources_changed body boolean The flag for changes of reserved resources. If it is set True if reserved resources were changed after the lease started.
reservation.resource_id body string The ID of the resource object of the reservation.
reservation.resource_type body string

The type of the resource to reserve.

Note

physical:host and virtual:instance types are supported.

reservation.created_at body string The date and time when the object was created.
reservation.updated_at body string The date and time when the object was updated.
events body array A list of event objects.
event.id body string The UUID of the event.
event.lease_id body string The UUID of the lease to which the event belongs.
event.status body string The status of the event.
event.event_type body string The type of the event.
event.time body string The date and time of the event.
event.created_at body string The date and time when the object was created.
event_updated_at body string The date and time when the object was updated.

Parameters for Host Reservation

The following parameters are returned for host reservation. All parameters are in the reservation object.

Name In Type Description
reservation.min body integer The minimum number of hosts to reserve.
reservation.max body integer The maximum number of hosts to reserve.
reservation.hypervisor_properties body string Properties of the hypervisor to reserve.
reservation.resource_properties body string Properties of the resource to reserve.
reservation.before_end body string

The before-end-action of the reservation.

Note

default and snapshot actions are supported.

Parameters for Instance Reservation

The following parameters are returned for instance reservation. All parameters are in the reservation object.

Name In Type Description
reservation.amount body integer The amount of instances to reserve.
reservation.vcpus body integer The number of VCPUs per the instance.
reservation.memory_mb body integer Megabytes of memory per the instance.
reservation.disk_gb body string Gigabytes of the local disk per the instance.
reservation.affinity body boolean The affinity of instances to reserve.
reservation.resource_properties body string Properties of the resource to reserve.
reservation.flavor_id body string The flavor ID used for launching instances on reserved resources.
reservation.server_group_id body string The server group ID specified when launch instances on reserved resources.
reservation.aggregate_id body integer The aggregate ID of the reservation.

Example of List Leases Response

{
    "leases": [
        {
            "id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
            "name": "lease_foo",
            "start_date": "2017-12-26T12:00:00.000000",
            "end_date": "2017-12-27T12:00:00.000000",
            "status":"PENDING",
            "degraded": false,
            "user_id": "5434f637520d4c17bbf254af034b0320",
            "project_id": "aa45f56901ef45ee95e3d211097c0ea3",
            "trust_id": "b442a580b9504ababf305bf2b4c49512",
            "created_at": "2017-12-27 10:00:00",
            "updated_at": null,
            "reservations": [
                {
                    "id": "087bc740-6d2d-410b-9d47-c7b2b55a9d36",
                    "lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
                    "status": "pending",
                    "missing_resources": false,
                    "resources_changed": false,
                    "resource_id": "5e6c0e6e-f1e6-490b-baaf-50deacbbe371",
                    "resource_type": "physical:host",
                    "min": 4,
                    "max": 6,
                    "hypervisor_properties": "[\">=\", \"$vcpus\", \"4\"]",
                    "resource_properties": "",
                    "before_end": "default",
                    "created_at": "2017-12-27 10:00:00",
                    "updated_at": null
                },
                {
                    "id": "ddc45423-f863-4e4e-8e7a-51d27cfec962",
                    "lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
                    "status": "pending",
                    "missing_resources": false,
                    "resources_changed": false,
                    "resource_id": "0b901727-cca2-43ed-bcc8-c21b0982dcb1",
                    "resource_type": "virtual:instance",
                    "amount": 4,
                    "vcpus": 2,
                    "memory_mb": 4096,
                    "disk_gb": 100,
                    "affinity": false,
                    "resource_properties": "",
                    "flavor_id": "ddc45423-f863-4e4e-8e7a-51d27cfec962",
                    "server_group_id": "33cdfc42-5a04-4fcc-b190-1abebaa056bb",
                    "aggregate_id": 11,
                    "created_at": "2017-12-27 10:00:00",
                    "updated_at": null
                }
            ],
            "events": [
                {
                    "id": "188a8584-f832-4df9-9a4a-51e6364420ff"
                    "lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
                    "status": "UNDONE",
                    "event_type": "start_lease",
                    "time": "2017-12-26T12:00:00.000000",
                    "created_at": "2017-12-27 10:00:00",
                    "updated_at": null
                },
                {
                    "id": "277d6436-dfcb-4eae-ae5e-ac7fa9c2fd56",
                    "lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
                    "status": "UNDONE",
                    "event_type": "end_lease",
                    "time": "2017-12-27T12:00:00.000000",
                    "created_at": "2017-12-27 10:00:00",
                    "updated_at": null
                },
                {
                    "id": "f583af71-ca21-4b66-87de-52211d118029"
                    "lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
                    "status": "UNDONE",
                    "time": "2017-12-27T11:00:00.000000",
                    "event_type": "before_end_lease",
                    "created_at": "2017-12-27 10:00:00",
                    "updated_at": null
                }
            ]
        }
    ]
}
POST
v1/leases

Create Lease

Create a lease.

Response codes

Normal response code: 201

Error response codes: Bad Request(400), Unauthorized(401), Forbidden(403), Conflict(409), Internal Server Error(500)

Request

General Parameters

Name In Type Description
name body string The name of the lease.
start_date body string

The start date and time of the lease.

Note

If now is specified, the lease starts immediately.

end_date body string The end date and time of the lease.
before_end_date (Optional) body string The date and time for the before-end-action of the lease.
reservations body array A list of reservation objects.
reservation.resource_type body string

The type of the resource to reserve.

Note

physical:host and virtual:instance types are supported.

events (Optional) body array A list of event objects.

Parameters for Host Reservation

The following parameters are required for host reservation. All parameters are in the reservation object.

Name In Type Description
reservation.min body integer The minimum number of hosts to reserve.
reservation.max body integer The maximum number of hosts to reserve.
reservation.hypervisor_properties body string Properties of the hypervisor to reserve.
reservation.resource_properties body string Properties of the resource to reserve.
reservation.before_end (Optional) body string

The before-end-action of the reservation.

Note

default and snapshot actions are supported.

Parameters for Instance Reservation

The following parameters are required for instance reservation. All parameters are in the reservation object.

Name In Type Description
reservation.amount body integer The amount of instances to reserve.
reservation.vcpus body integer The number of VCPUs per the instance.
reservation.memory_mb body integer Megabytes of memory per the instance.
reservation.disk_gb body string Gigabytes of the local disk per the instance.
reservation.affinity body boolean The affinity of instances to reserve.
reservation.resource_properties body string Properties of the resource to reserve.

Example of Create Lease Request

{
    "name": "lease_foo",
    "start_date": "2017-12-26 12:00",
    "end_date": "2017-12-27 12:00",
    "before_end_date": "2017-12-27 11:00",
    "reservations": [
        {
            "resource_type": "physical:host",
            "min": 4,
            "max": 6,
            "hypervisor_properties": "[\">=\", \"$vcpus\", \"4\"]",
            "resource_properties": "",
            "before_end": "default"
        },
        {
            "resource_type": "virtual:instance",
            "amount": 4,
            "vcpus": 2,
            "memory_mb": 4096,
            "disk_gb": 100,
            "affinity": false,
            "resource_properties": ""
        }
    ],
    "events": []
}

Response

General Parameters

Name In Type Description
lease body object A lease object.
id body string The UUID of the lease.
name body string The name of the lease.
start_date body string The start date and time of the lease.
end_date body string The end date and time of the lease.
status body string The status of the lease.
degraded body boolean The flag for reserved resources of the lease. This is set True while missing_resources or resources_changed of reservations is set True.
user_id body string The UUID of the lease owner.
project_id body string The UUID the project which owns the lease.
trust_id body string The UUID of the trust of the lease owner.
created_at body string The date and time when the object was created.
updated_at body string The date and time when the object was updated.
reservations body array A list of reservation objects.
reservation.id body string The UUID of the reservation.
reservation.lease_id body string The UUID of the lease to which the reservation belongs.
reservation.status body string The status of the reservation.
reservation.missing_resources body boolean The flag for the capacity of reserved resources. It is set True while the amount of reserved resources is less than the request.
reservation.resources_changed body boolean The flag for changes of reserved resources. If it is set True if reserved resources were changed after the lease started.
reservation.resource_id body string The ID of the resource object of the reservation.
reservation.resource_type body string

The type of the resource to reserve.

Note

physical:host and virtual:instance types are supported.

reservation.created_at body string The date and time when the object was created.
reservation.updated_at body string The date and time when the object was updated.
events body array A list of event objects.
event.id body string The UUID of the event.
event.lease_id body string The UUID of the lease to which the event belongs.
event.status body string The status of the event.
event.event_type body string The type of the event.
event.time body string The date and time of the event.
event.created_at body string The date and time when the object was created.
event_updated_at body string The date and time when the object was updated.

Parameters for Host Reservation

The following parameters are returned for host reservation. All parameters are in the reservation object.

Name In Type Description
reservation.min body integer The minimum number of hosts to reserve.
reservation.max body integer The maximum number of hosts to reserve.
reservation.hypervisor_properties body string Properties of the hypervisor to reserve.
reservation.resource_properties body string Properties of the resource to reserve.
reservation.before_end body string

The before-end-action of the reservation.

Note

default and snapshot actions are supported.

Parameters for Instance Reservation

The following parameters are returned for instance reservation. All parameters are in the reservation object.

Name In Type Description
reservation.amount body integer The amount of instances to reserve.
reservation.vcpus body integer The number of VCPUs per the instance.
reservation.memory_mb body integer Megabytes of memory per the instance.
reservation.disk_gb body string Gigabytes of the local disk per the instance.
reservation.affinity body boolean The affinity of instances to reserve.
reservation.resource_properties body string Properties of the resource to reserve.
reservation.flavor_id body string The flavor ID used for launching instances on reserved resources.
reservation.server_group_id body string The server group ID specified when launch instances on reserved resources.
reservation.aggregate_id body integer The aggregate ID of the reservation.

Example of Create Lease Response

{
    "lease": {
        "id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
        "name": "lease_foo",
        "start_date": "2017-12-26T12:00:00.000000",
        "end_date": "2017-12-27T12:00:00.000000",
        "status":"PENDING",
        "degraded": false,
        "user_id": "5434f637520d4c17bbf254af034b0320",
        "project_id": "aa45f56901ef45ee95e3d211097c0ea3",
        "trust_id": "b442a580b9504ababf305bf2b4c49512",
        "created_at": "2017-12-27 10:00:00",
        "updated_at": null,
        "reservations": [
            {
                "id": "087bc740-6d2d-410b-9d47-c7b2b55a9d36",
                "lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
                "status": "pending",
                "missing_resources": false,
                "resources_changed": false,
                "resource_id": "5e6c0e6e-f1e6-490b-baaf-50deacbbe371",
                "resource_type": "physical:host",
                "min": 4,
                "max": 6,
                "hypervisor_properties": "[\">=\", \"$vcpus\", \"4\"]",
                "resource_properties": "",
                "before_end": "default",
                "created_at": "2017-12-27 10:00:00",
                "updated_at": null
            },
            {
                "id": "ddc45423-f863-4e4e-8e7a-51d27cfec962",
                "lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
                "status": "pending",
                "missing_resources": false,
                "resources_changed": false,
                "resource_id": "0b901727-cca2-43ed-bcc8-c21b0982dcb1",
                "resource_type": "virtual:instance",
                "amount": 4,
                "vcpus": 2,
                "memory_mb": 4096,
                "disk_gb": 100,
                "affinity": false,
                "resource_properties": "",
                "flavor_id": "ddc45423-f863-4e4e-8e7a-51d27cfec962",
                "server_group_id": "33cdfc42-5a04-4fcc-b190-1abebaa056bb",
                "aggregate_id": 11,
                "created_at": "2017-12-27 10:00:00",
                "updated_at": null
            }
        ],
        "events": [
            {
                "id": "188a8584-f832-4df9-9a4a-51e6364420ff"
                "lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
                "status": "UNDONE",
                "event_type": "start_lease",
                "time": "2017-12-26T12:00:00.000000",
                "created_at": "2017-12-27 10:00:00",
                "updated_at": null
            },
            {
                "id": "277d6436-dfcb-4eae-ae5e-ac7fa9c2fd56",
                "lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
                "status": "UNDONE",
                "event_type": "end_lease",
                "time": "2017-12-27T12:00:00.000000",
                "created_at": "2017-12-27 10:00:00",
                "updated_at": null
            },
            {
                "id": "f583af71-ca21-4b66-87de-52211d118029"
                "lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
                "status": "UNDONE",
                "time": "2017-12-27T11:00:00.000000",
                "event_type": "before_end_lease",
                "created_at": "2017-12-27 10:00:00",
                "updated_at": null
            }
        ]
    }
}
GET
v1/leases/{lease_id}

Show Lease Details

Show details of a lease.

Preconditions

The lease must exist.

Response codes

Normal response code: 200

Error response codes: Bad Request(400), Unauthorized(401), Forbidden(403), Not Found(404), Internal Server Error(500)

Request

Name In Type Description
lease_id path string The UUID of the lease.

Response

General Parameters

Name In Type Description
lease body object A lease object.
id body string The UUID of the lease.
name body string The name of the lease.
start_date body string The start date and time of the lease.
end_date body string The end date and time of the lease.
status body string The status of the lease.
degraded body boolean The flag for reserved resources of the lease. This is set True while missing_resources or resources_changed of reservations is set True.
user_id body string The UUID of the lease owner.
project_id body string The UUID the project which owns the lease.
trust_id body string The UUID of the trust of the lease owner.
created_at body string The date and time when the object was created.
updated_at body string The date and time when the object was updated.
reservations body array A list of reservation objects.
reservation.id body string The UUID of the reservation.
reservation.lease_id body string The UUID of the lease to which the reservation belongs.
reservation.status body string The status of the reservation.
reservation.missing_resources body boolean The flag for the capacity of reserved resources. It is set True while the amount of reserved resources is less than the request.
reservation.resources_changed body boolean The flag for changes of reserved resources. If it is set True if reserved resources were changed after the lease started.
reservation.resource_id body string The ID of the resource object of the reservation.
reservation.resource_type body string

The type of the resource to reserve.

Note

physical:host and virtual:instance types are supported.

reservation.created_at body string The date and time when the object was created.
reservation.updated_at body string The date and time when the object was updated.
events body array A list of event objects.
event.id body string The UUID of the event.
event.lease_id body string The UUID of the lease to which the event belongs.
event.status body string The status of the event.
event.event_type body string The type of the event.
event.time body string The date and time of the event.
event.created_at body string The date and time when the object was created.
event_updated_at body string The date and time when the object was updated.

Parameters for Host Reservation

The following parameters are returned for host reservation. All parameters are in the reservation object.

Name In Type Description
reservation.min body integer The minimum number of hosts to reserve.
reservation.max body integer The maximum number of hosts to reserve.
reservation.hypervisor_properties body string Properties of the hypervisor to reserve.
reservation.resource_properties body string Properties of the resource to reserve.
reservation.before_end body string

The before-end-action of the reservation.

Note

default and snapshot actions are supported.

Parameters for Instance Reservation

The following parameters are returned for instance reservation. All parameters are in the reservation object.

Name In Type Description
reservation.amount body integer The amount of instances to reserve.
reservation.vcpus body integer The number of VCPUs per the instance.
reservation.memory_mb body integer Megabytes of memory per the instance.
reservation.disk_gb body string Gigabytes of the local disk per the instance.
reservation.affinity body boolean The affinity of instances to reserve.
reservation.resource_properties body string Properties of the resource to reserve.
reservation.flavor_id body string The flavor ID used for launching instances on reserved resources.
reservation.server_group_id body string The server group ID specified when launch instances on reserved resources.
reservation.aggregate_id body integer The aggregate ID of the reservation.

Example of Show Lease Details Response

{
    "lease": {
        "id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
        "name": "lease_foo",
        "start_date": "2017-12-26T12:00:00.000000",
        "end_date": "2017-12-27T12:00:00.000000",
        "status":"PENDING",
        "degraded": false,
        "user_id": "5434f637520d4c17bbf254af034b0320",
        "project_id": "aa45f56901ef45ee95e3d211097c0ea3",
        "trust_id": "b442a580b9504ababf305bf2b4c49512",
        "created_at": "2017-12-27 10:00:00",
        "updated_at": null,
        "reservations": [
            {
                "id": "087bc740-6d2d-410b-9d47-c7b2b55a9d36",
                "lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
                "status": "pending",
                "missing_resources": false,
                "resources_changed": false,
                "resource_id": "5e6c0e6e-f1e6-490b-baaf-50deacbbe371",
                "resource_type": "physical:host",
                "min": 4,
                "max": 6,
                "hypervisor_properties": "[\">=\", \"$vcpus\", \"4\"]",
                "resource_properties": "",
                "before_end": "default",
                "created_at": "2017-12-27 10:00:00",
                "updated_at": null
            },
            {
                "id": "ddc45423-f863-4e4e-8e7a-51d27cfec962",
                "lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
                "status": "pending",
                "missing_resources": false,
                "resources_changed": false,
                "resource_id": "0b901727-cca2-43ed-bcc8-c21b0982dcb1",
                "resource_type": "virtual:instance",
                "amount": 4,
                "vcpus": 2,
                "memory_mb": 4096,
                "disk_gb": 100,
                "affinity": false,
                "resource_properties": "",
                "flavor_id": "ddc45423-f863-4e4e-8e7a-51d27cfec962",
                "server_group_id": "33cdfc42-5a04-4fcc-b190-1abebaa056bb",
                "aggregate_id": 11,
                "created_at": "2017-12-27 10:00:00",
                "updated_at": null
            }
        ],
        "events": [
            {
                "id": "188a8584-f832-4df9-9a4a-51e6364420ff"
                "lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
                "status": "UNDONE",
                "event_type": "start_lease",
                "time": "2017-12-26T12:00:00.000000",
                "created_at": "2017-12-27 10:00:00",
                "updated_at": null
            },
            {
                "id": "277d6436-dfcb-4eae-ae5e-ac7fa9c2fd56",
                "lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
                "status": "UNDONE",
                "event_type": "end_lease",
                "time": "2017-12-27T12:00:00.000000",
                "created_at": "2017-12-27 10:00:00",
                "updated_at": null
            },
            {
                "id": "f583af71-ca21-4b66-87de-52211d118029"
                "lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
                "status": "UNDONE",
                "time": "2017-12-27T11:00:00.000000",
                "event_type": "before_end_lease",
                "created_at": "2017-12-27 10:00:00",
                "updated_at": null
            }
        ]
    }
}
PUT
v1/leases/{lease_id}

Update Lease

Update a lease.

Preconditions

The lease must exist.

Response codes

Normal response codes: 200

Error response codes: Bad Request(400), Unauthorized(401), Forbidden(403), Not Found(404), Conflict(409), Internal Server Error(500)

Request

General Parameters

Name In Type Description
lease_id path string The UUID of the lease.
name (Optional) body string The name of the lease.
start_date (Optional) body string

The start date and time of the lease.

Note

If now is specified, the lease starts immediately.

end_date (Optional) body string The end date and time of the lease.
before_end_date (Optional) body string The date and time for the before-end-action of the lease.
reservations (Optional) body array A list of reservation objects.
reservation.id body string The UUID of the reservation.

Parameters for Host Reservation

The following parameters are required for host reservation. All parameters are in the reservation object.

Name In Type Description
reservation.min (Optional) body integer The minimum number of hosts to reserve.
reservation.max (Optional) body integer The maximum number of hosts to reserve.
reservation.hypervisor_properties body string Properties of the hypervisor to reserve.
reservation.resource_properties (Optional) body string Properties of the resource to reserve.
reservation.before_end (Optional) body string

The before-end-action of the reservation.

Note

default and snapshot actions are supported.

Parameters for Instance Reservation

The following parameters are required for instance reservation. All parameters are in the reservation object.

Name In Type Description
reservation.amount (Optional) body integer The amount of instances to reserve.
reservation.vcpus (Optional) body integer The number of VCPUs per the instance.
reservation.memory_mb (Optional) body integer Megabytes of memory per the instance.
reservation.disk_gb (Optional) body string Gigabytes of the local disk per the instance.
reservation.affinity (Optional) body boolean The affinity of instances to reserve.
reservation.resource_properties (Optional) body string Properties of the resource to reserve.

Example of Update Lease Request

{
    "end_date": "2017-12-28 12:00",
    "reservations": [
        {
            "id": "087bc740-6d2d-410b-9d47-c7b2b55a9d36",
            "min": 6,
            "max": 8
        },
        {
            "id": "ddc45423-f863-4e4e-8e7a-51d27cfec962",
            "amount": 6
        }
    ],
    "events": []
}

Response

General Parameters

Name In Type Description
lease body object A lease object.
id body string The UUID of the lease.
name body string The name of the lease.
start_date body string The start date and time of the lease.
end_date body string The end date and time of the lease.
status body string The status of the lease.
degraded body boolean The flag for reserved resources of the lease. This is set True while missing_resources or resources_changed of reservations is set True.
user_id body string The UUID of the lease owner.
project_id body string The UUID the project which owns the lease.
trust_id body string The UUID of the trust of the lease owner.
created_at body string The date and time when the object was created.
updated_at body string The date and time when the object was updated.
reservations body array A list of reservation objects.
reservation.id body string The UUID of the reservation.
reservation.lease_id body string The UUID of the lease to which the reservation belongs.
reservation.status body string The status of the reservation.
reservation.missing_resources body boolean The flag for the capacity of reserved resources. It is set True while the amount of reserved resources is less than the request.
reservation.resources_changed body boolean The flag for changes of reserved resources. If it is set True if reserved resources were changed after the lease started.
reservation.resource_id body string The ID of the resource object of the reservation.
reservation.resource_type body string

The type of the resource to reserve.

Note

physical:host and virtual:instance types are supported.

reservation.created_at body string The date and time when the object was created.
reservation.updated_at body string The date and time when the object was updated.
events body array A list of event objects.
event.id body string The UUID of the event.
event.lease_id body string The UUID of the lease to which the event belongs.
event.status body string The status of the event.
event.event_type body string The type of the event.
event.time body string The date and time of the event.
event.created_at body string The date and time when the object was created.
event_updated_at body string The date and time when the object was updated.

Parameters for Host Reservation

The following parameters are returned for host reservation. All parameters are in the reservation object.

Name In Type Description
reservation.min body integer The minimum number of hosts to reserve.
reservation.max body integer The maximum number of hosts to reserve.
reservation.hypervisor_properties body string Properties of the hypervisor to reserve.
reservation.resource_properties body string Properties of the resource to reserve.
reservation.before_end body string

The before-end-action of the reservation.

Note

default and snapshot actions are supported.

Parameters for Instance Reservation

The following parameters are returned for instance reservation. All parameters are in the reservation object.

Name In Type Description
reservation.amount body integer The amount of instances to reserve.
reservation.vcpus body integer The number of VCPUs per the instance.
reservation.memory_mb body integer Megabytes of memory per the instance.
reservation.disk_gb body string Gigabytes of the local disk per the instance.
reservation.affinity body boolean The affinity of instances to reserve.
reservation.resource_properties body string Properties of the resource to reserve.
reservation.flavor_id body string The flavor ID used for launching instances on reserved resources.
reservation.server_group_id body string The server group ID specified when launch instances on reserved resources.
reservation.aggregate_id body integer The aggregate ID of the reservation.

Example of Update Lease Response

{
    "lease": {
        "id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
        "name": "lease_foo",
        "start_date": "2017-12-26T12:00:00.000000",
        "end_date": "2017-12-28T12:00:00.000000",
        "status":"PENDING",
        "degraded": false,
        "user_id": "5434f637520d4c17bbf254af034b0320",
        "project_id": "aa45f56901ef45ee95e3d211097c0ea3",
        "trust_id": "b442a580b9504ababf305bf2b4c49512",
        "created_at": "2017-12-27 10:00:00",
        "updated_at": null,
        "reservations": [
            {
                "id": "087bc740-6d2d-410b-9d47-c7b2b55a9d36",
                "lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
                "status": "pending",
                "missing_resources": false,
                "resources_changed": false,
                "resource_id": "5e6c0e6e-f1e6-490b-baaf-50deacbbe371",
                "resource_type": "physical:host",
                "min": 6,
                "max": 8,
                "hypervisor_properties": "[\">=\", \"$vcpus\", \"4\"]",
                "resource_properties": "",
                "before_end": "default",
                "created_at": "2017-12-27 10:00:00",
                "updated_at": null
            },
            {
                "id": "ddc45423-f863-4e4e-8e7a-51d27cfec962",
                "lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
                "status": "pending",
                "missing_resources": false,
                "resources_changed": false,
                "resource_id": "0b901727-cca2-43ed-bcc8-c21b0982dcb1",
                "resource_type": "virtual:instance",
                "amount": 6,
                "vcpus": 2,
                "memory_mb": 4096,
                "disk_gb": 100,
                "affinity": false,
                "resource_properties": "",
                "flavor_id": "ddc45423-f863-4e4e-8e7a-51d27cfec962",
                "server_group_id": "33cdfc42-5a04-4fcc-b190-1abebaa056bb",
                "aggregate_id": 11,
                "created_at": "2017-12-27 10:00:00",
                "updated_at": null
            }
        ],
        "events": [
            {
                "id": "188a8584-f832-4df9-9a4a-51e6364420ff"
                "lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
                "status": "UNDONE",
                "event_type": "start_lease",
                "time": "2017-12-26T12:00:00.000000",
                "created_at": "2017-12-27 10:00:00",
                "updated_at": null
            },
            {
                "id": "277d6436-dfcb-4eae-ae5e-ac7fa9c2fd56",
                "lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
                "status": "UNDONE",
                "event_type": "end_lease",
                "time": "2017-12-27T12:00:00.000000",
                "created_at": "2017-12-27 10:00:00",
                "updated_at": null
            },
            {
                "id": "f583af71-ca21-4b66-87de-52211d118029"
                "lease_id": "6ee55c78-ac52-41a6-99af-2d2d73bcc466",
                "status": "UNDONE",
                "time": "2017-12-27T11:00:00.000000",
                "event_type": "before_end_lease",
                "created_at": "2017-12-27 10:00:00",
                "updated_at": null
            }
        ]
    }
}
DELETE
v1/leases/{lease_id}

Delete Lease

Delete a lease.

Preconditions

The lease must exist.

Response codes

Normal response codes: 204

Error response codes: Bad Request(400), Unauthorized(401), Forbidden(403), Not Found(404), Conflict(409), Internal Server Error(500)

Request

Name In Type Description
lease_id path string The UUID of the lease.

Response

No body content is returned on a successful DELETE.

Hosts

GET
v1/os-hosts

List Hosts

List hosts.

Response codes

Normal response code: 200

Error response codes: Bad Request(400), Unauthorized(401), Forbidden(403), Internal Server Error(500)

Request

No body content, path, nor query option.

Response

Name In Type Description
hosts body array A list of host objects.
id body string The ID of the host.
hypervisor_hostname body string The hypervisor name of the host.
hypervisor_type body string The hypervisor type the host.
hypervisor_version body integer The hypervisor version of the host.
vcpus body integer The number of the VCPUs of the host.
cpu_info body string Information of the CPU of the host.
memory_mb body integer Megabytes of the memory of the host.
local_gb body integer Gigabytes of the disk of the host.
service_name body string The compute service name of the host.
reservable body boolean The flag which represents whether the host is reservable or not.
status body string

The status of the host.

Note

This is null currently.

trust_id body string The UUID of the trust of the host operator.
created_at body string The date and time when the object was created.
updated_at body string The date and time when the object was updated.
extra_capability (Optional) body any

The extra capability of the host.

Note

Any key-value pair can be stored as one of extra capabilities of the host.

Example of List Hosts Response

{
    "hosts": [
        {
            "id": "1",
            "hypervisor_hostname": "compute-1",
            "hypervisor_type": "QEMU",
            "hypervisor_version": 2010001,
            "vcpus": 4,
            "cpu_info": "{'arch': 'x86_64', 'model': 'cpu64-rhel6',
                          'vendor': 'Intel', 'features': [
                              'pge', 'clflush', 'sep', 'syscall', 'msr',
                              'vmx', 'cmov', 'nx', 'pat', 'lm', 'tsc',
                              'fpu', 'fxsr', 'pae', 'mmx', 'cx8', 'mce',
                              'de', 'mca', 'pse', 'pni', 'apic', 'sse',
                              'lahf_lm', 'sse2', 'hypervisor', 'cx16',
                              'pse36', 'mttr', 'x2apic'],
                          'topology': {
                              'cores': 1, 'cells': 1, 'threads': 1, 'sockets': 4
                          }}",
            "memory_mb": 8192,
            "local_gb": 100,
            "service_name": "compute-1",
            "reservable": true,
            "status": null,
            "trust_id": "5f67f11215cf4c52906453a181bfcfea",
            "created_at": "2017-12-27 10:00:00",
            "updated_at": null,
            "extra_capability_sample": "foo"
        }
    ]
}
POST
v1/os-hosts

Create Host

Create a host.

Response codes

Normal response code: 201

Error response codes: Bad Request(400), Unauthorized(401), Forbidden(403), Conflict(409), Internal Server Error(500)

Request

Name In Type Description
name body string The name of the host.
extra_capability (Optional) body any

The extra capability of the host.

Note

Any key-value pair can be stored as one of extra capabilities of the host.

Example of Create Host Request

{
    "name": "compute-1",
    "extra_capability_sample": "foo"
}

Response

Name In Type Description
host body object A host object.
id body string The ID of the host.
hypervisor_hostname body string The hypervisor name of the host.
hypervisor_type body string The hypervisor type the host.
hypervisor_version body integer The hypervisor version of the host.
vcpus body integer The number of the VCPUs of the host.
cpu_info body string Information of the CPU of the host.
memory_mb body integer Megabytes of the memory of the host.
local_gb body integer Gigabytes of the disk of the host.
service_name body string The compute service name of the host.
reservable body boolean The flag which represents whether the host is reservable or not.
status body string

The status of the host.

Note

This is null currently.

trust_id body string The UUID of the trust of the host operator.
created_at body string The date and time when the object was created.
updated_at body string The date and time when the object was updated.
extra_capability (Optional) body any

The extra capability of the host.

Note

Any key-value pair can be stored as one of extra capabilities of the host.

Example of Create Host Response

{
    "host": {
        "id": "1",
        "hypervisor_hostname": "compute-1",
        "hypervisor_type": "QEMU",
        "hypervisor_version": 2010001,
        "vcpus": 4,
        "cpu_info": "{'arch': 'x86_64', 'model': 'cpu64-rhel6',
                      'vendor': 'Intel', 'features': [
                          'pge', 'clflush', 'sep', 'syscall', 'msr',
                          'vmx', 'cmov', 'nx', 'pat', 'lm', 'tsc',
                          'fpu', 'fxsr', 'pae', 'mmx', 'cx8', 'mce',
                          'de', 'mca', 'pse', 'pni', 'apic', 'sse',
                          'lahf_lm', 'sse2', 'hypervisor', 'cx16',
                          'pse36', 'mttr', 'x2apic'],
                      'topology': {
                          'cores': 1, 'cells': 1, 'threads': 1, 'sockets': 4
                      }}",
        "memory_mb": 8192,
        "local_gb": 100,
        "service_name": "compute-1",
        "reservable": true,
        "status": null,
        "trust_id": "5f67f11215cf4c52906453a181bfcfea",
        "created_at": "2017-12-27 10:00:00",
        "updated_at": null,
        "extra_capability_sample": "foo"
    }
}
GET
v1/os-hosts/{host_id}

Show Host Details

Show details of a host.

Preconditions

The host must exist.

Response codes

Normal response code: 200

Error response codes: Bad Request(400), Unauthorized(401), Forbidden(403), Not Found(404), Internal Server Error(500)

Request

Name In Type Description
host_id path string The ID of the host.

Response

Name In Type Description
host body object A host object.
id body string The ID of the host.
hypervisor_hostname body string The hypervisor name of the host.
hypervisor_type body string The hypervisor type the host.
hypervisor_version body integer The hypervisor version of the host.
vcpus body integer The number of the VCPUs of the host.
cpu_info body string Information of the CPU of the host.
memory_mb body integer Megabytes of the memory of the host.
local_gb body integer Gigabytes of the disk of the host.
service_name body string The compute service name of the host.
reservable body boolean The flag which represents whether the host is reservable or not.
status body string

The status of the host.

Note

This is null currently.

trust_id body string The UUID of the trust of the host operator.
created_at body string The date and time when the object was created.
updated_at body string The date and time when the object was updated.
extra_capability (Optional) body any

The extra capability of the host.

Note

Any key-value pair can be stored as one of extra capabilities of the host.

Example of Show Host Details Response

{
    "host": {
        "id": "1",
        "hypervisor_hostname": "compute-1",
        "hypervisor_type": "QEMU",
        "hypervisor_version": 2010001,
        "vcpus": 4,
        "cpu_info": "{'arch': 'x86_64', 'model': 'cpu64-rhel6',
                      'vendor': 'Intel', 'features': [
                          'pge', 'clflush', 'sep', 'syscall', 'msr',
                          'vmx', 'cmov', 'nx', 'pat', 'lm', 'tsc',
                          'fpu', 'fxsr', 'pae', 'mmx', 'cx8', 'mce',
                          'de', 'mca', 'pse', 'pni', 'apic', 'sse',
                          'lahf_lm', 'sse2', 'hypervisor', 'cx16',
                          'pse36', 'mttr', 'x2apic'],
                      'topology': {
                          'cores': 1, 'cells': 1, 'threads': 1, 'sockets': 4
                      }}",
        "memory_mb": 8192,
        "local_gb": 100,
        "service_name": "compute-1",
        "reservable": true,
        "status": null,
        "trust_id": "5f67f11215cf4c52906453a181bfcfea",
        "created_at": "2017-12-27 10:00:00",
        "updated_at": null,
        "extra_capability_sample": "foo"
    }
}
PUT
v1/os-hosts/{host_id}

Update Host

Update a host.

Preconditions

The host must exist.

Response codes

Normal response code: 200

Error response codes: Bad Request(400), Unauthorized(401), Forbidden(403), Not Found(404), Conflict(409), Internal Server Error(500)

Request

Name In Type Description
host_id path string The ID of the host.
extra_capability (Optional) body any

The extra capability of the host.

Note

Any key-value pair can be stored as one of extra capabilities of the host.

Example of Update Host Request

{
    "extra_capability_sample": "bar"
}

Response

Name In Type Description
host body object A host object.
id body string The ID of the host.
hypervisor_hostname body string The hypervisor name of the host.
hypervisor_type body string The hypervisor type the host.
hypervisor_version body integer The hypervisor version of the host.
vcpus body integer The number of the VCPUs of the host.
cpu_info body string Information of the CPU of the host.
memory_mb body integer Megabytes of the memory of the host.
local_gb body integer Gigabytes of the disk of the host.
service_name body string The compute service name of the host.
reservable body boolean The flag which represents whether the host is reservable or not.
status body string

The status of the host.

Note

This is null currently.

trust_id body string The UUID of the trust of the host operator.
created_at body string The date and time when the object was created.
updated_at body string The date and time when the object was updated.
extra_capability (Optional) body any

The extra capability of the host.

Note

Any key-value pair can be stored as one of extra capabilities of the host.

Example of Host Update Response

{
    "host": {
        "id": "1",
        "hypervisor_hostname": "compute-1",
        "hypervisor_type": "QEMU",
        "hypervisor_version": 2010001,
        "vcpus": 4,
        "cpu_info": "{'arch': 'x86_64', 'model': 'cpu64-rhel6',
                      'vendor': 'Intel', 'features': [
                          'pge', 'clflush', 'sep', 'syscall', 'msr',
                          'vmx', 'cmov', 'nx', 'pat', 'lm', 'tsc',
                          'fpu', 'fxsr', 'pae', 'mmx', 'cx8', 'mce',
                          'de', 'mca', 'pse', 'pni', 'apic', 'sse',
                          'lahf_lm', 'sse2', 'hypervisor', 'cx16',
                          'pse36', 'mttr', 'x2apic'],
                      'topology': {
                          'cores': 1, 'cells': 1, 'threads': 1, 'sockets': 4
                      }}",
        "memory_mb": 8192,
        "local_gb": 100,
        "service_name": "compute-1",
        "reservable": true,
        "status": null,
        "trust_id": "5f67f11215cf4c52906453a181bfcfea",
        "created_at": "2017-12-27 10:00:00",
        "updated_at": null,
        "extra_capability_sample": "bar"
    }
}
DELETE
v1/os-hosts/{host_id}

Delete Host

Delete a host.

Preconditions

The host must exist.

Response codes

Normal response code: 204

Error response codes: Bad Request(400), Unauthorized(401), Forbidden(403), Not Found(404), Conflict(409), Internal Server Error(500)

Request

Name In Type Description
host_id path string The ID of the host.

Response

No body content is returned on a successful DELETE.

Resource Allocations

GET
v1/os-hosts/allocations

List Allocations

List allocations of all hosts.

Response codes

Normal response code: 200

Error response codes: Bad Request(400), Unauthorized(401), Forbidden(403), Internal Server Error(500)

Request

Name In Type Description
lease_id (Optional) query string Filter allocations results by lease id
reservation_id (Optional) query string Filter allocations results by reservation id

Response

Name In Type Description
allocations body array A list of allocation objects.
resource_id body string The ID of the host.
reservations body array A list of reservation allocation objects. The object consists of reservation id and its lease_id.
reservation.id body string The UUID of the reservation.
reservation.lease_id body string The UUID of the lease.

Example of List Allocations Response

{
    "allocations": [
        {
            "resource_id": "1",
            "reservations": [
                {
                    "id": "3504fbac-fdb2-458e-a43f-34d27fbd0b86",
                    "lease_id": "0ec2bed6-75f9-4959-8198-9d9717dde4cb"
                },
                {
                    "id": "4f4743a2-d8c7-44c2-ba39-300eb7659bb9",
                    "lease_id": "6050288d-5535-4e3c-93d5-083184b86c61"
                }
            ]
        },
        {
            "resource_id": "2",
            "reservations": [
                {
                    "id": "b2475424-6872-43ec-857d-f4b50b403e97",
                    "lease_id": "e92b9d47-9078-47ec-a35c-27e67f7b8429"
                }
            ]
        }
    ]
}
GET
v1/os-hosts/{host_id}/allocation

Get Allocation

Get allocation of a host.

Response codes

Normal response code: 200

Error response codes: Bad Request(400), Unauthorized(401), Forbidden(403), Internal Server Error(500)

Request

Name In Type Description
host_id path string The ID of the host.
lease_id (Optional) query string Filter allocations results by lease id
reservation_id (Optional) query string Filter allocations results by reservation id

Response

Name In Type Description
allocation body array An allocation object. This object describes a mapping between resource_id and reservations.
resource_id body string The ID of the host.
reservations body array A list of reservation allocation objects. The object consists of reservation id and its lease_id.
reservation.id body string The UUID of the reservation.
reservation.lease_id body string The UUID of the lease.

Example of Get Allocation Response

{
    "allocation": {
        "resource_id": "1",
        "reservations": [
            {
                "id": "3504fbac-fdb2-458e-a43f-34d27fbd0b86",
                "lease_id": "0ec2bed6-75f9-4959-8198-9d9717dde4cb"
            },
            {
                "id": "4f4743a2-d8c7-44c2-ba39-300eb7659bb9",
                "lease_id": "6050288d-5535-4e3c-93d5-083184b86c61"
            }
        ]
    }
}

Floating IPs

GET
v1/floatingips

List FloatingIPs

List floating IPs.

Response codes

Normal response code: 200

Error response codes: Bad Request(400), Unauthorized(401), Forbidden(403), Internal Server Error(500)

Request

No body content, path, nor query option.

Response

Name In Type Description
floatingips body array A list of floatingip objects.
id body string The ID of the floating ip resources.
floating_network_id body string An external network ID the floating IP belongs to.
subnet_id body boolean An external subnet ID the floating IP belongs to.
floating_ip_address body string The floating IP address.
reservable body boolean The flag which represents whether the floating IP is reservable or not.
created_at body string The date and time when the object was created.
updated_at body string The date and time when the object was updated.

Example of List Hosts Response

{
    "floatingips": [
        {
           "id": "84c4d37e-1f8b-45ce-897b-16ad7f49b0e9",
           "floating_network_id": "1e17587e-a7ed-4b82-a17b-4beb32523e28",
           "subnet_id": "a2fa9b7e-8451-4868-85f4-92ee7c77eed6",
           "floating_ip_address": "172.24.4.101",
           "reservable": true,
           "created_at": "2019-01-28 08:01:46",
           "updated_at": null

         },
        {
            "id": "f180cf4c-f886-4dd1-8c36-854d17fbefb5",
            "floating_network_id": "1e17587e-a7ed-4b82-a17b-4beb32523e28",
            "subnet_id": "a2fa9b7e-8451-4868-85f4-92ee7c77eed6",
            "floating_ip_address": "172.24.4.102",
            "reservable": true,
            "created_at": "2019-01-28 08:08:22",
            "updated_at": null,
        }
    ]
}
POST
v1/floatingips

Create Floating IP

Create a floating IP.

Response codes

Normal response code: 201

Error response codes: Bad Request(400), Unauthorized(401), Forbidden(403), Conflict(409), Internal Server Error(500)

Request

Name In Type Description
floating_network_id body string An external network ID the floating IP belongs to.
floating_ip_address body string The floating IP address. The IP must be the out side of allocation_pools and within its subnet’s CIDR network.

Example of Create Host Request

{
  "floating_network_id": "1e17587e-a7ed-4b82-a17b-4beb32523e28",
  "floating_ip_address": "172.24.4.101"
}

Response

Name In Type Description
floatingip body object A floatingip object.
id body string The ID of the floating ip resources.
floating_ip_address body string The floating IP address.
network_id body string An external network ID the floating IP belongs to.
subnet_id body boolean An external subnet ID the floating IP belongs to.
reservable body boolean The flag which represents whether the floating IP is reservable or not.
created_at body string The date and time when the object was created.
updated_at body string The date and time when the object was updated.

Example of Create Host Response

{
    "floatingip": {
        "id": "84c4d37e-1f8b-45ce-897b-16ad7f49b0e9",
        "floating_network_id": "1e17587e-a7ed-4b82-a17b-4beb32523e28",
        "floating_ip_address": "172.24.4.101",
        "subnet_id": "a2fa9b7e-8451-4868-85f4-92ee7c77eed6",
        "reservable": true,
        "created_at": "2019-01-28T08:01:46.000000",
        "updated_at": null
    }
}
GET
v1/floatingips/{floatingip_id}

Show Floating IP Details

Show details of a floating IP.

Preconditions

The floating IP must exist.

Response codes

Normal response code: 200

Error response codes: Bad Request(400), Unauthorized(401), Forbidden(403), Not Found(404), Internal Server Error(500)

Request

Name In Type Description
floatingip_id path string The ID of the floating IP.

Response

Name In Type Description
floatingip body object A floatingip object.
id body string The ID of the floating ip resources.
floating_network_id body string An external network ID the floating IP belongs to.
floating_ip_address body string The floating IP address.
reservable body boolean The flag which represents whether the floating IP is reservable or not.
created_at body string The date and time when the object was created.
updated_at body string The date and time when the object was updated.

Example of Show Floating IP Details Response

{
    "floatingip": {
        "id": "84c4d37e-1f8b-45ce-897b-16ad7f49b0e9",
        "floating_network_id": "1e17587e-a7ed-4b82-a17b-4beb32523e28",
        "floating_ip_address": "172.24.4.101",
        "subnet_id": "a2fa9b7e-8451-4868-85f4-92ee7c77eed6",
        "reservable": true,
        "created_at": "2019-01-28T08:01:46.000000",
        "updated_at": null
    }
}
DELETE
v1/floatingips/{floatingip_id}

Delete Floating IP

Delete a floating IP.

Preconditions

The floating IP must exist.

Response codes

Normal response code: 204

Error response codes: Bad Request(400), Unauthorized(401), Forbidden(403), Not Found(404), Conflict(409), Internal Server Error(500)

Request

Name In Type Description
floatingip_id path string The ID of the floating IP.

Repsponse

No body content is returned on a successful DELETE.

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.