This API allows users to manage their flat-rate BigQuery reservations.
A reservation provides computational resource guarantees, in the form of [slots](https://cloud.google.com/bigquery/docs/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
. v1
Package
@google-cloud/bigquery-reservationConstructors
(constructor)(opts, gaxInstance)
constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
Construct an instance of ReservationServiceClient.
Name | Description |
opts |
ClientOptions
|
gaxInstance |
typeof gax | typeof gax.fallback
: loaded instance of |
Properties
apiEndpoint
static get apiEndpoint(): string;
The DNS address for this API service - same as servicePath(), exists for compatibility reasons.
auth
auth: gax.GoogleAuth;
descriptors
descriptors: Descriptors;
innerApiCalls
innerApiCalls: {
[name: string]: Function;
};
pathTemplates
pathTemplates: {
[name: string]: gax.PathTemplate;
};
port
static get port(): number;
The port for this API service.
reservationServiceStub
reservationServiceStub?: Promise<{
[name: string]: Function;
}>;
scopes
static get scopes(): string[];
The scopes needed to make gRPC calls for every method defined in this service.
servicePath
static get servicePath(): string;
The DNS address for this API service.
warn
warn: (code: string, message: string, warnType?: string) => void;
Methods
assignmentPath(project, location, reservation, assignment)
assignmentPath(project: string, location: string, reservation: string, assignment: string): string;
Return a fully-qualified assignment resource name string.
Name | Description |
project |
string
|
location |
string
|
reservation |
string
|
assignment |
string
|
Type | Description |
string | {string} Resource name string. |
biReservationPath(project, location)
biReservationPath(project: string, location: string): string;
Return a fully-qualified biReservation resource name string.
Name | Description |
project |
string
|
location |
string
|
Type | Description |
string | {string} Resource name string. |
capacityCommitmentPath(project, location, capacityCommitment)
capacityCommitmentPath(project: string, location: string, capacityCommitment: string): string;
Return a fully-qualified capacityCommitment resource name string.
Name | Description |
project |
string
|
location |
string
|
capacityCommitment |
string
|
Type | Description |
string | {string} Resource name string. |
close()
close(): Promise<void>;
Terminate the gRPC channel and close the client.
The client will no longer be usable and all future behavior is undefined.
Type | Description |
Promise<void> | {Promise} A promise that resolves when the client is closed. |
createAssignment(request, options)
createAssignment(request?: protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest, options?: CallOptions): Promise<[
protos.google.cloud.bigquery.reservation.v1.IAssignment,
(protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest | undefined),
{} | undefined
]>;
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
and project2
. * Assignments for all three entities (organizationA
, project1
, and project2
) 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.
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Promise<[ protos.google.cloud.bigquery.reservation.v1.IAssignment, (protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest | undefined), {} | undefined ]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [Assignment]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
/**
* This snippet 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.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The parent resource name of the assignment
* E.g. `projects/myproject/locations/US/reservations/team1-prod`
*/
// const parent = 'abc123'
/**
* Assignment resource to create.
*/
// const assignment = {}
/**
* The optional assignment ID. Assignment name will be generated automatically
* if this field is empty.
* This field must only contain lower case alphanumeric characters or dashes.
* Max length is 64 characters.
*/
// const assignmentId = 'abc123'
// Imports the Reservation library
const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1;
// Instantiates a client
const reservationClient = new ReservationServiceClient();
async function callCreateAssignment() {
// Construct request
const request = {
parent,
};
// Run request
const response = await reservationClient.createAssignment(request);
console.log(response);
}
callCreateAssignment();
createAssignment(request, options, callback)
createAssignment(request: protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest, options: CallOptions, callback: Callback<protos.google.cloud.bigquery.reservation.v1.IAssignment, protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.bigquery.reservation.v1.IAssignment, protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
createAssignment(request, callback)
createAssignment(request: protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest, callback: Callback<protos.google.cloud.bigquery.reservation.v1.IAssignment, protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest
|
callback |
Callback<protos.google.cloud.bigquery.reservation.v1.IAssignment, protos.google.cloud.bigquery.reservation.v1.ICreateAssignmentRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
createCapacityCommitment(request, options)
createCapacityCommitment(request?: protos.google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest, options?: CallOptions): Promise<[
protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment,
(protos.google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest | undefined),
{} | undefined
]>;
Creates a new capacity commitment resource.
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Promise<[ protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, (protos.google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest | undefined), {} | undefined ]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [CapacityCommitment]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
/**
* This snippet 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.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Resource name of the parent reservation. E.g.,
* `projects/myproject/locations/US`
*/
// const parent = 'abc123'
/**
* Content of the capacity commitment to create.
*/
// const capacityCommitment = {}
/**
* If true, fail the request if another project in the organization has a
* capacity commitment.
*/
// const enforceSingleAdminProjectPerOrg = true
/**
* The optional capacity commitment ID. Capacity commitment name will be
* generated automatically if this field is empty.
* This field must only contain lower case alphanumeric characters or dashes.
* The first and last character cannot be a dash. Max length is 64 characters.
* NOTE: this ID won't be kept if the capacity commitment is split or merged.
*/
// const capacityCommitmentId = 'abc123'
// Imports the Reservation library
const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1;
// Instantiates a client
const reservationClient = new ReservationServiceClient();
async function callCreateCapacityCommitment() {
// Construct request
const request = {
parent,
};
// Run request
const response = await reservationClient.createCapacityCommitment(request);
console.log(response);
}
callCreateCapacityCommitment();
createCapacityCommitment(request, options, callback)
createCapacityCommitment(request: protos.google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest, options: CallOptions, callback: Callback<protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, protos.google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, protos.google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
createCapacityCommitment(request, callback)
createCapacityCommitment(request: protos.google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest, callback: Callback<protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, protos.google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest
|
callback |
Callback<protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, protos.google.cloud.bigquery.reservation.v1.ICreateCapacityCommitmentRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
createReservation(request, options)
createReservation(request?: protos.google.cloud.bigquery.reservation.v1.ICreateReservationRequest, options?: CallOptions): Promise<[
protos.google.cloud.bigquery.reservation.v1.IReservation,
(protos.google.cloud.bigquery.reservation.v1.ICreateReservationRequest | undefined),
{} | undefined
]>;
Creates a new reservation resource.
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.ICreateReservationRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Promise<[ protos.google.cloud.bigquery.reservation.v1.IReservation, (protos.google.cloud.bigquery.reservation.v1.ICreateReservationRequest | undefined), {} | undefined ]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [Reservation]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
/**
* This snippet 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.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Project, location. E.g.,
* `projects/myproject/locations/US`
*/
// const parent = 'abc123'
/**
* The reservation ID. It must only contain lower case alphanumeric
* characters or dashes. It must start with a letter and must not end
* with a dash. Its maximum length is 64 characters.
*/
// const reservationId = 'abc123'
/**
* Definition of the new reservation to create.
*/
// const reservation = {}
// Imports the Reservation library
const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1;
// Instantiates a client
const reservationClient = new ReservationServiceClient();
async function callCreateReservation() {
// Construct request
const request = {
parent,
};
// Run request
const response = await reservationClient.createReservation(request);
console.log(response);
}
callCreateReservation();
createReservation(request, options, callback)
createReservation(request: protos.google.cloud.bigquery.reservation.v1.ICreateReservationRequest, options: CallOptions, callback: Callback<protos.google.cloud.bigquery.reservation.v1.IReservation, protos.google.cloud.bigquery.reservation.v1.ICreateReservationRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.ICreateReservationRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.bigquery.reservation.v1.IReservation, protos.google.cloud.bigquery.reservation.v1.ICreateReservationRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
createReservation(request, callback)
createReservation(request: protos.google.cloud.bigquery.reservation.v1.ICreateReservationRequest, callback: Callback<protos.google.cloud.bigquery.reservation.v1.IReservation, protos.google.cloud.bigquery.reservation.v1.ICreateReservationRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.ICreateReservationRequest
|
callback |
Callback<protos.google.cloud.bigquery.reservation.v1.IReservation, protos.google.cloud.bigquery.reservation.v1.ICreateReservationRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
deleteAssignment(request, options)
deleteAssignment(request?: protos.google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest, options?: CallOptions): Promise<[
protos.google.protobuf.IEmpty,
(protos.google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest | undefined),
{} | undefined
]>;
Deletes a assignment. No expansion will happen.
Example:
* Organization organizationA
contains two projects, project1
and project2
. * 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.
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Promise<[ protos.google.protobuf.IEmpty, (protos.google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest | undefined), {} | undefined ]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [Empty]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
/**
* This snippet 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.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Name of the resource, e.g.
* `projects/myproject/locations/US/reservations/team1-prod/assignments/123`
*/
// const name = 'abc123'
// Imports the Reservation library
const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1;
// Instantiates a client
const reservationClient = new ReservationServiceClient();
async function callDeleteAssignment() {
// Construct request
const request = {
name,
};
// Run request
const response = await reservationClient.deleteAssignment(request);
console.log(response);
}
callDeleteAssignment();
deleteAssignment(request, options, callback)
deleteAssignment(request: protos.google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.protobuf.IEmpty, protos.google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
deleteAssignment(request, callback)
deleteAssignment(request: protos.google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest
|
callback |
Callback<protos.google.protobuf.IEmpty, protos.google.cloud.bigquery.reservation.v1.IDeleteAssignmentRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
deleteCapacityCommitment(request, options)
deleteCapacityCommitment(request?: protos.google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest, options?: CallOptions): Promise<[
protos.google.protobuf.IEmpty,
(protos.google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest | undefined),
{} | undefined
]>;
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
.
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Promise<[ protos.google.protobuf.IEmpty, (protos.google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest | undefined), {} | undefined ]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [Empty]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
/**
* This snippet 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.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Resource name of the capacity commitment to delete. E.g.,
* `projects/myproject/locations/US/capacityCommitments/123`
*/
// const name = 'abc123'
/**
* Can be used to force delete commitments even if assignments exist. Deleting
* commitments with assignments may cause queries to fail if they no longer
* have access to slots.
*/
// const force = true
// Imports the Reservation library
const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1;
// Instantiates a client
const reservationClient = new ReservationServiceClient();
async function callDeleteCapacityCommitment() {
// Construct request
const request = {
name,
};
// Run request
const response = await reservationClient.deleteCapacityCommitment(request);
console.log(response);
}
callDeleteCapacityCommitment();
deleteCapacityCommitment(request, options, callback)
deleteCapacityCommitment(request: protos.google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.protobuf.IEmpty, protos.google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
deleteCapacityCommitment(request, callback)
deleteCapacityCommitment(request: protos.google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest
|
callback |
Callback<protos.google.protobuf.IEmpty, protos.google.cloud.bigquery.reservation.v1.IDeleteCapacityCommitmentRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
deleteReservation(request, options)
deleteReservation(request?: protos.google.cloud.bigquery.reservation.v1.IDeleteReservationRequest, options?: CallOptions): Promise<[
protos.google.protobuf.IEmpty,
(protos.google.cloud.bigquery.reservation.v1.IDeleteReservationRequest | undefined),
{} | undefined
]>;
Deletes a reservation. Returns google.rpc.Code.FAILED_PRECONDITION
when reservation has assignments.
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IDeleteReservationRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Promise<[ protos.google.protobuf.IEmpty, (protos.google.cloud.bigquery.reservation.v1.IDeleteReservationRequest | undefined), {} | undefined ]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [Empty]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
/**
* This snippet 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.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Resource name of the reservation to retrieve. E.g.,
* `projects/myproject/locations/US/reservations/team1-prod`
*/
// const name = 'abc123'
// Imports the Reservation library
const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1;
// Instantiates a client
const reservationClient = new ReservationServiceClient();
async function callDeleteReservation() {
// Construct request
const request = {
name,
};
// Run request
const response = await reservationClient.deleteReservation(request);
console.log(response);
}
callDeleteReservation();
deleteReservation(request, options, callback)
deleteReservation(request: protos.google.cloud.bigquery.reservation.v1.IDeleteReservationRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.bigquery.reservation.v1.IDeleteReservationRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IDeleteReservationRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.protobuf.IEmpty, protos.google.cloud.bigquery.reservation.v1.IDeleteReservationRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
deleteReservation(request, callback)
deleteReservation(request: protos.google.cloud.bigquery.reservation.v1.IDeleteReservationRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.cloud.bigquery.reservation.v1.IDeleteReservationRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IDeleteReservationRequest
|
callback |
Callback<protos.google.protobuf.IEmpty, protos.google.cloud.bigquery.reservation.v1.IDeleteReservationRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
getBiReservation(request, options)
getBiReservation(request?: protos.google.cloud.bigquery.reservation.v1.IGetBiReservationRequest, options?: CallOptions): Promise<[
protos.google.cloud.bigquery.reservation.v1.IBiReservation,
(protos.google.cloud.bigquery.reservation.v1.IGetBiReservationRequest | undefined),
{} | undefined
]>;
Retrieves a BI reservation.
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IGetBiReservationRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Promise<[ protos.google.cloud.bigquery.reservation.v1.IBiReservation, (protos.google.cloud.bigquery.reservation.v1.IGetBiReservationRequest | undefined), {} | undefined ]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [BiReservation]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
/**
* This snippet 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.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Name of the requested reservation, for example:
* `projects/{project_id}/locations/{location_id}/biReservation`
*/
// const name = 'abc123'
// Imports the Reservation library
const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1;
// Instantiates a client
const reservationClient = new ReservationServiceClient();
async function callGetBiReservation() {
// Construct request
const request = {
name,
};
// Run request
const response = await reservationClient.getBiReservation(request);
console.log(response);
}
callGetBiReservation();
getBiReservation(request, options, callback)
getBiReservation(request: protos.google.cloud.bigquery.reservation.v1.IGetBiReservationRequest, options: CallOptions, callback: Callback<protos.google.cloud.bigquery.reservation.v1.IBiReservation, protos.google.cloud.bigquery.reservation.v1.IGetBiReservationRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IGetBiReservationRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.bigquery.reservation.v1.IBiReservation, protos.google.cloud.bigquery.reservation.v1.IGetBiReservationRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
getBiReservation(request, callback)
getBiReservation(request: protos.google.cloud.bigquery.reservation.v1.IGetBiReservationRequest, callback: Callback<protos.google.cloud.bigquery.reservation.v1.IBiReservation, protos.google.cloud.bigquery.reservation.v1.IGetBiReservationRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IGetBiReservationRequest
|
callback |
Callback<protos.google.cloud.bigquery.reservation.v1.IBiReservation, protos.google.cloud.bigquery.reservation.v1.IGetBiReservationRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
getCapacityCommitment(request, options)
getCapacityCommitment(request?: protos.google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest, options?: CallOptions): Promise<[
protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment,
(protos.google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest | undefined),
{} | undefined
]>;
Returns information about the capacity commitment.
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Promise<[ protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, (protos.google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest | undefined), {} | undefined ]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [CapacityCommitment]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
/**
* This snippet 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.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Resource name of the capacity commitment to retrieve. E.g.,
* `projects/myproject/locations/US/capacityCommitments/123`
*/
// const name = 'abc123'
// Imports the Reservation library
const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1;
// Instantiates a client
const reservationClient = new ReservationServiceClient();
async function callGetCapacityCommitment() {
// Construct request
const request = {
name,
};
// Run request
const response = await reservationClient.getCapacityCommitment(request);
console.log(response);
}
callGetCapacityCommitment();
getCapacityCommitment(request, options, callback)
getCapacityCommitment(request: protos.google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest, options: CallOptions, callback: Callback<protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, protos.google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, protos.google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
getCapacityCommitment(request, callback)
getCapacityCommitment(request: protos.google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest, callback: Callback<protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, protos.google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest
|
callback |
Callback<protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, protos.google.cloud.bigquery.reservation.v1.IGetCapacityCommitmentRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
getProjectId()
getProjectId(): Promise<string>;
Type | Description |
Promise<string> |
getProjectId(callback)
getProjectId(callback: Callback<string, undefined, undefined>): void;
Name | Description |
callback |
Callback<string, undefined, undefined>
|
Type | Description |
void |
getReservation(request, options)
getReservation(request?: protos.google.cloud.bigquery.reservation.v1.IGetReservationRequest, options?: CallOptions): Promise<[
protos.google.cloud.bigquery.reservation.v1.IReservation,
(protos.google.cloud.bigquery.reservation.v1.IGetReservationRequest | undefined),
{} | undefined
]>;
Returns information about the reservation.
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IGetReservationRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Promise<[ protos.google.cloud.bigquery.reservation.v1.IReservation, (protos.google.cloud.bigquery.reservation.v1.IGetReservationRequest | undefined), {} | undefined ]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [Reservation]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
/**
* This snippet 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.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Resource name of the reservation to retrieve. E.g.,
* `projects/myproject/locations/US/reservations/team1-prod`
*/
// const name = 'abc123'
// Imports the Reservation library
const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1;
// Instantiates a client
const reservationClient = new ReservationServiceClient();
async function callGetReservation() {
// Construct request
const request = {
name,
};
// Run request
const response = await reservationClient.getReservation(request);
console.log(response);
}
callGetReservation();
getReservation(request, options, callback)
getReservation(request: protos.google.cloud.bigquery.reservation.v1.IGetReservationRequest, options: CallOptions, callback: Callback<protos.google.cloud.bigquery.reservation.v1.IReservation, protos.google.cloud.bigquery.reservation.v1.IGetReservationRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IGetReservationRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.bigquery.reservation.v1.IReservation, protos.google.cloud.bigquery.reservation.v1.IGetReservationRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
getReservation(request, callback)
getReservation(request: protos.google.cloud.bigquery.reservation.v1.IGetReservationRequest, callback: Callback<protos.google.cloud.bigquery.reservation.v1.IReservation, protos.google.cloud.bigquery.reservation.v1.IGetReservationRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IGetReservationRequest
|
callback |
Callback<protos.google.cloud.bigquery.reservation.v1.IReservation, protos.google.cloud.bigquery.reservation.v1.IGetReservationRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
initialize()
initialize(): Promise<{
[name: string]: Function;
}>;
Initialize the client. Performs asynchronous operations (such as authentication) and prepares the client. This function will be called automatically when any class method is called for the first time, but if you need to initialize it before calling an actual method, feel free to call initialize() directly.
You can await on this method if you want to make sure the client is initialized.
Type | Description |
Promise<{ [name: string]: Function; }> | {Promise} A promise that resolves to an authenticated service stub. |
listAssignments(request, options)
listAssignments(request?: protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, options?: CallOptions): Promise<[
protos.google.cloud.bigquery.reservation.v1.IAssignment[],
protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest | null,
protos.google.cloud.bigquery.reservation.v1.IListAssignmentsResponse
]>;
Lists assignments.
Only explicitly created assignments will be returned.
Example:
* Organization organizationA
contains two projects, project1
and project2
. * 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.
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Promise<[ protos.google.cloud.bigquery.reservation.v1.IAssignment[], protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest | null, protos.google.cloud.bigquery.reservation.v1.IListAssignmentsResponse ]> | {Promise} - The promise which resolves to an array. The first element of the array is Array of [Assignment]. The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using |
listAssignments(request, options, callback)
listAssignments(request: protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, protos.google.cloud.bigquery.reservation.v1.IListAssignmentsResponse | null | undefined, protos.google.cloud.bigquery.reservation.v1.IAssignment>): void;
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, protos.google.cloud.bigquery.reservation.v1.IListAssignmentsResponse | null | undefined, protos.google.cloud.bigquery.reservation.v1.IAssignment>
|
Type | Description |
void |
listAssignments(request, callback)
listAssignments(request: protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, callback: PaginationCallback<protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, protos.google.cloud.bigquery.reservation.v1.IListAssignmentsResponse | null | undefined, protos.google.cloud.bigquery.reservation.v1.IAssignment>): void;
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest
|
callback |
PaginationCallback<protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, protos.google.cloud.bigquery.reservation.v1.IListAssignmentsResponse | null | undefined, protos.google.cloud.bigquery.reservation.v1.IAssignment>
|
Type | Description |
void |
listAssignmentsAsync(request, options)
listAssignmentsAsync(request?: protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.bigquery.reservation.v1.IAssignment>;
Equivalent to listAssignments
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
AsyncIterable<protos.google.cloud.bigquery.reservation.v1.IAssignment> | {Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing [Assignment]. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples. |
/**
* This snippet 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.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The parent resource name e.g.:
* `projects/myproject/locations/US/reservations/team1-prod`
* Or:
* `projects/myproject/locations/US/reservations/-`
*/
// const parent = 'abc123'
/**
* The maximum number of items to return per page.
*/
// const pageSize = 1234
/**
* The next_page_token value returned from a previous List request, if any.
*/
// const pageToken = 'abc123'
// Imports the Reservation library
const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1;
// Instantiates a client
const reservationClient = new ReservationServiceClient();
async function callListAssignments() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = await reservationClient.listAssignmentsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListAssignments();
listAssignmentsStream(request, options)
listAssignmentsStream(request?: protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest, options?: CallOptions): Transform;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IListAssignmentsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Transform | {Stream} An object stream which emits an object representing [Assignment] on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using |
listCapacityCommitments(request, options)
listCapacityCommitments(request?: protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, options?: CallOptions): Promise<[
protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment[],
protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest | null,
protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsResponse
]>;
Lists all the capacity commitments for the admin project.
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Promise<[ protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment[], protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest | null, protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsResponse ]> | {Promise} - The promise which resolves to an array. The first element of the array is Array of [CapacityCommitment]. The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using |
listCapacityCommitments(request, options, callback)
listCapacityCommitments(request: protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsResponse | null | undefined, protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment>): void;
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsResponse | null | undefined, protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment>
|
Type | Description |
void |
listCapacityCommitments(request, callback)
listCapacityCommitments(request: protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, callback: PaginationCallback<protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsResponse | null | undefined, protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment>): void;
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest
|
callback |
PaginationCallback<protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsResponse | null | undefined, protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment>
|
Type | Description |
void |
listCapacityCommitmentsAsync(request, options)
listCapacityCommitmentsAsync(request?: protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment>;
Equivalent to listCapacityCommitments
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
AsyncIterable<protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment> | {Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing [CapacityCommitment]. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples. |
/**
* This snippet 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.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. Resource name of the parent reservation. E.g.,
* `projects/myproject/locations/US`
*/
// const parent = 'abc123'
/**
* The maximum number of items to return.
*/
// const pageSize = 1234
/**
* The next_page_token value returned from a previous List request, if any.
*/
// const pageToken = 'abc123'
// Imports the Reservation library
const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1;
// Instantiates a client
const reservationClient = new ReservationServiceClient();
async function callListCapacityCommitments() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = await reservationClient.listCapacityCommitmentsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListCapacityCommitments();
listCapacityCommitmentsStream(request, options)
listCapacityCommitmentsStream(request?: protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest, options?: CallOptions): Transform;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IListCapacityCommitmentsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Transform | {Stream} An object stream which emits an object representing [CapacityCommitment] on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using |
listReservations(request, options)
listReservations(request?: protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, options?: CallOptions): Promise<[
protos.google.cloud.bigquery.reservation.v1.IReservation[],
protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest | null,
protos.google.cloud.bigquery.reservation.v1.IListReservationsResponse
]>;
Lists all the reservations for the project in the specified location.
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Promise<[ protos.google.cloud.bigquery.reservation.v1.IReservation[], protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest | null, protos.google.cloud.bigquery.reservation.v1.IListReservationsResponse ]> | {Promise} - The promise which resolves to an array. The first element of the array is Array of [Reservation]. The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using |
listReservations(request, options, callback)
listReservations(request: protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, protos.google.cloud.bigquery.reservation.v1.IListReservationsResponse | null | undefined, protos.google.cloud.bigquery.reservation.v1.IReservation>): void;
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, protos.google.cloud.bigquery.reservation.v1.IListReservationsResponse | null | undefined, protos.google.cloud.bigquery.reservation.v1.IReservation>
|
Type | Description |
void |
listReservations(request, callback)
listReservations(request: protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, callback: PaginationCallback<protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, protos.google.cloud.bigquery.reservation.v1.IListReservationsResponse | null | undefined, protos.google.cloud.bigquery.reservation.v1.IReservation>): void;
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest
|
callback |
PaginationCallback<protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, protos.google.cloud.bigquery.reservation.v1.IListReservationsResponse | null | undefined, protos.google.cloud.bigquery.reservation.v1.IReservation>
|
Type | Description |
void |
listReservationsAsync(request, options)
listReservationsAsync(request?: protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.bigquery.reservation.v1.IReservation>;
Equivalent to listReservations
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
AsyncIterable<protos.google.cloud.bigquery.reservation.v1.IReservation> | {Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing [Reservation]. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples. |
/**
* This snippet 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.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The parent resource name containing project and location, e.g.:
* `projects/myproject/locations/US`
*/
// const parent = 'abc123'
/**
* The maximum number of items to return per page.
*/
// const pageSize = 1234
/**
* The next_page_token value returned from a previous List request, if any.
*/
// const pageToken = 'abc123'
// Imports the Reservation library
const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1;
// Instantiates a client
const reservationClient = new ReservationServiceClient();
async function callListReservations() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = await reservationClient.listReservationsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListReservations();
listReservationsStream(request, options)
listReservationsStream(request?: protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest, options?: CallOptions): Transform;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IListReservationsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Transform | {Stream} An object stream which emits an object representing [Reservation] on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using |
locationPath(project, location)
locationPath(project: string, location: string): string;
Return a fully-qualified location resource name string.
Name | Description |
project |
string
|
location |
string
|
Type | Description |
string | {string} Resource name string. |
matchAssignmentFromAssignmentName(assignmentName)
matchAssignmentFromAssignmentName(assignmentName: string): string | number;
Parse the assignment from Assignment resource.
Name | Description |
assignmentName |
string
A fully-qualified path representing Assignment resource. |
Type | Description |
string | number | {string} A string representing the assignment. |
matchCapacityCommitmentFromCapacityCommitmentName(capacityCommitmentName)
matchCapacityCommitmentFromCapacityCommitmentName(capacityCommitmentName: string): string | number;
Parse the capacity_commitment from CapacityCommitment resource.
Name | Description |
capacityCommitmentName |
string
A fully-qualified path representing CapacityCommitment resource. |
Type | Description |
string | number | {string} A string representing the capacity_commitment. |
matchLocationFromAssignmentName(assignmentName)
matchLocationFromAssignmentName(assignmentName: string): string | number;
Parse the location from Assignment resource.
Name | Description |
assignmentName |
string
A fully-qualified path representing Assignment resource. |
Type | Description |
string | number | {string} A string representing the location. |
matchLocationFromBiReservationName(biReservationName)
matchLocationFromBiReservationName(biReservationName: string): string | number;
Parse the location from BiReservation resource.
Name | Description |
biReservationName |
string
A fully-qualified path representing BiReservation resource. |
Type | Description |
string | number | {string} A string representing the location. |
matchLocationFromCapacityCommitmentName(capacityCommitmentName)
matchLocationFromCapacityCommitmentName(capacityCommitmentName: string): string | number;
Parse the location from CapacityCommitment resource.
Name | Description |
capacityCommitmentName |
string
A fully-qualified path representing CapacityCommitment resource. |
Type | Description |
string | number | {string} A string representing the location. |
matchLocationFromLocationName(locationName)
matchLocationFromLocationName(locationName: string): string | number;
Parse the location from Location resource.
Name | Description |
locationName |
string
A fully-qualified path representing Location resource. |
Type | Description |
string | number | {string} A string representing the location. |
matchLocationFromReservationName(reservationName)
matchLocationFromReservationName(reservationName: string): string | number;
Parse the location from Reservation resource.
Name | Description |
reservationName |
string
A fully-qualified path representing Reservation resource. |
Type | Description |
string | number | {string} A string representing the location. |
matchProjectFromAssignmentName(assignmentName)
matchProjectFromAssignmentName(assignmentName: string): string | number;
Parse the project from Assignment resource.
Name | Description |
assignmentName |
string
A fully-qualified path representing Assignment resource. |
Type | Description |
string | number | {string} A string representing the project. |
matchProjectFromBiReservationName(biReservationName)
matchProjectFromBiReservationName(biReservationName: string): string | number;
Parse the project from BiReservation resource.
Name | Description |
biReservationName |
string
A fully-qualified path representing BiReservation resource. |
Type | Description |
string | number | {string} A string representing the project. |
matchProjectFromCapacityCommitmentName(capacityCommitmentName)
matchProjectFromCapacityCommitmentName(capacityCommitmentName: string): string | number;
Parse the project from CapacityCommitment resource.
Name | Description |
capacityCommitmentName |
string
A fully-qualified path representing CapacityCommitment resource. |
Type | Description |
string | number | {string} A string representing the project. |
matchProjectFromLocationName(locationName)
matchProjectFromLocationName(locationName: string): string | number;
Parse the project from Location resource.
Name | Description |
locationName |
string
A fully-qualified path representing Location resource. |
Type | Description |
string | number | {string} A string representing the project. |
matchProjectFromProjectName(projectName)
matchProjectFromProjectName(projectName: string): string | number;
Parse the project from Project resource.
Name | Description |
projectName |
string
A fully-qualified path representing Project resource. |
Type | Description |
string | number | {string} A string representing the project. |
matchProjectFromReservationName(reservationName)
matchProjectFromReservationName(reservationName: string): string | number;
Parse the project from Reservation resource.
Name | Description |
reservationName |
string
A fully-qualified path representing Reservation resource. |
Type | Description |
string | number | {string} A string representing the project. |
matchReservationFromAssignmentName(assignmentName)
matchReservationFromAssignmentName(assignmentName: string): string | number;
Parse the reservation from Assignment resource.
Name | Description |
assignmentName |
string
A fully-qualified path representing Assignment resource. |
Type | Description |
string | number | {string} A string representing the reservation. |
matchReservationFromReservationName(reservationName)
matchReservationFromReservationName(reservationName: string): string | number;
Parse the reservation from Reservation resource.
Name | Description |
reservationName |
string
A fully-qualified path representing Reservation resource. |
Type | Description |
string | number | {string} A string representing the reservation. |
mergeCapacityCommitments(request, options)
mergeCapacityCommitments(request?: protos.google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest, options?: CallOptions): Promise<[
protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment,
(protos.google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest | undefined),
{} | undefined
]>;
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
.
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Promise<[ protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, (protos.google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest | undefined), {} | undefined ]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [CapacityCommitment]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
/**
* This snippet 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.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Parent resource that identifies admin project and location e.g.,
* `projects/myproject/locations/us`
*/
// const parent = 'abc123'
/**
* Ids of capacity commitments to merge.
* These capacity commitments must exist under admin project and location
* specified in the parent.
* ID is the last portion of capacity commitment name e.g., 'abc' for
* projects/myproject/locations/US/capacityCommitments/abc
*/
// const capacityCommitmentIds = 'abc123'
// Imports the Reservation library
const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1;
// Instantiates a client
const reservationClient = new ReservationServiceClient();
async function callMergeCapacityCommitments() {
// Construct request
const request = {
};
// Run request
const response = await reservationClient.mergeCapacityCommitments(request);
console.log(response);
}
callMergeCapacityCommitments();
mergeCapacityCommitments(request, options, callback)
mergeCapacityCommitments(request: protos.google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest, options: CallOptions, callback: Callback<protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, protos.google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, protos.google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
mergeCapacityCommitments(request, callback)
mergeCapacityCommitments(request: protos.google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest, callback: Callback<protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, protos.google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest
|
callback |
Callback<protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, protos.google.cloud.bigquery.reservation.v1.IMergeCapacityCommitmentsRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
moveAssignment(request, options)
moveAssignment(request?: protos.google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest, options?: CallOptions): Promise<[
protos.google.cloud.bigquery.reservation.v1.IAssignment,
(protos.google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest | undefined),
{} | undefined
]>;
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.
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Promise<[ protos.google.cloud.bigquery.reservation.v1.IAssignment, (protos.google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest | undefined), {} | undefined ]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [Assignment]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
/**
* This snippet 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.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The resource name of the assignment,
* e.g.
* `projects/myproject/locations/US/reservations/team1-prod/assignments/123`
*/
// const name = 'abc123'
/**
* The new reservation ID, e.g.:
* `projects/myotherproject/locations/US/reservations/team2-prod`
*/
// const destinationId = 'abc123'
// Imports the Reservation library
const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1;
// Instantiates a client
const reservationClient = new ReservationServiceClient();
async function callMoveAssignment() {
// Construct request
const request = {
name,
};
// Run request
const response = await reservationClient.moveAssignment(request);
console.log(response);
}
callMoveAssignment();
moveAssignment(request, options, callback)
moveAssignment(request: protos.google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest, options: CallOptions, callback: Callback<protos.google.cloud.bigquery.reservation.v1.IAssignment, protos.google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.bigquery.reservation.v1.IAssignment, protos.google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
moveAssignment(request, callback)
moveAssignment(request: protos.google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest, callback: Callback<protos.google.cloud.bigquery.reservation.v1.IAssignment, protos.google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest
|
callback |
Callback<protos.google.cloud.bigquery.reservation.v1.IAssignment, protos.google.cloud.bigquery.reservation.v1.IMoveAssignmentRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
projectPath(project)
projectPath(project: string): string;
Return a fully-qualified project resource name string.
Name | Description |
project |
string
|
Type | Description |
string | {string} Resource name string. |
reservationPath(project, location, reservation)
reservationPath(project: string, location: string, reservation: string): string;
Return a fully-qualified reservation resource name string.
Name | Description |
project |
string
|
location |
string
|
reservation |
string
|
Type | Description |
string | {string} Resource name string. |
searchAllAssignments(request, options)
searchAllAssignments(request?: protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest, options?: CallOptions): Promise<[
protos.google.cloud.bigquery.reservation.v1.IAssignment[],
protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest | null,
protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsResponse
]>;
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. 2. Otherwise assignments created on the closest ancestor will be returned. 3. 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. 2. Hierarchy lookup (project->folder->organization) happens in this API. 3. Parent here is
projects/* /locations/*
, instead ofprojects/* /locations/*reservations/*
.
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Promise<[ protos.google.cloud.bigquery.reservation.v1.IAssignment[], protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest | null, protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsResponse ]> | {Promise} - The promise which resolves to an array. The first element of the array is Array of [Assignment]. The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using |
searchAllAssignments(request, options, callback)
searchAllAssignments(request: protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest, protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsResponse | null | undefined, protos.google.cloud.bigquery.reservation.v1.IAssignment>): void;
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest, protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsResponse | null | undefined, protos.google.cloud.bigquery.reservation.v1.IAssignment>
|
Type | Description |
void |
searchAllAssignments(request, callback)
searchAllAssignments(request: protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest, callback: PaginationCallback<protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest, protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsResponse | null | undefined, protos.google.cloud.bigquery.reservation.v1.IAssignment>): void;
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest
|
callback |
PaginationCallback<protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest, protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsResponse | null | undefined, protos.google.cloud.bigquery.reservation.v1.IAssignment>
|
Type | Description |
void |
searchAllAssignmentsAsync(request, options)
searchAllAssignmentsAsync(request?: protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.bigquery.reservation.v1.IAssignment>;
Equivalent to searchAllAssignments
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
AsyncIterable<protos.google.cloud.bigquery.reservation.v1.IAssignment> | {Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing [Assignment]. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples. |
/**
* This snippet 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.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The resource name with location (project name could be the wildcard '-'),
* e.g.:
* `projects/-/locations/US`.
*/
// const parent = 'abc123'
/**
* Please specify resource name as assignee in the query.
* Examples:
* * `assignee=projects/myproject`
* * `assignee=folders/123`
* * `assignee=organizations/456`
*/
// const query = 'abc123'
/**
* The maximum number of items to return per page.
*/
// const pageSize = 1234
/**
* The next_page_token value returned from a previous List request, if any.
*/
// const pageToken = 'abc123'
// Imports the Reservation library
const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1;
// Instantiates a client
const reservationClient = new ReservationServiceClient();
async function callSearchAllAssignments() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = await reservationClient.searchAllAssignmentsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callSearchAllAssignments();
searchAllAssignmentsStream(request, options)
searchAllAssignmentsStream(request?: protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest, options?: CallOptions): Transform;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.ISearchAllAssignmentsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Transform | {Stream} An object stream which emits an object representing [Assignment] on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using |
searchAssignments(request, options)
searchAssignments(request?: protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, options?: CallOptions): Promise<[
protos.google.cloud.bigquery.reservation.v1.IAssignment[],
protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest | null,
protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsResponse
]>;
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. 2. Otherwise assignments created on the closest ancestor will be returned. 3. 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. 2. Hierarchy lookup (project->folder->organization) happens in this API. 3. Parent here is
projects/* /locations/*
, instead ofprojects/* /locations/*reservations/*
.
**Note** "-" cannot be used for projects nor locations.
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Promise<[ protos.google.cloud.bigquery.reservation.v1.IAssignment[], protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest | null, protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsResponse ]> | {Promise} - The promise which resolves to an array. The first element of the array is Array of [Assignment]. The client library will perform auto-pagination by default: it will call the API as many times as needed and will merge results from all the pages into this array. Note that it can affect your quota. We recommend using |
searchAssignments(request, options, callback)
searchAssignments(request: protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, options: CallOptions, callback: PaginationCallback<protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsResponse | null | undefined, protos.google.cloud.bigquery.reservation.v1.IAssignment>): void;
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest
|
options |
CallOptions
|
callback |
PaginationCallback<protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsResponse | null | undefined, protos.google.cloud.bigquery.reservation.v1.IAssignment>
|
Type | Description |
void |
searchAssignments(request, callback)
searchAssignments(request: protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, callback: PaginationCallback<protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsResponse | null | undefined, protos.google.cloud.bigquery.reservation.v1.IAssignment>): void;
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest
|
callback |
PaginationCallback<protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsResponse | null | undefined, protos.google.cloud.bigquery.reservation.v1.IAssignment>
|
Type | Description |
void |
searchAssignmentsAsync(request, options)
searchAssignmentsAsync(request?: protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, options?: CallOptions): AsyncIterable<protos.google.cloud.bigquery.reservation.v1.IAssignment>;
Equivalent to searchAssignments
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
AsyncIterable<protos.google.cloud.bigquery.reservation.v1.IAssignment> | {Object} An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). When you iterate the returned iterable, each element will be an object representing [Assignment]. The API will be called under the hood as needed, once per the page, so you can stop the iteration when you don't need more results. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) for more details and examples. |
/**
* This snippet 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.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The resource name of the admin project(containing project and location),
* e.g.:
* `projects/myproject/locations/US`.
*/
// const parent = 'abc123'
/**
* Please specify resource name as assignee in the query.
* Examples:
* * `assignee=projects/myproject`
* * `assignee=folders/123`
* * `assignee=organizations/456`
*/
// const query = 'abc123'
/**
* The maximum number of items to return per page.
*/
// const pageSize = 1234
/**
* The next_page_token value returned from a previous List request, if any.
*/
// const pageToken = 'abc123'
// Imports the Reservation library
const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1;
// Instantiates a client
const reservationClient = new ReservationServiceClient();
async function callSearchAssignments() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = await reservationClient.searchAssignmentsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callSearchAssignments();
searchAssignmentsStream(request, options)
searchAssignmentsStream(request?: protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest, options?: CallOptions): Transform;
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.ISearchAssignmentsRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Transform | {Stream} An object stream which emits an object representing [Assignment] on 'data' event. The client library will perform auto-pagination by default: it will call the API as many times as needed. Note that it can affect your quota. We recommend using |
splitCapacityCommitment(request, options)
splitCapacityCommitment(request?: protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest, options?: CallOptions): Promise<[
protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentResponse,
(protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest | undefined),
{} | undefined
]>;
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.
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Promise<[ protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentResponse, (protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest | undefined), {} | undefined ]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [SplitCapacityCommitmentResponse]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
/**
* This snippet 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.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Required. The resource name e.g.,:
* `projects/myproject/locations/US/capacityCommitments/123`
*/
// const name = 'abc123'
/**
* Number of slots in the capacity commitment after the split.
*/
// const slotCount = 1234
// Imports the Reservation library
const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1;
// Instantiates a client
const reservationClient = new ReservationServiceClient();
async function callSplitCapacityCommitment() {
// Construct request
const request = {
name,
};
// Run request
const response = await reservationClient.splitCapacityCommitment(request);
console.log(response);
}
callSplitCapacityCommitment();
splitCapacityCommitment(request, options, callback)
splitCapacityCommitment(request: protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest, options: CallOptions, callback: Callback<protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentResponse, protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentResponse, protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
splitCapacityCommitment(request, callback)
splitCapacityCommitment(request: protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest, callback: Callback<protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentResponse, protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest
|
callback |
Callback<protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentResponse, protos.google.cloud.bigquery.reservation.v1.ISplitCapacityCommitmentRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
updateAssignment(request, options)
updateAssignment(request?: protos.google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest, options?: CallOptions): Promise<[
protos.google.cloud.bigquery.reservation.v1.IAssignment,
(protos.google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest | undefined),
{} | undefined
]>;
Updates an existing assignment.
Only the priority
field can be updated.
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Promise<[ protos.google.cloud.bigquery.reservation.v1.IAssignment, (protos.google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest | undefined), {} | undefined ]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [Assignment]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
/**
* This snippet 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.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Content of the assignment to update.
*/
// const assignment = {}
/**
* Standard field mask for the set of fields to be updated.
*/
// const updateMask = {}
// Imports the Reservation library
const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1;
// Instantiates a client
const reservationClient = new ReservationServiceClient();
async function callUpdateAssignment() {
// Construct request
const request = {
};
// Run request
const response = await reservationClient.updateAssignment(request);
console.log(response);
}
callUpdateAssignment();
updateAssignment(request, options, callback)
updateAssignment(request: protos.google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest, options: CallOptions, callback: Callback<protos.google.cloud.bigquery.reservation.v1.IAssignment, protos.google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.bigquery.reservation.v1.IAssignment, protos.google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
updateAssignment(request, callback)
updateAssignment(request: protos.google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest, callback: Callback<protos.google.cloud.bigquery.reservation.v1.IAssignment, protos.google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest
|
callback |
Callback<protos.google.cloud.bigquery.reservation.v1.IAssignment, protos.google.cloud.bigquery.reservation.v1.IUpdateAssignmentRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
updateBiReservation(request, options)
updateBiReservation(request?: protos.google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest, options?: CallOptions): Promise<[
protos.google.cloud.bigquery.reservation.v1.IBiReservation,
(protos.google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest | undefined),
{} | undefined
]>;
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.
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Promise<[ protos.google.cloud.bigquery.reservation.v1.IBiReservation, (protos.google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest | undefined), {} | undefined ]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [BiReservation]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
/**
* This snippet 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.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* A reservation to update.
*/
// const biReservation = {}
/**
* A list of fields to be updated in this request.
*/
// const updateMask = {}
// Imports the Reservation library
const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1;
// Instantiates a client
const reservationClient = new ReservationServiceClient();
async function callUpdateBiReservation() {
// Construct request
const request = {
};
// Run request
const response = await reservationClient.updateBiReservation(request);
console.log(response);
}
callUpdateBiReservation();
updateBiReservation(request, options, callback)
updateBiReservation(request: protos.google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest, options: CallOptions, callback: Callback<protos.google.cloud.bigquery.reservation.v1.IBiReservation, protos.google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.bigquery.reservation.v1.IBiReservation, protos.google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
updateBiReservation(request, callback)
updateBiReservation(request: protos.google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest, callback: Callback<protos.google.cloud.bigquery.reservation.v1.IBiReservation, protos.google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest
|
callback |
Callback<protos.google.cloud.bigquery.reservation.v1.IBiReservation, protos.google.cloud.bigquery.reservation.v1.IUpdateBiReservationRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
updateCapacityCommitment(request, options)
updateCapacityCommitment(request?: protos.google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest, options?: CallOptions): Promise<[
protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment,
(protos.google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest | undefined),
{} | undefined
]>;
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
.
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Promise<[ protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, (protos.google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest | undefined), {} | undefined ]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [CapacityCommitment]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
/**
* This snippet 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.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Content of the capacity commitment to update.
*/
// const capacityCommitment = {}
/**
* Standard field mask for the set of fields to be updated.
*/
// const updateMask = {}
// Imports the Reservation library
const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1;
// Instantiates a client
const reservationClient = new ReservationServiceClient();
async function callUpdateCapacityCommitment() {
// Construct request
const request = {
};
// Run request
const response = await reservationClient.updateCapacityCommitment(request);
console.log(response);
}
callUpdateCapacityCommitment();
updateCapacityCommitment(request, options, callback)
updateCapacityCommitment(request: protos.google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest, options: CallOptions, callback: Callback<protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, protos.google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, protos.google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
updateCapacityCommitment(request, callback)
updateCapacityCommitment(request: protos.google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest, callback: Callback<protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, protos.google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest
|
callback |
Callback<protos.google.cloud.bigquery.reservation.v1.ICapacityCommitment, protos.google.cloud.bigquery.reservation.v1.IUpdateCapacityCommitmentRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
updateReservation(request, options)
updateReservation(request?: protos.google.cloud.bigquery.reservation.v1.IUpdateReservationRequest, options?: CallOptions): Promise<[
protos.google.cloud.bigquery.reservation.v1.IReservation,
(protos.google.cloud.bigquery.reservation.v1.IUpdateReservationRequest | undefined),
{} | undefined
]>;
Updates an existing reservation resource.
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IUpdateReservationRequest
The request object that will be sent. |
options |
CallOptions
Call options. See CallOptions for more details. |
Type | Description |
Promise<[ protos.google.cloud.bigquery.reservation.v1.IReservation, (protos.google.cloud.bigquery.reservation.v1.IUpdateReservationRequest | undefined), {} | undefined ]> | {Promise} - The promise which resolves to an array. The first element of the array is an object representing [Reservation]. Please see the [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) for more details and examples. |
/**
* This snippet 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.
* TODO(developer): Uncomment these variables before running the sample.
*/
/**
* Content of the reservation to update.
*/
// const reservation = {}
/**
* Standard field mask for the set of fields to be updated.
*/
// const updateMask = {}
// Imports the Reservation library
const {ReservationServiceClient} = require('@google-cloud/bigquery-reservation').v1;
// Instantiates a client
const reservationClient = new ReservationServiceClient();
async function callUpdateReservation() {
// Construct request
const request = {
};
// Run request
const response = await reservationClient.updateReservation(request);
console.log(response);
}
callUpdateReservation();
updateReservation(request, options, callback)
updateReservation(request: protos.google.cloud.bigquery.reservation.v1.IUpdateReservationRequest, options: CallOptions, callback: Callback<protos.google.cloud.bigquery.reservation.v1.IReservation, protos.google.cloud.bigquery.reservation.v1.IUpdateReservationRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IUpdateReservationRequest
|
options |
CallOptions
|
callback |
Callback<protos.google.cloud.bigquery.reservation.v1.IReservation, protos.google.cloud.bigquery.reservation.v1.IUpdateReservationRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |
updateReservation(request, callback)
updateReservation(request: protos.google.cloud.bigquery.reservation.v1.IUpdateReservationRequest, callback: Callback<protos.google.cloud.bigquery.reservation.v1.IReservation, protos.google.cloud.bigquery.reservation.v1.IUpdateReservationRequest | null | undefined, {} | null | undefined>): void;
Name | Description |
request |
protos.google.cloud.bigquery.reservation.v1.IUpdateReservationRequest
|
callback |
Callback<protos.google.cloud.bigquery.reservation.v1.IReservation, protos.google.cloud.bigquery.reservation.v1.IUpdateReservationRequest | null | undefined, {} | null | undefined>
|
Type | Description |
void |