You can manage your alerts policies using our GraphQL NerdGraph API. Here are some queries and mutations you can develop in our NerdGraph API explorer.
ヒント
See the NerdGraph introduction for help getting started with NerdGraph API explorer.
List and filter policies
The policiesSearch
query allows you to paginate through all of your policies per account. It also allows some filtering functionality on the account policies.
Create a policy
In order to create a policy, supply a name and an incidentPreference
.
The incident preference will configure how incidents get created for each condition created in the policy. For more information, refer to the documentation about choosing your incident preference.
mutation {
alertsPolicyCreate(accountId: YOUR_ACCOUNT_ID, policy: {
name: "Your Policy Name"
incidentPreference: PER_CONDITION
}) {
id
name
incidentPreference
}
}
Update a policy
When you update a policy, note that you don't need to supply all of the attributes on the policy. For example, you only need to supply the name if you only intend to update the name:
mutation {
alertsPolicyUpdate(accountId: YOUR_ACCOUNT_ID, id: YOUR_POLICY_ID, policy: {
name: "Updated Policy Name"
}) {
id
name
incidentPreference
}
}
Delete a policy
You can delete policies via the NerdGraph API. Note that only the id may be requested back from a deleted resource:
mutation {
alertsPolicyDelete(accountId: YOUR_ACCOUNT_ID, id: YOUR_POLICY_ID) {
id
}
}
その他のヘルプ
さらに支援が必要な場合は、これらのサポートと学習リソースを確認してください:
- Explorers Hubでは、コミュニティからのサポートを受けたり、ディスカッションに参加したりすることができます。
- 当社サイトで答えを見つけて、サポートポータルの使用方法を確認してください。
- Linux、Windows、およびmacOS向けトラブルシューティングツールであるNew Relic Diagnosticsを実行してください。
- New Relicのデータセキュリティとライセンスドキュメント をご確認ください。