Pagination in Storage/Central

Registered by Kiall Mac Innes

This blueprint has been superseded. See the newer blueprint "API Version 2" for updated plans.

The storage and central API should accept "page" and "per_page" values.

Additionally, we need to amend the listing methods to return some additional metadata like "total_items" etc

Mock a central method for finding domains:

    def find_domains(self, context, criterion=None, page=None, per_page=None):

        # ....
        domains = [{
            'id': '12345',
            'name': 'example.com.',
        }, {
            'id': '54321',
            'name': 'example.org.',
        }]

        metadata = {
            'total_items': 50,
            'has_next': True
        }

        return domains, metadata

Mock usage:

    domains, metadata = central_api.find_domains(context, page=1, per_page=30)

Blueprint information

Status:
Complete
Approver:
None
Priority:
Undefined
Drafter:
None
Direction:
Needs approval
Assignee:
None
Definition:
Superseded
Series goal:
None
Implementation:
Unknown
Milestone target:
None
Completed by
Kiall Mac Innes

Related branches

Sprints

Whiteboard

Gerrit topic: https://review.openstack.org/#q,topic:bp/pagination,n,z

Addressed by: https://review.openstack.org/40445
    WIP - Add Pagination support to storage+central

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.