-
Notifications
You must be signed in to change notification settings - Fork 438
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add the managed disaster recovery API(https://cloud.google.com/…
…bigquery/docs/managed-disaster-recovery) (#7869) feat: Add a new field `is_flat_rate` to `.google.cloud.bigquery.reservation.v1.CapacityCommitment` to distinguish between flat rate and edition commitments docs: Clarify that `Autoscale.current_slots` in message `.google.cloud.bigquery.reservation.v1.Reservation` can temporarily be larger than `Autoscale.max_slots` if users reduce `Autoscale.max_slots` docs: Update comment for `slot_capacity` in message `.google.cloud.bigquery.reservation.v1.Reservation` to provide more clarity about reservation baselines, committed slots and autoscaler SKU charges when the baseline exceeds committed slots docs: Update comments for `commitment_start_time` and `commitment_end_time` in message `.google.cloud.bigquery.reservation.v1.CapacityCommitment` to provide details on how these values are affected by commitment renewal PiperOrigin-RevId: 702079972 Source-Link: googleapis/googleapis@4743cf9 Source-Link: googleapis/googleapis-gen@30e9360 Copy-Tag: eyJwIjoiQmlnUXVlcnlSZXNlcnZhdGlvbi8uT3dsQm90LnlhbWwiLCJoIjoiMzBlOTM2MDAwYmZhYjk5YmYyODU2YmI4NDZhNTBlYjBlZTAzODViNyJ9
- Loading branch information
1 parent
f826313
commit bcd09f1
Showing
14 changed files
with
617 additions
and
62 deletions.
There are no files selected for viewing
Binary file not shown.
80 changes: 80 additions & 0 deletions
80
BigQueryReservation/samples/V1/ReservationServiceClient/failover_reservation.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 bigqueryreservation_v1_generated_ReservationService_FailoverReservation_sync] | ||
use Google\ApiCore\ApiException; | ||
use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient; | ||
use Google\Cloud\BigQuery\Reservation\V1\FailoverReservationRequest; | ||
use Google\Cloud\BigQuery\Reservation\V1\Reservation; | ||
|
||
/** | ||
* Fail over a reservation to the secondary location. The operation should be | ||
* done in the current secondary location, which will be promoted to the | ||
* new primary location for the reservation. | ||
* Attempting to failover a reservation in the current primary location will | ||
* fail with the error code `google.rpc.Code.FAILED_PRECONDITION`. | ||
* | ||
* @param string $formattedName Resource name of the reservation to failover. E.g., | ||
* `projects/myproject/locations/US/reservations/team1-prod` | ||
* Please see {@see ReservationServiceClient::reservationName()} for help formatting this field. | ||
*/ | ||
function failover_reservation_sample(string $formattedName): void | ||
{ | ||
// Create a client. | ||
$reservationServiceClient = new ReservationServiceClient(); | ||
|
||
// Prepare the request message. | ||
$request = (new FailoverReservationRequest()) | ||
->setName($formattedName); | ||
|
||
// Call the API and handle any network failures. | ||
try { | ||
/** @var Reservation $response */ | ||
$response = $reservationServiceClient->failoverReservation($request); | ||
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 | ||
{ | ||
$formattedName = ReservationServiceClient::reservationName( | ||
'[PROJECT]', | ||
'[LOCATION]', | ||
'[RESERVATION]' | ||
); | ||
|
||
failover_reservation_sample($formattedName); | ||
} | ||
// [END bigqueryreservation_v1_generated_ReservationService_FailoverReservation_sync] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
BigQueryReservation/src/V1/CapacityCommitment/CommitmentPlan.php
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.