Atom feed of this document
 
 
 

 3.11.1. Pagination Elements and Attributes

For any collection in a result, there is a totalEntries attribute representing the total number of entries there are for this item type. If the number of items requested in the GET call is less then the total number of items for this type, then there will be pagination links previous and/or next, specifying how to get to the previous and/or next set of records.

[Note]Note

The previous and/or next link elements are displayed only if there are items available in the corresponding link. See the following examples for details.

 

Example 3.37. List Domains Request with limit: XML

GET https://dns.api.rackspacecloud.com/v1.0/1234/domains?limit=3
Accept: application/xml
X-Auth-Token: ea85e6ac-baff-4a6c-bf43-848020ea3812
Content-Type: application/xml
Content-Length: 0

 

Example 3.38. List Domains Request with limit: JSON

GET https://dns.api.rackspacecloud.com/v1.0/1234/domains?limit=3
Accept: application/json
X-Auth-Token: ea85e6ac-baff-4a6c-bf43-848020ea3812
Content-Type: application/json
Content-Length: 0

 

Example 3.39. List Domains Response with totalEntries: XML

Status: 200 OK
Date: Thu, 28 Jul 2011 21:54:21 GMT
X-API-VERSION: 1.0.17
Content-Type: application/xml
Content-Length: 934

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<domains totalEntries="114" xmlns:ns2="http://www.w3.org/2005/Atom" xmlns="http://docs.rackspacecloud.com/dns/api/v1.0" xmlns:ns3="http://docs.rackspacecloud.com/dns/api/management/v1.0">
    <domain id="2725257" accountId="1234" name="sub1.example.com" emailAddress="sample@rackspace.com" updated="2011-06-23T03:09:34Z" created="2011-06-23T03:09:33Z" comment="1st sample subdomain"/>
    <domain id="2725258" accountId="1234" name="sub2.example.com" emailAddress="sample@rackspace.com" updated="2011-06-23T03:52:55Z" created="2011-06-23T03:52:55Z" comment="1st sample subdomain"/>
    <domain id="2725260" accountId="1234" name="north.example.com" emailAddress="sample@rackspace.com" updated="2011-06-23T03:53:10Z" created="2011-06-23T03:53:09Z"/>
    <ns2:link href="https://dns.api.rackspacecloud.com/v1.0/1234/domains?limit=3&amp;offset=3" rel="next"></ns2:link>
</domains>

 

Example 3.40. List Domains Response with totalEntries: JSON

Status: 200 OK
Date: Thu, 28 Jul 2011 21:54:21 GMT
X-API-VERSION: 1.0.17
Content-Type: application/json
Content-Length: 945

{
  "links" : [ {
    "href" : "https://dns.api.rackspacecloud.com/v1.0/1234/domains?limit=3&offset=3",
    "rel" : "next",
    "content" : ""
  } ],
  "totalEntries" : 114,
  "domains" : [ {
    "accountId" : 1234,
    "updated" : "2011-06-23T03:09:34.000+0000",
    "emailAddress" : "sample@rackspace.com",
    "created" : "2011-06-23T03:09:33.000+0000",
    "name" : "sub1.example.com",
    "id" : 2725257,
    "comment" : "1st sample subdomain"
  }, {
    "accountId" : 1234,
    "updated" : "2011-06-23T03:52:55.000+0000",
    "emailAddress" : "sample@rackspace.com",
    "created" : "2011-06-23T03:52:55.000+0000",
    "name" : "sub2.example.com",
    "id" : 2725258,
    "comment" : "1st sample subdomain"
  }, {
    "accountId" : 1234,
    "updated" : "2011-06-23T03:53:10.000+0000",
    "emailAddress" : "sample@rackspace.com",
    "created" : "2011-06-23T03:53:09.000+0000",
    "name" : "north.example.com",
    "id" : 2725260
  } ]
}

In the previous two response examples, note that totalEntries=112 and that a link has been provided to retrieve the next 3 results (limit=3) in the link element identified by the attribute rel="next" (XML) or "rel":"next" (JSON).

The following example shows links to both previous and next results in the responses, since the request specified to start with the fourth item in the collection (offset=3):

 

