2022-03-01 04:29:52 +00:00
|
|
|
NAME
|
|
|
|
|
gcloud monitoring dashboards create - create a new Cloud Monitoring
|
|
|
|
|
dashboard
|
|
|
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
|
gcloud monitoring dashboards create
|
2024-07-31 09:35:16 +00:00
|
|
|
(--config=CONFIG | --config-from-file=PATH_TO_FILE) [--validate-only]
|
|
|
|
|
[GCLOUD_WIDE_FLAG ...]
|
2022-03-01 04:29:52 +00:00
|
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
|
Create a new Monitoring dashboard. A dashboard can be specified as a
|
|
|
|
|
JSON/YAML value passed in as a string through the --config flag or as a
|
2022-09-28 10:27:48 +00:00
|
|
|
file through the --config-from-file flag. Validate a dashboard config
|
|
|
|
|
without saving by setting the --validate-only flag.
|
2022-03-01 04:29:52 +00:00
|
|
|
|
|
|
|
|
For information about the format of a dashboard:
|
|
|
|
|
https://cloud.google.com/monitoring/api/ref_v3/rest/v1/projects.dashboards
|
|
|
|
|
|
|
|
|
|
EXAMPLES
|
|
|
|
|
To create a dashboard with a YAML config, run:
|
|
|
|
|
|
|
|
|
|
$ gcloud monitoring dashboards create --config='''
|
|
|
|
|
displayName: New Dashboard
|
|
|
|
|
gridLayout:
|
|
|
|
|
widgets:
|
|
|
|
|
- text:
|
|
|
|
|
content: Hello World
|
|
|
|
|
'''
|
|
|
|
|
|
2022-09-28 10:27:48 +00:00
|
|
|
To validate a dashboard and not save it, run:
|
|
|
|
|
|
|
|
|
|
$ gcloud monitoring dashboards create --validate-only --config='''
|
|
|
|
|
displayName: New Dashboard
|
|
|
|
|
gridLayout:
|
|
|
|
|
widgets:
|
|
|
|
|
- text:
|
|
|
|
|
content: Hello World
|
|
|
|
|
'''
|
|
|
|
|
|
2022-03-01 04:29:52 +00:00
|
|
|
To create a dashboard with a JSON config, run:
|
|
|
|
|
|
|
|
|
|
$ gcloud monitoring dashboards create --config='''
|
|
|
|
|
{
|
|
|
|
|
"displayName": "New Dashboard",
|
|
|
|
|
"gridLayout": {
|
|
|
|
|
"widgets": [
|
|
|
|
|
{
|
|
|
|
|
"text": {
|
|
|
|
|
"content": "Hello World",
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
To create a dashboard with a specific dashboard ID, run:
|
|
|
|
|
|
|
|
|
|
$ gcloud monitoring dashboards create --config='''
|
|
|
|
|
name: projects/MY-PROJECT/dashboards/MY-DASHBOARD
|
|
|
|
|
displayName: New Dashboard
|
|
|
|
|
gridLayout:
|
|
|
|
|
widgets:
|
|
|
|
|
- text:
|
|
|
|
|
content: Hello World
|
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
To create a dashboard within a specific project, run:
|
|
|
|
|
|
|
|
|
|
$ gcloud monitoring dashboards create --project=MY-PROJECT \
|
|
|
|
|
--config='''
|
|
|
|
|
displayName: New Dashboard
|
|
|
|
|
gridLayout:
|
|
|
|
|
widgets:
|
|
|
|
|
- text:
|
|
|
|
|
content: Hello World
|
|
|
|
|
'''
|
|
|
|
|
|
|
|
|
|
To create a dashboard with a file, run:
|
|
|
|
|
|
|
|
|
|
$ gcloud monitoring dashboards create --config-from-file=MY-FILE
|
|
|
|
|
|
|
|
|
|
Sample contents of MY-FILE:
|
|
|
|
|
|
|
|
|
|
displayName: New Dashboard
|
|
|
|
|
gridLayout:
|
|
|
|
|
widgets:
|
|
|
|
|
- text:
|
|
|
|
|
content: Hello World
|
|
|
|
|
|
|
|
|
|
REQUIRED FLAGS
|
|
|
|
|
Exactly one of these must be specified:
|
|
|
|
|
|
|
|
|
|
--config=CONFIG
|
|
|
|
|
Dashboard configuration, in either JSON or YAML format, as a string.
|
|
|
|
|
|
2024-07-31 09:35:16 +00:00
|
|
|
--config-from-file=PATH_TO_FILE
|
2022-03-01 04:29:52 +00:00
|
|
|
Path to a JSON or YAML file containing the dashboard configuration.
|
2024-07-31 09:35:16 +00:00
|
|
|
Use a full or relative path to a local file containing the value of
|
|
|
|
|
config.
|
2022-03-01 04:29:52 +00:00
|
|
|
|
2022-09-28 10:27:48 +00:00
|
|
|
OPTIONAL FLAGS
|
|
|
|
|
--validate-only
|
|
|
|
|
When set, validate the dashboard but do not save it.
|
|
|
|
|
|
2022-03-01 04:29:52 +00:00
|
|
|
GCLOUD WIDE FLAGS
|
|
|
|
|
These flags are available to all commands: --access-token-file, --account,
|
|
|
|
|
--billing-project, --configuration, --flags-file, --flatten, --format,
|
|
|
|
|
--help, --impersonate-service-account, --log-http, --project, --quiet,
|
|
|
|
|
--trace-token, --user-output-enabled, --verbosity.
|
|
|
|
|
|
|
|
|
|
Run $ gcloud help for details.
|
|
|
|
|
|
|
|
|
|
API REFERENCE
|
|
|
|
|
This command uses the monitoring/v1 API. The full documentation for this
|
|
|
|
|
API can be found at: https://cloud.google.com/monitoring/api/
|
|
|
|
|
|
|
|
|
|
NOTES
|
|
|
|
|
These variants are also available:
|
|
|
|
|
|
|
|
|
|
$ gcloud alpha monitoring dashboards create
|
|
|
|
|
|
|
|
|
|
$ gcloud beta monitoring dashboards create
|
|
|
|
|
|