@@ -48,9 +48,9 @@ def set_usage_export_bucket(project_id: str, bucket_name: str,
48
48
})
49
49
50
50
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 )
54
54
print ("Setting report_name_prefix to empty value will cause the report "
55
55
"to have the default prefix of `usage_gce`." )
56
56
@@ -103,12 +103,10 @@ def disable_usage_export(project_id: str) -> None:
103
103
project_id: project ID or project number of the project to update.
104
104
"""
105
105
projects_client = compute_v1 .ProjectsClient ()
106
- export_location = compute_v1 .UsageExportLocation (
107
- {'bucket_name' : '' , 'report_name_prefix' : '' })
108
106
109
- # Updating the setting with empty bucket name will disable the
107
+ # Updating the setting with None will disable the
110
108
# usage report generation.
111
109
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 )
113
111
return
114
112
# [END compute_usage_report_disable]
0 commit comments