Skip to content

Commit 865cb11

Browse files
committed
feat(fresh-public-dashboard) Feb release-Doc update for Public dashboard GA
Created this new PR having all the Public Dashboard related updates in #19748 Due to merge conflicts in the above PR, creating this fresh PR.
1 parent 4b2fabc commit 865cb11

13 files changed

+752
-89
lines changed

src/content/docs/apis/nerdgraph/examples/manage-live-chart-urls-via-api.mdx

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "NerdGraph tutorial: List and revoke live chart URLs"
2+
title: "NerdGraph tutorial: List and revoke public sharing chart URLs"
33
tags:
44
- APIs
55
- NerdGraph
@@ -10,21 +10,21 @@ freshnessValidatedDate: never
1010

1111
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).
1212

13-
To do so:
13+
To do this:
1414

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

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

2323
## List all live chart URLs [#list]
2424

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

27-
```graphql
27+
```
2828
{
2929
actor {
3030
dashboard {
@@ -48,14 +48,14 @@ Use the following query to retrieve a list of existing live chart URLs:
4848

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

51-
```graphql
51+
```
5252
mutation {
53-
dashboardWidgetRevokeLiveUrl(uuid: "LIVE_CHART_UUID") {
53+
dashboardWidgetRevokeLiveUrl(uuid: "<enter-the-UUID-of-the-live-chart>") {
5454
uuid
5555
errors {
5656
description
5757
type
5858
}
5959
}
6060
}
61-
```
61+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
---
2+
title: "NerdGraph tutorial: Create, update, and revoke public sharing dashboard URLs"
3+
tags:
4+
- share dashboards externally
5+
- share dashboards using NerdGraph
6+
- public dashboard
7+
- public dashboard URL
8+
metaDescription: Use New Relic NerdGraph to create, update, and revoke live dashboard URLs
9+
freshnessValidatedDate: never
10+
---
11+
12+
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),
13+
You can also do it from the [New Relic UI](/docs/query-your-data/explore-query-data/dashboards/share-charts-dashboards-externally/#dashboard).
14+
15+
<Callout variant="caution">
16+
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.
17+
</Callout>
18+
19+
For creating, updating, or revoking a publicly accessible live dashboard URL from NerdGraph, you need the GUID of the dashboard you want to share.
20+
21+
1. Go to <DNT>**[one.newrelic.com > Dashboards](https://one.newrelic.com//dashboards)**</DNT>.
22+
2. Open the dashboard you want to share.
23+
3. Navigate to <DNT>**<Icon name="fe-more-horizontal"/> > Metadata**</DNT>, and copy the entity GUID of the dasboard.
24+
25+
<CollapserGroup>
26+
<Collapser id="create-dashboard-url-nerdgraph" title="Create a live dashboard URL">
27+
1. Go to [NerdGraph API explorer](https://one.newrelic.com/nerdgraph-graphiql).
28+
2. Construct a [graph API call](/docs/apis/nerdgraph/get-started/nerdgraph-explorer) using the following details:
29+
* **Mutation**: `dashboardCreateLiveUrl`
30+
* **GUID**: The entity guide of the dashboard
31+
* **Options**(optional): The time period in seconds for the URL to be live
32+
* **Minimum value**: 300 seconds (5 minutes)
33+
* **Maximum value**: 631152000 seconds (20 years)
34+
* **Default value**: 2592000 seconds (30 days)
35+
* **Response**: `url`
36+
37+
```
38+
mutation CreatePublicLink {
39+
dashboardCreateLiveUrl(
40+
guid: "enter the dashboard GUID"
41+
options: { ttl: "updated duration in seconds" }
42+
) {
43+
url
44+
}
45+
}
46+
47+
```
48+
The live dashboard URL appears in the response. This is a public URL, so you can share it with anyone.
49+
50+
```
51+
https://share.newrelic.com/dashboard/<public_link_id>
52+
53+
```
54+
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.
55+
56+
<Callout variant="important">
57+
Any content update in the dashboard on New Relic platform reflects in the shared dashboard page.
58+
</Callout>
59+
60+
</Collapser>
61+
62+
<Collapser id="update-dashboard-url-nerdgraph" title="Update a live dashboard URL">
63+
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.
64+
65+
To update the time period for the URL to be live:
66+
1. Go to [NerdGraph API explorer](https://one.newrelic.com/nerdgraph-graphiql).
67+
2. Construct a [graph API call](/docs/apis/nerdgraph/get-started/nerdgraph-explorer) using the following details:
68+
* **Mutation**: `dashboardUpdateLiveUrl`
69+
* **ID**: The ID of the shared dashboard (Copy it from the shared dashboard URL.)
70+
* **Options**: The updated time period in seconds
71+
* **Minimum value**: 300 seconds (5 minutes)
72+
* **Maximum value**: 631152000 seconds (20 years)
73+
* **Default value**: 2592000 seconds (30 days)
74+
75+
```
76+
mutation UpdatePublicLink{
77+
dashboardUpdateLiveUrl(
78+
id:"enter the public link ID"
79+
options: { ttl: "updated duration in seconds" }
80+
) {
81+
title
82+
url
83+
}
84+
}
85+
86+
```
87+
The URL appears in the response as follows. Now the URL will remain live for the updated time period.
88+
89+
```
90+
https://share.newrelic.com/dashboard/<public_link_id>
91+
92+
```
93+
94+
</Collapser>
95+
96+
<Collapser id="revoke-dashboard-url-nerdgraph" title="Revoke a live dashboard URL">
97+
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:
98+
1. Go to [NerdGraph API explorer](https://one.newrelic.com/nerdgraph-graphiql).
99+
2. Construct a [graph API call](/docs/apis/nerdgraph/get-started/nerdgraph-explorer) using the following details:
100+
* **Mutation**: `dashboardRevokeLiveUrl`
101+
* **ID**: The ID of the shared dashboard (Copy it from the shared dashboard URL.)
102+
103+
```
104+
mutation {
105+
dashboardRevokeLiveUrl(id: "<public_link_id>") {
106+
id
107+
}
108+
}
109+
110+
```
111+
The shared dashboard URL is now revoked, and it will no longer be accessible. The response appears as follows:
112+
113+
```
114+
{
115+
"data": {
116+
"dashboardRevokeLiveUrl": {
117+
"id": "<public_link_id>" //the one you passed to the mutation
118+
}
119+
}
120+
}
121+
122+
```
123+
</Collapser>
124+
125+
<Collapser id="list-dashboard-url-nerdgraph" title="List all shared dashboard URLs">
126+
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:
127+
1. Go to [NerdGraph API explorer](https://one.newrelic.com/nerdgraph-graphiql).
128+
2. Construct a [graph API call](/docs/apis/nerdgraph/get-started/nerdgraph-explorer) using the following details:
129+
* **Query**: `dashboard`
130+
* **Response**: `liveUrls`
131+
132+
```
133+
{
134+
actor {
135+
user {
136+
name
137+
}
138+
dashboard {
139+
liveUrls(filter: {type: DASHBOARD}) {
140+
liveUrls {
141+
createdAt
142+
type
143+
uuid
144+
}
145+
}
146+
}
147+
}
148+
}
149+
150+
```
151+
152+
The list of the shared dashboard URLs appears in response.
153+
</Collapser>
154+
155+
156+
</CollapserGroup>

src/content/docs/apis/nerdgraph/examples/nerdgraph-dashboards.mdx

+71-14
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,63 @@ Here are operations related to creating, reading, updating, and deleting (CRUD).
248248
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.
249249
</td>
250250
</tr>
251+
252+
<tr>
253+
<td>
254+
`dashboardCreateLiveUrl()`
255+
</td>
256+
257+
<td>
258+
mutation
259+
</td>
260+
261+
<td>
262+
Create publicly accessible live dashboard URL.
263+
</td>
264+
</tr>
265+
266+
<tr>
267+
<td>
268+
`dashboardUpdateLiveUrl()`
269+
</td>
270+
271+
<td>
272+
mutation
273+
</td>
274+
275+
<td>
276+
Update the expiration date of a publicly accessible live dashboard URL.
277+
</td>
278+
</tr>
279+
280+
<tr>
281+
<td>
282+
`dashboardRevokeLiveUrl()`
283+
</td>
284+
285+
<td>
286+
mutation
287+
</td>
288+
289+
<td>
290+
Revoke publicly accessible live dashboard URL.
291+
</td>
292+
</tr>
293+
294+
<tr>
295+
<td>
296+
`dashboardUpdateLiveUrlCreationPolicies()`
297+
</td>
298+
299+
<td>
300+
mutation
301+
</td>
302+
303+
<td>
304+
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.
305+
</td>
306+
</tr>
307+
251308
</tbody>
252309
</table>
253310

@@ -262,7 +319,7 @@ Here's an example of creating a cross-account dashboard:
262319
id="cross-account-dashboard"
263320
title="Dashboard with cross-account query"
264321
>
265-
```graphql lineHighlight=21,37,53
322+
```graphql
266323
mutation {
267324
dashboardCreate(
268325
accountId: 1
@@ -283,7 +340,7 @@ Here's an example of creating a cross-account dashboard:
283340
legend: { enabled: true }
284341
nrqlQueries: [
285342
{
286-
accountIds: [1, 1606862, 2212585]
343+
<var>accountIds: [1, 1606862, 2212585]</var>
287344
query: "SELECT count(*) FROM Transaction"
288345
}
289346
]
@@ -299,7 +356,7 @@ Here's an example of creating a cross-account dashboard:
299356
legend: { enabled: true }
300357
nrqlQueries: [
301358
{
302-
accountIds: [1, 1606862, 2212585]
359+
<var>accountIds: [1, 1606862, 2212585]</var>
303360
query: "SELECT count(*) FROM Transaction FACET accountId()"
304361
}
305362
]
@@ -315,7 +372,7 @@ Here's an example of creating a cross-account dashboard:
315372
legend: { enabled: true }
316373
nrqlQueries: [
317374
{
318-
accountIds: [1, 1606862, 2212585]
375+
<var>accountIds: [1, 1606862, 2212585]</var>
319376
query: "SELECT count(*) FROM Transaction FACET accountId() TIMESERIES"
320377
}
321378
]
@@ -565,20 +622,20 @@ All dashboard mutations offer a way to ask for errors when being executed. This
565622
id="errors-first-class"
566623
title="Errors as part of every mutation response"
567624
>
568-
```graphql
625+
```
569626
mutation {
570-
dashboardMutation(guid: "MY_EXISTING_DASHBOARD_GUID") {
571-
mutationResult {
572-
result
573-
}
574-
errors {
575-
description
576-
type
627+
dashboardMutation(guid: "<var>MY_EXISTING_DASHBOARD_GUID</var>") {
628+
mutationResult {
629+
result
630+
}
631+
errors {
632+
description
633+
type
634+
}
577635
}
578636
}
579-
}
580637
```
581638
</Collapser>
582639
</CollapserGroup>
583640

584-
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).
641+
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).

src/content/docs/apis/nerdgraph/get-started/introduction-new-relic-nerdgraph.mdx

+4-3
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ Here are all our available NerdGraph docs:
139139

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

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

@@ -365,4 +366,4 @@ The following are terms that originate with GraphQL, the API format NerdGraph us
365366
</td>
366367
</tr>
367368
</tbody>
368-
</table>
369+
</table>

0 commit comments

Comments
 (0)