Updating resource provider traits
PUT /resource_providers/{uuid}/traits
Associate traits with a resource provider with the specified ID.
All the associated traits will be replaced by the traits specified in the request body. For this reason, make sure to pass all of resource provider’s standard traits (refer to Listing resource provider traits) and only add or remove the custom traits you need.
In addition, you must pass resource provider’s current resource_provider_generation value in the request.
Request
Parameters
| Name | In | Type | Description |
|---|---|---|---|
traits
|
body | array | A list of traits. |
resource_provider_generation
|
body | integer | A consistent view marker that assists with the management of concurrent resource provider updates. |
uuid
|
path | string | The UUID of a resource provider. |
Example
curl -ks -X PUT -H 'Content-Type: application/json' -H 'OpenStack-API-Version: placement 1.32' -H 'X-Auth-Token: gAAAAA<...>' -d '
{
"traits": [
"COMPUTE_DEVICE_TAGGING",
"COMPUTE_TRUSTED_CERTS",
"COMPUTE_VOLUME_EXTEND",
"COMPUTE_NET_ATTACH_INTERFACE_WITH_TAG",
"COMPUTE_NET_ATTACH_INTERFACE",
"COMPUTE_VOLUME_ATTACH_WITH_TAG",
"COMPUTE_VOLUME_MULTI_ATTACH",
"CUSTOM_HCI_E3A45A6A4B614263893D72015BFB1A5F"
],
"resource_provider_generation": 546
}' https://<node_IP_addr>:8780/resource_providers/34233b75-4022-4539-9e3f-305e9f9f1f18/traits
Response
Parameters
| Name | In | Type | Description |
|---|---|---|---|
traits
|
body | array | A list of traits. |
resource_provider_generation
|
body | integer | A consistent view marker that assists with the management of concurrent resource provider updates. |
Status codes
Success
| Code | Reason |
|---|---|
200 - OK
|
Request was successful. |
Error
| Code | Reason |
|---|---|
400 - Bad Request
|
Some content in the request was invalid. |
404 - Not Found
|
The requested resource could not be found. |
409 - Conflict
|
This operation conflicted with another operation on this resource. |
Example
{
"traits": [
"COMPUTE_DEVICE_TAGGING",
"COMPUTE_TRUSTED_CERTS",
"COMPUTE_VOLUME_EXTEND",
"COMPUTE_NET_ATTACH_INTERFACE_WITH_TAG",
"COMPUTE_NET_ATTACH_INTERFACE",
"COMPUTE_VOLUME_ATTACH_WITH_TAG",
"COMPUTE_VOLUME_MULTI_ATTACH",
"CUSTOM_HCI_E3A45A6A4B614263893D72015BFB1A5F"
],
"resource_provider_generation": 547
}