Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions,
see Getting Started with Amazon Web Services in China
(PDF).
Use GetDashboard
with an Amazon SDK or command line tool
The following code examples show how to use GetDashboard
.
- .NET
-
- Amazon SDK for .NET
-
/// <summary>
/// Get information on a dashboard.
/// </summary>
/// <param name="dashboardName">The name of the dashboard.</param>
/// <returns>A JSON object with dashboard information.</returns>
public async Task<string> GetDashboard(string dashboardName)
{
var dashboardResponse = await _amazonCloudWatch.GetDashboardAsync(
new GetDashboardRequest()
{
DashboardName = dashboardName
});
return dashboardResponse.DashboardBody;
}
- PowerShell
-
- Tools for PowerShell
-
Example 1: Returns the arn the body of the specified dashboard.
Get-CWDashboard -DashboardName Dashboard1
Output:
DashboardArn DashboardBody
------------ -------------
arn:aws:cloudwatch::123456789012:dashboard/Dashboard1 {...
For a complete list of Amazon SDK developer guides and code examples, see
Using CloudWatch with an Amazon SDK.
This topic also includes information about getting started and details about previous SDK versions.