Set and retrieve Compute Engine usage export bucket
Stay organized with collections
Save and categorize content based on your preferences.
This sample shows you how to set and retrieve the Compute Engine usage export bucket for a project. The usage export bucket is a Google Cloud Storage bucket where Compute Engine usage reports are stored. The usage reports can be used for billing and cost management purposes.
Code sample
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],[],[[["This sample demonstrates how to configure a Google Cloud Storage bucket to store Compute Engine usage reports."],["Usage reports stored in the designated bucket can be used to manage billing and costs related to Compute Engine."],["The `set_usage_export_bucket` function allows you to specify the bucket and an optional report name prefix, which defaults to \"usage_gce\" if not specified."],["The `get_usage_export_bucket` function retrieves the current usage export settings, automatically replacing an empty report name prefix with the default \"usage_gce\"."],["Authentication to Compute Engine uses Application Default Credentials."]]],[]]