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

NerdGraph tutorial: Partner and reseller subscriptions

重要

The Provisioning API is only available for Partner accounts on our original pricing plan.

The Provisioning NerdGraph API allows you, as a New Relic partner to create subscriptions for your accounts containing a more extensive range of New Relic products than the Partner API.

The Provisioning API and Partnership API are compatible when it comes to the products supported by both (APM, Mobile, Insights, Browser, Synthetics, and Infrastructure). If you use the Provisioning API to create a subscription for any of the newer products, you will no longer be able to update the account using the Partnership API V2.

The Provisioning API is a GraphQL mutation field named organizationProvisioningUpdatePartnerSubscription. To learn more about how to use this mutation, see Introduction to NerdGraph.

Get started: endpoint and API key

The provisioning API uses your user key.

The endpoint for the Provisioning API is:

https://api.newrelic.com/graphql

To get started, run the following command:

curl -v -d'{"query": "mutation { organizationProvisioningUpdatePartnerSubscription(accountId: PARTNER_ACCOUNT_ID, affectedAccountId: ACCOUNT_ID, 
products: [{id: 9200, name: \"Traces\", unitsOfMeasure: [{unit: SPANS_IN_MILLIONS, quantity: 40}]}]) {enqueued errors {message path } } }"}' -H'Content-type: application/json' -H'Api-key: PERSONAL_API_KEY' https://api.newrelic.com/graphql

Product subscriptions for an account

The Provisioning API does not allow you to upgrade or downgrade individual product subscriptions for an account. Instead, the API requires you to replace (add) the configuration for all product subscriptions for the account.

ヒント

If any product configurations are not included, the Provisioning API automatically provisions the account with a free product (when available).

Mapping for products (productId)

With each account creation call, you must supply at least one New Relic product type. The mutation query only accepts the numeric productId for the type.

GraphQL types

The Provisioning API uses the following GraphQL types:

Examples

Here are examples of an API call to create a subscription and the JSON response.

Variations from the Partnership API

These are some key differences between the Provisioning API and the Partner API that frequent Partner API users should know:

Feature

Description

API keys

The Provisioning API uses a Personal API key.

The Partner API uses the Partnership API key.

productId and product_id

The product id’s used for the Provisioning API are different than the ones documented for the Partner API.

Curl request format

To make a curl request to the Provisioning API, the format will be different than the Partner API:

  1. The url endpoint is different
  2. The required api key is your personal API key
  3. Provisioning API responds only to HTTP POST requests

Serverless INGESTED_EVENTS units are in millions

sending unitsOfMeasure: [{unit: INGESTED_EVENTS, quantity: 3000 } ] will be interpreted by the Provisioning API as 3,000 million events.

Insights and Mobile require 2 units of measure

Insights requires DATA_RETENTION_IN_DAYS and EVENTS_IN_MILLIONS Mobile requires APPS and USERS.

Logs data retention unit of measure is determined by productID

This is specified in the product name:

  • Logs Annual Commit - 8 Days | product ID: 9110
  • Logs Annual Commit - 15 Days | product ID: 9111
  • Logs Annual Commit - 30 Days | product ID: 9112
  • Logs Monthly Commit - 8 Days | product ID: 9100
  • Logs Monthly Commit - 15 Days | product ID: 9101
  • Logs Monthly Commit - 30 Days | product ID: 9102

その他のヘルプ

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

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