5 Commits

Author SHA1 Message Date
Bence Romsics
203f4f0696 Placement client: ensure_resource_provider
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)
2018-08-21 16:52:30 +02:00
Lajos Katona
a24bf9841d Add placement calls for bandwith resource provider
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
2018-04-19 09:51:36 +02:00
Lajos Katona
f0a9959a7f Fix placement calls in placement client
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
2018-04-18 12:59:27 +02:00
Rodolfo Alonso Hernandez
874cf4f550 Add new Resource Provider functions to placement client
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>
2018-02-26 20:18:40 +01:00
Rodolfo Alonso Hernandez
9ef0860033 Rehome placement client to neutron-lib
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
2018-01-03 10:12:08 +00:00