gcloud beta monitoring dashboards create

NAME
gcloud beta monitoring dashboards create - create a new Cloud Monitoring dashboard
SYNOPSIS
gcloud beta monitoring dashboards create(--config=CONFIG    |--config-from-file=PATH_TO_FILE)[--validate-only][GCLOUD_WIDE_FLAG]
DESCRIPTION
(BETA) Create a new Monitoring dashboard. A dashboard can bespecified as a JSON/YAML value passed in as a string through the--config flag or as a file through the--config-from-file flag. Validate a dashboard config without savingby setting the--validate-only flag.

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:
gcloudbetamonitoringdashboardscreate--config='''  displayName: New Dashboard  gridLayout:    widgets:    - text:        content: Hello World  '''

To validate a dashboard and not save it, run:

gcloudbetamonitoringdashboardscreate--validate-only--config='''  displayName: New Dashboard  gridLayout:    widgets:    - text:        content: Hello World  '''

To create a dashboard with a JSON config, run:

gcloudbetamonitoringdashboardscreate--config='''  {    "displayName": "New Dashboard",    "gridLayout": {      "widgets": [        {          "text": {            "content": "Hello World",          }        }      ]    },  }  '''

To create a dashboard with a specific dashboard ID, run:

gcloudbetamonitoringdashboardscreate--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:

gcloudbetamonitoringdashboardscreate--project=MY-PROJECT--config='''  displayName: New Dashboard  gridLayout:    widgets:    - text:        content: Hello World  '''

To create a dashboard with a file, run:

gcloudbetamonitoringdashboardscreate--config-from-file=MY-FILE

Sample contents of MY-FILE:

displayName:NewDashboardgridLayout:widgets:-text:content:HelloWorld
REQUIRED FLAGS
Exactly one of these must be specified:
--config=CONFIG
Dashboard configuration, in either JSON or YAML format, as a string.
--config-from-file=PATH_TO_FILE
Path to a JSON or YAML file containing the dashboard configuration. Use a fullor relative path to a local file containing the value of config.
OPTIONAL FLAGS
--validate-only
When set, validate the dashboard but do not save it.
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 themonitoring/v1 API. The full documentation forthis API can be found at:https://cloud.google.com/monitoring/api/
NOTES
This command is currently in beta and might change without notice. Thesevariants are also available:
gcloudmonitoringdashboardscreate
gcloudalphamonitoringdashboardscreate

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-07-22 UTC.