使用 Amazon Managed Grafana 示例 Amazon CLI - Amazon Command Line Interface
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

使用 Amazon Managed Grafana 示例 Amazon CLI

以下代码示例向您展示了如何使用 Amazon Command Line Interface 与 Amazon Managed Grafana 搭配使用来执行操作和实现常见场景。

操作是大型程序的代码摘录,必须在上下文中运行。您可以通过操作了解如何调用单个服务函数,还可以通过函数相关场景和跨服务示例的上下文查看操作。

场景是展示如何通过在同一服务中调用多个函数来完成特定任务任务的代码示例。

每个示例都包含一个指向的链接 GitHub,您可以在其中找到有关如何在上下文中设置和运行代码的说明。

主题

操作

以下代码示例演示如何使用 list-workspaces

Amazon CLI

在用户凭据指定的区域中列出该账户的工作空间

以下list-workspaces示例列出了账户所在区域的 Grafana 工作空间。

aws grafana list-workspaces

输出:

{ "workspaces": [ { "authentication": { "providers": [ "AWS_SSO" ] }, "created": "2022-04-04T16:20:21.796000-07:00", "description": "to test tags", "endpoint": "g-949e7b44df.grafana-workspace.us-east-1.amazonaws.com", "grafanaVersion": "8.2", "id": "g-949e7b44df", "modified": "2022-04-04T16:20:21.796000-07:00", "name": "testtag2", "notificationDestinations": [ "SNS" ], "status": "ACTIVE" }, { "authentication": { "providers": [ "AWS_SSO" ] }, "created": "2022-04-20T10:22:15.115000-07:00", "description": "ww", "endpoint": "g-bffa51ed1b.grafana-workspace.us-east-1.amazonaws.com", "grafanaVersion": "8.2", "id": "g-bffa51ed1b", "modified": "2022-04-20T10:22:15.115000-07:00", "name": "ww", "notificationDestinations": [ "SNS" ], "status": "ACTIVE" } ] }
  • 有关 API 的详细信息,请参阅Amazon CLI 命令参考ListWorkspaces中的。