← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1708204] Re: placement allocation representation asymetric on PUT and GET

 

Reviewed:  https://review.openstack.org/510626
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=808323e0c53ae5459c5ca453b744f7a4e2d3a445
Submitter: Zuul
Branch:    master

commit 808323e0c53ae5459c5ca453b744f7a4e2d3a445
Author: Chris Dent <cdent@xxxxxxxxxxxxx>
Date:   Mon Oct 16 21:27:40 2017 +0100

    [placement] Symmetric GET and PUT /allocations/{consumer_uuid}
    
    In a new microversion, 1.12, include project_id and user_id in the
    output of GET /allocations/{consumer_uuid} and add JSON schema
    to enable PUT to /allocations/{consumer_uuid} using the same dict-based
    format for request body that is used in the GET response. In later
    commits a similar format will be used in POST /allocations. This
    symmetry is general good form and also will make client code a little
    easier.
    
    Since GET /allocation_candiates includes objects which are capable
    of being PUT to /allocations/{consumer_uuid}, its response body has
    been updated as well, to change the 'allocation_requests' object
    to use the dict-based format.
    
    Internally to handlers/allocation.py the same method (_set_allocations)
    is used for every microversion. Any previous data structure is
    transformed into the dict-ish form. This means that pre-existing tests
    (like allocation-bad-class.yaml) continue to exercise the problems it
    was made for, but needs to be pinned to an older microversion, rather than
    being latest.
    
    Info about these changes is added to placement-api-ref,
    rest_api_version_history and a reno.
    
    Change-Id: I49f5680c15413bce27f2abba68b699f3ea95dcdc
    Implements: bp symmetric-allocations
    Closes-Bug: #1708204


** Changed in: nova
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1708204

Title:
  placement allocation representation asymetric on PUT and GET

Status in OpenStack Compute (nova):
  Fix Released

Bug description:
  GET /allocations/{consumer_uuid} is a dict keyed by resource provider
  uuid.

  PUT /allocations/{consumer_uuid} is an array of anonymous json objects
  with 'resource_provider' and 'resources' objects

  This asymmetry is undesirable and confusing. It's probably the result
  of failing to update one side when changing the other, earlier in the
  development of placement.

  Changing it is likely a bit of a bear, would require a microversion of
  course, but might be worth considering to make things more clear for
  the future.

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1708204/+subscriptions


References