Example 3.41. List Domains Request with limit and offset: XML

GET https://dns.api.rackspacecloud.com/v1.0/1234/domains?limit=3&offset=3
Accept: application/xml
X-Auth-Token: ea85e6ac-baff-4a6c-bf43-848020ea3812
Content-Type: application/xml
Content-Length: 0

 

Example 3.42. List Domains Request with limit and offset: JSON

GET https://dns.api.rackspacecloud.com/v1.0/1234/domains?limit=3&offset=3
Accept: application/json
X-Auth-Token: ea85e6ac-baff-4a6c-bf43-848020ea3812
Content-Type: application/json
Content-Length: 0

 

Example 3.43. List Domains Response with Links to previous and next Results: XML

Status: 200 OK
Date: Thu, 28 Jul 2011 21:54:21 GMT
X-API-VERSION: 1.0.17
Content-Type: application/xml
Content-Length: 1056

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<domains totalEntries="114" xmlns:ns2="http://www.w3.org/2005/Atom" xmlns="http://docs.rackspacecloud.com/dns/api/v1.0" xmlns:ns3="http://docs.rackspacecloud.com/dns/api/management/v1.0">
    <domain id="2725257" accountId="1234" name="sub1.example.com" emailAddress="sample@rackspace.com" updated="2011-06-23T03:09:34Z" created="2011-06-23T03:09:33Z" comment="1st sample subdomain"/>
    <domain id="2725258" accountId="1234" name="sub2.example.com" emailAddress="sample@rackspace.com" updated="2011-06-23T03:52:55Z" created="2011-06-23T03:52:55Z" comment="1st sample subdomain"/>
    <domain id="2725260" accountId="1234" name="north.example.com" emailAddress="sample@rackspace.com" updated="2011-06-23T03:53:10Z" created="2011-06-23T03:53:09Z"/>
    <ns2:link href="https://dns.api.rackspacecloud.com/v1.0/1234/domains?limit=3&amp;offset=0" rel="previous"></ns2:link>
    <ns2:link href="https://dns.api.rackspacecloud.com/v1.0/1234/domains?limit=3&amp;offset=6" rel="next"></ns2:link>
</domains>

 

Example 3.44. List Domains Response with Links to previous and next Results: JSON

Status: 200 OK
Date: Thu, 28 Jul 2011 21:54:21 GMT
X-API-VERSION: 1.0.17
Content-Type: application/json
Content-Length: 1081

{
  "links" : [ {
    "href" : "https://dns.api.rackspacecloud.com/v1.0/1234/domains?limit=3&offset=0",
    "rel" : "previous",
    "content" : ""
  }, {
    "href" : "https://dns.api.rackspacecloud.com/v1.0/1234/domains?limit=3&offset=6",
    "rel" : "next",
    "content" : ""
  } ],
  "totalEntries" : 114,
  "domains" : [ {
    "accountId" : 1234,
    "updated" : "2011-06-23T03:09:34.000+0000",
    "emailAddress" : "sample@rackspace.com",
    "created" : "2011-06-23T03:09:33.000+0000",
    "name" : "sub1.example.com",
    "id" : 2725257,
    "comment" : "1st sample subdomain"
  }, {
    "accountId" : 1234,
    "updated" : "2011-06-23T03:52:55.000+0000",
    "emailAddress" : "sample@rackspace.com",
    "created" : "2011-06-23T03:52:55.000+0000",
    "name" : "sub2.example.com",
    "id" : 2725258,
    "comment" : "1st sample subdomain"
  }, {
    "accountId" : 1234,
    "updated" : "2011-06-23T03:53:10.000+0000",
    "emailAddress" : "sample@rackspace.com",
    "created" : "2011-06-23T03:53:09.000+0000",
    "name" : "north.example.com",
    "id" : 2725260
  } ]
}

In the previous two response examples, note that totalEntries=112 and two links have been provided to:

  • Retrieve the next 3 results (limit=3) via the link element identified by the attribute rel="next" (XML) or "rel":"next" (JSON)

  • Retrieve the previous 3 results via the link element identified by the attribute rel="previous" (XML) or "rel":"previous" (JSON)



loading table of contents...