Masakari API¶
This is a reference for the OpenStack Masakari API which is provided by the Masakari project.
API Versions¶
In order to bring new features to users over time, the Masakari API supports versioning.
‘’major versions’’, which have dedicated urls
The Version APIs work differently from other APIs as they do not require authentication.
This fetches all the information about all known major API versions in the deployment. Links to more specific information will be provided for each API version.
Response Codes¶
Success¶
Code |
Reason |
---|---|
200 - OK |
Request was successful. |
Response¶
Name |
In |
Type |
Description |
---|---|---|---|
versions |
body |
array |
A list of version objects that describe the API versions available. |
id |
body |
string |
A common name for the version in question. Informative only, it has no real semantic meaning. |
status |
body |
string |
The status of this API version. This can be one of:
|
links |
body |
array |
Links to the resources in question. |
version |
body |
string |
The maximum version supported by API. |
min_version |
body |
string |
The minimum version supported by API. |
Note
The updated
parameter in the response is vestigial and provides
no useful information.
Response Example¶
This demonstrates the expected response from a bleeding edge server that supports up to the current version.
{
"versions": [
{
"id": "v1.0",
"links": [
{
"href": "http://openstack.example.com/v1/",
"rel": "self"
}
],
"status": "CURRENT",
"version": "1.0",
"min_version": "1.0",
"updated": "2016-07-01T11:33:21Z"
}
]
}
This gets the details of a specific API at its root. Nearly all this information exists at the API root, so this is mostly a redundant operation.
Response Codes¶
Success¶
Code |
Reason |
---|---|
200 - OK |
Request was successful. |
Request¶
Name |
In |
Type |
Description |
---|---|---|---|
api_version |
path |
string |
The API version as returned in the links from the |
Response¶
Name |
In |
Type |
Description |
---|---|---|---|
version |
body |
string |
The version. |
id |
body |
string |
A common name for the version in question. Informative only, it has no real semantic meaning. |
status |
body |
string |
The status of this API version. This can be one of:
|
links |
body |
array |
Links to the resources in question. |
version |
body |
string |
The maximum version supported by API. |
min_version |
body |
string |
The minimum version supported by API. |
Note
The updated
and media-types
parameters in the response are
vestigial and provide no useful information. They will probably be
deprecated and removed in the future.
Response Example¶
This is an example of a GET /v1/
on a relatively current server.
{
"version": {
"id": "v1",
"links": [
{
"href": "http://openstack.example.com/v1/",
"rel": "self"
},
{
"href": "http://docs.openstack.org/",
"rel": "describedby",
"type": "text/html"
}
],
"media-types": [
{
"base": "application/json",
"type": "application/vnd.openstack.masakari+json;version=1"
}
],
"status": "CURRENT",
"version": "1.0",
"min_version": "1.0",
"updated": "2016-07-01T11:33:21Z"
}
}
FailoverSegments (segments)¶
Segments
System can be zoned from top to down levels, into Regions, Availability Zones and Host Aggregates (or Cells). Within those zones, one or more pacemaker/pacemaker-remote clusters may exist. In addition to those boundaries, shared storage boundary is also important to decide the optimal host for fail-over. Openstack zoned boundaries (such as Regions, AZ, Host Aggregates, etc..) can be managed by the nova scheduler. However, shared storage boundaries are difficult to manage. Moreover, the operator may want to use other types of boundary such as rack layout and powering. Therefore, operator may want to define the segment of hypervisor hosts and assign the failover host/hosts for each of them. Those segment can be define based on the shared storage boundaries or any other limitations may critical for selection of the failover host.
Lists, creates, shows details for, updates, and deletes segments.
Lists IDs, names, description, recovery_method, service_type, enabled for all segments.
Segments contains service_type, recovery_method and enabled attributes. service_type attribute indicates for which service (e.g. compute, cinder etc) this segment belongs to. recovery_method attribute indicates the recovery action to be followed when any host in a segment goes down. enabled attribute indicates whether notifications which belong to this segment will be dealt with. The possible recovery_method values are:
auto
. Auto recovery action.reserved_host
. Reserved host recovery action.auto_priority
. First executes auto and if auto fails then retried with reserved host recovery action.rh_priority
. First executes reserved host and if it fails then retried with auto recovery action.
You can filter on the service_type, recovery_method and enabled when you complete a list segments request.
Response Codes¶
Success¶
Code |
Reason |
---|---|
200 - OK |
Request was successful. |
Error¶
Code |
Reason |
---|---|
400 - Bad Request |
Some content in the request was invalid. |
401 - Unauthorized |
User must authenticate before making a request. |
403 - Forbidden |
Policy does not allow current user to do this operation. |
404 - Not Found |
The requested resource could not be found. |
Request¶
Name |
In |
Type |
Description |
---|---|---|---|
limit (Optional) |
query |
integer |
Requests a page size of items. Returns a number of items up to a limit value.
Use the |
marker (Optional) |
query |
string |
The ID of the last-seen item. Use the |
recovery_method (Optional) |
query |
string |
Filter the segment list result by recovery_method. |
service_type (Optional) |
query |
string |
Filter the segment list result by service_type. |
enabled (Optional) |
body |
boolean |
Boolean whether this segment is enabled or not. |
sort_dir (Optional) |
query |
string |
Sort direction. A valid value is |
sort_key (Optional) |
query |
string |
Sorts by a segment attribute. Default attribute is
|
Response¶
Name |
In |
Type |
Description |
---|---|---|---|
segments |
body |
array |
A list of |
name |
body |
string |
The segment name. |
uuid |
body |
string |
The UUID of the segment. |
Example List Segments
{
"segments": [
{
"uuid": "9e800031-6946-4b43-bf09-8b3d1cab792b",
"deleted": false,
"created_at": "2017-04-20T10:17:17.000000",
"description": "Segment1",
"recovery_method": "auto",
"updated_at": null,
"service_type": "Compute",
"deleted_at": null,
"id": 1,
"name": "segment2",
"enabled": true
}
]
}
Creates a segment.
Creates a FailoverSegment with name, description, service_type, enabled and recovery_method. For service_type user can mention the name of service for which this segment is created. As of now user can mention COMPUTE as service_type. For recovery_method user can mention either auto, reserved_host, auto_priority or rh_priority. Segment name should be unique. For enabled user can mention true or false to enable/disable this segment.
Response Codes¶
Success¶
Code |
Reason |
---|---|
202 - Accepted |
Request was accepted for processing, but the processing has not been completed. A ‘location’ header is included in the response which contains a link to check the progress of the request. |
Error¶
Code |
Reason |
---|---|
400 - Bad Request |
Some content in the request was invalid. |
401 - Unauthorized |
User must authenticate before making a request. |
403 - Forbidden |
Policy does not allow current user to do this operation. |
409 - Conflict |
This operation conflicted with another operation on this resource. |
A conflict(409) is returned if segment with same name is already present.
Request¶
Name |
In |
Type |
Description |
---|---|---|---|
segment |
body |
object |
A |
description (Optional) |
body |
string |
A free form description of the segment. Limited to 255 characters in length. |
name |
body |
string |
The segment name. |
recovery_method |
body |
string |
Type of recovery if any host in this segment goes down. User can mention either ‘auto’, ‘reserved_host’, ‘auto_priority’ or ‘rh_priority’. |
service_type |
body |
string |
The name of service which will be deployed in this segment. As of now user can mention ‘COMPUTE’ as service_type. |
enabled (Optional) |
body |
boolean |
Boolean whether this segment is enabled or not. |
Example Create Segment
{
"segment": {
"service_type": "COMPUTE",
"recovery_method": "auto",
"name": "new_segment",
"enabled": true
}
}
Response¶
Name |
In |
Type |
Description |
---|---|---|---|
segment |
body |
object |
A |
created |
body |
string |
The date and time when the resource was created. The date and time stamp format is ISO 8601 CCYY-MM-DDThh:mm:ss±hh:mm
For example, |
description (Optional) |
body |
string |
A free form description of the segment. Limited to 255 characters in length. |
id |
body |
string |
The Id of the segment. |
name |
body |
string |
The segment name. |
recovery_method |
body |
string |
Type of recovery if any host in this segment goes down. User can mention either ‘auto’, ‘reserved_host’, ‘auto_priority’ or ‘rh_priority’. |
service_type |
body |
string |
The name of service which will be deployed in this segment. As of now user can mention ‘COMPUTE’ as service_type. |
enabled (Optional) |
body |
boolean |
Boolean whether this segment is enabled or not. |
updated |
body |
string |
The date and time when the resource was updated. The date and time stamp format is ISO 8601 CCYY-MM-DDThh:mm:ss±hh:mm
For example, |
uuid |
body |
string |
The UUID of the segment. |
Example Create Segment
{
"segment": {
"uuid": "5fd9f925-0379-40db-a7f8-786a0b655b2a",
"deleted": false,
"created_at": "2017-04-21T08:59:53.991030",
"description": null,
"recovery_method": "auto",
"updated_at": null,
"service_type": "COMPUTE",
"deleted_at": null,
"id": 4,
"name": "new_segment",
"enabled": true
}
}
Shows details for a segment.
Preconditions
The segment must exist.
Response Codes¶
Success¶
Code |
Reason |
---|---|
200 - OK |
Request was successful. |
Error¶
Code |
Reason |
---|---|
401 - Unauthorized |
User must authenticate before making a request. |
403 - Forbidden |
Policy does not allow current user to do this operation. |
404 - Not Found |
The requested resource could not be found. |
Request¶
Name |
In |
Type |
Description |
---|---|---|---|
segment_id |
path |
string |
The UUID of the segment. |
Response¶
Name |
In |
Type |
Description |
---|---|---|---|
segment |
body |
object |
A |
created |
body |
string |
The date and time when the resource was created. The date and time stamp format is ISO 8601 CCYY-MM-DDThh:mm:ss±hh:mm
For example, |
description (Optional) |
body |
string |
A free form description of the segment. Limited to 255 characters in length. |
id |
body |
string |
The Id of the segment. |
name |
body |
string |
The segment name. |
recovery_method |
body |
string |
Type of recovery if any host in this segment goes down. User can mention either ‘auto’, ‘reserved_host’, ‘auto_priority’ or ‘rh_priority’. |
service_type |
body |
string |
The name of service which will be deployed in this segment. As of now user can mention ‘COMPUTE’ as service_type. |
enabled (Optional) |
body |
boolean |
Boolean whether this segment is enabled or not. |
updated |
body |
string |
The date and time when the resource was updated. The date and time stamp format is ISO 8601 CCYY-MM-DDThh:mm:ss±hh:mm
For example, |
uuid |
body |
string |
The UUID of the segment. |
Example Show Segment Details
{
"segment": {
"uuid": "5fd9f925-0379-40db-a7f8-786a0b655b2a",
"deleted": false,
"created_at": "2017-04-21T08:59:53.991030",
"description": null,
"recovery_method": "auto",
"updated_at": null,
"service_type": "COMPUTE",
"deleted_at": null,
"id": 4,
"name": "new_segment",
"enabled": true
}
}
Updates the editable attributes of an existing segment.
Preconditions
The segment must exist.
User can not update segment if any host from the segment has any usage in the notification table i.e. any host from the failover segment has notification status as new/error/running.
Response Codes¶
Success¶
Code |
Reason |
---|---|
200 - OK |
Request was successful. |
Error¶
Code |
Reason |
---|---|
400 - Bad Request |
Some content in the request was invalid. |
401 - Unauthorized |
User must authenticate before making a request. |
403 - Forbidden |
Policy does not allow current user to do this operation. |
404 - Not Found |
The requested resource could not be found. |
409 - Conflict |
This operation conflicted with another operation on this resource. |
A conflict(409) is returned if user tries to update segment name which is already assigned to segment or if any host from the segment has any usage in the notification table i.e. any host from the failover segment has notification status as new/error/running.
Request¶
Name |
In |
Type |
Description |
---|---|---|---|
segment_id |
path |
string |
The UUID of the segment. |
description (Optional) |
body |
string |
A free form description of the segment. Limited to 255 characters in length. |
name |
body |
string |
The segment name. |
recovery_method |
body |
string |
Type of recovery if any host in this segment goes down. User can mention either ‘auto’, ‘reserved_host’, ‘auto_priority’ or ‘rh_priority’. |
service_type |
body |
string |
The name of service which will be deployed in this segment. As of now user can mention ‘COMPUTE’ as service_type. |
enabled (Optional) |
body |
boolean |
Boolean whether this segment is enabled or not. |
Example Update segment name
{
"segment": {
"name": "new_segment",
"enabled": false
}
}
Response¶
Name |
In |
Type |
Description |
---|---|---|---|
segment |
body |
object |
A |
created |
body |
string |
The date and time when the resource was created. The date and time stamp format is ISO 8601 CCYY-MM-DDThh:mm:ss±hh:mm
For example, |
description (Optional) |
body |
string |
A free form description of the segment. Limited to 255 characters in length. |
id |
body |
string |
The Id of the segment. |
name |
body |
string |
The segment name. |
recovery_method |
body |
string |
Type of recovery if any host in this segment goes down. User can mention either ‘auto’, ‘reserved_host’, ‘auto_priority’ or ‘rh_priority’. |
service_type |
body |
string |
The name of service which will be deployed in this segment. As of now user can mention ‘COMPUTE’ as service_type. |
enabled (Optional) |
body |
boolean |
Boolean whether this segment is enabled or not. |
updated |
body |
string |
The date and time when the resource was updated. The date and time stamp format is ISO 8601 CCYY-MM-DDThh:mm:ss±hh:mm
For example, |
uuid |
body |
string |
The UUID of the segment. |
Example Update Segment name
{
"segment": {
"uuid": "5fd9f925-0379-40db-a7f8-786a0b655b2a",
"deleted": false,
"created_at": "2017-04-21T08:59:54.000000",
"description": null,
"recovery_method": "auto",
"updated_at": "2017-04-21T09:47:03.748028",
"service_type": "COMPUTE",
"deleted_at": null,
"id": 4,
"name": "new_segment",
"enabled": false
}
}
Deletes a segment.
Preconditions
The segment must exist.
User can not delete segment if any host from the segment has any usage in the notification table i.e. any host from the failover segment has notification status as new/error/running.
Response Codes¶
Success¶
Code |
Reason |
---|---|
204 - No Content |
The server has fulfilled the request by deleting the resource. |
Error¶
Code |
Reason |
---|---|
400 - Bad Request |
Some content in the request was invalid. |
401 - Unauthorized |
User must authenticate before making a request. |
403 - Forbidden |
Policy does not allow current user to do this operation. |
404 - Not Found |
The requested resource could not be found. |
409 - Conflict |
This operation conflicted with another operation on this resource. |
A conflict(409) is returned if user tries to delete the segment if any host from the segment has any usage in the notification table i.e. any host from the failover segment has notification status as new/error/running.
Request¶
Name |
In |
Type |
Description |
---|---|---|---|
segment_id |
path |
string |
The UUID of the segment. |
Response¶
There is no body content for the response of a successful DELETE query.
Hosts (hosts)¶
Hosts
A host belongs to segment. Host can be any kind of virtual machine which can have compute service running on it.
Lists, creates, shows details for, updates, and deletes hosts.
Lists IDs, names, type, reserved, on_maintenance for all hosts.
You can filter on the type, on_maintenance and reserved when you complete a list hosts request.
Preconditions
The segment must exist.
Response Codes¶
Success¶
Code |
Reason |
---|---|
200 - OK |
Request was successful. |
Error¶
Code |
Reason |
---|---|
400 - Bad Request |
Some content in the request was invalid. |
401 - Unauthorized |
User must authenticate before making a request. |
403 - Forbidden |
Policy does not allow current user to do this operation. |
404 - Not Found |
The requested resource could not be found. |
Request¶
Name |
In |
Type |
Description |
---|---|---|---|
segment_id |
path |
string |
The UUID of the segment. |
limit (Optional) |
query |
integer |
Requests a page size of items. Returns a number of items up to a limit value.
Use the |
marker (Optional) |
query |
string |
The ID of the last-seen item. Use the |
on_maintenance (Optional) |
query |
boolean |
Filter the host list result by on_maintenance. |
reserved (Optional) |
query |
boolean |
Filter the host list result by reserved flag. |
sort_dir (Optional) |
query |
string |
Sort direction. A valid value is |
sort_key (Optional) |
query |
string |
Sorts by a hosts attribute. Default attribute is
|
type (Optional) |
query |
boolean |
Filter the host list result by type of host. |
Response¶
Name |
In |
Type |
Description |
---|---|---|---|
hosts |
body |
array |
A list of |
name |
body |
string |
The host name. |
uuid |
body |
string |
The UUID of the host. |
failover_segment_id |
body |
string |
The UUID of the segment. |
deleted |
body |
boolean |
A boolean indicates whether this resource is deleted or not, if it has
not been deleted, |
on_maintenance (Optional) |
body |
boolean |
A boolean indicates whether this host is on maintenance or not, if it is
not on maintenance mode, |
reserved (Optional) |
body |
boolean |
A boolean indicates whether this host is reserved or not, if it is
not reserved, |
created_at |
body |
string |
The date and time when the resource was created. The date and time stamp format is ISO 8601 CCYY-MM-DDThh:mm:ss±hh:mm
For example, |
control_attributes |
body |
string |
Attributes to control host. |
updated_at |
body |
string |
The date and time when the resource was updated. The date and time stamp format is ISO 8601 CCYY-MM-DDThh:mm:ss±hh:mm
For example, |
failover_segment |
body |
object |
A |
type |
body |
string |
Type of host. |
id |
body |
string |
ID of host. |
Example List hosts
{
"hosts": [
{
"reserved": false,
"uuid": "083a8474-22c0-407f-b89b-c569134c3bfd",
"deleted": false,
"on_maintenance": false,
"created_at": "2017-04-21T10:09:20.000000",
"control_attributes": "SSH",
"updated_at": null,
"name": "openstack-VirtualBox",
"failover_segment": {
"uuid": "9e800031-6946-4b43-bf09-8b3d1cab792b",
"deleted": false,
"created_at": "2017-04-20T10:17:17.000000",
"description": null,
"recovery_method": "auto",
"updated_at": null,
"service_type": "COMPUTE",
"deleted_at": null,
"id": 2,
"name": "segment2"
},
"deleted_at": null,
"type": "COMPUTE_HOST",
"id": 1,
"failover_segment_id": "9e800031-6946-4b43-bf09-8b3d1cab792b"
}
]
}
Creates a host under given segment.
Creates a Host under given segment with name, type, control_attributes. User can set sepcific hosts as reserved by setting reserved attribute to True. By default on_maintenance mode which indicates whether host is under maintenance or not is False when host is created. Host name should be equal to nova-compute host name from nova service list and host name from the corosync cluster.
Preconditions
The segment must exist.
Response Codes¶
Success¶
Code |
Reason |
---|---|
201 - Created |
Resource was created and is ready to use. |
Error¶
Code |
Reason |
---|---|
400 - Bad Request |
Some content in the request was invalid. |
401 - Unauthorized |
User must authenticate before making a request. |
403 - Forbidden |
Policy does not allow current user to do this operation. |
404 - Not Found |
The requested resource could not be found. |
409 - Conflict |
This operation conflicted with another operation on this resource. |
A conflict(409) is returned if host with same name is already present under given segment.
BadRequest (400) is returned if host doesn’t exists in nova.
Request¶
Name |
In |
Type |
Description |
---|---|---|---|
segment_id |
path |
string |
The UUID of the segment. |
host |
body |
object |
A |
type |
body |
string |
Type of host. |
name |
body |
string |
The host name. |
control_attributes |
body |
string |
Attributes to control host. |
reserved (Optional) |
body |
boolean |
A boolean indicates whether this host is reserved or not, if it is
not reserved, |
on_maintenance (Optional) |
body |
boolean |
A boolean indicates whether this host is on maintenance or not, if it is
not on maintenance mode, |
Example Create Host
{
"host": {
"control_attributes": "SSH",
"type": "COMPUTE",
"name": "openstack-VirtualBox"
}
}
Response¶
Name |
In |
Type |
Description |
---|---|---|---|
host |
body |
object |
A |
name |
body |
string |
The host name. |
uuid |
body |
string |
The UUID of the host. |
failover_segment_id |
body |
string |
The UUID of the segment. |
deleted |
body |
boolean |
A boolean indicates whether this resource is deleted or not, if it has
not been deleted, |
on_maintenance (Optional) |
body |
boolean |
A boolean indicates whether this host is on maintenance or not, if it is
not on maintenance mode, |
reserved (Optional) |
body |
boolean |
A boolean indicates whether this host is reserved or not, if it is
not reserved, |
created_at |
body |
string |
The date and time when the resource was created. The date and time stamp format is ISO 8601 CCYY-MM-DDThh:mm:ss±hh:mm
For example, |
control_attributes |
body |
string |
Attributes to control host. |
updated_at |
body |
string |
The date and time when the resource was updated. The date and time stamp format is ISO 8601 CCYY-MM-DDThh:mm:ss±hh:mm
For example, |
failover_segment |
body |
object |
A |
type |
body |
string |
Type of host. |
id |
body |
string |
ID of host. |
Example Create Host
{
"host": {
"reserved": false,
"uuid": "083a8474-22c0-407f-b89b-c569134c3bfd",
"deleted": false,
"on_maintenance": false,
"created_at": "2017-04-21T10:09:20.000000",
"control_attributes": "SSH",
"updated_at": null,
"name": "openstack-VirtualBox",
"failover_segment": {
"uuid": "9e800031-6946-4b43-bf09-8b3d1cab792b",
"deleted": false,
"created_at": "2017-04-20T10:17:17.000000",
"description": null,
"recovery_method": "auto",
"updated_at": null,
"service_type": "COMPUTE",
"deleted_at": null,
"id": 2,
"name": "segment2"
},
"deleted_at": null,
"type": "COMPUTE_HOST",
"id": 1,
"failover_segment_id": "9e800031-6946-4b43-bf09-8b3d1cab792b"
}
}
Shows details for a host.
Preconditions
The segment must exist. The host must exist.
Response Codes¶
Success¶
Code |
Reason |
---|---|
200 - OK |
Request was successful. |
Error¶
Code |
Reason |
---|---|
401 - Unauthorized |
User must authenticate before making a request. |
403 - Forbidden |
Policy does not allow current user to do this operation. |
404 - Not Found |
The requested resource could not be found. |
Request¶
Name |
In |
Type |
Description |
---|---|---|---|
segment_id |
path |
string |
The UUID of the segment. |
host_id |
path |
string |
The UUID of the host. |
Response¶
Name |
In |
Type |
Description |
---|---|---|---|
host |
body |
object |
A |
name |
body |
string |
The host name. |
uuid |
body |
string |
The UUID of the host. |
failover_segment_id |
body |
string |
The UUID of the segment. |
deleted |
body |
boolean |
A boolean indicates whether this resource is deleted or not, if it has
not been deleted, |
on_maintenance (Optional) |
body |
boolean |
A boolean indicates whether this host is on maintenance or not, if it is
not on maintenance mode, |
reserved (Optional) |
body |
boolean |
A boolean indicates whether this host is reserved or not, if it is
not reserved, |
created_at |
body |
string |
The date and time when the resource was created. The date and time stamp format is ISO 8601 CCYY-MM-DDThh:mm:ss±hh:mm
For example, |
control_attributes |
body |
string |
Attributes to control host. |
updated_at |
body |
string |
The date and time when the resource was updated. The date and time stamp format is ISO 8601 CCYY-MM-DDThh:mm:ss±hh:mm
For example, |
failover_segment |
body |
object |
A |
type |
body |
string |
Type of host. |
id |
body |
string |
ID of host. |
Example Show Host Details
{
"host": {
"reserved": false,
"uuid": "083a8474-22c0-407f-b89b-c569134c3bfd",
"deleted": false,
"on_maintenance": false,
"created_at": "2017-04-21T10:09:20.000000",
"control_attributes": "SSH",
"updated_at": null,
"name": "openstack-VirtualBox",
"failover_segment": {
"uuid": "9e800031-6946-4b43-bf09-8b3d1cab792b",
"deleted": false,
"created_at": "2017-04-20T10:17:17.000000",
"description": null,
"recovery_method": "auto",
"updated_at": null,
"service_type": "COMPUTE",
"deleted_at": null,
"id": 2,
"name": "segment2"
},
"deleted_at": null,
"type": "COMPUTE_HOST",
"id": 1,
"failover_segment_id": "9e800031-6946-4b43-bf09-8b3d1cab792b"
}
}
Updates the editable attributes of an existing host.
Preconditions
The segment must exist.
The host must exist.
User can not update host if that host or any host from the failover segment has any usage in the notification table i.e. any host from the failover segment has notification status as new/error/running.
Response Codes¶
Success¶
Code |
Reason |
---|---|
200 - OK |
Request was successful. |
Error¶
Code |
Reason |
---|---|
400 - Bad Request |
Some content in the request was invalid. |
401 - Unauthorized |
User must authenticate before making a request. |
403 - Forbidden |
Policy does not allow current user to do this operation. |
404 - Not Found |
The requested resource could not be found. |
409 - Conflict |
This operation conflicted with another operation on this resource. |
A conflict(409) is returned if user tries to update host name which is already assigned to host under given segment or user tries to update the host or any other host from the failover segment has any usage in the notification table i.e. any host from the failover segment has notification status as new/error/running.
BadRequest (400) is returned if host doesn’t exists in nova.
Request¶
Name |
In |
Type |
Description |
---|---|---|---|
segment_id |
path |
string |
The UUID of the segment. |
host_id |
path |
string |
The UUID of the host. |
type |
body |
string |
Type of host. |
name |
body |
string |
The segment name. |
on_maintenance (Optional) |
body |
boolean |
A boolean indicates whether this host is on maintenance or not, if it is
not on maintenance mode, |
reserved (Optional) |
body |
boolean |
A boolean indicates whether this host is reserved or not, if it is
not reserved, |
Example Update host reserved flag
{
"host": {
"reserved": "True"
}
}
Response¶
Name |
In |
Type |
Description |
---|---|---|---|
host |
body |
object |
A |
name |
body |
string |
The host name. |
uuid |
body |
string |
The UUID of the host. |
failover_segment_id |
body |
string |
The UUID of the segment. |
deleted |
body |
boolean |
A boolean indicates whether this resource is deleted or not, if it has
not been deleted, |
on_maintenance (Optional) |
body |
boolean |
A boolean indicates whether this host is on maintenance or not, if it is
not on maintenance mode, |
reserved (Optional) |
body |
boolean |
A boolean indicates whether this host is reserved or not, if it is
not reserved, |
created_at |
body |
string |
The date and time when the resource was created. The date and time stamp format is ISO 8601 CCYY-MM-DDThh:mm:ss±hh:mm
For example, |
control_attributes |
body |
string |
Attributes to control host. |
updated_at |
body |
string |
The date and time when the resource was updated. The date and time stamp format is ISO 8601 CCYY-MM-DDThh:mm:ss±hh:mm
For example, |
failover_segment |
body |
object |
A |
type |
body |
string |
Type of host. |
id |
body |
string |
ID of host. |
Example Update host reserved flag
{
"host": {
"reserved": true,
"uuid": "083a8474-22c0-407f-b89b-c569134c3bfd",
"deleted": false,
"on_maintenance": false,
"created_at": "2017-04-21T10:09:20.000000",
"control_attributes": "SSH",
"updated_at": "2017-04-21T11:12:43.351320",
"name": "openstack-VirtualBox",
"failover_segment": {
"uuid": "9e800031-6946-4b43-bf09-8b3d1cab792b",
"deleted": false,
"created_at": "2017-04-20T10:17:17.000000",
"description": null,
"recovery_method": "auto",
"updated_at": null,
"service_type": "Compute",
"deleted_at": null,
"id": 2,
"name": "new_segment"
},
"deleted_at": null,
"type": "COMPUTE",
"id": 1,
"failover_segment_id": "9e800031-6946-4b43-bf09-8b3d1cab792b"
}
}
Deletes a host from given segment.
Preconditions
The segment must exist.
The host must exist.
User can not delete host if that host or any host from the failover segment has any usage in the notification table i.e. any host from the failover segment has notification status as new/error/running.
Response Codes¶
Success¶
Code |
Reason |
---|---|
204 - No Content |
The server has fulfilled the request by deleting the resource. |
Error¶
Code |
Reason |
---|---|
400 - Bad Request |
Some content in the request was invalid. |
401 - Unauthorized |
User must authenticate before making a request. |
403 - Forbidden |
Policy does not allow current user to do this operation. |
404 - Not Found |
The requested resource could not be found. |
409 - Conflict |
This operation conflicted with another operation on this resource. |
A conflict(409) is returned if user tries to delete the host or any other host from the failover segment has any usage in the notification table i.e. any host from the failover segment has notification status as new/error/running.
Request¶
Name |
In |
Type |
Description |
---|---|---|---|
segment_id |
path |
string |
The UUID of the segment. |
host_id |
path |
string |
The UUID of the host. |
Response¶
There is no body content for the response of a successful DELETE query.
Notifications (notifications)¶
Notifications
A notification is a kind of alert provided by monitoring services (masakari-monitors) for failure of either host, process or instance.
Lists, creates and shows details for notifications.
Lists IDs, notification types, host_name, generated_time, payload and status for all notifications.
Notifications contain a status attribute that indicates the current notification state. You can filter on the notification status when you complete a list notifications request. The notification status is returned in the response body. The possible notification status values are:
new
. The notification is in new state and yet to be processed.running
. The notification is in progress.finished
. The notification is completed successfully.error
. The notification is ended up in error.failed
. The notification is not processed successfully after failed once.ignored
. The notification is ignored by masakari engine.
You can also filter on the basis of source_host_uuid, generated_since and type when you complete a list notifications request.
Response Codes¶
Success¶
Code |
Reason |
---|---|
200 - OK |
Request was successful. |
Error¶
Code |
Reason |
---|---|
400 - Bad Request |
Some content in the request was invalid. |
401 - Unauthorized |
User must authenticate before making a request. |
403 - Forbidden |
Policy does not allow current user to do this operation. |
404 - Not Found |
The requested resource could not be found. |
Request¶
Name |
In |
Type |
Description |
---|---|---|---|
generated_since (Optional) |
query |
string |
Filter the notifications list result by notification generated time. |
limit (Optional) |
query |
integer |
Requests a page size of items. Returns a number of items up to a limit value.
Use the |
marker (Optional) |
query |
string |
The ID of the last-seen item. Use the |
sort_dir (Optional) |
query |
string |
Sort direction. A valid value is |
sort_key (Optional) |
query |
string |
Sorts by a notification attribute. Default attribute is
|
source_host_uuid (Optional) |
query |
string |
Filter the notifications list result by source_host_uuid. |
type (Optional) |
query |
string |
Filter the notifications list result by notification type. |
Response¶
Name |
In |
Type |
Description |
---|---|---|---|
notifications |
body |
array |
A list of |
notification_uuid |
body |
string |
The UUID of the notification. |
deleted |
body |
boolean |
A boolean indicates whether this resource is deleted or not, if it has
not been deleted, |
created_at |
body |
string |
The date and time when the resource was created. The date and time stamp format is ISO 8601 CCYY-MM-DDThh:mm:ss±hh:mm
For example, |
updated_at |
body |
string |
The date and time when the resource was updated. The date and time stamp format is ISO 8601 CCYY-MM-DDThh:mm:ss±hh:mm
For example, |
status |
body |
string |
The notification status. |
uuid |
body |
string |
The UUID of the notification. |
source_host_uuid |
body |
string |
The UUID of host for which notification is generated. |
generated_time |
body |
string |
The date and time when the notification was created. The date and time stamp format is ISO 8601 CCYY-MM-DDThh:mm:ss±hh:mm
For example, |
type |
body |
string |
Type of notification, can be either |
payload |
body |
string |
Payload for notification. Note This is a JSON string. |
id |
body |
string |
ID of notification. |
Example List Notifications
{
"notifications": [
{
"notification_uuid": "32bc95ac-858d-460a-b562-7e365391be64",
"status": "new",
"source_host_uuid": "083a8474-22c0-407f-b89b-c569134c3bfd",
"deleted": false,
"created_at": "2017-04-21T12:09:44.000000",
"updated_at": null,
"id": 1,
"generated_time": "2017-04-21T17:29:55.000000",
"deleted_at": null,
"type": "PROCESS",
"payload": {
"process_name": "nova-compute",
"event": "stopped"
}
}
]
}
Creates a notification.
Response Codes¶
Success¶
Code |
Reason |
---|---|
202 - Accepted |
Request was accepted for processing, but the processing has not been completed. A ‘location’ header is included in the response which contains a link to check the progress of the request. |
Error¶
Code |
Reason |
---|---|
400 - Bad Request |
Some content in the request was invalid. |
401 - Unauthorized |
User must authenticate before making a request. |
403 - Forbidden |
Policy does not allow current user to do this operation. |
409 - Conflict |
This operation conflicted with another operation on this resource. |
A conflict(409) is returned if notification with same payload is exists or host for which notification is generated is under maintenance.
BadRequest (400) is returned if notification payload is incorrect.
Request¶
Name |
In |
Type |
Description |
---|---|---|---|
notification |
body |
object |
A |
type |
body |
string |
Type of notification, can be either |
generated_time |
body |
string |
The date and time when the notification was created. The date and time stamp format is ISO 8601 CCYY-MM-DDThh:mm:ss±hh:mm
For example, |
payload |
body |
string |
Payload for notification. Note This is a JSON string. |
host_name |
body |
object |
A name of host for which notification is created. |
Example create Process failure notification
{
"notification": {
"type": "PROCESS",
"generated_time": "2017-04-21 17:29:55",
"payload": {
"process_name": "nova-compute",
"event": "stopped"
},
"hostname": "openstack-VirtualBox"
}
}
Example create VM failure notification
{
"notification": {
"type": "VM",
"generated_time": "2017-04-23T07:18:51.523726",
"payload": {
"instance_uuid": "96ab1c42-668c-4f2d-8689-afa3301d4ee9",
"vir_domain_event": "STOPPED_DESTROYED",
"event": "LIFECYCLE"
},
"hostname": "openstack-VirtualBox"
}
}
Example create COMPUTE_HOST failure notification
{
"notification": {
"type": "COMPUTE_HOST",
"generated_time": "2017-04-24 08:34:46",
"payload": {
"event": "STOPPED",
"host_status": "UNKNOWN",
"cluster_status": "OFFLINE"
},
"hostname": "openstack-VirtualBox"
}
}
Response¶
Name |
In |
Type |
Description |
---|---|---|---|
notification |
body |
object |
A |
type |
body |
string |
Type of notification, can be either |
generated_time |
body |
string |
The date and time when the notification was created. The date and time stamp format is ISO 8601 CCYY-MM-DDThh:mm:ss±hh:mm
For example, |
payload |
body |
string |
Payload for notification. Note This is a JSON string. |
source_host_uuid |
body |
string |
The UUID of host for which notification is generated. |
uuid |
body |
string |
The UUID of the notification. |
deleted |
body |
boolean |
A boolean indicates whether this resource is deleted or not, if it has
not been deleted, |
created_at |
body |
string |
The date and time when the resource was created. The date and time stamp format is ISO 8601 CCYY-MM-DDThh:mm:ss±hh:mm
For example, |
status |
body |
string |
The notification status. |
updated_at |
body |
string |
The date and time when the resource was updated. The date and time stamp format is ISO 8601 CCYY-MM-DDThh:mm:ss±hh:mm
For example, |
id |
body |
string |
ID of notification. |
Example create Process failure notification
{
"notification": {
"notification_uuid": "2b412acf-c55a-442d-8fd2-e823ec0d827f",
"status": "new",
"source_host_uuid": "083a8474-22c0-407f-b89b-c569134c3bfd",
"deleted": false,
"created_at": "2017-04-24T06:05:29.387678",
"updated_at": null,
"id": 2,
"generated_time": "2017-04-21T17:29:55.000000",
"deleted_at": null,
"type": "PROCESS",
"payload": {
"process_name": "nova-compute",
"event": "stopped"
}
}
}
Example create VM failure notification
{
"notification": {
"notification_uuid": "f4836386-7648-4395-89b6-75a2c5ca7ff2",
"status": "new",
"source_host_uuid": "083a8474-22c0-407f-b89b-c569134c3bfd",
"deleted": false,
"created_at": "2017-04-24T06:22:47.569979",
"updated_at": null,
"id": 3,
"generated_time": "2017-04-23T07:18:51.523726",
"deleted_at": null,
"type": "VM",
"payload": {
"instance_uuid": "96ab1c42-668c-4f2d-8689-afa3301d4ee9",
"vir_domain_event": "STOPPED_DESTROYED",
"event": "LIFECYCLE"
}
}
}
Example create COMPUTE_HOST failure notification
{
"notification": {
"notification_uuid": "9e66b95d-45da-4695-bfb6-ace68b35d955",
"status": "new",
"source_host_uuid": "083a8474-22c0-407f-b89b-c569134c3bfd",
"deleted": false,
"created_at": "2017-04-24T06:37:37.396994",
"updated_at": null,
"id": 4,
"generated_time": "2017-04-24T08:34:46.000000",
"deleted_at": null,
"type": "COMPUTE_HOST",
"payload": {
"host_status": "UNKNOWN",
"event": "STOPPED",
"cluster_status": "OFFLINE"
}
}
}
Shows details for a notification.
Preconditions
The notification must exist.
Response Codes¶
Success¶
Code |
Reason |
---|---|
200 - OK |
Request was successful. |
Error¶
Code |
Reason |
---|---|
401 - Unauthorized |
User must authenticate before making a request. |
403 - Forbidden |
Policy does not allow current user to do this operation. |
404 - Not Found |
The requested resource could not be found. |
Request¶
Name |
In |
Type |
Description |
---|---|---|---|
notification_id |
path |
string |
The UUID of the notification. |
Response¶
Name |
In |
Type |
Description |
---|---|---|---|
notification |
body |
object |
A |
type |
body |
string |
Type of notification, can be either |
generated_time |
body |
string |
The date and time when the notification was created. The date and time stamp format is ISO 8601 CCYY-MM-DDThh:mm:ss±hh:mm
For example, |
payload |
body |
string |
Payload for notification. Note This is a JSON string. |
source_host_uuid |
body |
string |
The UUID of host for which notification is generated. |
uuid |
body |
string |
The UUID of the notification. |
deleted |
body |
boolean |
A boolean indicates whether this resource is deleted or not, if it has
not been deleted, |
created_at |
body |
string |
The date and time when the resource was created. The date and time stamp format is ISO 8601 CCYY-MM-DDThh:mm:ss±hh:mm
For example, |
status |
body |
string |
The notification status. |
updated_at |
body |
string |
The date and time when the resource was updated. The date and time stamp format is ISO 8601 CCYY-MM-DDThh:mm:ss±hh:mm
For example, |
recovery_workflow_details |
body |
array |
Recovery workflow details of the notification. This is a list of dictionary.
|
id |
body |
string |
ID of notification. |
Example Show Notification Details
{
"notification": {
"notification_uuid": "07a331b8-df15-4582-b121-73ed3541a408",
"status": "finished",
"source_host_uuid": "b5bc49be-ea6f-472d-9240-968f75d7a16a",
"deleted": false,
"created_at": "2019-02-28T07:19:49.000000",
"updated_at": "2019-02-28T07:19:59.000000",
"payload": {
"instance_uuid": "b9837317-a5b8-44f4-93b4-45500c562bb8",
"vir_domain_event": "STOPPED_FAILED",
"event": "LIFECYCLE"
},
"recovery_workflow_details": [
{
"progress": 1.0,
"state": "SUCCESS",
"name": "StopInstanceTask",
"progress_details": [
{"timestamp": "2019-03-07 13:54:28.842031", "message": "Stopping instance: df528f02-2415-4a40-bad8-453ad6a519f7", "progress": "0.0"},
{"timestamp": "2019-03-07 13:54:34.442617", "message": "Stopped instance: 'df528f02-2415-4a40-bad8-453ad6a519f7'", "progress": "1.0"}
]
},
{
"progress": 1.0,
"state": "SUCCESS",
"name": "StartInstanceTask",
"progress_details": [
{"timestamp": "2019-03-07 13:54:34.531755", "message": "Starting instance: 'df528f02-2415-4a40-bad8-453ad6a519f7'", "progress": "0.0"},
{"timestamp": "2019-03-07 13:54:35.930430", "message": "Instance started: 'df528f02-2415-4a40-bad8-453ad6a519f7'", "progress": "1.0"}
]
},
{
"progress": 1.0,
"state": "SUCCESS",
"name": "ConfirmInstanceActiveTask",
"progress_details": [
{"timestamp": "2019-03-07 13:54:36.019208", "message": "Confirming instance 'df528f02-2415-4a40-bad8-453ad6a519f7' vm_state is ACTIVE", "progress": "0.0"},
{"timestamp": "2019-03-07 13:54:38.569373", "message": "Confirmed instance 'df528f02-2415-4a40-bad8-453ad6a519f7' vm_state is ACTIVE", "progress": "1.0"}
]
}
],
"generated_time": "2017-06-13T15:34:55.000000",
"deleted_at": null,
"type": "VM",
"id": 13
}
}
VMoves (vmoves)¶
VMoves
A vmove belongs to one host failure notification.
Lists, shows details for vmoves.
Lists IDs, notification_id, instance_id, source_host, dest_host, start_time, end_time, status and type for all VM moves.
Vmoves contain a type attribute that indicates the current vmove type. The possible vmove type values are:
evacuation
. The vmove is one evacuation.migration
. The vmove is one migration.live_migration
. The vmove is one live_migration.
Vmoves contain a status attribute that indicates the current vmove state. The possible vmove status values are:
pending
. The vmove is in pending state and yet to be processed.ongoing
. The vmove is in progress.succeeded
. The vmove is processed successfully.failed
. The vmove is processed failed.ignored
. The vmove is ignored for some reason.
You can filter on the type and status when you complete a list vmoves request.
Preconditions
The notification must exist.
Response Codes¶
Success¶
Code |
Reason |
---|---|
200 - OK |
Request was successful. |
Error¶
Code |
Reason |
---|---|
400 - Bad Request |
Some content in the request was invalid. |
401 - Unauthorized |
User must authenticate before making a request. |
403 - Forbidden |
Policy does not allow current user to do this operation. |
404 - Not Found |
The requested resource could not be found. |
BadRequest (400) is returned if the notification type is not COMPUTE_NODE.
Request¶
Name |
In |
Type |
Description |
---|---|---|---|
notification_id |
path |
string |
The UUID of the notification. |
limit (Optional) |
query |
integer |
Requests a page size of items. Returns a number of items up to a limit value.
Use the |
marker (Optional) |
query |
string |
The ID of the last-seen item. Use the |
sort_dir (Optional) |
query |
string |
Sort direction. A valid value is |
sort_key (Optional) |
query |
string |
Sorts by a vmove attribute. Default attribute is
|
status (Optional) |
query |
string |
Filter the vmoves list result by vmove status. |
type (Optional) |
query |
string |
Filter the vmoves list result by vmove type. |
Response¶
Name |
In |
Type |
Description |
---|---|---|---|
vmoves |
body |
array |
A list of |
created_at |
body |
string |
The date and time when the resource was created. The date and time stamp format is ISO 8601 CCYY-MM-DDThh:mm:ss±hh:mm
For example, |
updated_at |
body |
string |
The date and time when the resource was updated. The date and time stamp format is ISO 8601 CCYY-MM-DDThh:mm:ss±hh:mm
For example, |
deleted |
body |
boolean |
A boolean indicates whether this resource is deleted or not, if it has
not been deleted, |
id |
body |
string |
ID of vmove. |
uuid |
body |
string |
The UUID of the vmove. |
notification_uuid |
body |
string |
The UUID of the notification. |
instance_uuid |
body |
string |
The UUID of the instance. |
instance_name |
body |
string |
The name of the instance. |
source_host |
body |
string |
The host name. |
dest_host |
body |
string |
The host name. |
start_time |
body |
string |
The date and time when the vmove started. |
end_time |
body |
string |
The date and time when the vmove ended. |
status |
body |
string |
The vmove status. |
type |
body |
string |
The vmove type. |
message |
body |
string |
The vmove message info. |
Example List vmoves
{
"vmoves": [
{
"created_at": "2023-01-28T14:55:27.000000",
"updated_at": null,
"deleted_at": null,
"deleted": false,
"id": 1,
"notification_uuid": "a0e70d3a-b3a2-4616-b65d-a7c03a2c85fc",
"instance_uuid": "1c2f1795-ce78-4d4c-afd0-ce141fdb3952",
"instance_name": "vm1",
"source_host": "host1",
"dest_host": "host2",
"start_time": "2023-01-28T14:55:27.000000",
"end_time": "2023-01-28T14:55:31.000000",
"status": "succeeded",
"type": "evacuation",
"message": null
}
]
}
Shows details for a vmove.
Preconditions
The notification must exist. The vmove must exist.
Response Codes¶
Success¶
Code |
Reason |
---|---|
200 - OK |
Request was successful. |
Error¶
Code |
Reason |
---|---|
401 - Unauthorized |
User must authenticate before making a request. |
403 - Forbidden |
Policy does not allow current user to do this operation. |
404 - Not Found |
The requested resource could not be found. |
Request¶
Name |
In |
Type |
Description |
---|---|---|---|
notification_id |
path |
string |
The UUID of the notification. |
vmove_id |
path |
string |
The UUID of the vmove. |
Response¶
Name |
In |
Type |
Description |
---|---|---|---|
vmove |
body |
object |
A |
created_at |
body |
string |
The date and time when the resource was created. The date and time stamp format is ISO 8601 CCYY-MM-DDThh:mm:ss±hh:mm
For example, |
updated_at |
body |
string |
The date and time when the resource was updated. The date and time stamp format is ISO 8601 CCYY-MM-DDThh:mm:ss±hh:mm
For example, |
deleted |
body |
boolean |
A boolean indicates whether this resource is deleted or not, if it has
not been deleted, |
id |
body |
string |
ID of vmove. |
uuid |
body |
string |
The UUID of the vmove. |
notification_uuid |
body |
string |
The UUID of the notification. |
instance_uuid |
body |
string |
The UUID of the instance. |
instance_name |
body |
string |
The name of the instance. |
source_host |
body |
string |
The host name. |
dest_host |
body |
string |
The host name. |
start_time |
body |
string |
The date and time when the vmove started. |
end_time |
body |
string |
The date and time when the vmove ended. |
status |
body |
string |
The vmove status. |
type |
body |
string |
The vmove type. |
message |
body |
string |
The vmove message info. |
Example Show VMove Details
{
"vmove": {
"created_at": "2023-01-28T14:55:27.000000",
"updated_at": null,
"deleted_at": null,
"deleted": false,
"id": 1,
"notification_uuid": "a0e70d3a-b3a2-4616-b65d-a7c03a2c85fc",
"instance_uuid": "1c2f1795-ce78-4d4c-afd0-ce141fdb3952",
"instance_name": "vm1",
"source_host": "host1",
"dest_host": "host2",
"start_time": "2023-01-28T14:55:27.000000",
"end_time": "2023-01-28T14:55:31.000000",
"status": "succeeded",
"type": "evacuation",
"message": null
}
}