Limit functionality only partially implemented for listing hosts

Bug #1642532 reported by git-harry
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
craton
Fix Released
Medium
Unassigned

Bug Description

The ('hosts', 'GET') schema advertises support for limiting the number of returned results [1]. There are also references to this in other parts of the code and the documentation. It appears this functionality has only been partially implemented, there is no where the limit is actually used. Depending on the priority of the ability to limit the results returned this feature should either be fixed or removed to prevent confusion and properly implemented at a later date.

Example of attempted use of limit:
```
curl "http://172.17.0.02:8080/v1/hosts?region_id=1&limit=1" -H "Content-Type: application/json" -H "X-Auth-Token: demo" -H "X-Auth-User: demo" -H "X-Auth-Project: b9f10eca66ac4c279c139d01e65f96b4" -s | python -m json.tool | head -n30
[
    {
        "active": true,
        "cell_id": 1,
        "device_type": "server",
        "id": 2,
        "ip_address": "192.168.1.5",
        "name": "host0.ORD135.C0001.C-1.example1.com",
        "note": null,
        "parent_id": null,
        "region_id": 1
    },
    {
        "active": true,
        "cell_id": 1,
        "device_type": "server",
        "id": 4,
        "ip_address": "192.168.1.7",
        "name": "host0.ORD135.C0001.C-2.example2.com",
        "note": null,
        "parent_id": null,
        "region_id": 1
    },
    {
        "active": true,
        "cell_id": 2,
        "device_type": "server",
        "id": 7,
        "ip_address": "192.168.1.9",
        "name": "host0.ORD135.C0002.C-1.example1.com",
```

[1] https://github.com/openstack/craton/blob/master/craton/api/v1/schemas.py#L362

Changed in craton:
status: New → Confirmed
importance: Undecided → Medium
Jim Baker (jimbaker)
Changed in craton:
status: Confirmed → Fix Released
milestone: none → v0.1.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.