[placement] Fix GET PUT /allocations nits

In the review of I49f5680c15413bce27f2abba68b699f3ea95dcdc, a few
non-blocking nits were identified. This change addresses some of
those nits, fixing some typos, clarifying method names and what
microversion is in use at particular times.

Change-Id: Iff15340502ce43eba3b98db26aa0652b1da24504
This commit is contained in:
Chris Dent 2017-11-28 12:25:13 +00:00
parent 8caf4f5148
commit 453fd67da1
5 changed files with 7 additions and 6 deletions

View File

@ -91,7 +91,7 @@ ALLOCATION_SCHEMA_V1_12 = {
"allocations": {
"type": "object",
"minProperties": 1,
# resource provider id
# resource provider uuid
"patternProperties": {
"^[0-9a-fA-F-]{36}$": {
"type": "object",

View File

@ -89,8 +89,9 @@ def _transform_allocation_requests_list(alloc_reqs):
"""Turn supplied list of AllocationRequest objects into a list of dicts of
resources involved in the allocation request. The returned results is
intended to be able to be used as the body of a PUT
/allocations/{consumer_uuid} HTTP request, so therefore we return a list of
JSON objects that looks like the following:
/allocations/{consumer_uuid} HTTP request, prior to microversion 1.12,
so therefore we return a list of JSON objects that looks like the
following:
[
{

View File

@ -51,7 +51,8 @@ VERSIONS = [
'1.11', # Adds 'allocations' link to the GET /resource_providers response
'1.12', # Add project_id and user_id to GET /allocations/{consumer_uuid}
# and PUT to /allocations/{consumer_uuid} in the same dict form
# as GET
# as GET. The 'allocation_requests' format in GET
# /allocation_candidates is updated to be the same as well.
'1.13', # Adds POST /allocations to set allocations for multiple consumers
]

View File

@ -151,7 +151,6 @@ allocations_dict: &allocations_dict
type: object
in: body
required: true
min_version: 1.12
description: >
A dictionary of resource allocations keyed by resource provider uuid.
allocations_dict_empty:

View File

@ -8,4 +8,4 @@ features:
and `project_id` in the request body, these fields are added to the
`GET` response. In addition, the response body for
``GET /allocation_candidates`` is updated so the allocations in the
``alocation_requests`` object work with the new `PUT` format.
``allocation_requests`` object work with the new `PUT` format.