Skip to content

Commit a6d2d57

Browse files
feat: [Compute] Update Compute Engine v1 API to revision 20260227 (#1166) (#8983)
* feat: Update Compute Engine v1 API to revision 20260227 (#1166) Source-Link: googleapis/googleapis@1c9510a Source-Link: googleapis/googleapis-gen@6336891 Copy-Tag: eyJwIjoiQ29tcHV0ZS8uT3dsQm90LnlhbWwiLCJoIjoiNjMzNjg5MTFiMGNjMjI0OTg3YzIxNWMxZTFjN2JlNjZjYzU3YTc0OSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent aa8af3d commit a6d2d57

2,392 files changed

Lines changed: 22482 additions & 4624 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Compute/metadata/V1/Compute.php

562 KB
Binary file not shown.
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<?php
2+
/*
3+
* Copyright 2026 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
/*
19+
* GENERATED CODE WARNING
20+
* This file was automatically generated - do not edit!
21+
*/
22+
23+
require_once __DIR__ . '/../../../vendor/autoload.php';
24+
25+
// [START compute_v1_generated_RegionCompositeHealthChecks_AggregatedList_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\ApiCore\PagedListResponse;
28+
use Google\Cloud\Compute\V1\AggregatedListRegionCompositeHealthChecksRequest;
29+
use Google\Cloud\Compute\V1\Client\RegionCompositeHealthChecksClient;
30+
31+
/**
32+
* Retrieves the list of all CompositeHealthCheck resources (all
33+
* regional) available to the specified project.
34+
*
35+
* To prevent failure, it is recommended that you set the
36+
* `returnPartialSuccess` parameter to `true`.
37+
*
38+
* @param string $project Name of the project scoping this request.
39+
*/
40+
function aggregated_list_sample(string $project): void
41+
{
42+
// Create a client.
43+
$regionCompositeHealthChecksClient = new RegionCompositeHealthChecksClient();
44+
45+
// Prepare the request message.
46+
$request = (new AggregatedListRegionCompositeHealthChecksRequest())
47+
->setProject($project);
48+
49+
// Call the API and handle any network failures.
50+
try {
51+
/** @var PagedListResponse $response */
52+
$response = $regionCompositeHealthChecksClient->aggregatedList($request);
53+
54+
foreach ($response as $element) {
55+
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString());
56+
}
57+
} catch (ApiException $ex) {
58+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
59+
}
60+
}
61+
62+
/**
63+
* Helper to execute the sample.
64+
*
65+
* This sample has been automatically generated and should be regarded as a code
66+
* template only. It will require modifications to work:
67+
* - It may require correct/in-range values for request initialization.
68+
* - It may require specifying regional endpoints when creating the service client,
69+
* please see the apiEndpoint client configuration option for more details.
70+
*/
71+
function callSample(): void
72+
{
73+
$project = '[PROJECT]';
74+
75+
aggregated_list_sample($project);
76+
}
77+
// [END compute_v1_generated_RegionCompositeHealthChecks_AggregatedList_sync]
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
<?php
2+
/*
3+
* Copyright 2026 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
/*
19+
* GENERATED CODE WARNING
20+
* This file was automatically generated - do not edit!
21+
*/
22+
23+
require_once __DIR__ . '/../../../vendor/autoload.php';
24+
25+
// [START compute_v1_generated_RegionCompositeHealthChecks_Delete_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\ApiCore\OperationResponse;
28+
use Google\Cloud\Compute\V1\Client\RegionCompositeHealthChecksClient;
29+
use Google\Cloud\Compute\V1\DeleteRegionCompositeHealthCheckRequest;
30+
use Google\Rpc\Status;
31+
32+
/**
33+
* Deletes the specified CompositeHealthCheck in the given region
34+
*
35+
* @param string $compositeHealthCheck Name of the CompositeHealthCheck resource to delete.
36+
* @param string $project Project ID for this request.
37+
* @param string $region Name of the region scoping this request.
38+
*/
39+
function delete_sample(string $compositeHealthCheck, string $project, string $region): void
40+
{
41+
// Create a client.
42+
$regionCompositeHealthChecksClient = new RegionCompositeHealthChecksClient();
43+
44+
// Prepare the request message.
45+
$request = (new DeleteRegionCompositeHealthCheckRequest())
46+
->setCompositeHealthCheck($compositeHealthCheck)
47+
->setProject($project)
48+
->setRegion($region);
49+
50+
// Call the API and handle any network failures.
51+
try {
52+
/** @var OperationResponse $response */
53+
$response = $regionCompositeHealthChecksClient->delete($request);
54+
$response->pollUntilComplete();
55+
56+
if ($response->operationSucceeded()) {
57+
printf('Operation completed successfully.' . PHP_EOL);
58+
} else {
59+
/** @var Status $error */
60+
$error = $response->getError();
61+
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
62+
}
63+
} catch (ApiException $ex) {
64+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
65+
}
66+
}
67+
68+
/**
69+
* Helper to execute the sample.
70+
*
71+
* This sample has been automatically generated and should be regarded as a code
72+
* template only. It will require modifications to work:
73+
* - It may require correct/in-range values for request initialization.
74+
* - It may require specifying regional endpoints when creating the service client,
75+
* please see the apiEndpoint client configuration option for more details.
76+
*/
77+
function callSample(): void
78+
{
79+
$compositeHealthCheck = '[COMPOSITE_HEALTH_CHECK]';
80+
$project = '[PROJECT]';
81+
$region = '[REGION]';
82+
83+
delete_sample($compositeHealthCheck, $project, $region);
84+
}
85+
// [END compute_v1_generated_RegionCompositeHealthChecks_Delete_sync]
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<?php
2+
/*
3+
* Copyright 2026 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
/*
19+
* GENERATED CODE WARNING
20+
* This file was automatically generated - do not edit!
21+
*/
22+
23+
require_once __DIR__ . '/../../../vendor/autoload.php';
24+
25+
// [START compute_v1_generated_RegionCompositeHealthChecks_Get_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\Cloud\Compute\V1\Client\RegionCompositeHealthChecksClient;
28+
use Google\Cloud\Compute\V1\CompositeHealthCheck;
29+
use Google\Cloud\Compute\V1\GetRegionCompositeHealthCheckRequest;
30+
31+
/**
32+
* Returns the specified CompositeHealthCheck resource in the given region.
33+
*
34+
* @param string $compositeHealthCheck Name of the CompositeHealthCheck resource to return.
35+
* @param string $project Project ID for this request.
36+
* @param string $region Name of the region scoping this request.
37+
*/
38+
function get_sample(string $compositeHealthCheck, string $project, string $region): void
39+
{
40+
// Create a client.
41+
$regionCompositeHealthChecksClient = new RegionCompositeHealthChecksClient();
42+
43+
// Prepare the request message.
44+
$request = (new GetRegionCompositeHealthCheckRequest())
45+
->setCompositeHealthCheck($compositeHealthCheck)
46+
->setProject($project)
47+
->setRegion($region);
48+
49+
// Call the API and handle any network failures.
50+
try {
51+
/** @var CompositeHealthCheck $response */
52+
$response = $regionCompositeHealthChecksClient->get($request);
53+
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
54+
} catch (ApiException $ex) {
55+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
56+
}
57+
}
58+
59+
/**
60+
* Helper to execute the sample.
61+
*
62+
* This sample has been automatically generated and should be regarded as a code
63+
* template only. It will require modifications to work:
64+
* - It may require correct/in-range values for request initialization.
65+
* - It may require specifying regional endpoints when creating the service client,
66+
* please see the apiEndpoint client configuration option for more details.
67+
*/
68+
function callSample(): void
69+
{
70+
$compositeHealthCheck = '[COMPOSITE_HEALTH_CHECK]';
71+
$project = '[PROJECT]';
72+
$region = '[REGION]';
73+
74+
get_sample($compositeHealthCheck, $project, $region);
75+
}
76+
// [END compute_v1_generated_RegionCompositeHealthChecks_Get_sync]
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<?php
2+
/*
3+
* Copyright 2026 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
/*
19+
* GENERATED CODE WARNING
20+
* This file was automatically generated - do not edit!
21+
*/
22+
23+
require_once __DIR__ . '/../../../vendor/autoload.php';
24+
25+
// [START compute_v1_generated_RegionCompositeHealthChecks_Insert_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\ApiCore\OperationResponse;
28+
use Google\Cloud\Compute\V1\Client\RegionCompositeHealthChecksClient;
29+
use Google\Cloud\Compute\V1\CompositeHealthCheck;
30+
use Google\Cloud\Compute\V1\InsertRegionCompositeHealthCheckRequest;
31+
use Google\Rpc\Status;
32+
33+
/**
34+
* Create a CompositeHealthCheck in the specified project in the given region
35+
* using the parameters that are included in the request.
36+
*
37+
* @param string $project Project ID for this request.
38+
* @param string $region Name of the region scoping this request.
39+
*/
40+
function insert_sample(string $project, string $region): void
41+
{
42+
// Create a client.
43+
$regionCompositeHealthChecksClient = new RegionCompositeHealthChecksClient();
44+
45+
// Prepare the request message.
46+
$compositeHealthCheckResource = new CompositeHealthCheck();
47+
$request = (new InsertRegionCompositeHealthCheckRequest())
48+
->setCompositeHealthCheckResource($compositeHealthCheckResource)
49+
->setProject($project)
50+
->setRegion($region);
51+
52+
// Call the API and handle any network failures.
53+
try {
54+
/** @var OperationResponse $response */
55+
$response = $regionCompositeHealthChecksClient->insert($request);
56+
$response->pollUntilComplete();
57+
58+
if ($response->operationSucceeded()) {
59+
printf('Operation completed successfully.' . PHP_EOL);
60+
} else {
61+
/** @var Status $error */
62+
$error = $response->getError();
63+
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
64+
}
65+
} catch (ApiException $ex) {
66+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
67+
}
68+
}
69+
70+
/**
71+
* Helper to execute the sample.
72+
*
73+
* This sample has been automatically generated and should be regarded as a code
74+
* template only. It will require modifications to work:
75+
* - It may require correct/in-range values for request initialization.
76+
* - It may require specifying regional endpoints when creating the service client,
77+
* please see the apiEndpoint client configuration option for more details.
78+
*/
79+
function callSample(): void
80+
{
81+
$project = '[PROJECT]';
82+
$region = '[REGION]';
83+
84+
insert_sample($project, $region);
85+
}
86+
// [END compute_v1_generated_RegionCompositeHealthChecks_Insert_sync]

0 commit comments

Comments
 (0)