gcloud alpha compute project-info set-usage-bucket - set usage reporting bucket for a project
gcloud alpha compute project-info set-usage-bucket (--bucket=BUCKET | --no-bucket) [--prefix=PREFIX] [GCLOUD_WIDE_FLAG ...]
(ALPHA) gcloud alpha compute project-info set-usage-bucket configures usage reporting for projects.
Setting usage reporting will cause a log of usage per resource to be written to a specified Google Cloud Storage bucket daily.
For example, to write daily logs of the form usage_gce_YYYYMMDD.csv to the bucket my-bucket, run:
$ gcloud compute project-info set-usage-bucket \ --bucket=gs://my-bucket
To disable this feature, issue the command:
$ gcloud compute project-info set-usage-bucket --no-bucket
- Exactly one of these must be specified:
- --bucket=BUCKET
Name of an existing Google Cloud Storage bucket where the usage report object should be stored. This can either be the bucket name by itself, such as my-bucket, or the bucket name with gs:// or https://storage.googleapis.com/ in front of it, such as gs://my-bucket. The Google Service Account for performing usage reporting is granted write access to this bucket. The user running this command must be an owner of the bucket.
To clear the usage bucket, use --no-bucket.
- --no-bucket
Unsets the bucket. This disables usage report storage.
- --prefix=PREFIX
Optional prefix for the name of the usage report object stored in the bucket. If not supplied, then this defaults to usage. The report is stored as a CSV file named PREFIX_gce_YYYYMMDD.csv where YYYYMMDD is the day of the usage according to Pacific Time. The prefix should conform to Google Cloud Storage object naming conventions. This flag must not be provided when clearing the usage bucket.
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.
This command is currently in alpha and might change without notice. If this command fails with API permission errors despite specifying the correct project, you might be trying to access an API with an invitation-only early access allowlist. These variants are also available:
$ gcloud compute project-info set-usage-bucket
$ gcloud beta compute project-info set-usage-bucket