Skip to content

Commit

Permalink
updates including links to new data retention with nerdgraph section.
Browse files Browse the repository at this point in the history
  • Loading branch information
mmfred committed Aug 25, 2021
1 parent c6aacbd commit 928d4fe
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 151 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -326,155 +326,7 @@ Requirements to use this feature:
</Collapser>
</CollapserGroup>

## Manage flexible retention via API [#api-examples]

You can control data retention with either NerdGraph (our GraphQL API) or in [the UI](/docs/telemetry-data-platform/manage-data/manage-data-retention).

The following API examples show how to alter data retention via the [NerdGraph GraphiQL explorer](https://api.newrelic.com/graphiql).

Your retention changes take effect within 24 hours after updating.

<CollapserGroup>
<Collapser
id="api-list-namespaces"
title="List customizable retention event namespaces"
>
To list the customizable retention event names spaces for your account, go to [api.newrelic.com/graphiql](https://api.newrelic.com/graphiql) and run the following:

```
query {
actor {
account(id: <var>YOUR_ACCOUNT_ID</var>) {
dataManagement {
customizableRetention {
eventNamespaces {
namespace
}
}
}
}
}
}
```
</Collapser>

<Collapser
id="api-list-rules"
title="List active rules on an account"
>
To list active rules on an account, go to [api.newrelic.com/graphiql](https://api.newrelic.com/graphiql) and run the following:

```
query {
actor {
account(id: <var>YOUR_ACCOUNT_ID</var>) {
dataManagement {
eventRetentionRules {
id
deletedAt
deletedById
createdAt
createdById
retentionInDays
namespace
}
}
}
}
}
```
</Collapser>

<Collapser
id="api-show-active-rule"
title="Show active rule on an account/namespace pair"
>
To show the active rule on a specific account/namespace pair, go to [api.newrelic.com/graphiql](https://api.newrelic.com/graphiql) and run the following:

```
query {
actor {
account(id: <var>YOUR_ACCOUNT_ID</var>) {
dataManagement {
eventRetentionRule(namespace: "APM") {
id
deletedById
deletedAt
createdById
createdAt
retentionInDays
namespace
}
}
}
}
}
```
</Collapser>

<Collapser
id="api-create-new-rule"
title="Create a new rule"
>
To create a new rule, go to [api.newrelic.com/graphiql](https://api.newrelic.com/graphiql) and run the following:

```
mutation {
dataManagementCreateEventRetentionRule(accountId: <var>YOUR_ACCOUNT_ID</var>, namespace: "APM", retentionInDays: 8) {
id
deletedById
deletedAt
createdById
createdAt
retentionInDays
namespace
}
}
```
</Collapser>

<Collapser
id="api-delete-rule"
title="Delete an existing rule"
>
If you delete a rule applied to a child account, that child account will adopt the current retention value of its parent account for the given namespace. If you delete a rule applied to a parent account, the default retention value will re-apply for the given namespace. To delete an existing rule, go to [api.newrelic.com/graphiql](https://api.newrelic.com/graphiql) and run the following:

```
mutation {
dataManagementDeleteEventRetentionRule(accountId: <var>YOUR_ACCOUNT_ID</var>, namespace: "APM") {
id
deletedById
deletedAt
createdById
createdAt
retentionInDays
namespace
}
}
```
</Collapser>

<Collapser
id="api-delete-rule"
title="Copy existing child account rules to others"
>
You can specify a child account to be the template or source account, and have other destination child accounts adopt the same namespace retention values of the source child account. Note: all child accounts must be within the same parent account. To copy an existing set of retentions, go to [api.newrelic.com/graphiql](https://api.newrelic.com/graphiql) and run the following:

```
mutation {
dataManagementCopyRetentions(
sourceAccountId: <var>SOURCE_ACCOUNT_ID</var>,
destinationAccountIds: [<var>DESTINATION_ACCOUNT_ID_1</var>, <var>DESTINATION_ACCOUNT_ID_2</var>, <var>DESTINATION_ACCOUNT_ID_3</var>])
{
success
failure
}
}
```

Success and failure will return lists of destination account ids which were successful (or failed) in copying rules from the source account.
</Collapser>
</CollapserGroup>
For information on managing retention settings with APIs, see the [Manage data retention documentation](/docs/telemetry-data-platform/manage-data/manage-data-retention/#api-examples).

## For more help [#more_help]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,13 @@ Data partitions</td>
[Manage data partitions](/docs/apis/nerdgraph/examples/nerdgraph-data-partition-rules-tutorial/)</td>
</tr>

<tr>
<td>
Date retention</td>

<td>
[Manage data retention](/docs/telemetry-data-platform/manage-data/manage-data-retention/#api-examples)

</tbody>
</table>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -386,9 +386,9 @@ Once [telemetry data](/docs/using-new-relic/data/understand-data/new-relic-data-

## Manage retention via API [#api-examples]

You can control data retention with NerdGraph (our GraphQL API) as well as the UI.
You can change your retention settings with [NerdGraph](/docs/apis/nerdgraph/get-started/introduction-new-relic-nerdgraph/) as well as the UI.

The following API examples show how to alter data retention via the . For each of the following retention changes, copy the code in the [NerdGraph GraphiQL explorer](https://api.newrelic.com/graphiql), provide any necessary information and run.
The following examples show how to change a variety of retention settings with the API. Provide any necessary information, and run the code in the [NerdGraph GraphiQL explorer](https://api.newrelic.com/graphiql).

Your retention changes take effect within 24 hours after updating.

Expand Down

0 comments on commit 928d4fe

Please sign in to comment.