• /
  • ログイン
  • 無料アカウント

Pagination for API output

The New Relic REST API (v2) paginates some responses, for performance reasons. This is because returning the entire data set might be feasible for some queries but prohibitive for others that return a very large amount of data.

Requirements and limitations

  • Metric data return:
    • Pagination is no longer available for metrics output for some customers (deprecation beginning December 2020).
    • Returns up to 3000 results per cell. For large outputs, we recommend narrowing the query using application ID or another attribute.
  • The sort order for returned data is indeterminate. Do not assume or rely on a particular order.

The data returned per page depends on what data is requested. The number of pages depends on the number of JSON objects necessary to complete the list.

重要

Before listing metric names, see Metric name listing guidelines.

Request a specific page

To specify a page, add the page= parameter to the query. Here's an example:

curl -X GET 'https://api.newrelic.com/v2/alerts_incidents.json?page=3' \
     -H 'Api-Key:$API_KEY' -i

In the REST API Explorer, you can quickly change the page being viewed.

The API call returns the Link header if the data is paginated. This indicates the number of pages and the page being viewed. This line also appears at the top of the Response in the REST API Explorer.

重要

The Link header will only appear if the output data is paginated.

ヒント

The rel="last" reference will not be shown when making calls to the Violations endpoint (https://api.newrelic.com/v2/alerts_violations.json). To determine the final page when making calls to this endpoint, look for the absence of a rel="next" reference.

To obtain this line using some implementations of curl, you may need to include the -v option.

curl -v -X GET 'https://api.newrelic.com/v2/applications/$APP_ID/...'

New Relic uses the RFC 5988 standard format for links.

その他のヘルプ

さらに支援が必要な場合は、これらのサポートと学習リソースを確認してください:

問題を作成するこのページを編集する
Copyright © 2020 New Relic Inc.