Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(fresh-public-dashboard) Feb release-Doc update for Public dashboard #20050

Merged
merged 1 commit into from
Feb 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "NerdGraph tutorial: List and revoke live chart URLs"
title: "NerdGraph tutorial: List and revoke public sharing chart URLs"
tags:
- APIs
- NerdGraph
Expand All @@ -10,21 +10,21 @@ freshnessValidatedDate: never

You can list and revoke publicly accessible live chart URLs using queries and mutations in [NerdGraph](/docs/apis/nerdgraph/get-started/introduction-new-relic-nerdgraph).

To do so:
To do this:

1. Go to the [GraphiQL explorer](https://api.newrelic.com/graphiql).
1. Go to [GraphiQL Explorer](https://api.newrelic.com/graphiql).
2. [List all live chart URLs](#list) created within your New Relic account.
3. [Revoke any live chart URL you want to](#revoke).

<Callout variant="tip">
See our docs [to create public live charts](/docs/query-your-data/explore-query-data/dashboards/manage-your-dashboard/#export-share).
To create publicly accessible live chart URLs, refer our [docs](/docs/query-your-data/explore-query-data/dashboards/share-charts-dashboards-externally/#chart).
</Callout>

## List all live chart URLs [#list]

Use the following query to retrieve a list of existing live chart URLs:

```graphql
```
{
actor {
dashboard {
Expand All @@ -48,14 +48,14 @@ Use the following query to retrieve a list of existing live chart URLs:

Use the following query to revoke the live chart URL you specify:

```graphql
```
mutation {
dashboardWidgetRevokeLiveUrl(uuid: "LIVE_CHART_UUID") {
dashboardWidgetRevokeLiveUrl(uuid: "<enter-the-UUID-of-the-live-chart>") {
uuid
errors {
description
type
}
}
}
```
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
---
title: "NerdGraph tutorial: Create, update, and revoke public sharing dashboard URLs"
tags:
- share dashboards externally
- share dashboards using NerdGraph
- public dashboard
- public dashboard URL
metaDescription: Use New Relic NerdGraph to create, update, and revoke live dashboard URLs
freshnessValidatedDate: never
---

With the necessary [security and access set up](/docs/query-your-data/explore-query-data/dashboards/prerequisites-to-share-dashboards-charts) you can create, manage, and revoke publicly accessible live dashboard URLs using queries and mutations in [NerdGraph](/docs/apis/nerdgraph/get-started/introduction-new-relic-nerdgraph),
You can also do it from the [New Relic UI](/docs/query-your-data/explore-query-data/dashboards/share-charts-dashboards-externally/#dashboard).

<Callout variant="caution">
Anyone with the live dashboard or chart URLs can view all the information from the dashboard. Share information carefully and in accordance with your company's internal policies and procedures.
</Callout>

For creating, updating, or revoking a publicly accessible live dashboard URL from NerdGraph, you need the GUID of the dashboard you want to share.

1. Go to <DNT>**[one.newrelic.com > Dashboards](https://one.newrelic.com//dashboards)**</DNT>.
2. Open the dashboard you want to share.
3. Navigate to <DNT>**<Icon name="fe-more-horizontal"/> > Metadata**</DNT>, and copy the entity GUID of the dasboard.

<CollapserGroup>
<Collapser id="create-dashboard-url-nerdgraph" title="Create a live dashboard URL">
1. Go to [NerdGraph API explorer](https://one.newrelic.com/nerdgraph-graphiql).
2. Construct a [graph API call](/docs/apis/nerdgraph/get-started/nerdgraph-explorer) using the following details:
* **Mutation**: `dashboardCreateLiveUrl`
* **GUID**: The entity guide of the dashboard
* **Options**(optional): The time period in seconds for the URL to be live
* **Minimum value**: 300 seconds (5 minutes)
* **Maximum value**: 631152000 seconds (20 years)
* **Default value**: 2592000 seconds (30 days)
* **Response**: `url`

```
mutation CreatePublicLink {
dashboardCreateLiveUrl(
guid: "enter the dashboard GUID"
options: { ttl: "updated duration in seconds" }
) {
url
}
}

```
The live dashboard URL appears in the response. This is a public URL, so you can share it with anyone.

```
https://share.newrelic.com/dashboard/<public_link_id>

```
The `<public_link_id>` is the ID of the shared dashboard. You can use it to update or revoke the shared dashboard URL through NerdGraph.

<Callout variant="important">
Any content update in the dashboard on New Relic platform reflects in the shared dashboard page.
</Callout>

</Collapser>

<Collapser id="update-dashboard-url-nerdgraph" title="Update a live dashboard URL">
Make sure you have the [permissions](/docs/query-your-data/explore-query-data/dashboards/prerequisites-to-share-dashboards-charts/#permissions-to-custom-role) to modify the configuration of the shared dashboard.

To update the time period for the URL to be live:
1. Go to [NerdGraph API explorer](https://one.newrelic.com/nerdgraph-graphiql).
2. Construct a [graph API call](/docs/apis/nerdgraph/get-started/nerdgraph-explorer) using the following details:
* **Mutation**: `dashboardUpdateLiveUrl`
* **ID**: The ID of the shared dashboard (Copy it from the shared dashboard URL.)
* **Options**: The updated time period in seconds
* **Minimum value**: 300 seconds (5 minutes)
* **Maximum value**: 631152000 seconds (20 years)
* **Default value**: 2592000 seconds (30 days)

```
mutation UpdatePublicLink{
dashboardUpdateLiveUrl(
id:"enter the public link ID"
options: { ttl: "updated duration in seconds" }
) {
title
url
}
}

```
The URL appears in the response as follows. Now the URL will remain live for the updated time period.

```
https://share.newrelic.com/dashboard/<public_link_id>

```

</Collapser>

<Collapser id="revoke-dashboard-url-nerdgraph" title="Revoke a live dashboard URL">
Based on the [permissions](/docs/query-your-data/explore-query-data/dashboards/prerequisites-to-share-dashboards-charts/#permissions-to-custom-role) you have, you can revoke only the URLs you have created, or all URLs created by users in the account. To revoke a shared dashboard URL:
1. Go to [NerdGraph API explorer](https://one.newrelic.com/nerdgraph-graphiql).
2. Construct a [graph API call](/docs/apis/nerdgraph/get-started/nerdgraph-explorer) using the following details:
* **Mutation**: `dashboardRevokeLiveUrl`
* **ID**: The ID of the shared dashboard (Copy it from the shared dashboard URL.)

```
mutation {
dashboardRevokeLiveUrl(id: "<public_link_id>") {
id
}
}

```
The shared dashboard URL is now revoked, and it will no longer be accessible. The response appears as follows:

```
{
"data": {
"dashboardRevokeLiveUrl": {
"id": "<public_link_id>" //the one you passed to the mutation
}
}
}

```
</Collapser>

<Collapser id="list-dashboard-url-nerdgraph" title="List all shared dashboard URLs">
Based on the [permissions](/docs/query-your-data/explore-query-data/dashboards/prerequisites-to-share-dashboards-charts/#permissions-to-custom-role) you have, you can retrieve the list of links you have created, or all links created by users in the account. To get the list of shared dashboard URLs:
1. Go to [NerdGraph API explorer](https://one.newrelic.com/nerdgraph-graphiql).
2. Construct a [graph API call](/docs/apis/nerdgraph/get-started/nerdgraph-explorer) using the following details:
* **Query**: `dashboard`
* **Response**: `liveUrls`

```
{
actor {
user {
name
}
dashboard {
liveUrls(filter: {type: DASHBOARD}) {
liveUrls {
createdAt
type
uuid
}
}
}
}
}

```

The list of the shared dashboard URLs appears in response.
</Collapser>


</CollapserGroup>
85 changes: 71 additions & 14 deletions src/content/docs/apis/nerdgraph/examples/nerdgraph-dashboards.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,63 @@ Here are operations related to creating, reading, updating, and deleting (CRUD).
Revoke widget live URL operation. You can revoke a previously created live URL of a widget. As a result, the live URL will become unavailable to the public.
</td>
</tr>

<tr>
<td>
`dashboardCreateLiveUrl()`
</td>

<td>
mutation
</td>

<td>
Create publicly accessible live dashboard URL.
</td>
</tr>

<tr>
<td>
`dashboardUpdateLiveUrl()`
</td>

<td>
mutation
</td>

<td>
Update the expiration date of a publicly accessible live dashboard URL.
</td>
</tr>

<tr>
<td>
`dashboardRevokeLiveUrl()`
</td>

<td>
mutation
</td>

<td>
Revoke publicly accessible live dashboard URL.
</td>
</tr>

<tr>
<td>
`dashboardUpdateLiveUrlCreationPolicies()`
</td>

<td>
mutation
</td>

<td>
Only an Authentication Domain Manager can use this mutation to enable or disable the <DNT>**Live URL Creation**</DNT> policy for accounts. Users can create live URLs for dashboards in accounts where this policy is enabled.
</td>
</tr>

</tbody>
</table>

Expand All @@ -262,7 +319,7 @@ Here's an example of creating a cross-account dashboard:
id="cross-account-dashboard"
title="Dashboard with cross-account query"
>
```graphql lineHighlight=21,37,53
```graphql
mutation {
dashboardCreate(
accountId: 1
Expand All @@ -283,7 +340,7 @@ Here's an example of creating a cross-account dashboard:
legend: { enabled: true }
nrqlQueries: [
{
accountIds: [1, 1606862, 2212585]
<var>accountIds: [1, 1606862, 2212585]</var>
query: "SELECT count(*) FROM Transaction"
}
]
Expand All @@ -299,7 +356,7 @@ Here's an example of creating a cross-account dashboard:
legend: { enabled: true }
nrqlQueries: [
{
accountIds: [1, 1606862, 2212585]
<var>accountIds: [1, 1606862, 2212585]</var>
query: "SELECT count(*) FROM Transaction FACET accountId()"
}
]
Expand All @@ -315,7 +372,7 @@ Here's an example of creating a cross-account dashboard:
legend: { enabled: true }
nrqlQueries: [
{
accountIds: [1, 1606862, 2212585]
<var>accountIds: [1, 1606862, 2212585]</var>
query: "SELECT count(*) FROM Transaction FACET accountId() TIMESERIES"
}
]
Expand Down Expand Up @@ -565,20 +622,20 @@ All dashboard mutations offer a way to ask for errors when being executed. This
id="errors-first-class"
title="Errors as part of every mutation response"
>
```graphql
```
mutation {
dashboardMutation(guid: "MY_EXISTING_DASHBOARD_GUID") {
mutationResult {
result
}
errors {
description
type
dashboardMutation(guid: "<var>MY_EXISTING_DASHBOARD_GUID</var>") {
mutationResult {
result
}
errors {
description
type
}
}
}
}
```
</Collapser>
</CollapserGroup>

Keep in mind that these are expected errors that we are aware of in advance. You should also check for unexpected errors that will be returned in the standard [GraphQL errors field](https://graphql.org/learn/serving-over-http/#response).
Keep in mind that these are expected errors that we are aware of in advance. You should also check for unexpected errors that will be returned in the standard [GraphQL errors field](https://graphql.org/learn/serving-over-http/#response).
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ Here are all our available NerdGraph docs:

<td>
* [Install browser agent and configure monitoring](/docs/apis/nerdgraph/examples/browser-monitoring-config-nerdgraph)
* [Instrument multiple apps using npm package](/docs/apis/nerdgraph/examples/combining-npm-nerdgraph)
* [Instrument multiple apps using NPM package](/docs/apis/nerdgraph/examples/combining-npm-nerdgraph)
</td>
</tr>

Expand All @@ -164,7 +164,8 @@ Here are all our available NerdGraph docs:
* [Dashboards: charts and widgets](/docs/apis/nerdgraph/examples/create-widgets-dashboards-api)
* [Export dashboards to other accounts](/docs/apis/nerdgraph/examples/export-import-dashboards-using-api/)
* [Export dashboards as files](/docs/apis/nerdgraph/examples/export-dashboards-pdfpng-using-api/)
* [Manage externally shared dashboards](/docs/apis/nerdgraph/examples/manage-live-chart-urls-via-api)
* [Manage externally shared dashboards](/docs/apis/nerdgraph/examples/manage-live-dashboard-urls-via-api)
* [Manage externally shared charts](/docs/apis/nerdgraph/examples/manage-live-chart-urls-via-api)
</td>
</tr>

Expand Down Expand Up @@ -365,4 +366,4 @@ The following are terms that originate with GraphQL, the API format NerdGraph us
</td>
</tr>
</tbody>
</table>
</table>
Loading
Loading