az grafana dashboard
Note
This reference is part of the amg extension for the Azure CLI (version 2.61.0 or higher). 该扩展会在首次运行 az grafana dashboard 命令时自动安装。 Learn more about extensions.
用于管理实例仪表板的命令。
命令
名称 | 说明 | 类型 | Status |
---|---|---|---|
az grafana dashboard create |
创建新的仪表板。 |
Extension | GA |
az grafana dashboard delete |
删除仪表板。 |
Extension | GA |
az grafana dashboard import |
导入仪表板。 |
Extension | GA |
az grafana dashboard list |
列出实例的所有仪表板。 |
Extension | GA |
az grafana dashboard show |
获取仪表板的详细信息。 |
Extension | GA |
az grafana dashboard sync |
将 Azure 托管 Grafana 仪表板从一个实例同步到另一个实例。 仪表板中的库面板将自动包含在同步中。请注意,由于只读,将跳过状态为“已预配”状态的仪表板。 |
Extension | Preview |
az grafana dashboard update |
更新仪表板。 |
Extension | GA |
az grafana dashboard create
创建新的仪表板。
az grafana dashboard create --definition
--name
[--api-key --token]
[--folder]
[--overwrite {false, true}]
[--resource-group]
[--title]
示例
在 json 文件中创建具有定义的仪表板。 若要快速入门,请从“az grafana dashboard show”的输出克隆,删除“id”和“uid”,并应用更改。
az grafana dashboard create -g MyResourceGroup -n MyGrafana --title "My dashboard" --folder folder1 --definition '{
"dashboard": {
"annotations": {
...
},
"panels": {
...
}
},
"message": "Create a new test dashboard"
}'
必需参数
json 字符串中的完整仪表板模型、包含此类内容的文件的路径或 URL。
Azure 托管 Grafana 的名称。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
API 密钥或服务帐户令牌,这是一个随机生成的字符串,用于与 Grafana 终结点交互;如果缺少,CLI 将使用当前登录用户的凭据。
可标识文件夹的 Uid 或标题。 CLI 将首先使用 uid 进行搜索,然后进行标题搜索,直到找到匹配项。
使用相同的 uid 覆盖仪表板。
属性 | 值 |
---|---|
接受的值: | false, true |
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
仪表板的标题。
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az grafana dashboard delete
删除仪表板。
az grafana dashboard delete --dashboard
--name
[--api-key --token]
[--resource-group]
示例
删除唯一标识符指定的仪表板(使用“az grafana dashboard list”命令检索 uid)
az grafana dashboard delete -g MyResourceGroup -n MyGrafana --dashboard VdrOA7jGz
必需参数
Dashboard uid.
Azure 托管 Grafana 的名称。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
API 密钥或服务帐户令牌,这是一个随机生成的字符串,用于与 Grafana 终结点交互;如果缺少,CLI 将使用当前登录用户的凭据。
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az grafana dashboard import
导入仪表板。
CLI 命令将填写数据源的必需参数(如果已配置)。
az grafana dashboard import --definition
--name
[--api-key --token]
[--folder]
[--overwrite {false, true}]
[--resource-group]
示例
从 Grafana 库导入“AKS 容器见解”的仪表板。
az grafana dashboard import -g MyResourceGroup -n MyGrafana --definition 12180
从文件导入仪表板。
az grafana dashboard import -g MyResourceGroup -n MyGrafana --definition @c:\temp\dashboard.json
必需参数
json 字符串、Grafana 库 ID、包含此类内容的文件的路径或 URL 的完整仪表板模型。
Azure 托管 Grafana 的名称。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
API 密钥或服务帐户令牌,这是一个随机生成的字符串,用于与 Grafana 终结点交互;如果缺少,CLI 将使用当前登录用户的凭据。
可标识文件夹的 Uid 或标题。 CLI 将首先使用 uid 进行搜索,然后进行标题搜索,直到找到匹配项。
使用相同的 uid 覆盖仪表板。
属性 | 值 |
---|---|
接受的值: | false, true |
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az grafana dashboard list
列出实例的所有仪表板。
az grafana dashboard list --name
[--api-key --token]
[--resource-group]
示例
查找 K8s API 服务器的仪表板并检索唯一标识符(若要调用“az grafana dashboard show”命令)
az grafana dashboard list -g MyResourceGroup -n MyGrafana --query "[?contains(@.title, 'API server')].uid"
必需参数
Azure 托管 Grafana 的名称。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
API 密钥或服务帐户令牌,这是一个随机生成的字符串,用于与 Grafana 终结点交互;如果缺少,CLI 将使用当前登录用户的凭据。
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az grafana dashboard show
获取仪表板的详细信息。
az grafana dashboard show --dashboard
--name
[--api-key --token]
[--resource-group]
示例
获取唯一标识符指定的仪表板的详细信息(使用“az grafana dashboard list”命令检索 uid)
az grafana dashboard show -g MyResourceGroup -n MyGrafana --dashboard VdrOA7jGz
必需参数
Dashboard uid.
Azure 托管 Grafana 的名称。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
API 密钥或服务帐户令牌,这是一个随机生成的字符串,用于与 Grafana 终结点交互;如果缺少,CLI 将使用当前登录用户的凭据。
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az grafana dashboard sync
此命令处于预览阶段,正在开发中。 参考和支持级别:https://aka.ms/CLI_refstatus
将 Azure 托管 Grafana 仪表板从一个实例同步到另一个实例。 仪表板中的库面板将自动包含在同步中。请注意,由于只读,将跳过状态为“已预配”状态的仪表板。
az grafana dashboard sync --destination
--source
[--dashboards-to-exclude]
[--dashboards-to-include]
[--dry-run {false, true}]
[--folders-to-exclude]
[--folders-to-include]
示例
仅同步几个文件夹下的仪表板
az grafana dashboard sync --source /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspaces/providers/Microsoft.Dashboard/grafana/source --destination /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspaces/providers/Microsoft.Dashboard/grafana/destination --folders-to-include "Azure Monitor Container Insights" "Azure Monitor"
同步单个仪表板
az grafana dashboard sync --source /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspaces/providers/Microsoft.Dashboard/grafana/source --destination /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspaces/providers/Microsoft.Dashboard/grafana/destination --folders-to-include "MyFolder" --dashboards-to-include "My Service Health"
预览同步
az grafana dashboard sync --source /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspaces/providers/Microsoft.Dashboard/grafana/source --destination /subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/workspaces/providers/Microsoft.Dashboard/grafana/destination --dry-run
必需参数
目标工作区的资源 ID。
源工作区的资源 ID。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
要同步排除的仪表板的空格分隔标题。与特定文件夹的 --folders-to-exclude 配对。
用于同步的仪表板的空格分隔标题。与特定文件夹的 --folders-to-include 配对。
预览更改,w/o 提交。
属性 | 值 |
---|---|
接受的值: | false, true |
备份或同步中要排除的文件夹。
要包含在备份或同步中的文件夹。
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az grafana dashboard update
更新仪表板。
az grafana dashboard update --definition
--name
[--api-key --token]
[--folder]
[--overwrite {false, true}]
[--resource-group]
示例
使用 json 文件中的定义更新仪表板。 若要快速入门,请从“az grafana dashboard show”获取现有配置,并应用更改。 需要更新“version”字段,“overwrite”字段应为 true。
az grafana dashboard update -g MyResourceGroup -n MyGrafana --definition @c:\temp\dashboard.json
必需参数
json 字符串中的完整仪表板模型、包含此类内容的文件的路径或 URL。
Azure 托管 Grafana 的名称。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
API 密钥或服务帐户令牌,这是一个随机生成的字符串,用于与 Grafana 终结点交互;如果缺少,CLI 将使用当前登录用户的凭据。
可标识文件夹的 Uid 或标题。 CLI 将首先使用 uid 进行搜索,然后进行标题搜索,直到找到匹配项。
使用相同的 uid 覆盖仪表板。
属性 | 值 |
---|---|
接受的值: | false, true |
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |