Partager via


Paging in Service Management Automation Web Service

For performance reasons, the Service Management Automation web service limits the number of entries that are returned by a single request. If you want to retrieve a number of members of a particular collection that exceeds the maximum number for that collection, then you must retrieve multiple pages using multiple requests. For most kinds of objects this limit is 50, but it can be changed through the configuration of the Service Management Automation application in Internet Information Services.

Specifying Records to Retrieve

In order to retrieve a particular set of entries from a particular query, you can use the following query options in your request.

Query Option Description

$skip

The number of records to skip

$top

The number of records to return (maximum of 50)

$inlinecount

Specifies whether the request response includes a count of the total number of entries. A value of allpages will include the total count.

For example, the following request will return the first 50 jobs from a server called server1.contoso.com:

http://server1.contoso.com:9090/00000000-0000-0000-0000-000000000000/Jobs

The following request will return records 101-150 (the third page of 50) and include the total number of records in the request response.

http://server1.contoso.com:9090/00000000-0000-0000-0000-000000000000/Jobs?$skip=100&$top=50&$inlinecount=allpages

The count appears in the request response in the following format:

<m:count>153</m:count>

In this example, 153 records are available, and four different requests would be required to retrieve all records.

Changing the Number of Entries Returned

The number of entries returned from the Service Management Automation web service in a single request can be changed using the following procedure.

To change the number of entries returned in a single request

  1. On the computer running the Service Management Automation web service, select Start, then Administrative Tools, and then Internet Information Services (IIS) Manager.

  2. Expand the computer, then Sites.

  3. Select SMA.

  4. In the /SMA Home pane, double-click Application Settings.

  5. Double-click the type of collection that you want to change.

  6. In the Value field, type the number of entries to return and click OK.

See Also

Concepts

OData Queries Using the Service Management Automation Web Service
Service Management Automation Web Service Fundamentals