Skip to content

Commit 38d772f

Browse files
committed
Adding region tags for use on Google Cloud documentation pages + minor comments tweaks.
1 parent 31550a3 commit 38d772f

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
namespace Google\Cloud\Samples\Compute;
2525

26+
# [START compute_instances_create]
2627
use Google\Cloud\Compute\V1\InstancesClient;
2728
use Google\Cloud\Compute\V1\AttachedDisk;
2829
use Google\Cloud\Compute\V1\AttachedDiskInitializeParams;
@@ -37,11 +38,13 @@
3738
* ```
3839
*
3940
* @param string $projectId Your Google Cloud project ID.
40-
* @param string $zone The zone to create the instance in (e.g. "us-central1-a")
41+
* @param string $zone The zone to create the instance in (e.g. "us-central1-a").
4142
* @param string $instanceName The unique name for this Compute instance.
42-
* @param string $machineType Instance machine type
43-
* @param string $sourceImage Boot disk image name or family
43+
* @param string $machineType Instance machine type.
44+
* @param string $sourceImage Boot disk image name or family.
4445
* @param string $networkName The Compute instance ID.
46+
*
47+
* @throws \Google\ApiCore\ApiException if the remote call fails.
4548
*/
4649
function create_instance(
4750
string $projectId,
@@ -80,6 +83,7 @@ function create_instance(
8083

8184
printf('Created instance %s' . PHP_EOL, $instanceName);
8285
}
86+
# [END compute_instances_create]
8387

8488
require_once __DIR__ . '/../../../../testing/sample_helpers.php';
85-
\Google\Cloud\Samples\execute_sample(__FILE__, __NAMESPACE__, $argv);
89+
\Google\Cloud\Samples\execute_sample(__FILE__, __NAMESPACE__, $argv);

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
namespace Google\Cloud\Samples\Compute;
2525

26+
# [START compute_instances_delete]
2627
use Google\Cloud\Compute\V1\InstancesClient;
2728

2829
/**
@@ -33,8 +34,10 @@
3334
* ```
3435
*
3536
* @param string $projectId Your Google Cloud project ID.
36-
* @param string $zone The zone to delete the instance in (e.g. "us-central1-a")
37+
* @param string $zone The zone to delete the instance in (e.g. "us-central1-a").
3738
* @param string $instanceName The unique name for the Compute instance to delete.
39+
*
40+
* @throws \Google\ApiCore\ApiException if the remote call fails.
3841
*/
3942
function delete_instance(
4043
string $projectId,
@@ -49,6 +52,7 @@ function delete_instance(
4952

5053
printf('Deleted instance %s' . PHP_EOL, $instanceName);
5154
}
55+
# [END compute_instances_delete]
5256

5357
require_once __DIR__ . '/../../../../testing/sample_helpers.php';
5458
\Google\Cloud\Samples\execute_sample(__FILE__, __NAMESPACE__, $argv);

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,20 @@
2323

2424
namespace Google\Cloud\Samples\Compute;
2525

26+
# [START compute_instances_list]
2627
use Google\Cloud\Compute\V1\InstancesClient;
2728

2829
/**
29-
* Creates an instance.
30+
* List instances for particular $projectId and $zone
3031
* Example:
3132
* ```
3233
* list_instances($projectId, $zone);
3334
* ```
3435
*
3536
* @param string $projectId Your Google Cloud project ID.
36-
* @param string $zone The zone to list the instance in (e.g. "us-central1-a")
37+
* @param string $zone The zone to list the instance in (e.g. "us-central1-a").
38+
*
39+
* @throws \Google\ApiCore\ApiException if the remote call fails.
3740
*/
3841
function list_instances(string $projectId, string $zone)
3942
{
@@ -46,6 +49,7 @@ function list_instances(string $projectId, string $zone)
4649
printf(' - %s' . PHP_EOL, $instance->getName());
4750
}
4851
}
52+
# [END compute_instances_list]
4953

5054
require_once __DIR__ . '/../../../../testing/sample_helpers.php';
5155
\Google\Cloud\Samples\execute_sample(__FILE__, __NAMESPACE__, $argv);

0 commit comments

Comments
 (0)