4.6. 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.

Source: https://docs.openstack.org/api-ref/placement/?expanded=update-resource-provider-traits-detail#update-resource-provider-traits

4.6.1. Request

Name In Type Description
uuid path string The uuid of a resource provider.
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.

4.6.1.1. 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

4.6.2. Response

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.

4.6.2.1. Status codes

4.6.2.1.1. Success

Code Reason
200 - OK Request was successful.

4.6.2.1.2. 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.

4.6.2.2. 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
}