Reference documentation and code samples for the Google BigQuery Reservation V1 Client class ReservationServiceClient.
Service Description: This API allows users to manage their BigQuery reservations.
A reservation provides computational resource guarantees, in the form of
slots, to users. A slot is a
unit of computational power in BigQuery, and serves as the basic unit of
parallelism. In a scan of a multi-partitioned table, a single slot operates
on a single partition of the table. A reservation resource exists as a child
resource of the admin project and location, e.g.:
projects/myproject/locations/US/reservations/reservationName
.
A capacity commitment is a way to purchase compute capacity for BigQuery jobs
(in the form of slots) with some committed period of usage. A capacity
commitment resource exists as a child resource of the admin project and
location, e.g.:
projects/myproject/locations/US/capacityCommitments/id
.
This class provides the ability to make remote calls to the backing service through method calls that map to API methods.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parseName method to extract the individual identifiers contained within formatted names that are returned by the API.
Namespace
Google \ Cloud \ BigQuery \ Reservation \ V1 \ ClientMethods
__construct
Constructor.
Parameters | |
---|---|
Name | Description |
options |
array
Optional. Options for configuring the service API wrapper. |
↳ apiEndpoint |
string
The address of the API remote host. May optionally include the port, formatted as "
|
↳ credentials |
string|array|FetchAuthTokenInterface|CredentialsWrapper
The credentials to be used by the client to authorize API calls. This option accepts either a path to a credentials file, or a decoded credentials file as a PHP array. Advanced usage: In addition, this option can also accept a pre-constructed Google\Auth\FetchAuthTokenInterface object or Google\ApiCore\CredentialsWrapper object. Note that when one of these objects are provided, any settings in $credentialsConfig will be ignored. |
↳ credentialsConfig |
array
Options used to configure credentials, including auth token caching, for the client. For a full list of supporting configuration options, see Google\ApiCore\CredentialsWrapper::build() . |
↳ disableRetries |
bool
Determines whether or not retries defined by the client configuration should be disabled. Defaults to |
↳ clientConfig |
string|array
Client method configuration, including retry settings. This option can be either a path to a JSON file, or a PHP array containing the decoded JSON data. By default this settings points to the default client config file, which is provided in the resources folder. |
↳ transport |
string|TransportInterface
The transport used for executing network requests. May be either the string |
↳ transportConfig |
array
Configuration options that will be used to construct the transport. Options for each supported transport type should be passed in a key for that transport. For example: $transportConfig = [ 'grpc' => [...], 'rest' => [...], ]; See the Google\ApiCore\Transport\GrpcTransport::build() and Google\ApiCore\Transport\RestTransport::build() methods for the supported options. |
↳ clientCertSource |
callable
A callable which returns the client cert as a string. This can be used to provide a certificate and private key to the transport layer for mTLS. |
createAssignment
Creates an assignment object which allows the given project to submit jobs of a certain type using slots from the specified reservation.
Currently a resource (project, folder, organization) can only have one assignment per each (job_type, location) combination, and that reservation will be used for all jobs of the matching type.
Different assignments can be created on different levels of the projects, folders or organization hierarchy. During query execution, the assignment is looked up at the project, folder and organization levels in that order. The first assignment found is applied to the query.
When creating assignments, it does not matter if other assignments exist at higher levels.
Example:
- The organization
organizationA
contains two projects,project1
andproject2
. - Assignments for all three entities (
organizationA
,project1
, andproject2
) could all be created and mapped to the same or different reservations.
"None" assignments represent an absence of the assignment. Projects
assigned to None use on-demand pricing. To create a "None" assignment, use
"none" as a reservation_id in the parent. Example parent:
projects/myproject/locations/US/reservations/none
.
Returns google.rpc.Code.PERMISSION_DENIED
if user does not have
'bigquery.admin' permissions on the project using the reservation
and the project that owns this reservation.
Returns google.rpc.Code.INVALID_ARGUMENT
when location of the assignment
does not match location of the reservation.
The async variant is Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient::createAssignmentAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BigQuery\Reservation\V1\CreateAssignmentRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\BigQuery\Reservation\V1\Assignment |
use Google\ApiCore\ApiException;
use Google\Cloud\BigQuery\Reservation\V1\Assignment;
use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
use Google\Cloud\BigQuery\Reservation\V1\CreateAssignmentRequest;
/**
* @param string $formattedParent The parent resource name of the assignment
* E.g. `projects/myproject/locations/US/reservations/team1-prod`
* Please see {@see ReservationServiceClient::reservationName()} for help formatting this field.
*/
function create_assignment_sample(string $formattedParent): void
{
// Create a client.
$reservationServiceClient = new ReservationServiceClient();
// Prepare the request message.
$request = (new CreateAssignmentRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var Assignment $response */
$response = $reservationServiceClient->createAssignment($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
{
$formattedParent = ReservationServiceClient::reservationName(
'[PROJECT]',
'[LOCATION]',
'[RESERVATION]'
);
create_assignment_sample($formattedParent);
}
createCapacityCommitment
Creates a new capacity commitment resource.
The async variant is Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient::createCapacityCommitmentAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BigQuery\Reservation\V1\CreateCapacityCommitmentRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\BigQuery\Reservation\V1\CapacityCommitment |
use Google\ApiCore\ApiException;
use Google\Cloud\BigQuery\Reservation\V1\CapacityCommitment;
use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
use Google\Cloud\BigQuery\Reservation\V1\CreateCapacityCommitmentRequest;
/**
* @param string $formattedParent Resource name of the parent reservation. E.g.,
* `projects/myproject/locations/US`
* Please see {@see ReservationServiceClient::locationName()} for help formatting this field.
*/
function create_capacity_commitment_sample(string $formattedParent): void
{
// Create a client.
$reservationServiceClient = new ReservationServiceClient();
// Prepare the request message.
$request = (new CreateCapacityCommitmentRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var CapacityCommitment $response */
$response = $reservationServiceClient->createCapacityCommitment($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
{
$formattedParent = ReservationServiceClient::locationName('[PROJECT]', '[LOCATION]');
create_capacity_commitment_sample($formattedParent);
}
createReservation
Creates a new reservation resource.
The async variant is Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient::createReservationAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BigQuery\Reservation\V1\CreateReservationRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\BigQuery\Reservation\V1\Reservation |
use Google\ApiCore\ApiException;
use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
use Google\Cloud\BigQuery\Reservation\V1\CreateReservationRequest;
use Google\Cloud\BigQuery\Reservation\V1\Reservation;
/**
* @param string $formattedParent Project, location. E.g.,
* `projects/myproject/locations/US`
* Please see {@see ReservationServiceClient::locationName()} for help formatting this field.
*/
function create_reservation_sample(string $formattedParent): void
{
// Create a client.
$reservationServiceClient = new ReservationServiceClient();
// Prepare the request message.
$request = (new CreateReservationRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var Reservation $response */
$response = $reservationServiceClient->createReservation($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
{
$formattedParent = ReservationServiceClient::locationName('[PROJECT]', '[LOCATION]');
create_reservation_sample($formattedParent);
}
deleteAssignment
Deletes a assignment. No expansion will happen.
Example:
- Organization
organizationA
contains two projects,project1
andproject2
. - Reservation
res1
exists and was created previously. - CreateAssignment was used previously to define the following
associations between entities and reservations:
<organizationA, res1>
and<project1, res1>
In this example, deletion of the <organizationA, res1>
assignment won't
affect the other assignment <project1, res1>
. After said deletion,
queries from project1
will still use res1
while queries from
project2
will switch to use on-demand mode.
The async variant is Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient::deleteAssignmentAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BigQuery\Reservation\V1\DeleteAssignmentRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
use Google\ApiCore\ApiException;
use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
use Google\Cloud\BigQuery\Reservation\V1\DeleteAssignmentRequest;
/**
* @param string $formattedName Name of the resource, e.g.
* `projects/myproject/locations/US/reservations/team1-prod/assignments/123`
* Please see {@see ReservationServiceClient::assignmentName()} for help formatting this field.
*/
function delete_assignment_sample(string $formattedName): void
{
// Create a client.
$reservationServiceClient = new ReservationServiceClient();
// Prepare the request message.
$request = (new DeleteAssignmentRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
$reservationServiceClient->deleteAssignment($request);
printf('Call completed successfully.' . PHP_EOL);
} 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::assignmentName(
'[PROJECT]',
'[LOCATION]',
'[RESERVATION]',
'[ASSIGNMENT]'
);
delete_assignment_sample($formattedName);
}
deleteCapacityCommitment
Deletes a capacity commitment. Attempting to delete capacity commitment
before its commitment_end_time will fail with the error code
google.rpc.Code.FAILED_PRECONDITION
.
The async variant is Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient::deleteCapacityCommitmentAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BigQuery\Reservation\V1\DeleteCapacityCommitmentRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
use Google\ApiCore\ApiException;
use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
use Google\Cloud\BigQuery\Reservation\V1\DeleteCapacityCommitmentRequest;
/**
* @param string $formattedName Resource name of the capacity commitment to delete. E.g.,
* `projects/myproject/locations/US/capacityCommitments/123`
* Please see {@see ReservationServiceClient::capacityCommitmentName()} for help formatting this field.
*/
function delete_capacity_commitment_sample(string $formattedName): void
{
// Create a client.
$reservationServiceClient = new ReservationServiceClient();
// Prepare the request message.
$request = (new DeleteCapacityCommitmentRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
$reservationServiceClient->deleteCapacityCommitment($request);
printf('Call completed successfully.' . PHP_EOL);
} 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::capacityCommitmentName(
'[PROJECT]',
'[LOCATION]',
'[CAPACITY_COMMITMENT]'
);
delete_capacity_commitment_sample($formattedName);
}
deleteReservation
Deletes a reservation.
Returns google.rpc.Code.FAILED_PRECONDITION
when reservation has
assignments.
The async variant is Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient::deleteReservationAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BigQuery\Reservation\V1\DeleteReservationRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
use Google\ApiCore\ApiException;
use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
use Google\Cloud\BigQuery\Reservation\V1\DeleteReservationRequest;
/**
* @param string $formattedName Resource name of the reservation to retrieve. E.g.,
* `projects/myproject/locations/US/reservations/team1-prod`
* Please see {@see ReservationServiceClient::reservationName()} for help formatting this field.
*/
function delete_reservation_sample(string $formattedName): void
{
// Create a client.
$reservationServiceClient = new ReservationServiceClient();
// Prepare the request message.
$request = (new DeleteReservationRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
$reservationServiceClient->deleteReservation($request);
printf('Call completed successfully.' . PHP_EOL);
} 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]'
);
delete_reservation_sample($formattedName);
}
getBiReservation
Retrieves a BI reservation.
The async variant is Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient::getBiReservationAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BigQuery\Reservation\V1\GetBiReservationRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\BigQuery\Reservation\V1\BiReservation |
use Google\ApiCore\ApiException;
use Google\Cloud\BigQuery\Reservation\V1\BiReservation;
use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
use Google\Cloud\BigQuery\Reservation\V1\GetBiReservationRequest;
/**
* @param string $formattedName Name of the requested reservation, for example:
* `projects/{project_id}/locations/{location_id}/biReservation`
* Please see {@see ReservationServiceClient::biReservationName()} for help formatting this field.
*/
function get_bi_reservation_sample(string $formattedName): void
{
// Create a client.
$reservationServiceClient = new ReservationServiceClient();
// Prepare the request message.
$request = (new GetBiReservationRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var BiReservation $response */
$response = $reservationServiceClient->getBiReservation($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::biReservationName('[PROJECT]', '[LOCATION]');
get_bi_reservation_sample($formattedName);
}
getCapacityCommitment
Returns information about the capacity commitment.
The async variant is Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient::getCapacityCommitmentAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BigQuery\Reservation\V1\GetCapacityCommitmentRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\BigQuery\Reservation\V1\CapacityCommitment |
use Google\ApiCore\ApiException;
use Google\Cloud\BigQuery\Reservation\V1\CapacityCommitment;
use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
use Google\Cloud\BigQuery\Reservation\V1\GetCapacityCommitmentRequest;
/**
* @param string $formattedName Resource name of the capacity commitment to retrieve. E.g.,
* `projects/myproject/locations/US/capacityCommitments/123`
* Please see {@see ReservationServiceClient::capacityCommitmentName()} for help formatting this field.
*/
function get_capacity_commitment_sample(string $formattedName): void
{
// Create a client.
$reservationServiceClient = new ReservationServiceClient();
// Prepare the request message.
$request = (new GetCapacityCommitmentRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var CapacityCommitment $response */
$response = $reservationServiceClient->getCapacityCommitment($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::capacityCommitmentName(
'[PROJECT]',
'[LOCATION]',
'[CAPACITY_COMMITMENT]'
);
get_capacity_commitment_sample($formattedName);
}
getReservation
Returns information about the reservation.
The async variant is Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient::getReservationAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BigQuery\Reservation\V1\GetReservationRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\BigQuery\Reservation\V1\Reservation |
use Google\ApiCore\ApiException;
use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
use Google\Cloud\BigQuery\Reservation\V1\GetReservationRequest;
use Google\Cloud\BigQuery\Reservation\V1\Reservation;
/**
* @param string $formattedName Resource name of the reservation to retrieve. E.g.,
* `projects/myproject/locations/US/reservations/team1-prod`
* Please see {@see ReservationServiceClient::reservationName()} for help formatting this field.
*/
function get_reservation_sample(string $formattedName): void
{
// Create a client.
$reservationServiceClient = new ReservationServiceClient();
// Prepare the request message.
$request = (new GetReservationRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Reservation $response */
$response = $reservationServiceClient->getReservation($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]'
);
get_reservation_sample($formattedName);
}
listAssignments
Lists assignments.
Only explicitly created assignments will be returned.
Example:
- Organization
organizationA
contains two projects,project1
andproject2
. - Reservation
res1
exists and was created previously. - CreateAssignment was used previously to define the following
associations between entities and reservations:
<organizationA, res1>
and<project1, res1>
In this example, ListAssignments will just return the above two assignments
for reservation res1
, and no expansion/merge will happen.
The wildcard "-" can be used for reservations in the request. In that case all assignments belongs to the specified project and location will be listed.
Note "-" cannot be used for projects nor locations.
The async variant is Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient::listAssignmentsAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BigQuery\Reservation\V1\ListAssignmentsRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\BigQuery\Reservation\V1\Assignment;
use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
use Google\Cloud\BigQuery\Reservation\V1\ListAssignmentsRequest;
/**
* @param string $formattedParent The parent resource name e.g.:
*
* `projects/myproject/locations/US/reservations/team1-prod`
*
* Or:
*
* `projects/myproject/locations/US/reservations/-`
* Please see {@see ReservationServiceClient::reservationName()} for help formatting this field.
*/
function list_assignments_sample(string $formattedParent): void
{
// Create a client.
$reservationServiceClient = new ReservationServiceClient();
// Prepare the request message.
$request = (new ListAssignmentsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $reservationServiceClient->listAssignments($request);
/** @var Assignment $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->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
{
$formattedParent = ReservationServiceClient::reservationName(
'[PROJECT]',
'[LOCATION]',
'[RESERVATION]'
);
list_assignments_sample($formattedParent);
}
listCapacityCommitments
Lists all the capacity commitments for the admin project.
The async variant is Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient::listCapacityCommitmentsAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BigQuery\Reservation\V1\ListCapacityCommitmentsRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\BigQuery\Reservation\V1\CapacityCommitment;
use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
use Google\Cloud\BigQuery\Reservation\V1\ListCapacityCommitmentsRequest;
/**
* @param string $formattedParent Resource name of the parent reservation. E.g.,
* `projects/myproject/locations/US`
* Please see {@see ReservationServiceClient::locationName()} for help formatting this field.
*/
function list_capacity_commitments_sample(string $formattedParent): void
{
// Create a client.
$reservationServiceClient = new ReservationServiceClient();
// Prepare the request message.
$request = (new ListCapacityCommitmentsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $reservationServiceClient->listCapacityCommitments($request);
/** @var CapacityCommitment $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->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
{
$formattedParent = ReservationServiceClient::locationName('[PROJECT]', '[LOCATION]');
list_capacity_commitments_sample($formattedParent);
}
listReservations
Lists all the reservations for the project in the specified location.
The async variant is Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient::listReservationsAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BigQuery\Reservation\V1\ListReservationsRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
use Google\Cloud\BigQuery\Reservation\V1\ListReservationsRequest;
use Google\Cloud\BigQuery\Reservation\V1\Reservation;
/**
* @param string $formattedParent The parent resource name containing project and location, e.g.:
* `projects/myproject/locations/US`
* Please see {@see ReservationServiceClient::locationName()} for help formatting this field.
*/
function list_reservations_sample(string $formattedParent): void
{
// Create a client.
$reservationServiceClient = new ReservationServiceClient();
// Prepare the request message.
$request = (new ListReservationsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $reservationServiceClient->listReservations($request);
/** @var Reservation $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->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
{
$formattedParent = ReservationServiceClient::locationName('[PROJECT]', '[LOCATION]');
list_reservations_sample($formattedParent);
}
mergeCapacityCommitments
Merges capacity commitments of the same plan into a single commitment.
The resulting capacity commitment has the greater commitment_end_time out of the to-be-merged capacity commitments.
Attempting to merge capacity commitments of different plan will fail
with the error code google.rpc.Code.FAILED_PRECONDITION
.
The async variant is Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient::mergeCapacityCommitmentsAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BigQuery\Reservation\V1\MergeCapacityCommitmentsRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\BigQuery\Reservation\V1\CapacityCommitment |
use Google\ApiCore\ApiException;
use Google\Cloud\BigQuery\Reservation\V1\CapacityCommitment;
use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
use Google\Cloud\BigQuery\Reservation\V1\MergeCapacityCommitmentsRequest;
/**
* 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 merge_capacity_commitments_sample(): void
{
// Create a client.
$reservationServiceClient = new ReservationServiceClient();
// Prepare the request message.
$request = new MergeCapacityCommitmentsRequest();
// Call the API and handle any network failures.
try {
/** @var CapacityCommitment $response */
$response = $reservationServiceClient->mergeCapacityCommitments($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
moveAssignment
Moves an assignment under a new reservation.
This differs from removing an existing assignment and recreating a new one by providing a transactional change that ensures an assignee always has an associated reservation.
The async variant is Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient::moveAssignmentAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BigQuery\Reservation\V1\MoveAssignmentRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\BigQuery\Reservation\V1\Assignment |
use Google\ApiCore\ApiException;
use Google\Cloud\BigQuery\Reservation\V1\Assignment;
use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
use Google\Cloud\BigQuery\Reservation\V1\MoveAssignmentRequest;
/**
* @param string $formattedName The resource name of the assignment,
* e.g.
* `projects/myproject/locations/US/reservations/team1-prod/assignments/123`
* Please see {@see ReservationServiceClient::assignmentName()} for help formatting this field.
*/
function move_assignment_sample(string $formattedName): void
{
// Create a client.
$reservationServiceClient = new ReservationServiceClient();
// Prepare the request message.
$request = (new MoveAssignmentRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var Assignment $response */
$response = $reservationServiceClient->moveAssignment($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::assignmentName(
'[PROJECT]',
'[LOCATION]',
'[RESERVATION]',
'[ASSIGNMENT]'
);
move_assignment_sample($formattedName);
}
searchAllAssignments
Looks up assignments for a specified resource for a particular region.
If the request is about a project:
- Assignments created on the project will be returned if they exist.
- Otherwise assignments created on the closest ancestor will be returned.
- Assignments for different JobTypes will all be returned.
The same logic applies if the request is about a folder.
If the request is about an organization, then assignments created on the organization will be returned (organization doesn't have ancestors).
Comparing to ListAssignments, there are some behavior differences:
- permission on the assignee will be verified in this API.
- Hierarchy lookup (project->folder->organization) happens in this API.
- Parent here is
projects/*/locations/*
, instead ofprojects/*/locations/*reservations/*
.
The async variant is Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient::searchAllAssignmentsAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BigQuery\Reservation\V1\SearchAllAssignmentsRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\BigQuery\Reservation\V1\Assignment;
use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
use Google\Cloud\BigQuery\Reservation\V1\SearchAllAssignmentsRequest;
/**
* @param string $formattedParent The resource name with location (project name could be the
* wildcard '-'), e.g.:
* `projects/-/locations/US`. Please see
* {@see ReservationServiceClient::locationName()} for help formatting this field.
*/
function search_all_assignments_sample(string $formattedParent): void
{
// Create a client.
$reservationServiceClient = new ReservationServiceClient();
// Prepare the request message.
$request = (new SearchAllAssignmentsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $reservationServiceClient->searchAllAssignments($request);
/** @var Assignment $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->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
{
$formattedParent = ReservationServiceClient::locationName('[PROJECT]', '[LOCATION]');
search_all_assignments_sample($formattedParent);
}
searchAssignments
Deprecated: Looks up assignments for a specified resource for a particular region. If the request is about a project:
- Assignments created on the project will be returned if they exist.
- Otherwise assignments created on the closest ancestor will be returned.
- Assignments for different JobTypes will all be returned.
The same logic applies if the request is about a folder.
If the request is about an organization, then assignments created on the organization will be returned (organization doesn't have ancestors).
Comparing to ListAssignments, there are some behavior differences:
- permission on the assignee will be verified in this API.
- Hierarchy lookup (project->folder->organization) happens in this API.
- Parent here is
projects/*/locations/*
, instead ofprojects/*/locations/*reservations/*
.
Note "-" cannot be used for projects nor locations.
The async variant is Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient::searchAssignmentsAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BigQuery\Reservation\V1\SearchAssignmentsRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\ApiCore\PagedListResponse |
use Google\ApiCore\ApiException;
use Google\ApiCore\PagedListResponse;
use Google\Cloud\BigQuery\Reservation\V1\Assignment;
use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
use Google\Cloud\BigQuery\Reservation\V1\SearchAssignmentsRequest;
/**
* @param string $formattedParent The resource name of the admin project(containing project and
* location), e.g.:
* `projects/myproject/locations/US`. Please see
* {@see ReservationServiceClient::locationName()} for help formatting this field.
*/
function search_assignments_sample(string $formattedParent): void
{
// Create a client.
$reservationServiceClient = new ReservationServiceClient();
// Prepare the request message.
$request = (new SearchAssignmentsRequest())
->setParent($formattedParent);
// Call the API and handle any network failures.
try {
/** @var PagedListResponse $response */
$response = $reservationServiceClient->searchAssignments($request);
/** @var Assignment $element */
foreach ($response as $element) {
printf('Element data: %s' . PHP_EOL, $element->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
{
$formattedParent = ReservationServiceClient::locationName('[PROJECT]', '[LOCATION]');
search_assignments_sample($formattedParent);
}
splitCapacityCommitment
Splits capacity commitment to two commitments of the same plan and
commitment_end_time
.
A common use case is to enable downgrading commitments.
For example, in order to downgrade from 10000 slots to 8000, you might split a 10000 capacity commitment into commitments of 2000 and 8000. Then, you delete the first one after the commitment end time passes.
The async variant is Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient::splitCapacityCommitmentAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BigQuery\Reservation\V1\SplitCapacityCommitmentRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\BigQuery\Reservation\V1\SplitCapacityCommitmentResponse |
use Google\ApiCore\ApiException;
use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
use Google\Cloud\BigQuery\Reservation\V1\SplitCapacityCommitmentRequest;
use Google\Cloud\BigQuery\Reservation\V1\SplitCapacityCommitmentResponse;
/**
* @param string $formattedName The resource name e.g.,:
* `projects/myproject/locations/US/capacityCommitments/123`
* Please see {@see ReservationServiceClient::capacityCommitmentName()} for help formatting this field.
*/
function split_capacity_commitment_sample(string $formattedName): void
{
// Create a client.
$reservationServiceClient = new ReservationServiceClient();
// Prepare the request message.
$request = (new SplitCapacityCommitmentRequest())
->setName($formattedName);
// Call the API and handle any network failures.
try {
/** @var SplitCapacityCommitmentResponse $response */
$response = $reservationServiceClient->splitCapacityCommitment($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::capacityCommitmentName(
'[PROJECT]',
'[LOCATION]',
'[CAPACITY_COMMITMENT]'
);
split_capacity_commitment_sample($formattedName);
}
updateAssignment
Updates an existing assignment.
Only the priority
field can be updated.
The async variant is Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient::updateAssignmentAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BigQuery\Reservation\V1\UpdateAssignmentRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\BigQuery\Reservation\V1\Assignment |
use Google\ApiCore\ApiException;
use Google\Cloud\BigQuery\Reservation\V1\Assignment;
use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
use Google\Cloud\BigQuery\Reservation\V1\UpdateAssignmentRequest;
/**
* 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 update_assignment_sample(): void
{
// Create a client.
$reservationServiceClient = new ReservationServiceClient();
// Prepare the request message.
$request = new UpdateAssignmentRequest();
// Call the API and handle any network failures.
try {
/** @var Assignment $response */
$response = $reservationServiceClient->updateAssignment($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
updateBiReservation
Updates a BI reservation.
Only fields specified in the field_mask
are updated.
A singleton BI reservation always exists with default size 0. In order to reserve BI capacity it needs to be updated to an amount greater than 0. In order to release BI capacity reservation size must be set to 0.
The async variant is Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient::updateBiReservationAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BigQuery\Reservation\V1\UpdateBiReservationRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\BigQuery\Reservation\V1\BiReservation |
use Google\ApiCore\ApiException;
use Google\Cloud\BigQuery\Reservation\V1\BiReservation;
use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
use Google\Cloud\BigQuery\Reservation\V1\UpdateBiReservationRequest;
/**
* 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 update_bi_reservation_sample(): void
{
// Create a client.
$reservationServiceClient = new ReservationServiceClient();
// Prepare the request message.
$request = new UpdateBiReservationRequest();
// Call the API and handle any network failures.
try {
/** @var BiReservation $response */
$response = $reservationServiceClient->updateBiReservation($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
updateCapacityCommitment
Updates an existing capacity commitment.
Only plan
and renewal_plan
fields can be updated.
Plan can only be changed to a plan of a longer commitment period.
Attempting to change to a plan with shorter commitment period will fail
with the error code google.rpc.Code.FAILED_PRECONDITION
.
The async variant is Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient::updateCapacityCommitmentAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BigQuery\Reservation\V1\UpdateCapacityCommitmentRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\BigQuery\Reservation\V1\CapacityCommitment |
use Google\ApiCore\ApiException;
use Google\Cloud\BigQuery\Reservation\V1\CapacityCommitment;
use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
use Google\Cloud\BigQuery\Reservation\V1\UpdateCapacityCommitmentRequest;
/**
* 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 update_capacity_commitment_sample(): void
{
// Create a client.
$reservationServiceClient = new ReservationServiceClient();
// Prepare the request message.
$request = new UpdateCapacityCommitmentRequest();
// Call the API and handle any network failures.
try {
/** @var CapacityCommitment $response */
$response = $reservationServiceClient->updateCapacityCommitment($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
updateReservation
Updates an existing reservation resource.
The async variant is Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient::updateReservationAsync() .
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BigQuery\Reservation\V1\UpdateReservationRequest
A request to house fields associated with the call. |
callOptions |
array
Optional. |
↳ retrySettings |
RetrySettings|array
Retry settings to use for this call. Can be a Google\ApiCore\RetrySettings object, or an associative array of retry settings parameters. See the documentation on Google\ApiCore\RetrySettings for example usage. |
Returns | |
---|---|
Type | Description |
Google\Cloud\BigQuery\Reservation\V1\Reservation |
use Google\ApiCore\ApiException;
use Google\Cloud\BigQuery\Reservation\V1\Client\ReservationServiceClient;
use Google\Cloud\BigQuery\Reservation\V1\Reservation;
use Google\Cloud\BigQuery\Reservation\V1\UpdateReservationRequest;
/**
* 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 update_reservation_sample(): void
{
// Create a client.
$reservationServiceClient = new ReservationServiceClient();
// Prepare the request message.
$request = new UpdateReservationRequest();
// Call the API and handle any network failures.
try {
/** @var Reservation $response */
$response = $reservationServiceClient->updateReservation($request);
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
} catch (ApiException $ex) {
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
}
}
createAssignmentAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BigQuery\Reservation\V1\CreateAssignmentRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
createCapacityCommitmentAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BigQuery\Reservation\V1\CreateCapacityCommitmentRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
createReservationAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BigQuery\Reservation\V1\CreateReservationRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
deleteAssignmentAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BigQuery\Reservation\V1\DeleteAssignmentRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
deleteCapacityCommitmentAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BigQuery\Reservation\V1\DeleteCapacityCommitmentRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
deleteReservationAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BigQuery\Reservation\V1\DeleteReservationRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
getBiReservationAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BigQuery\Reservation\V1\GetBiReservationRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
getCapacityCommitmentAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BigQuery\Reservation\V1\GetCapacityCommitmentRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
getReservationAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BigQuery\Reservation\V1\GetReservationRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
listAssignmentsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BigQuery\Reservation\V1\ListAssignmentsRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
listCapacityCommitmentsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BigQuery\Reservation\V1\ListCapacityCommitmentsRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
listReservationsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BigQuery\Reservation\V1\ListReservationsRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
mergeCapacityCommitmentsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BigQuery\Reservation\V1\MergeCapacityCommitmentsRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
moveAssignmentAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BigQuery\Reservation\V1\MoveAssignmentRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
searchAllAssignmentsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BigQuery\Reservation\V1\SearchAllAssignmentsRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
searchAssignmentsAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BigQuery\Reservation\V1\SearchAssignmentsRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
splitCapacityCommitmentAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BigQuery\Reservation\V1\SplitCapacityCommitmentRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
updateAssignmentAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BigQuery\Reservation\V1\UpdateAssignmentRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
updateBiReservationAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BigQuery\Reservation\V1\UpdateBiReservationRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
updateCapacityCommitmentAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BigQuery\Reservation\V1\UpdateCapacityCommitmentRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
updateReservationAsync
Parameters | |
---|---|
Name | Description |
request |
Google\Cloud\BigQuery\Reservation\V1\UpdateReservationRequest
|
optionalArgs = [] |
array
|
Returns | |
---|---|
Type | Description |
GuzzleHttp\Promise\PromiseInterface |
static::assignmentName
Formats a string containing the fully-qualified path to represent a assignment resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
reservation |
string
|
assignment |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted assignment resource. |
static::biReservationName
Formats a string containing the fully-qualified path to represent a bi_reservation resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted bi_reservation resource. |
static::capacityCommitmentName
Formats a string containing the fully-qualified path to represent a capacity_commitment resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
capacityCommitment |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted capacity_commitment resource. |
static::locationName
Formats a string containing the fully-qualified path to represent a location resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted location resource. |
static::reservationName
Formats a string containing the fully-qualified path to represent a reservation resource.
Parameters | |
---|---|
Name | Description |
project |
string
|
location |
string
|
reservation |
string
|
Returns | |
---|---|
Type | Description |
string |
The formatted reservation resource. |
static::parseName
Parses a formatted name string and returns an associative array of the components in the name.
The following name formats are supported: Template: Pattern
- assignment: projects/{project}/locations/{location}/reservations/{reservation}/assignments/{assignment}
- biReservation: projects/{project}/locations/{location}/biReservation
- capacityCommitment: projects/{project}/locations/{location}/capacityCommitments/{capacity_commitment}
- location: projects/{project}/locations/{location}
- reservation: projects/{project}/locations/{location}/reservations/{reservation}
The optional $template argument can be supplied to specify a particular pattern, and must match one of the templates listed above. If no $template argument is provided, or if the $template argument does not match one of the templates listed, then parseName will check each of the supported templates, and return the first match.
Parameters | |
---|---|
Name | Description |
formattedName |
string
The formatted name string |
template |
string
Optional name of template to match |
Returns | |
---|---|
Type | Description |
array |
An associative array from name component IDs to component values. |