Skip to content

Commit 10c85c9

Browse files
feat: [Compute] Update Compute Engine v1 API to revision 20250916 (#1107) (#8652)
* feat: Update Compute Engine v1 API to revision 20250916 (#1107) Source-Link: googleapis/googleapis@a23c956 Source-Link: googleapis/googleapis-gen@eca33e4 Copy-Tag: eyJwIjoiQ29tcHV0ZS8uT3dsQm90LnlhbWwiLCJoIjoiZWNhMzNlNDdmMTEzY2YxYjBhOGQzMzk0M2QxZjAzNzhjMTJhM2UzOCJ9 * 🦉 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 00cb3be commit 10c85c9

92 files changed

Lines changed: 13016 additions & 1 deletion

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

13.8 KB
Binary file not shown.
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<?php
2+
/*
3+
* Copyright 2025 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_BackendServices_GetEffectiveSecurityPolicies_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\Cloud\Compute\V1\Client\BackendServicesClient;
28+
use Google\Cloud\Compute\V1\GetEffectiveSecurityPoliciesBackendServiceRequest;
29+
use Google\Cloud\Compute\V1\GetEffectiveSecurityPoliciesBackendServiceResponse;
30+
31+
/**
32+
* Returns effective security policies applied to this backend service.
33+
*
34+
* @param string $backendService Name of the Backend Service for this request.
35+
* @param string $project Project ID for this request.
36+
*/
37+
function get_effective_security_policies_sample(string $backendService, string $project): void
38+
{
39+
// Create a client.
40+
$backendServicesClient = new BackendServicesClient();
41+
42+
// Prepare the request message.
43+
$request = (new GetEffectiveSecurityPoliciesBackendServiceRequest())
44+
->setBackendService($backendService)
45+
->setProject($project);
46+
47+
// Call the API and handle any network failures.
48+
try {
49+
/** @var GetEffectiveSecurityPoliciesBackendServiceResponse $response */
50+
$response = $backendServicesClient->getEffectiveSecurityPolicies($request);
51+
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
52+
} catch (ApiException $ex) {
53+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
54+
}
55+
}
56+
57+
/**
58+
* Helper to execute the sample.
59+
*
60+
* This sample has been automatically generated and should be regarded as a code
61+
* template only. It will require modifications to work:
62+
* - It may require correct/in-range values for request initialization.
63+
* - It may require specifying regional endpoints when creating the service client,
64+
* please see the apiEndpoint client configuration option for more details.
65+
*/
66+
function callSample(): void
67+
{
68+
$backendService = '[BACKEND_SERVICE]';
69+
$project = '[PROJECT]';
70+
71+
get_effective_security_policies_sample($backendService, $project);
72+
}
73+
// [END compute_v1_generated_BackendServices_GetEffectiveSecurityPolicies_sync]
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
<?php
2+
/*
3+
* Copyright 2025 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_OrganizationSecurityPolicies_AddAssociation_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\ApiCore\OperationResponse;
28+
use Google\Cloud\Compute\V1\AddAssociationOrganizationSecurityPolicyRequest;
29+
use Google\Cloud\Compute\V1\Client\OrganizationSecurityPoliciesClient;
30+
use Google\Cloud\Compute\V1\SecurityPolicyAssociation;
31+
use Google\Rpc\Status;
32+
33+
/**
34+
* Inserts an association for the specified security policy. This has billing implications. Projects in the hierarchy with effective hierarchical security policies will be automatically enrolled into Cloud Armor Enterprise if not already enrolled. Use of this API to modify firewall policies is deprecated. Use firewallPolicies.addAssociation instead if possible.
35+
*
36+
* @param string $securityPolicy Name of the security policy to update.
37+
*/
38+
function add_association_sample(string $securityPolicy): void
39+
{
40+
// Create a client.
41+
$organizationSecurityPoliciesClient = new OrganizationSecurityPoliciesClient();
42+
43+
// Prepare the request message.
44+
$securityPolicyAssociationResource = new SecurityPolicyAssociation();
45+
$request = (new AddAssociationOrganizationSecurityPolicyRequest())
46+
->setSecurityPolicy($securityPolicy)
47+
->setSecurityPolicyAssociationResource($securityPolicyAssociationResource);
48+
49+
// Call the API and handle any network failures.
50+
try {
51+
/** @var OperationResponse $response */
52+
$response = $organizationSecurityPoliciesClient->addAssociation($request);
53+
$response->pollUntilComplete();
54+
55+
if ($response->operationSucceeded()) {
56+
printf('Operation completed successfully.' . PHP_EOL);
57+
} else {
58+
/** @var Status $error */
59+
$error = $response->getError();
60+
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
61+
}
62+
} catch (ApiException $ex) {
63+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
64+
}
65+
}
66+
67+
/**
68+
* Helper to execute the sample.
69+
*
70+
* This sample has been automatically generated and should be regarded as a code
71+
* template only. It will require modifications to work:
72+
* - It may require correct/in-range values for request initialization.
73+
* - It may require specifying regional endpoints when creating the service client,
74+
* please see the apiEndpoint client configuration option for more details.
75+
*/
76+
function callSample(): void
77+
{
78+
$securityPolicy = '[SECURITY_POLICY]';
79+
80+
add_association_sample($securityPolicy);
81+
}
82+
// [END compute_v1_generated_OrganizationSecurityPolicies_AddAssociation_sync]
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
<?php
2+
/*
3+
* Copyright 2025 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_OrganizationSecurityPolicies_AddRule_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\ApiCore\OperationResponse;
28+
use Google\Cloud\Compute\V1\AddRuleOrganizationSecurityPolicyRequest;
29+
use Google\Cloud\Compute\V1\Client\OrganizationSecurityPoliciesClient;
30+
use Google\Cloud\Compute\V1\SecurityPolicyRule;
31+
use Google\Rpc\Status;
32+
33+
/**
34+
* Inserts a rule into a security policy.
35+
*
36+
* @param string $securityPolicy Name of the security policy to update.
37+
*/
38+
function add_rule_sample(string $securityPolicy): void
39+
{
40+
// Create a client.
41+
$organizationSecurityPoliciesClient = new OrganizationSecurityPoliciesClient();
42+
43+
// Prepare the request message.
44+
$securityPolicyRuleResource = new SecurityPolicyRule();
45+
$request = (new AddRuleOrganizationSecurityPolicyRequest())
46+
->setSecurityPolicy($securityPolicy)
47+
->setSecurityPolicyRuleResource($securityPolicyRuleResource);
48+
49+
// Call the API and handle any network failures.
50+
try {
51+
/** @var OperationResponse $response */
52+
$response = $organizationSecurityPoliciesClient->addRule($request);
53+
$response->pollUntilComplete();
54+
55+
if ($response->operationSucceeded()) {
56+
printf('Operation completed successfully.' . PHP_EOL);
57+
} else {
58+
/** @var Status $error */
59+
$error = $response->getError();
60+
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
61+
}
62+
} catch (ApiException $ex) {
63+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
64+
}
65+
}
66+
67+
/**
68+
* Helper to execute the sample.
69+
*
70+
* This sample has been automatically generated and should be regarded as a code
71+
* template only. It will require modifications to work:
72+
* - It may require correct/in-range values for request initialization.
73+
* - It may require specifying regional endpoints when creating the service client,
74+
* please see the apiEndpoint client configuration option for more details.
75+
*/
76+
function callSample(): void
77+
{
78+
$securityPolicy = '[SECURITY_POLICY]';
79+
80+
add_rule_sample($securityPolicy);
81+
}
82+
// [END compute_v1_generated_OrganizationSecurityPolicies_AddRule_sync]
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<?php
2+
/*
3+
* Copyright 2025 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_OrganizationSecurityPolicies_CopyRules_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\ApiCore\OperationResponse;
28+
use Google\Cloud\Compute\V1\Client\OrganizationSecurityPoliciesClient;
29+
use Google\Cloud\Compute\V1\CopyRulesOrganizationSecurityPolicyRequest;
30+
use Google\Rpc\Status;
31+
32+
/**
33+
* Copies rules to the specified security policy. Use of this API to modify firewall policies is deprecated. Use firewallPolicies.copyRules instead.
34+
*
35+
* @param string $securityPolicy Name of the security policy to update.
36+
*/
37+
function copy_rules_sample(string $securityPolicy): void
38+
{
39+
// Create a client.
40+
$organizationSecurityPoliciesClient = new OrganizationSecurityPoliciesClient();
41+
42+
// Prepare the request message.
43+
$request = (new CopyRulesOrganizationSecurityPolicyRequest())
44+
->setSecurityPolicy($securityPolicy);
45+
46+
// Call the API and handle any network failures.
47+
try {
48+
/** @var OperationResponse $response */
49+
$response = $organizationSecurityPoliciesClient->copyRules($request);
50+
$response->pollUntilComplete();
51+
52+
if ($response->operationSucceeded()) {
53+
printf('Operation completed successfully.' . PHP_EOL);
54+
} else {
55+
/** @var Status $error */
56+
$error = $response->getError();
57+
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
58+
}
59+
} catch (ApiException $ex) {
60+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
61+
}
62+
}
63+
64+
/**
65+
* Helper to execute the sample.
66+
*
67+
* This sample has been automatically generated and should be regarded as a code
68+
* template only. It will require modifications to work:
69+
* - It may require correct/in-range values for request initialization.
70+
* - It may require specifying regional endpoints when creating the service client,
71+
* please see the apiEndpoint client configuration option for more details.
72+
*/
73+
function callSample(): void
74+
{
75+
$securityPolicy = '[SECURITY_POLICY]';
76+
77+
copy_rules_sample($securityPolicy);
78+
}
79+
// [END compute_v1_generated_OrganizationSecurityPolicies_CopyRules_sync]
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<?php
2+
/*
3+
* Copyright 2025 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_OrganizationSecurityPolicies_Delete_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\ApiCore\OperationResponse;
28+
use Google\Cloud\Compute\V1\Client\OrganizationSecurityPoliciesClient;
29+
use Google\Cloud\Compute\V1\DeleteOrganizationSecurityPolicyRequest;
30+
use Google\Rpc\Status;
31+
32+
/**
33+
* Deletes the specified policy. Use of this API to remove firewall policies is deprecated. Use firewallPolicies.delete instead.
34+
*
35+
* @param string $securityPolicy Name of the security policy to delete.
36+
*/
37+
function delete_sample(string $securityPolicy): void
38+
{
39+
// Create a client.
40+
$organizationSecurityPoliciesClient = new OrganizationSecurityPoliciesClient();
41+
42+
// Prepare the request message.
43+
$request = (new DeleteOrganizationSecurityPolicyRequest())
44+
->setSecurityPolicy($securityPolicy);
45+
46+
// Call the API and handle any network failures.
47+
try {
48+
/** @var OperationResponse $response */
49+
$response = $organizationSecurityPoliciesClient->delete($request);
50+
$response->pollUntilComplete();
51+
52+
if ($response->operationSucceeded()) {
53+
printf('Operation completed successfully.' . PHP_EOL);
54+
} else {
55+
/** @var Status $error */
56+
$error = $response->getError();
57+
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
58+
}
59+
} catch (ApiException $ex) {
60+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
61+
}
62+
}
63+
64+
/**
65+
* Helper to execute the sample.
66+
*
67+
* This sample has been automatically generated and should be regarded as a code
68+
* template only. It will require modifications to work:
69+
* - It may require correct/in-range values for request initialization.
70+
* - It may require specifying regional endpoints when creating the service client,
71+
* please see the apiEndpoint client configuration option for more details.
72+
*/
73+
function callSample(): void
74+
{
75+
$securityPolicy = '[SECURITY_POLICY]';
76+
77+
delete_sample($securityPolicy);
78+
}
79+
// [END compute_v1_generated_OrganizationSecurityPolicies_Delete_sync]

0 commit comments

Comments
 (0)