Skip to content
This repository was archived by the owner on Dec 31, 2023. It is now read-only.

Commit 1b9ef96

Browse files
committed
chore: Applying changes from review
1 parent a36d7d6 commit 1b9ef96

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

samples/snippets/sample_default_values.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ def set_usage_export_bucket(project_id: str, bucket_name: str,
4848
})
4949

5050
if not report_name_prefix:
51-
# Sending empty value for report_name_prefix, will result with the
52-
# next usage report generated will have the default prefix value
53-
# "usage_gce". (ref: https://cloud.google.com/compute/docs/reference/rest/v1/projects/get)
51+
# Sending an empty value for report_name_prefix will result in the
52+
# next usage report generated to have the default prefix value
53+
# "usage_gce". (ref: https://cloud.google.com/compute/docs/reference/rest/v1/projects/setUsageExportBucket)
5454
print("Setting report_name_prefix to empty value will cause the report "
5555
"to have the default prefix of `usage_gce`.")
5656

@@ -103,12 +103,10 @@ def disable_usage_export(project_id: str) -> None:
103103
project_id: project ID or project number of the project to update.
104104
"""
105105
projects_client = compute_v1.ProjectsClient()
106-
export_location = compute_v1.UsageExportLocation(
107-
{'bucket_name': '', 'report_name_prefix': ''})
108106

109-
# Updating the setting with empty bucket name will disable the
107+
# Updating the setting with None will disable the
110108
# usage report generation.
111109
projects_client.set_usage_export_bucket(
112-
project=project_id, usage_export_location_resource=export_location)
110+
project=project_id, usage_export_location_resource=None)
113111
return
114112
# [END compute_usage_report_disable]

0 commit comments

Comments
 (0)