Skip to content
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
@@ -0,0 +1,19 @@
const { DashboardManagementClient } = require("@azure/arm-dashboard");
const { DefaultAzureCredential } = require("@azure/identity");

/**
* 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.
*
* @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.
* x-ms-original-file: 2025-08-01/Dashboard_Create.json
*/
async function dashboardCreate() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new DashboardManagementClient(credential, subscriptionId);
const result = await client.managedDashboards.create("myResourceGroup", "myDashboard", {
location: "West US",
tags: { Environment: "Dev" },
});
console.log(result);
}
Original file line number Diff line number Diff line change
@@ -0,0 +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 number Diff line number Diff line change
@@ -0,0 +1,15 @@
const { DashboardManagementClient } = require("@azure/arm-dashboard");
const { DefaultAzureCredential } = require("@azure/identity");

/**
* This sample demonstrates how to delete a dashboard for Grafana resource.
*
* @summary delete a dashboard for Grafana resource.
* x-ms-original-file: 2025-08-01/Dashboard_Delete.json
*/
async function dashboardDelete() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new DashboardManagementClient(credential, subscriptionId);
await client.managedDashboards.delete("myResourceGroup", "myDashboard");
}
Original file line number Diff line number Diff line change
@@ -0,0 +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 number Diff line number Diff line change
@@ -0,0 +1,16 @@
const { DashboardManagementClient } = require("@azure/arm-dashboard");
const { DefaultAzureCredential } = require("@azure/identity");

/**
* This sample demonstrates how to get the properties of a specific dashboard for grafana resource.
*
* @summary get the properties of a specific dashboard for grafana resource.
* x-ms-original-file: 2025-08-01/Dashboard_Get.json
*/
async function dashboardGet() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new DashboardManagementClient(credential, subscriptionId);
const result = await client.managedDashboards.get("myResourceGroup", "myDashboard");
console.log(result);
}
Original file line number Diff line number Diff line change
@@ -0,0 +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 number Diff line number Diff line change
@@ -0,0 +1,20 @@
const { DashboardManagementClient } = require("@azure/arm-dashboard");
const { DefaultAzureCredential } = require("@azure/identity");

/**
* This sample demonstrates how to list all resources of dashboards under the specified subscription.
*
* @summary list all resources of dashboards under the specified subscription.
* x-ms-original-file: 2025-08-01/Dashboard_List.json
*/
async function dashboardListByResourceGroup() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new DashboardManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (const item of client.managedDashboards.listBySubscription()) {
resArray.push(item);
}

console.log(resArray);
}
Original file line number Diff line number Diff line change
@@ -0,0 +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 number Diff line number Diff line change
@@ -0,0 +1,20 @@
const { DashboardManagementClient } = require("@azure/arm-dashboard");
const { DefaultAzureCredential } = require("@azure/identity");

/**
* This sample demonstrates how to list all resources of dashboards under the specified resource group.
*
* @summary list all resources of dashboards under the specified resource group.
* x-ms-original-file: 2025-08-01/Dashboard_ListByResourceGroup.json
*/
async function dashboardListByResourceGroup() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new DashboardManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (const item of client.managedDashboards.list("myResourceGroup")) {
resArray.push(item);
}

console.log(resArray);
}
Original file line number Diff line number Diff line change
@@ -0,0 +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 number Diff line number Diff line change
@@ -0,0 +1,18 @@
const { DashboardManagementClient } = require("@azure/arm-dashboard");
const { DefaultAzureCredential } = require("@azure/identity");

/**
* This sample demonstrates how to update a dashboard for Grafana resource.
*
* @summary update a dashboard for Grafana resource.
* x-ms-original-file: 2025-08-01/Dashboard_Update.json
*/
async function dashboardUpdate() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new DashboardManagementClient(credential, subscriptionId);
const result = await client.managedDashboards.update("myResourceGroup", "myDashboard", {
tags: { Environment: "Dev 2" },
});
console.log(result);
}
Original file line number Diff line number Diff line change
@@ -0,0 +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 number Diff line number Diff line change
@@ -0,0 +1,16 @@
const { DashboardManagementClient } = require("@azure/arm-dashboard");
const { DefaultAzureCredential } = require("@azure/identity");

