Constructor
new ReservationServiceClient(optionsopt, gaxInstanceopt)
Construct an instance of ReservationServiceClient.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
<optional> |
The configuration object. The options accepted by the constructor are described in detail in this document. The common options are: Properties
|
||||||||||||||||||||||||||||||||||||||||||||||||
gaxInstance |
gax |
<optional> |
loaded instance of |
Members
apiEndpoint
The DNS address for this API service - same as servicePath(), exists for compatibility reasons.
port
The port for this API service.
scopes
The scopes needed to make gRPC calls for every method defined in this service.
servicePath
The DNS address for this API service.
Methods
assignmentPath(project, location, reservation, assignment) → {string}
Return a fully-qualified assignment resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string | |
location |
string | |
reservation |
string | |
assignment |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |
biReservationPath(project, location) → {string}
Return a fully-qualified biReservation resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string | |
location |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |
capacityCommitmentPath(project, location, capacity_commitment) → {string}
Return a fully-qualified capacityCommitment resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string | |
location |
string | |
capacity_commitment |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |
close() → {Promise}
Terminate the gRPC channel and close the client.
The client will no longer be usable and all future behavior is undefined.
Returns:
Type | Description |
---|---|
Promise |
A promise that resolves when the client is closed. |
getProjectId() → {Promise}
Return the project ID used by this class.
Returns:
Type | Description |
---|---|
Promise |
A promise that resolves to string containing the project ID. |
initialize() → {Promise}
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.
Returns:
Type | Description |
---|---|
Promise |
A promise that resolves to an authenticated service stub. |
listAssignmentsAsync(request, optionsopt) → {Object}
Equivalent to listAssignments
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
Type | Description |
---|---|
Object |
An iterable Object that allows async iteration. 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 for more details and examples. |
Example
/**
* 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, optionsopt) → {Stream}
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
Type | Description |
---|---|
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 |
listCapacityCommitmentsAsync(request, optionsopt) → {Object}
Equivalent to listCapacityCommitments
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
Type | Description |
---|---|
Object |
An iterable Object that allows async iteration. 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 for more details and examples. |
Example
/**
* 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, optionsopt) → {Stream}
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
Type | Description |
---|---|
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 |
listReservationsAsync(request, optionsopt) → {Object}
Equivalent to listReservations
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
Type | Description |
---|---|
Object |
An iterable Object that allows async iteration. 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 for more details and examples. |
Example
/**
* 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, optionsopt) → {Stream}
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
|||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
Type | Description |
---|---|
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) → {string}
Return a fully-qualified location resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string | |
location |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |
matchAssignmentFromAssignmentName(assignmentName) → {string}
Parse the assignment from Assignment resource.
Parameters:
Name | Type | Description |
---|---|---|
assignmentName |
string |
A fully-qualified path representing Assignment resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the assignment. |
matchCapacityCommitmentFromCapacityCommitmentName(capacityCommitmentName) → {string}
Parse the capacity_commitment from CapacityCommitment resource.
Parameters:
Name | Type | Description |
---|---|---|
capacityCommitmentName |
string |
A fully-qualified path representing CapacityCommitment resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the capacity_commitment. |
matchLocationFromAssignmentName(assignmentName) → {string}
Parse the location from Assignment resource.
Parameters:
Name | Type | Description |
---|---|---|
assignmentName |
string |
A fully-qualified path representing Assignment resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the location. |
matchLocationFromBiReservationName(biReservationName) → {string}
Parse the location from BiReservation resource.
Parameters:
Name | Type | Description |
---|---|---|
biReservationName |
string |
A fully-qualified path representing BiReservation resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the location. |
matchLocationFromCapacityCommitmentName(capacityCommitmentName) → {string}
Parse the location from CapacityCommitment resource.
Parameters:
Name | Type | Description |
---|---|---|
capacityCommitmentName |
string |
A fully-qualified path representing CapacityCommitment resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the location. |
matchLocationFromLocationName(locationName) → {string}
Parse the location from Location resource.
Parameters:
Name | Type | Description |
---|---|---|
locationName |
string |
A fully-qualified path representing Location resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the location. |
matchLocationFromReservationName(reservationName) → {string}
Parse the location from Reservation resource.
Parameters:
Name | Type | Description |
---|---|---|
reservationName |
string |
A fully-qualified path representing Reservation resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the location. |
matchProjectFromAssignmentName(assignmentName) → {string}
Parse the project from Assignment resource.
Parameters:
Name | Type | Description |
---|---|---|
assignmentName |
string |
A fully-qualified path representing Assignment resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the project. |
matchProjectFromBiReservationName(biReservationName) → {string}
Parse the project from BiReservation resource.
Parameters:
Name | Type | Description |
---|---|---|
biReservationName |
string |
A fully-qualified path representing BiReservation resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the project. |
matchProjectFromCapacityCommitmentName(capacityCommitmentName) → {string}
Parse the project from CapacityCommitment resource.
Parameters:
Name | Type | Description |
---|---|---|
capacityCommitmentName |
string |
A fully-qualified path representing CapacityCommitment resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the project. |
matchProjectFromLocationName(locationName) → {string}
Parse the project from Location resource.
Parameters:
Name | Type | Description |
---|---|---|
locationName |
string |
A fully-qualified path representing Location resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the project. |
matchProjectFromProjectName(projectName) → {string}
Parse the project from Project resource.
Parameters:
Name | Type | Description |
---|---|---|
projectName |
string |
A fully-qualified path representing Project resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the project. |
matchProjectFromReservationName(reservationName) → {string}
Parse the project from Reservation resource.
Parameters:
Name | Type | Description |
---|---|---|
reservationName |
string |
A fully-qualified path representing Reservation resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the project. |
matchReservationFromAssignmentName(assignmentName) → {string}
Parse the reservation from Assignment resource.
Parameters:
Name | Type | Description |
---|---|---|
assignmentName |
string |
A fully-qualified path representing Assignment resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the reservation. |
matchReservationFromReservationName(reservationName) → {string}
Parse the reservation from Reservation resource.
Parameters:
Name | Type | Description |
---|---|---|
reservationName |
string |
A fully-qualified path representing Reservation resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the reservation. |
projectPath(project) → {string}
Return a fully-qualified project resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |
reservationPath(project, location, reservation) → {string}
Return a fully-qualified reservation resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string | |
location |
string | |
reservation |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |
searchAllAssignmentsAsync(request, optionsopt) → {Object}
Equivalent to searchAllAssignments
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
||||||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
Type | Description |
---|---|
Object |
An iterable Object that allows async iteration. 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 for more details and examples. |
Example
/**
* 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, optionsopt) → {Stream}
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
||||||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
Type | Description |
---|---|
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 |
searchAssignmentsAsync(request, optionsopt) → {Object}
Equivalent to searchAssignments
, but returns an iterable object.
for
-await
-of
syntax is used with the iterable to get response elements on-demand.
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
||||||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
Type | Description |
---|---|
Object |
An iterable Object that allows async iteration. 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 for more details and examples. |
Example
/**
* 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, optionsopt) → {Stream}
Equivalent to method.name.toCamelCase()
, but returns a NodeJS Stream object.
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
request |
Object |
The request object that will be sent. Properties
|
||||||||||||||||
options |
object |
<optional> |
Call options. See CallOptions for more details. |
Returns:
Type | Description |
---|---|
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 |