All other API resources (ie. traits, resource_provider_traits and
resource_provider_inventories) we need to report on for minimum
guaranteed bandwidth have update methods that can be called in one go,
either because they have update-or-create or update-overrides-all
semantics. Here we add the 'ensure_resource_provider' method so
resource providers also have a similarly simple way of being kept in
sync. We also add 'update_resource_provider' as a pre-requisite. On
the side we also fix a little, silent unit test type error.
Change-Id: Ib615ceeb323970d179ffb3dee14e52cb40e73ae7
Partial-Bug: #1578989
See-Also: https://review.openstack.org/502306 (nova spec)
See-Also: https://review.openstack.org/508149 (neutron spec)
Add placement calls that are necessary to report the necessary resource
providers, traits, resource classes and inventories for bandwidth
allocation in placement.
Related-Bug: #1578989
Change-Id: Ie3a14e5461d2d14ee77e1bd101943b7c28cf86f1
Based on the placement api-ref fix the already implemented placement API
calls in the placement client of neutron-lib.
Fixed/changed parts:
- Add version header to create_resource_provider
- Change create_inventory to update_resource_provider_inventories, as
the http request is a PUT not a POST, and add exception to handle the
case when the rp is not found.
- Change update_inventory to update_resource_provider_inventory, to make
the method name in sync with placement API ref.
- Fix the failing unit tests, and cover the negative case for
update_resource_provider_inventories.
Change-Id: I336c57e734f91795038c5ba9074970d1f5522da2
Related-Bug: #1578989
Added list_resource_providers function, which allows to retrieve
a list of Resource Providers filtering by UUID or parent UUID.
Added get_resource_provider function, which allows to retrieve an
specific Resource Provider by its UUID.
This feature depends on Nova Nested Resource Providers.
Depends-On: I4db74e4dc682bc03df6ec94cd1c3a5f5dc927a7bi
Change-Id: I6eb42b9a53c8001c5f14d4d1c9a98e060148ae21
Partial-Bug: #1578989
Co-Authored-By: Slawek Kaplonski <slawek@kaplonski.pl>
The placement client is going to be used by other services aside from
segments; e.g. QoS plugin. It makes sense to move this file to a common
place, like neutron-lib.
Closes-Bug: #1723452
Partial-Bug: #1578989
Change-Id: I2f7d204828a620152ec9e005e057fc7fd77f9126