openstacksdk/releasenotes/notes/add-placement-resource-provider-inventory-8714cafefae74810.yaml
Stephen Finucane 15207b2070 placement: Add support for resource provider inventories
Unlike resource classes, this one is not easy. The list operation is
particularly tricky: unlike most OpenStack APIs that returns a list of
objects, the resource provider inventory list operation returns an
object with resource class as the keys and the inventory details as the
values. Put another way, we see:

  {
    "MEMORY_MB": { ... },
    "VCPU": { ... },
    ...
  }

instead of the more typical:

  [
    {
      "resource_class": "MEMORY_MB",
      ...
    },
    {
      "resource_class": "VCPU",
      ...
    },
    ...
  ]

This need special handling code, namely a reimplementation of the 'list'
class method.

In addition, updating inventory requires providing
'resource_provider_generation'. This should match the current server
value of this field, but by setting this SDK assumes the field is
unchanged and doesn't include it in the list of "dirty" attributes. This
requires manually adding the 'resource_provider_generation' value to the
list of 'dirty' fields before the 'commit' operation.

Change-Id: I5ea5d0a477147e1a4e30b428f17b44807253deaa
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
2023-07-12 12:52:18 +01:00

5 lines
96 B
YAML

---
features:
- |
Added support for the ``ResourceProviderInventory`` Placement resource.