Skip to content

Commit aad80ea

Browse files
authored
chore(Compute): update comments and variable name based on feedback (GoogleCloudPlatform#1426)
1 parent cb05572 commit aad80ea

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

compute/cloud-client/instances/src/set_usage_export_bucket.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,17 @@
3636

3737
# [START compute_usage_report_set]
3838
/**
39-
* Set Compute Engine usage export bucket for the Cloud Project.
39+
* Set Compute Engine usage export bucket for the Cloud project.
4040
* This sample presents how to interpret the default value for the report name prefix parameter.
4141
* Example:
4242
* ```
43-
* set_usage_export_bucket($projectId, $bucketName, $reportPrefixName);
43+
* set_usage_export_bucket($projectId, $bucketName, $reportNamePrefix);
4444
* ```
4545
*
4646
* @param string $projectId Your Google Cloud project ID.
47-
* @param string $bucketName Google Cloud Storage Bucket used to store Compute Engine usage reports.
47+
* @param string $bucketName Google Cloud Storage bucket used to store Compute Engine usage reports.
4848
* An existing Google Cloud Storage bucket is required.
49-
* @param string $reportPrefixName Prefix of the usage report name which defaults to an empty string
49+
* @param string $reportNamePrefix Prefix of the usage report name which defaults to an empty string
5050
* to showcase default values behavior.
5151
*
5252
* @return \Google\Cloud\Compute\V1\Operation
@@ -56,15 +56,15 @@
5656
function set_usage_export_bucket(
5757
string $projectId,
5858
string $bucketName,
59-
string $reportPrefixName = ''
59+
string $reportNamePrefix = ''
6060
) {
6161
// Initialize UsageExportLocation object with provided bucket name and no report name prefix.
6262
$usageExportLocation = new UsageExportLocation(array(
6363
"bucket_name" => $bucketName,
64-
"report_name_prefix" => $reportPrefixName
64+
"report_name_prefix" => $reportNamePrefix
6565
));
6666

67-
if (strlen($reportPrefixName) == 0) {
67+
if (strlen($reportNamePrefix) == 0) {
6868
// Sending empty value for report_name_prefix results in the next usage report
6969
// being generated with the default prefix value "usage_gce".
7070
// See https://cloud.google.com/compute/docs/reference/rest/v1/projects/setUsageExportBucket
@@ -80,7 +80,7 @@ function set_usage_export_bucket(
8080

8181
# [START compute_usage_report_get]
8282
/**
83-
* Retrieve Compute Engine usage export bucket for the Cloud Project.
83+
* Retrieve Compute Engine usage export bucket for the Cloud project.
8484
* Replaces the empty value returned by the API with the default value used
8585
* to generate report file names.
8686
* Example:
@@ -96,11 +96,11 @@ function set_usage_export_bucket(
9696
*/
9797
function get_usage_export_bucket(string $projectId)
9898
{
99-
// Get the usage setting for the project from the server.
99+
// Get the usage export location for the project from the server.
100100
$projectsClient = new ProjectsClient();
101101
$projectResponse = $projectsClient->get($projectId);
102102

103-
// Construct proper values to be displayed, taking into account default values behavior.
103+
// Replace the empty value returned by the API with the default value used to generate report file names.
104104
if ($projectResponse->hasUsageExportLocation()) {
105105
$responseUsageExportLocation = $projectResponse->getUsageExportLocation();
106106

0 commit comments

Comments
 (0)