-
Notifications
You must be signed in to change notification settings - Fork 441
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* feat: Update Compute Engine API to revision 20240407 (#890) Source-Link: googleapis/googleapis@018c0e3 Source-Link: googleapis/googleapis-gen@dad8476 Copy-Tag: eyJwIjoiQ29tcHV0ZS8uT3dsQm90LnlhbWwiLCJoIjoiZGFkODQ3NmM5NGViMWVjYjJmZDcyZjI5NjgyNWU5NjIxZWE4YjQ1ZCJ9 * feat: Update Compute Engine API to revision 20240421 (#899) Source-Link: googleapis/googleapis@55499b5 Source-Link: googleapis/googleapis-gen@cf5049b Copy-Tag: eyJwIjoiQ29tcHV0ZS8uT3dsQm90LnlhbWwiLCJoIjoiY2Y1MDQ5YjcwNzkyODIwMDY1ZGIzOGU3MTI3ZjMyZWFiNzcwNTk0NCJ9
- Loading branch information
1 parent
6c54a89
commit 1841c79
Showing
177 changed files
with
26,203 additions
and
96 deletions.
There are no files selected for viewing
Binary file not shown.
89 changes: 89 additions & 0 deletions
89
Compute/samples/V1/InstanceGroupManagerResizeRequestsClient/cancel.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
<?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_InstanceGroupManagerResizeRequests_Cancel_sync] | ||
use Google\ApiCore\ApiException; | ||
use Google\ApiCore\OperationResponse; | ||
use Google\Cloud\Compute\V1\InstanceGroupManagerResizeRequestsClient; | ||
use Google\Rpc\Status; | ||
|
||
/** | ||
* Cancels the specified resize request and removes it from the queue. Cancelled resize request does no longer wait for the resources to be provisioned. Cancel is only possible for requests that are accepted in the queue. | ||
* | ||
* @param string $instanceGroupManager The name of the managed instance group. The name should conform to RFC1035 or be a resource ID. | ||
* @param string $project Project ID for this request. | ||
* @param string $resizeRequest The name of the resize request to cancel. The name should conform to RFC1035 or be a resource ID. | ||
* @param string $zone The name of the zone where the managed instance group is located. The name should conform to RFC1035. | ||
*/ | ||
function cancel_sample( | ||
string $instanceGroupManager, | ||
string $project, | ||
string $resizeRequest, | ||
string $zone | ||
): void { | ||
// Create a client. | ||
$instanceGroupManagerResizeRequestsClient = new InstanceGroupManagerResizeRequestsClient(); | ||
|
||
// Call the API and handle any network failures. | ||
try { | ||
/** @var OperationResponse $response */ | ||
$response = $instanceGroupManagerResizeRequestsClient->cancel( | ||
$instanceGroupManager, | ||
$project, | ||
$resizeRequest, | ||
$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 | ||
{ | ||
$instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; | ||
$project = '[PROJECT]'; | ||
$resizeRequest = '[RESIZE_REQUEST]'; | ||
$zone = '[ZONE]'; | ||
|
||
cancel_sample($instanceGroupManager, $project, $resizeRequest, $zone); | ||
} | ||
// [END compute_v1_generated_InstanceGroupManagerResizeRequests_Cancel_sync] |
89 changes: 89 additions & 0 deletions
89
Compute/samples/V1/InstanceGroupManagerResizeRequestsClient/delete.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
<?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_InstanceGroupManagerResizeRequests_Delete_sync] | ||
use Google\ApiCore\ApiException; | ||
use Google\ApiCore\OperationResponse; | ||
use Google\Cloud\Compute\V1\InstanceGroupManagerResizeRequestsClient; | ||
use Google\Rpc\Status; | ||
|
||
/** | ||
* Deletes the specified, inactive resize request. Requests that are still active cannot be deleted. Deleting request does not delete instances that were provisioned previously. | ||
* | ||
* @param string $instanceGroupManager The name of the managed instance group. The name should conform to RFC1035 or be a resource ID. | ||
* @param string $project Project ID for this request. | ||
* @param string $resizeRequest The name of the resize request to delete. The name should conform to RFC1035 or be a resource ID. | ||
* @param string $zone The name of the zone where the managed instance group is located. The name should conform to RFC1035. | ||
*/ | ||
function delete_sample( | ||
string $instanceGroupManager, | ||
string $project, | ||
string $resizeRequest, | ||
string $zone | ||
): void { | ||
// Create a client. | ||
$instanceGroupManagerResizeRequestsClient = new InstanceGroupManagerResizeRequestsClient(); | ||
|
||
// Call the API and handle any network failures. | ||
try { | ||
/** @var OperationResponse $response */ | ||
$response = $instanceGroupManagerResizeRequestsClient->delete( | ||
$instanceGroupManager, | ||
$project, | ||
$resizeRequest, | ||
$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 | ||
{ | ||
$instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; | ||
$project = '[PROJECT]'; | ||
$resizeRequest = '[RESIZE_REQUEST]'; | ||
$zone = '[ZONE]'; | ||
|
||
delete_sample($instanceGroupManager, $project, $resizeRequest, $zone); | ||
} | ||
// [END compute_v1_generated_InstanceGroupManagerResizeRequests_Delete_sync] |
80 changes: 80 additions & 0 deletions
80
Compute/samples/V1/InstanceGroupManagerResizeRequestsClient/get.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<?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_InstanceGroupManagerResizeRequests_Get_sync] | ||
use Google\ApiCore\ApiException; | ||
use Google\Cloud\Compute\V1\InstanceGroupManagerResizeRequest; | ||
use Google\Cloud\Compute\V1\InstanceGroupManagerResizeRequestsClient; | ||
|
||
/** | ||
* Returns all of the details about the specified resize request. | ||
* | ||
* @param string $instanceGroupManager The name of the managed instance group. Name should conform to RFC1035 or be a resource ID. | ||
* @param string $project Project ID for this request. | ||
* @param string $resizeRequest The name of the resize request. Name should conform to RFC1035 or be a resource ID. | ||
* @param string $zone Name of the href="/compute/docs/regions-zones/#available">zone scoping this request. Name should conform to RFC1035. | ||
*/ | ||
function get_sample( | ||
string $instanceGroupManager, | ||
string $project, | ||
string $resizeRequest, | ||
string $zone | ||
): void { | ||
// Create a client. | ||
$instanceGroupManagerResizeRequestsClient = new InstanceGroupManagerResizeRequestsClient(); | ||
|
||
// Call the API and handle any network failures. | ||
try { | ||
/** @var InstanceGroupManagerResizeRequest $response */ | ||
$response = $instanceGroupManagerResizeRequestsClient->get( | ||
$instanceGroupManager, | ||
$project, | ||
$resizeRequest, | ||
$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 | ||
{ | ||
$instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; | ||
$project = '[PROJECT]'; | ||
$resizeRequest = '[RESIZE_REQUEST]'; | ||
$zone = '[ZONE]'; | ||
|
||
get_sample($instanceGroupManager, $project, $resizeRequest, $zone); | ||
} | ||
// [END compute_v1_generated_InstanceGroupManagerResizeRequests_Get_sync] |
87 changes: 87 additions & 0 deletions
87
Compute/samples/V1/InstanceGroupManagerResizeRequestsClient/insert.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
<?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_InstanceGroupManagerResizeRequests_Insert_sync] | ||
use Google\ApiCore\ApiException; | ||
use Google\ApiCore\OperationResponse; | ||
use Google\Cloud\Compute\V1\InstanceGroupManagerResizeRequest; | ||
use Google\Cloud\Compute\V1\InstanceGroupManagerResizeRequestsClient; | ||
use Google\Rpc\Status; | ||
|
||
/** | ||
* Creates a new resize request that starts provisioning VMs immediately or queues VM creation. | ||
* | ||
* @param string $instanceGroupManager The name of the managed instance group to which the resize request will be added. Name should conform to RFC1035 or be a resource ID. | ||
* @param string $project Project ID for this request. | ||
* @param string $zone The name of the zone where the managed instance group is located and where the resize request will be created. Name should conform to RFC1035. | ||
*/ | ||
function insert_sample(string $instanceGroupManager, string $project, string $zone): void | ||
{ | ||
// Create a client. | ||
$instanceGroupManagerResizeRequestsClient = new InstanceGroupManagerResizeRequestsClient(); | ||
|
||
// Prepare any non-scalar elements to be passed along with the request. | ||
$instanceGroupManagerResizeRequestResource = new InstanceGroupManagerResizeRequest(); | ||
|
||
// Call the API and handle any network failures. | ||
try { | ||
/** @var OperationResponse $response */ | ||
$response = $instanceGroupManagerResizeRequestsClient->insert( | ||
$instanceGroupManager, | ||
$instanceGroupManagerResizeRequestResource, | ||
$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 | ||
{ | ||
$instanceGroupManager = '[INSTANCE_GROUP_MANAGER]'; | ||
$project = '[PROJECT]'; | ||
$zone = '[ZONE]'; | ||
|
||
insert_sample($instanceGroupManager, $project, $zone); | ||
} | ||
// [END compute_v1_generated_InstanceGroupManagerResizeRequests_Insert_sync] |
Oops, something went wrong.