Skip to content

Commit

Permalink
feat: Update Compute Engine API to revision 20240220 (#886) (#7114)
Browse files Browse the repository at this point in the history
* feat: Update Compute Engine API to revision 20240220 (#886)
Source-Link: googleapis/googleapis@0df0f51
Source-Link: googleapis/googleapis-gen@b0b8f14
Copy-Tag: eyJwIjoiQ29tcHV0ZS8uT3dsQm90LnlhbWwiLCJoIjoiYjBiOGYxNDdhNzcxNjJiYmM2MDNjYzFlMDQ3NTJhMzYyMWUxMmViNSJ9
  • Loading branch information
gcf-owl-bot[bot] committed Mar 6, 2024
1 parent 62e2620 commit f2b474d
Show file tree
Hide file tree
Showing 422 changed files with 17,371 additions and 881 deletions.
Binary file modified Compute/metadata/V1/Compute.php
Binary file not shown.
Expand Up @@ -28,7 +28,7 @@
use Google\Cloud\Compute\V1\AcceleratorTypesClient;

/**
* Retrieves an aggregated list of accelerator types.
* Retrieves an aggregated list of accelerator types. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.
*
* @param string $project Project ID for this request.
*/
Expand Down
2 changes: 1 addition & 1 deletion Compute/samples/V1/AddressesClient/aggregated_list.php
Expand Up @@ -28,7 +28,7 @@
use Google\Cloud\Compute\V1\AddressesClient;

/**
* Retrieves an aggregated list of addresses.
* Retrieves an aggregated list of addresses. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.
*
* @param string $project Project ID for this request.
*/
Expand Down
2 changes: 1 addition & 1 deletion Compute/samples/V1/AutoscalersClient/aggregated_list.php
Expand Up @@ -28,7 +28,7 @@
use Google\Cloud\Compute\V1\AutoscalersClient;

/**
* Retrieves an aggregated list of autoscalers.
* Retrieves an aggregated list of autoscalers. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.
*
* @param string $project Project ID for this request.
*/
Expand Down
Expand Up @@ -28,7 +28,7 @@
use Google\Cloud\Compute\V1\BackendServicesClient;

/**
* Retrieves the list of all BackendService resources, regional and global, available to the specified project.
* Retrieves the list of all BackendService resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.
*
* @param string $project Name of the project scoping this request.
*/
Expand Down
2 changes: 1 addition & 1 deletion Compute/samples/V1/DiskTypesClient/aggregated_list.php
Expand Up @@ -28,7 +28,7 @@
use Google\Cloud\Compute\V1\DiskTypesClient;

/**
* Retrieves an aggregated list of disk types.
* Retrieves an aggregated list of disk types. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.
*
* @param string $project Project ID for this request.
*/
Expand Down
2 changes: 1 addition & 1 deletion Compute/samples/V1/DisksClient/aggregated_list.php
Expand Up @@ -28,7 +28,7 @@
use Google\Cloud\Compute\V1\DisksClient;

/**
* Retrieves an aggregated list of persistent disks.
* Retrieves an aggregated list of persistent disks. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.
*
* @param string $project Project ID for this request.
*/
Expand Down
Expand Up @@ -28,7 +28,7 @@
use Google\Cloud\Compute\V1\ForwardingRulesClient;

/**
* Retrieves an aggregated list of forwarding rules.
* Retrieves an aggregated list of forwarding rules. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.
*
* @param string $project Project ID for this request.
*/
Expand Down
Expand Up @@ -28,7 +28,7 @@
use Google\Cloud\Compute\V1\GlobalOperationsClient;

/**
* Retrieves an aggregated list of all operations.
* Retrieves an aggregated list of all operations. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.
*
* @param string $project Project ID for this request.
*/
Expand Down
2 changes: 1 addition & 1 deletion Compute/samples/V1/HealthChecksClient/aggregated_list.php
Expand Up @@ -28,7 +28,7 @@
use Google\Cloud\Compute\V1\HealthChecksClient;

/**
* Retrieves the list of all HealthCheck resources, regional and global, available to the specified project.
* Retrieves the list of all HealthCheck resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.
*
* @param string $project Name of the project scoping this request.
*/
Expand Down
Expand Up @@ -28,7 +28,7 @@
use Google\Cloud\Compute\V1\InstanceGroupManagersClient;

/**
* Retrieves the list of managed instance groups and groups them by zone.
* Retrieves the list of managed instance groups and groups them by zone. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.
*
* @param string $project Project ID for this request.
*/
Expand Down
Expand Up @@ -28,7 +28,7 @@
use Google\Cloud\Compute\V1\InstanceGroupsClient;

/**
* Retrieves the list of instance groups and sorts them by zone.
* Retrieves the list of instance groups and sorts them by zone. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.
*
* @param string $project Project ID for this request.
*/
Expand Down
Expand Up @@ -28,7 +28,7 @@
use Google\Cloud\Compute\V1\InstanceTemplatesClient;

/**
* Retrieves the list of all InstanceTemplates resources, regional and global, available to the specified project.
* Retrieves the list of all InstanceTemplates resources, regional and global, available to the specified project. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.
*
* @param string $project Name of the project scoping this request.
*/
Expand Down
2 changes: 1 addition & 1 deletion Compute/samples/V1/InstancesClient/aggregated_list.php
Expand Up @@ -28,7 +28,7 @@
use Google\Cloud\Compute\V1\InstancesClient;

/**
* Retrieves an aggregated list of all of the instances in your project across all regions and zones. The performance of this method degrades when a filter is specified on a project that has a very large number of instances.
* Retrieves an aggregated list of all of the instances in your project across all regions and zones. The performance of this method degrades when a filter is specified on a project that has a very large number of instances. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.
*
* @param string $project Project ID for this request.
*/
Expand Down
68 changes: 68 additions & 0 deletions Compute/samples/V1/InstantSnapshotsClient/aggregated_list.php
@@ -0,0 +1,68 @@
<?php
/*
* Copyright 2024 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_InstantSnapshots_AggregatedList_sync]
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\Compute\V1\InstantSnapshotsClient;

/**
* Retrieves an aggregated list of instantSnapshots. To prevent failure, Google recommends that you set the `returnPartialSuccess` parameter to `true`.
*
* @param string $project Project ID for this request.
*/
function aggregated_list_sample(string $project): void
{
// Create a client.
$instantSnapshotsClient = new InstantSnapshotsClient();

// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $instantSnapshotsClient->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_InstantSnapshots_AggregatedList_sync]
78 changes: 78 additions & 0 deletions Compute/samples/V1/InstantSnapshotsClient/delete.php
@@ -0,0 +1,78 @@
<?php
/*
* Copyright 2024 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_InstantSnapshots_Delete_sync]
use Google\ApiCore\ApiException;
use Google\ApiCore\OperationResponse;
use Google\Cloud\Compute\V1\InstantSnapshotsClient;
use Google\Rpc\Status;

/**
* Deletes the specified InstantSnapshot resource. Keep in mind that deleting a single instantSnapshot might not necessarily delete all the data on that instantSnapshot. If any data on the instantSnapshot that is marked for deletion is needed for subsequent instantSnapshots, the data will be moved to the next corresponding instantSnapshot. For more information, see Deleting instantSnapshots.
*
* @param string $instantSnapshot Name of the InstantSnapshot resource to delete.
* @param string $project Project ID for this request.
* @param string $zone The name of the zone for this request.
*/
function delete_sample(string $instantSnapshot, string $project, string $zone): void
{
// Create a client.
$instantSnapshotsClient = new InstantSnapshotsClient();

// Call the API and handle any network failures.
try {
/** @var OperationResponse $response */
$response = $instantSnapshotsClient->delete($instantSnapshot, $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
{
$instantSnapshot = '[INSTANT_SNAPSHOT]';
$project = '[PROJECT]';
$zone = '[ZONE]';

delete_sample($instantSnapshot, $project, $zone);
}
// [END compute_v1_generated_InstantSnapshots_Delete_sync]
69 changes: 69 additions & 0 deletions Compute/samples/V1/InstantSnapshotsClient/get.php
@@ -0,0 +1,69 @@
<?php
/*
* Copyright 2024 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_InstantSnapshots_Get_sync]
use Google\ApiCore\ApiException;
use Google\Cloud\Compute\V1\InstantSnapshot;
use Google\Cloud\Compute\V1\InstantSnapshotsClient;

/**
* Returns the specified InstantSnapshot resource in the specified zone.
*
* @param string $instantSnapshot Name of the InstantSnapshot resource to return.
* @param string $project Project ID for this request.
* @param string $zone The name of the zone for this request.
*/
function get_sample(string $instantSnapshot, string $project, string $zone): void
{
// Create a client.
$instantSnapshotsClient = new InstantSnapshotsClient();

// Call the API and handle any network failures.
try {
/** @var InstantSnapshot $response */
$response = $instantSnapshotsClient->get($instantSnapshot, $project, $zone);
printf('Response data: %s' . PHP_EOL, $response->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
{
$instantSnapshot = '[INSTANT_SNAPSHOT]';
$project = '[PROJECT]';
$zone = '[ZONE]';

get_sample($instantSnapshot, $project, $zone);
}
// [END compute_v1_generated_InstantSnapshots_Get_sync]

0 comments on commit f2b474d

Please sign in to comment.