Skip to content

Commit

Permalink
feat: Update Compute Engine API to revision 20230307 (#770) (#5973)
Browse files Browse the repository at this point in the history
Source-Link: googleapis/googleapis@c2016e5
Source-Link: googleapis/googleapis-gen@0885fd7
Copy-Tag: eyJwIjoiQ29tcHV0ZS8uT3dsQm90LnlhbWwiLCJoIjoiMDg4NWZkN2FlOGE4MDVhMzc3OTc0ZWRmYmE2MGFiN2M5MzI3Zjc1YSJ9
  • Loading branch information
gcf-owl-bot[bot] committed Mar 20, 2023
1 parent a66e6b8 commit f6d8866
Show file tree
Hide file tree
Showing 185 changed files with 6,667 additions and 219 deletions.
Binary file modified Compute/metadata/V1/Compute.php
Binary file not shown.
2 changes: 1 addition & 1 deletion Compute/samples/V1/AutoscalersClient/get.php
Expand Up @@ -28,7 +28,7 @@
use Google\Cloud\Compute\V1\AutoscalersClient;

/**
* Returns the specified autoscaler resource. Gets a list of available autoscalers by making a list() request.
* Returns the specified autoscaler resource.
*
* @param string $autoscaler Name of the autoscaler to return.
* @param string $project Project ID for this request.
Expand Down
2 changes: 1 addition & 1 deletion Compute/samples/V1/BackendBucketsClient/get.php
Expand Up @@ -28,7 +28,7 @@
use Google\Cloud\Compute\V1\BackendBucketsClient;

/**
* Returns the specified BackendBucket resource. Gets a list of available backend buckets by making a list() request.
* Returns the specified BackendBucket resource.
*
* @param string $backendBucket Name of the BackendBucket resource to return.
* @param string $project Project ID for this request.
Expand Down
2 changes: 1 addition & 1 deletion Compute/samples/V1/BackendServicesClient/get.php
Expand Up @@ -28,7 +28,7 @@
use Google\Cloud\Compute\V1\BackendServicesClient;

/**
* Returns the specified BackendService resource. Gets a list of available backend services.
* Returns the specified BackendService resource.
*
* @param string $backendService Name of the BackendService resource to return.
* @param string $project Project ID for this request.
Expand Down
2 changes: 1 addition & 1 deletion Compute/samples/V1/DiskTypesClient/get.php
Expand Up @@ -28,7 +28,7 @@
use Google\Cloud\Compute\V1\DiskTypesClient;

/**
* Returns the specified disk type. Gets a list of available disk types by making a list() request.
* Returns the specified disk type.
*
* @param string $diskType Name of the disk type to return.
* @param string $project Project ID for this request.
Expand Down
2 changes: 1 addition & 1 deletion Compute/samples/V1/DisksClient/get.php
Expand Up @@ -28,7 +28,7 @@
use Google\Cloud\Compute\V1\DisksClient;

/**
* Returns a specified persistent disk. Gets a list of available persistent disks by making a list() request.
* Returns the specified persistent disk.
*
* @param string $disk Name of the persistent disk to return.
* @param string $project Project ID for this request.
Expand Down
82 changes: 82 additions & 0 deletions Compute/samples/V1/DisksClient/update.php
@@ -0,0 +1,82 @@
<?php
/*
* Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/*
* GENERATED CODE WARNING
* This file was automatically generated - do not edit!
*/

require_once __DIR__ . '/../../../vendor/autoload.php';

// [START compute_v1_generated_Disks_Update_sync]
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Compute\V1\Disk;
use Google\Cloud\Compute\V1\DisksClient;
use Google\Rpc\Status;

/**
* Updates the specified disk with the data included in the request. The update is performed only on selected fields included as part of update-mask. Only the following fields can be modified: user_license.
*
* @param string $disk The disk name for this request.
* @param string $project Project ID for this request.
* @param string $zone The name of the zone for this request.
*/
function update_sample(string $disk, string $project, string $zone): void
{
// Create a client.
$disksClient = new DisksClient();

// Prepare any non-scalar elements to be passed along with the request.
$diskResource = new Disk();

// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $disksClient->update($disk, $diskResource, $project, $zone);
$response->pollUntilComplete();

if ($response->operationSucceeded()) {
printf('Operation completed successfully.' . PHP_EOL);
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}

/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$disk = '[DISK]';
$project = '[PROJECT]';
$zone = '[ZONE]';

update_sample($disk, $project, $zone);
}
// [END compute_v1_generated_Disks_Update_sync]
2 changes: 1 addition & 1 deletion Compute/samples/V1/FirewallPoliciesClient/move.php
Expand Up @@ -32,7 +32,7 @@
* Moves the specified firewall policy.
*
* @param string $firewallPolicy Name of the firewall policy to update.
* @param string $parentId The new parent of the firewall policy.
* @param string $parentId The new parent of the firewall policy. The ID can be either be "folders/[FOLDER_ID]" if the parent is a folder or "organizations/[ORGANIZATION_ID]" if the parent is an organization.
*/
function move_sample(string $firewallPolicy, string $parentId): void
{
Expand Down
2 changes: 1 addition & 1 deletion Compute/samples/V1/GlobalAddressesClient/get.php
Expand Up @@ -28,7 +28,7 @@
use Google\Cloud\Compute\V1\GlobalAddressesClient;

/**
* Returns the specified address resource. Gets a list of available addresses by making a list() request.
* Returns the specified address resource.
*
* @param string $address Name of the address resource to return.
* @param string $project Project ID for this request.
Expand Down
Expand Up @@ -28,7 +28,7 @@
use Google\Cloud\Compute\V1\NetworkEndpointGroup;

/**
* Returns the specified network endpoint group. Gets a list of available network endpoint groups by making a list() request.
* Returns the specified network endpoint group.
*
* @param string $networkEndpointGroup The name of the network endpoint group. It should comply with RFC1035.
* @param string $project Project ID for this request.
Expand Down
2 changes: 1 addition & 1 deletion Compute/samples/V1/HealthChecksClient/get.php
Expand Up @@ -28,7 +28,7 @@
use Google\Cloud\Compute\V1\HealthChecksClient;

/**
* Returns the specified HealthCheck resource. Gets a list of available health checks by making a list() request.
* Returns the specified HealthCheck resource.
*
* @param string $healthCheck Name of the HealthCheck resource to return.
* @param string $project Project ID for this request.
Expand Down
2 changes: 1 addition & 1 deletion Compute/samples/V1/ImagesClient/get.php
Expand Up @@ -28,7 +28,7 @@
use Google\Cloud\Compute\V1\ImagesClient;

/**
* Returns the specified image. Gets a list of available images by making a list() request.
* Returns the specified image.
*
* @param string $image Name of the image resource to return.
* @param string $project Project ID for this request.
Expand Down
4 changes: 2 additions & 2 deletions Compute/samples/V1/ImagesClient/get_from_family.php
Expand Up @@ -28,10 +28,10 @@
use Google\Cloud\Compute\V1\ImagesClient;

/**
* Returns the latest image that is part of an image family and is not deprecated.
* Returns the latest image that is part of an image family and is not deprecated. For more information on image families, see Public image families documentation.
*
* @param string $family Name of the image family to search for.
* @param string $project Project ID for this request.
* @param string $project The image project that the image belongs to. For example, to get a CentOS image, specify centos-cloud as the image project.
*/
function get_from_family_sample(string $family, string $project): void
{
Expand Down
2 changes: 1 addition & 1 deletion Compute/samples/V1/InstanceGroupManagersClient/get.php
Expand Up @@ -28,7 +28,7 @@
use Google\Cloud\Compute\V1\InstanceGroupManagersClient;

/**
* Returns all of the details about the specified managed instance group. Gets a list of available managed instance groups by making a list() request.
* Returns all of the details about the specified managed instance group.
*
* @param string $instanceGroupManager The name of the managed instance group.
* @param string $project Project ID for this request.
Expand Down
68 changes: 68 additions & 0 deletions Compute/samples/V1/InstanceTemplatesClient/aggregated_list.php
@@ -0,0 +1,68 @@
<?php
/*
* Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/*
* GENERATED CODE WARNING
* This file was automatically generated - do not edit!
*/

require_once __DIR__ . '/../../../vendor/autoload.php';

// [START compute_v1_generated_InstanceTemplates_AggregatedList_sync]
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Compute\V1\InstanceTemplatesClient;

/**
* Retrieves the list of all InstanceTemplates resources, regional and global, available to the specified project.
*
* @param string $project Name of the project scoping this request.
*/
function aggregated_list_sample(string $project): void
{
// Create a client.
$instanceTemplatesClient = new InstanceTemplatesClient();

// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $instanceTemplatesClient->aggregatedList($project);

foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}

/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$project = '[PROJECT]';

aggregated_list_sample($project);
}
// [END compute_v1_generated_InstanceTemplates_AggregatedList_sync]
2 changes: 1 addition & 1 deletion Compute/samples/V1/InstanceTemplatesClient/get.php
Expand Up @@ -28,7 +28,7 @@
use Google\Cloud\Compute\V1\InstanceTemplatesClient;

/**
* Returns the specified instance template. Gets a list of available instance templates by making a list() request.
* Returns the specified instance template.
*
* @param string $instanceTemplate The name of the instance template.
* @param string $project Project ID for this request.
Expand Down
2 changes: 1 addition & 1 deletion Compute/samples/V1/InstancesClient/get.php
Expand Up @@ -28,7 +28,7 @@
use Google\Cloud\Compute\V1\InstancesClient;

/**
* Returns the specified Instance resource. Gets a list of available instances by making a list() request.
* Returns the specified Instance resource.
*
* @param string $instance Name of the instance resource to return.
* @param string $project Project ID for this request.
Expand Down
82 changes: 82 additions & 0 deletions Compute/samples/V1/InstancesClient/set_name.php
@@ -0,0 +1,82 @@
<?php
/*
* Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

/*
* GENERATED CODE WARNING
* This file was automatically generated - do not edit!
*/

require_once __DIR__ . '/../../../vendor/autoload.php';

// [START compute_v1_generated_Instances_SetName_sync]
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Compute\V1\InstancesClient;
use Google\Cloud\Compute\V1\InstancesSetNameRequest;
use Google\Rpc\Status;

/**
* Sets name of an instance.
*
* @param string $instance The instance name for this request.
* @param string $project Project ID for this request.
* @param string $zone The name of the zone for this request.
*/
function set_name_sample(string $instance, string $project, string $zone): void
{
// Create a client.
$instancesClient = new InstancesClient();

// Prepare any non-scalar elements to be passed along with the request.
$instancesSetNameRequestResource = new InstancesSetNameRequest();

// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $instancesClient->setName($instance, $instancesSetNameRequestResource, $project, $zone);
$response->pollUntilComplete();

if ($response->operationSucceeded()) {
printf('Operation completed successfully.' . PHP_EOL);
} else {
/** @var Status $error */
$error = $response->getError();
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
}
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}

/**
* Helper to execute the sample.
*
* This sample has been automatically generated and should be regarded as a code
* template only. It will require modifications to work:
* - It may require correct/in-range values for request initialization.
* - It may require specifying regional endpoints when creating the service client,
* please see the apiEndpoint client configuration option for more details.
*/
function callSample(): void
{
$instance = '[INSTANCE]';
$project = '[PROJECT]';
$zone = '[ZONE]';

set_name_sample($instance, $project, $zone);
}
// [END compute_v1_generated_Instances_SetName_sync]
2 changes: 1 addition & 1 deletion Compute/samples/V1/MachineImagesClient/get.php
Expand Up @@ -28,7 +28,7 @@
use Google\Cloud\Compute\V1\MachineImagesClient;

/**
* Returns the specified machine image. Gets a list of available machine images by making a list() request.
* Returns the specified machine image.
*
* @param string $machineImage The name of the machine image.
* @param string $project Project ID for this request.
Expand Down
2 changes: 1 addition & 1 deletion Compute/samples/V1/MachineTypesClient/get.php
Expand Up @@ -28,7 +28,7 @@
use Google\Cloud\Compute\V1\MachineTypesClient;

/**
* Returns the specified machine type. Gets a list of available machine types by making a list() request.
* Returns the specified machine type.
*
* @param string $machineType Name of the machine type to return.
* @param string $project Project ID for this request.
Expand Down
2 changes: 1 addition & 1 deletion Compute/samples/V1/NetworkEndpointGroupsClient/get.php
Expand Up @@ -28,7 +28,7 @@
use Google\Cloud\Compute\V1\NetworkEndpointGroupsClient;

/**
* Returns the specified network endpoint group. Gets a list of available network endpoint groups by making a list() request.
* Returns the specified network endpoint group.
*
* @param string $networkEndpointGroup The name of the network endpoint group. It should comply with RFC1035.
* @param string $project Project ID for this request.
Expand Down

0 comments on commit f6d8866

Please sign in to comment.