Adding hosts to aggregates
POST /os-aggregates/{aggregate_id}/action
Adds a host to an aggregate.
Specify the add_host
action and host name in the request body.
Source: https://docs.openstack.org/api-ref/compute/?expanded=add-host-detail#add-host
Request
Parameters
Name | In | Type | Description |
---|---|---|---|
aggregate_id
|
path | integer | The aggregate ID. |
add_host
|
body | object | The add_host object used to add host to aggregate. |
host
|
body | string | The name of the host. |
Example
curl -ks -X POST -H 'Content-Type: application/json' -H 'X-Auth-Token: gAAAAA<...>' -d ' { "add_host": { "host": "node1.vstoragedomain" } }' https://<node_IP_addr>:8774/v2.1/6ef5371261ea42008e3d1d41ba051977/os-aggregates/4/action
Response
Parameters
Name | In | Type | Description |
---|---|---|---|
aggregate
|
body | object | The host aggregate object. |
name
|
body | string | The name of the host aggregate. |
availability_zone
|
body | string | The availability zone of the host aggregate. |
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, The |
deleted_at
|
body | string |
The date and time when the resource was deleted. If the resource has
not been deleted yet, this field will be The date and time stamp format is ISO 8601: CCYY-MM-DDThh:mm:ss±hh:mm For example, The |
deleted
|
body | boolean | A boolean indicates whether this aggregate is deleted or not, if it has
not been deleted, false will appear. |
hosts
|
body | array | An array of host information. |
id
|
body | integer | The ID of the host aggregate. |
metadata
|
body | object | Metadata key and value pairs associated with the aggregate. |
updated_at
|
body | string |
The date and time when the resource was updated. If the resource has
not been updated, this field will be The date and time stamp format is ISO 8601: CCYY-MM-DDThh:mm:ss±hh:mm For example, The |
uuid
|
body | string |
The UUID of the host aggregate. New in version 2.41 |
Status 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. |
Example
{ "aggregate": { "name": "CUSTOM_HCI_0A7F6A35E650420CB30200A8359861D9", "availability_zone": null, "deleted": false, "created_at": "2020-04-19T12:56:10.191466", "updated_at": null, "hosts": [ "node1.vstoragedomain" ], "deleted_at": null, "id": 4, "metadata": {} } }