/**
* This sample demonstrates how to retrieve enterprise add-on details information
*
* @summary retrieve enterprise add-on details information
* x-ms-original-file: 2025-08-01/EnterpriseDetails_Post.json
*/
async function enterpriseDetailsPost() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new DashboardManagementClient(credential, subscriptionId);
const result = await client.grafana.checkEnterpriseDetails("myResourceGroup", "myWorkspace");
console.log(result);
}
Original file line number Diff line number Diff line change
@@ -0,0 +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 number Diff line number Diff line change
@@ -0,0 +1,57 @@
const { DashboardManagementClient } = require("@azure/arm-dashboard");
const { DefaultAzureCredential } = require("@azure/identity");

/**
* This sample demonstrates how to create or update a workspace for Grafana resource. This API is idempotent, so user can either create a new grafana or update an existing grafana.
*
* @summary create or update a workspace for Grafana resource. This API is idempotent, so user can either create a new grafana or update an existing grafana.
* x-ms-original-file: 2025-08-01/Grafana_Create.json
*/
async function grafanaCreate() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new DashboardManagementClient(credential, subscriptionId);
const result = await client.grafana.create("myResourceGroup", "myWorkspace", {
identity: { type: "SystemAssigned" },
location: "West US",
properties: {
apiKey: "Enabled",
deterministicOutboundIP: "Enabled",
enterpriseConfigurations: {
marketplaceAutoRenew: "Enabled",
marketplacePlanId: "myPlanId",
},
grafanaConfigurations: {
security: { csrfAlwaysCheck: false },
smtp: {
enabled: true,
fromAddress: "[email protected]",
fromName: "emailsender",
host: "smtp.sendemail.com:587",
password: "<password>",
skipVerify: true,
startTLSPolicy: "OpportunisticStartTLS",
user: "username",
},
snapshots: { externalEnabled: true },
unifiedAlertingScreenshots: { captureEnabled: false },
users: { editorsCanAdmin: true, viewersCanEdit: true },
},
grafanaIntegrations: {
azureMonitorWorkspaceIntegrations: [
{
azureMonitorWorkspaceResourceId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace",
},
],
},
grafanaMajorVersion: "9",
grafanaPlugins: { "sample-plugin-id": {} },
publicNetworkAccess: "Enabled",
zoneRedundancy: "Enabled",
},
sku: { name: "Standard" },
tags: { Environment: "Dev" },
});
console.log(result);
}
Original file line number Diff line number Diff line change
@@ -0,0 +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 number Diff line number Diff line change
@@ -0,0 +1,15 @@
const { DashboardManagementClient } = require("@azure/arm-dashboard");
const { DefaultAzureCredential } = require("@azure/identity");

/**
* This sample demonstrates how to delete a workspace for Grafana resource.
*
* @summary delete a workspace for Grafana resource.
* x-ms-original-file: 2025-08-01/Grafana_Delete.json
*/
async function grafanaDelete() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new DashboardManagementClient(credential, subscriptionId);
await client.grafana.delete("myResourceGroup", "myWorkspace");
}
Original file line number Diff line number Diff line change
@@ -0,0 +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 number Diff line number Diff line change
@@ -0,0 +1,16 @@
const { DashboardManagementClient } = require("@azure/arm-dashboard");
const { DefaultAzureCredential } = require("@azure/identity");

/**
* This sample demonstrates how to a synchronous resource action.
*
* @summary a synchronous resource action.
* x-ms-original-file: 2025-08-01/Grafana_FetchAvailablePlugins.json
*/
async function grafanaFetchAvailablePlugins() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new DashboardManagementClient(credential, subscriptionId);
const result = await client.grafana.fetchAvailablePlugins("myResourceGroup", "myWorkspace");
console.log(result);
}
Original file line number Diff line number Diff line change
@@ -0,0 +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 number Diff line number Diff line change
@@ -0,0 +1,16 @@
const { DashboardManagementClient } = require("@azure/arm-dashboard");
const { DefaultAzureCredential } = require("@azure/identity");

