Skip to content

Commit

Permalink
feat: Update Compute Engine API to revision 20240421 (#899) (#7268)
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
gcf-owl-bot[bot] committed Apr 30, 2024
1 parent 6c54a89 commit 1841c79
Show file tree
Hide file tree
Showing 177 changed files with 26,203 additions and 96 deletions.
Binary file modified Compute/metadata/V1/Compute.php
Binary file not shown.
@@ -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]
@@ -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]
@@ -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]
@@ -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]

0 comments on commit 1841c79

Please sign in to comment.