808323e0c5
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
20 lines
494 B
JSON
20 lines
494 B
JSON
{
|
|
"allocations": {
|
|
"92637880-2d79-43c6-afab-d860886c6391": {
|
|
"generation": 2,
|
|
"resources": {
|
|
"DISK_GB": 5
|
|
}
|
|
},
|
|
"ba8e1ef8-7fa3-41a4-9bb4-d7cb2019899b": {
|
|
"generation": 8,
|
|
"resources": {
|
|
"MEMORY_MB": 512,
|
|
"VCPU": 2
|
|
}
|
|
}
|
|
},
|
|
"project_id": "7e67cbf7-7c38-4a32-b85b-0739c690991a",
|
|
"user_id": "067f691e-725a-451a-83e2-5c3d13e1dffc"
|
|
}
|