/**
* This sample demonstrates how to get the properties of a specific workspace for Grafana resource.
*
* @summary get the properties of a specific workspace for Grafana resource.
* x-ms-original-file: 2025-08-01/Grafana_Get.json
*/
async function grafanaGet() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new DashboardManagementClient(credential, subscriptionId);
const result = await client.grafana.get("myResourceGroup", "myWorkspace");
console.log(result);
}
Original file line number Diff line number Diff line change
@@ -0,0 +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 number Diff line number Diff line change
@@ -0,0 +1,20 @@
const { DashboardManagementClient } = require("@azure/arm-dashboard");
const { DefaultAzureCredential } = require("@azure/identity");

/**
* This sample demonstrates how to list all resources of workspaces for Grafana under the specified subscription.
*
* @summary list all resources of workspaces for Grafana under the specified subscription.
* x-ms-original-file: 2025-08-01/Grafana_List.json
*/
async function grafanaList() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new DashboardManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (const item of client.grafana.list()) {
resArray.push(item);
}

console.log(resArray);
}
Original file line number Diff line number Diff line change
@@ -0,0 +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 number Diff line number Diff line change
@@ -0,0 +1,20 @@
const { DashboardManagementClient } = require("@azure/arm-dashboard");
const { DefaultAzureCredential } = require("@azure/identity");

/**
* This sample demonstrates how to list all resources of workspaces for Grafana under the specified resource group.
*
* @summary list all resources of workspaces for Grafana under the specified resource group.
* x-ms-original-file: 2025-08-01/Grafana_ListByResourceGroup.json
*/
async function grafanaListByResourceGroup() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new DashboardManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (const item of client.grafana.listByResourceGroup("myResourceGroup")) {
resArray.push(item);
}

console.log(resArray);
}
Original file line number Diff line number Diff line change
@@ -0,0 +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 number Diff line number Diff line change
@@ -0,0 +1,53 @@
const { DashboardManagementClient } = require("@azure/arm-dashboard");
const { DefaultAzureCredential } = require("@azure/identity");

/**
* This sample demonstrates how to update a workspace for Grafana resource.
*
* @summary update a workspace for Grafana resource.
* x-ms-original-file: 2025-08-01/Grafana_Update.json
*/
async function grafanaUpdate() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new DashboardManagementClient(credential, subscriptionId);
const result = await client.grafana.update("myResourceGroup", "myWorkspace", {
properties: {
apiKey: "Enabled",
deterministicOutboundIP: "Enabled",
enterpriseConfigurations: {
marketplaceAutoRenew: "Enabled",
marketplacePlanId: "myPlanId",
},
grafanaConfigurations: {
security: { csrfAlwaysCheck: false },
smtp: {
enabled: true,
fromAddress: "[email protected]",
fromName: "emailsender",
host: "smtp.sendemail.com:587",
password: "<password>",
skipVerify: true,
startTLSPolicy: "OpportunisticStartTLS",
user: "username",
},
snapshots: { externalEnabled: true },
unifiedAlertingScreenshots: { captureEnabled: false },
users: { editorsCanAdmin: true, viewersCanEdit: true },
},
grafanaIntegrations: {
azureMonitorWorkspaceIntegrations: [
{
azureMonitorWorkspaceResourceId:
"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.monitor/accounts/myAzureMonitorWorkspace",
},
],
},
grafanaMajorVersion: "9",
grafanaPlugins: { "sample-plugin-id": {} },
},
sku: { name: "Standard" },
tags: { Environment: "Dev 2" },
});
console.log(result);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"sdkUrl": "https://github.com/Azure/azure-sdk-for-js/blob/%40azure%2Farm-dashboard_2.0.0/sdk/dashboard/arm-dashboard/README.md"}
Loading