[occi-wg] Pagination
Ralf Nyren
ralf at nyren.net
Tue Oct 2 14:54:21 EDT 2012
Hi,
Pagination [1] is currently not defined in the HTTP Rendering. The hope is
to remedy this in a future version combined with the work to separate the
OCCI Rendering concept into "transport protocol" and "data format".
Since pagination is a protocol feature rather than a data format issue it
was concluded during today's confcall that future pagination support in
OCCI should only affect the transport protocol (if possible). I.e. a data
format, such as JSON, should not contain any pagination information.
How to implement this over HTTP then? And we do not want any custom HTTP
headers...
Proposal
-------------
A client must (if desired) request pagination by use of _query_parameters_
in the HTTP URL.
To solve the issue where a server need to enforce pagination when not
requested by the client Florian made an interesting proposal.
Let us say an OCCI system has 1000000 Compute instances. An OCCI client
asking for the full collection (no pagination in the request) must be
forced to use pagination because the server cannot send back all instances
of the collection.
The server would then return HTTP status code 301 (redirect) with a URL
containing the proper pagination parameters the server would have wished
the client had used in the first place.
Example
------------
< GET /compute/ HTTP/1.0
> HTTP/1.0 301 Moved Permanently
> Location:
> /compute/?id=urn:uuid:f3ec2e3a-0cc1-11e2-91ed-abf19593d6e2&start=0&end=100
< GET
/compute/?id=urn:uuid:f3ec2e3a-0cc1-11e2-91ed-abf19593d6e2&start=0&end=100
> HTTP/1.0 200
...
By looking at the query parameters the client would see what pagination
the server has enforced.
regards, Ralf
[1] http://en.wikipedia.org/wiki/Pagination
More information about the occi-wg
mailing list