Skip to content

Commit 42ea32e

Browse files
authored
[Automation] Collect examples from azure-sdk-for-js#@azure/arm-dashboard_2.0.0
1 parent 59247ac commit 42ea32e

File tree

64 files changed

+718
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+718
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
const { DashboardManagementClient } = require("@azure/arm-dashboard");
2+
const { DefaultAzureCredential } = require("@azure/identity");
3+
4+
/**
5+
* This sample demonstrates how to create or update a dashboard for grafana resource. This API is idempotent, so user can either create a new dashboard or update an existing dashboard.
6+
*
7+
* @summary create or update a dashboard for grafana resource. This API is idempotent, so user can either create a new dashboard or update an existing dashboard.
8+
* x-ms-original-file: 2025-08-01/Dashboard_Create.json
9+
*/
10+
async function dashboardCreate() {
11+
const credential = new DefaultAzureCredential();
12+
const subscriptionId = "00000000-0000-0000-0000-000000000000";
13+
const client = new DashboardManagementClient(credential, subscriptionId);
14+
const result = await client.managedDashboards.create("myResourceGroup", "myDashboard", {
15+
location: "West US",
16+
tags: { Environment: "Dev" },
17+
});
18+
console.log(result);
19+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-js/blob/%40azure%2Farm-dashboard_2.0.0/sdk/dashboard/arm-dashboard/README.md"}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
const { DashboardManagementClient } = require("@azure/arm-dashboard");
2+
const { DefaultAzureCredential } = require("@azure/identity");
3+
4+
/**
5+
* This sample demonstrates how to delete a dashboard for Grafana resource.
6+
*
7+
* @summary delete a dashboard for Grafana resource.
8+
* x-ms-original-file: 2025-08-01/Dashboard_Delete.json
9+
*/
10+
async function dashboardDelete() {
11+
const credential = new DefaultAzureCredential();
12+
const subscriptionId = "00000000-0000-0000-0000-000000000000";
13+
const client = new DashboardManagementClient(credential, subscriptionId);
14+
await client.managedDashboards.delete("myResourceGroup", "myDashboard");
15+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-js/blob/%40azure%2Farm-dashboard_2.0.0/sdk/dashboard/arm-dashboard/README.md"}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
const { DashboardManagementClient } = require("@azure/arm-dashboard");
2+
const { DefaultAzureCredential } = require("@azure/identity");
3+
4+
/**
5+
* This sample demonstrates how to get the properties of a specific dashboard for grafana resource.
6+
*
7+
* @summary get the properties of a specific dashboard for grafana resource.
8+
* x-ms-original-file: 2025-08-01/Dashboard_Get.json
9+
*/
10+
async function dashboardGet() {
11+
const credential = new DefaultAzureCredential();
12+
const subscriptionId = "00000000-0000-0000-0000-000000000000";
13+
const client = new DashboardManagementClient(credential, subscriptionId);
14+
const result = await client.managedDashboards.get("myResourceGroup", "myDashboard");
15+
console.log(result);
16+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-js/blob/%40azure%2Farm-dashboard_2.0.0/sdk/dashboard/arm-dashboard/README.md"}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
const { DashboardManagementClient } = require("@azure/arm-dashboard");
2+
const { DefaultAzureCredential } = require("@azure/identity");
3+
4+
/**
5+
* This sample demonstrates how to list all resources of dashboards under the specified subscription.
6+
*
7+
* @summary list all resources of dashboards under the specified subscription.
8+
* x-ms-original-file: 2025-08-01/Dashboard_List.json
9+
*/
10+
async function dashboardListByResourceGroup() {
11+
const credential = new DefaultAzureCredential();
12+
const subscriptionId = "00000000-0000-0000-0000-000000000000";
13+
const client = new DashboardManagementClient(credential, subscriptionId);
14+
const resArray = new Array();
15+
for await (const item of client.managedDashboards.listBySubscription()) {
16+
resArray.push(item);
17+
}
18+
19+
console.log(resArray);
20+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-js/blob/%40azure%2Farm-dashboard_2.0.0/sdk/dashboard/arm-dashboard/README.md"}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
const { DashboardManagementClient } = require("@azure/arm-dashboard");
2+
const { DefaultAzureCredential } = require("@azure/identity");
3+
4+
/**
5+
* This sample demonstrates how to list all resources of dashboards under the specified resource group.
6+
*
7+
* @summary list all resources of dashboards under the specified resource group.
8+
* x-ms-original-file: 2025-08-01/Dashboard_ListByResourceGroup.json
9+
*/
10+
async function dashboardListByResourceGroup() {
11+
const credential = new DefaultAzureCredential();
12+
const subscriptionId = "00000000-0000-0000-0000-000000000000";
13+
const client = new DashboardManagementClient(credential, subscriptionId);
14+
const resArray = new Array();
15+
for await (const item of client.managedDashboards.list("myResourceGroup")) {
16+
resArray.push(item);
17+
}
18+
19+
console.log(resArray);
20+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-js/blob/%40azure%2Farm-dashboard_2.0.0/sdk/dashboard/arm-dashboard/README.md"}

0 commit comments

Comments
 (0)