pool-detail/[pool-machine-name] provides region machine names instead of nested objects
The UI has a screen to display all sequential regions within a pool, but currently the API returns a slug string for each region, meaning that the UI must perform requests in a loop to get the detail for each region:
GET /pool-detail/poolbot/
HTTP 200 OK
Allow: GET, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept
{
"sequentialregion_set": [
"region1"
],
"created_date": "2018-01-25T18:00:24.767256Z",
"modified_date": "2018-01-25T18:00:24.767337Z",
"readable_name": "mypool",
"machine_name": "poolbot",
"active": true,
"request_threshold": 50000
}
To get the sequential region detail for "region1", a subsequent request is required. This is more of a nice to have enhancement, and not an issue until we need to display a large number of regions for a given pool in one screen. Also, every time the "allocate" is submitted, each region detail needs to be fetched again to get their (potentially) new value.
Having the regions as nested objects would remove some minor overhead from the UI, e.g.:
GET /pool-detail/poolbot/
HTTP 200 OK
Allow: GET, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept
{
"sequentialregion_set": [
{
"pool": "poolbot",
"created_date": "2018-01-29T23:01:34.586281Z",
"modified_date": "2018-01-30T16:58:52.202780Z",
"readable_name": "region1",
"machine_name": "region1",
"active": true,
"order": 1,
"start": 1,
"end": 10000,
"state": 501
}
],
"created_date": "2018-01-25T18:00:24.767256Z",
"modified_date": "2018-01-25T18:00:24.767337Z",
"readable_name": "mypool",
"machine_name": "poolbot",
"active": true,
"request_threshold": 50000
}