Skip to content

Commit

Permalink
style(nerdgraph): Hero review: restructuring, links, minor edits
Browse files Browse the repository at this point in the history
  • Loading branch information
urbiz-nr committed Sep 17, 2021
1 parent f1d0269 commit b7583e1
Showing 1 changed file with 37 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,37 +12,13 @@ You can use New Relic’s [NerdGraph GraphQL explorer](https://api.newrelic.com/

This document includes:

* Example partition rules queries
* How to create a data partition rule
* How to update a data partition rule
* How to delete a data partition rule
* [The data partition rule schema](#data-partition-schema)
* [An example query of data partition rules](#query-data-partition-rules)
* [How to create a data partition rule](#create-data-partition-rules)
* [How to update a data partition rule](#update-data-partition-rules)
* [How to delete a data partition rule](#delete-data-partition-rules)

## How to query data partitions rules

This NerdGraph API request example gets all of the data partition rules for a given account. In this example, only a few fields are requested.

```
{
actor {
account(id: 123456) {
logConfigurations {
dataPartitionRules {
id
targetDataPartition
description
matchingCriteria {
attributeName
matchingOperator
matchingExpression
}
}
}
}
}
}
```

## Data partition rule schema
## Data partition rule schema [#data-partition-schema]

Here's the complete list of possible data partition rule fields:

Expand Down Expand Up @@ -111,9 +87,34 @@ Here's the complete list of possible data partition rule fields:
</tbody>
</table>

## How to create data partitions rules
## Example query of data partitions rules [#query-data-partition-rules]

This NerdGraph API request example gets all of the data partition rules for a given account. In this example, only a few fields are requested.

```
{
actor {
account(id: 123456) {
logConfigurations {
dataPartitionRules {
id
targetDataPartition
description
matchingCriteria {
attributeName
matchingOperator
matchingExpression
}
}
}
}
}
}
```

## Create data partitions rules [#create-data-partition-rules]

This example creates a new data partition rule. Before creating the rule, please be sure to check this article: [Organize data with partitions](/docs/logs/log-management/ui-data/data-partitions/) and make sure the **targetDataPartition** name `startsDeleting` a data partition rule doesn't delete the already persisted data. This data will be retained for a given period of time defined by the retention policy field.
This example creates a new data partition rule. Before creating the rule, please be sure to check the article [organize data with partitions](/docs/logs/log-management/ui-data/data-partitions/) and make sure the **targetDataPartition** name `startsDeleting` a data partition rule doesn't delete the already persisted data. This data is retained for a given period of time defined by the retention policy field.

```
mutation {
Expand Down Expand Up @@ -143,9 +144,9 @@ mutation {
}
```

## How to update data partitions rules
## Update data partitions rules [#update-data-partition-rules]

This example updates the data partition rule with given id `"123"`. The fields that could be updated are `description`, `matchingCriteria` and `enabled` and all of them are optional so you just need to use the ones you want to update.
This example updates the data partition rule with the given id `"123"`. The fields that can be updated are `description`, `matchingCriteria`, and `enabled`. All of them are optional so you just need to use the ones you want to update.

```
mutation {
Expand Down Expand Up @@ -174,9 +175,9 @@ mutation {
}
```

## How to delete data partitions rules
## Delete data partitions rules [#delete-data-partition-rules]

This example deletes a data partition rule. Deleting a data partition rule doesn't delete the already persisted data. This data will be retained for a given period of time defined by the retention policy field.
This example deletes a data partition rule. Deleting a data partition rule doesn't delete the already persisted data. This data is retained for a given period of time defined by the retention policy field.

```
mutation {
Expand Down

0 comments on commit b7583e1

Please sign in to comment.