Constructor
new DataTransferServiceClient(optionsopt, gaxInstanceopt)
Construct an instance of DataTransferServiceClient.
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.
apiEndpoint
The DNS address for this API service - same as servicePath.
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
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. |
getLocation(request, optionsopt) → {Promise}
Gets information about a location.
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 |
---|---|
Promise |
|
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. |
listDataSourcesAsync(request, optionsopt) → {Object}
Equivalent to listDataSources
, 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 DataSource. 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 BigQuery project id for which data sources should be
* returned. Must be in the form: `projects/{project_id}` or
* `projects/{project_id}/locations/{location_id}`
*/
// const parent = 'abc123'
/**
* Pagination token, which can be used to request a specific page
* of `ListDataSourcesRequest` list results. For multiple-page
* results, `ListDataSourcesResponse` outputs
* a `next_page` token, which can be used as the
* `page_token` value to request the next page of list results.
*/
// const pageToken = 'abc123'
/**
* Page size. The default page size is the maximum value of 1000 results.
*/
// const pageSize = 1234
// Imports the Datatransfer library
const {DataTransferServiceClient} = require('@google-cloud/bigquery-data-transfer').v1;
// Instantiates a client
const datatransferClient = new DataTransferServiceClient();
async function callListDataSources() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = datatransferClient.listDataSourcesAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListDataSources();
listDataSourcesStream(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 DataSource 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 |
listLocationsAsync(request, optionsopt) → {Object}
Lists information about the supported locations for this service. 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 Location. 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
```
const iterable = client.listLocationsAsync(request);
for await (const response of iterable) {
// process response
}
```
listTransferConfigsAsync(request, optionsopt) → {Object}
Equivalent to listTransferConfigs
, 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 TransferConfig. 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 BigQuery project id for which transfer configs
* should be returned: `projects/{project_id}` or
* `projects/{project_id}/locations/{location_id}`
*/
// const parent = 'abc123'
/**
* When specified, only configurations of requested data sources are returned.
*/
// const dataSourceIds = ['abc','def']
/**
* Pagination token, which can be used to request a specific page
* of `ListTransfersRequest` list results. For multiple-page
* results, `ListTransfersResponse` outputs
* a `next_page` token, which can be used as the
* `page_token` value to request the next page of list results.
*/
// const pageToken = 'abc123'
/**
* Page size. The default page size is the maximum value of 1000 results.
*/
// const pageSize = 1234
// Imports the Datatransfer library
const {DataTransferServiceClient} = require('@google-cloud/bigquery-data-transfer').v1;
// Instantiates a client
const datatransferClient = new DataTransferServiceClient();
async function callListTransferConfigs() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = datatransferClient.listTransferConfigsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListTransferConfigs();
listTransferConfigsStream(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 TransferConfig 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 |
listTransferLogsAsync(request, optionsopt) → {Object}
Equivalent to listTransferLogs
, 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 TransferMessage. 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. Transfer run name in the form:
* `projects/{project_id}/transferConfigs/{config_id}/runs/{run_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}`
*/
// const parent = 'abc123'
/**
* Pagination token, which can be used to request a specific page
* of `ListTransferLogsRequest` list results. For multiple-page
* results, `ListTransferLogsResponse` outputs
* a `next_page` token, which can be used as the
* `page_token` value to request the next page of list results.
*/
// const pageToken = 'abc123'
/**
* Page size. The default page size is the maximum value of 1000 results.
*/
// const pageSize = 1234
/**
* Message types to return. If not populated - INFO, WARNING and ERROR
* messages are returned.
*/
// const messageTypes = [1,2,3,4]
// Imports the Datatransfer library
const {DataTransferServiceClient} = require('@google-cloud/bigquery-data-transfer').v1;
// Instantiates a client
const datatransferClient = new DataTransferServiceClient();
async function callListTransferLogs() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = datatransferClient.listTransferLogsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListTransferLogs();
listTransferLogsStream(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 TransferMessage 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 |
listTransferRunsAsync(request, optionsopt) → {Object}
Equivalent to listTransferRuns
, 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 TransferRun. 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. Name of transfer configuration for which transfer runs should be
* retrieved. Format of transfer configuration resource name is:
* `projects/{project_id}/transferConfigs/{config_id}` or
* `projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}`.
*/
// const parent = 'abc123'
/**
* When specified, only transfer runs with requested states are returned.
*/
// const states = [1,2,3,4]
/**
* Pagination token, which can be used to request a specific page
* of `ListTransferRunsRequest` list results. For multiple-page
* results, `ListTransferRunsResponse` outputs
* a `next_page` token, which can be used as the
* `page_token` value to request the next page of list results.
*/
// const pageToken = 'abc123'
/**
* Page size. The default page size is the maximum value of 1000 results.
*/
// const pageSize = 1234
/**
* Indicates how run attempts are to be pulled.
*/
// const runAttempt = {}
// Imports the Datatransfer library
const {DataTransferServiceClient} = require('@google-cloud/bigquery-data-transfer').v1;
// Instantiates a client
const datatransferClient = new DataTransferServiceClient();
async function callListTransferRuns() {
// Construct request
const request = {
parent,
};
// Run request
const iterable = datatransferClient.listTransferRunsAsync(request);
for await (const response of iterable) {
console.log(response);
}
}
callListTransferRuns();
listTransferRunsStream(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 TransferRun 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 |
matchDataSourceFromProjectDataSourceName(projectDataSourceName) → {string}
Parse the data_source from ProjectDataSource resource.
Parameters:
Name | Type | Description |
---|---|---|
projectDataSourceName |
string |
A fully-qualified path representing project_data_source resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the data_source. |
matchDataSourceFromProjectLocationDataSourceName(projectLocationDataSourceName) → {string}
Parse the data_source from ProjectLocationDataSource resource.
Parameters:
Name | Type | Description |
---|---|---|
projectLocationDataSourceName |
string |
A fully-qualified path representing project_location_data_source resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the data_source. |
matchLocationFromProjectLocationDataSourceName(projectLocationDataSourceName) → {string}
Parse the location from ProjectLocationDataSource resource.
Parameters:
Name | Type | Description |
---|---|---|
projectLocationDataSourceName |
string |
A fully-qualified path representing project_location_data_source resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the location. |
matchLocationFromProjectLocationTransferConfigName(projectLocationTransferConfigName) → {string}
Parse the location from ProjectLocationTransferConfig resource.
Parameters:
Name | Type | Description |
---|---|---|
projectLocationTransferConfigName |
string |
A fully-qualified path representing project_location_transfer_config resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the location. |
matchLocationFromProjectLocationTransferConfigRunName(projectLocationTransferConfigRunName) → {string}
Parse the location from ProjectLocationTransferConfigRun resource.
Parameters:
Name | Type | Description |
---|---|---|
projectLocationTransferConfigRunName |
string |
A fully-qualified path representing project_location_transfer_config_run resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the location. |
matchProjectFromProjectDataSourceName(projectDataSourceName) → {string}
Parse the project from ProjectDataSource resource.
Parameters:
Name | Type | Description |
---|---|---|
projectDataSourceName |
string |
A fully-qualified path representing project_data_source resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the project. |
matchProjectFromProjectLocationDataSourceName(projectLocationDataSourceName) → {string}
Parse the project from ProjectLocationDataSource resource.
Parameters:
Name | Type | Description |
---|---|---|
projectLocationDataSourceName |
string |
A fully-qualified path representing project_location_data_source resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the project. |
matchProjectFromProjectLocationTransferConfigName(projectLocationTransferConfigName) → {string}
Parse the project from ProjectLocationTransferConfig resource.
Parameters:
Name | Type | Description |
---|---|---|
projectLocationTransferConfigName |
string |
A fully-qualified path representing project_location_transfer_config resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the project. |
matchProjectFromProjectLocationTransferConfigRunName(projectLocationTransferConfigRunName) → {string}
Parse the project from ProjectLocationTransferConfigRun resource.
Parameters:
Name | Type | Description |
---|---|---|
projectLocationTransferConfigRunName |
string |
A fully-qualified path representing project_location_transfer_config_run 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. |
matchProjectFromProjectTransferConfigName(projectTransferConfigName) → {string}
Parse the project from ProjectTransferConfig resource.
Parameters:
Name | Type | Description |
---|---|---|
projectTransferConfigName |
string |
A fully-qualified path representing project_transfer_config resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the project. |
matchProjectFromProjectTransferConfigRunName(projectTransferConfigRunName) → {string}
Parse the project from ProjectTransferConfigRun resource.
Parameters:
Name | Type | Description |
---|---|---|
projectTransferConfigRunName |
string |
A fully-qualified path representing project_transfer_config_run resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the project. |
matchRunFromProjectLocationTransferConfigRunName(projectLocationTransferConfigRunName) → {string}
Parse the run from ProjectLocationTransferConfigRun resource.
Parameters:
Name | Type | Description |
---|---|---|
projectLocationTransferConfigRunName |
string |
A fully-qualified path representing project_location_transfer_config_run resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the run. |
matchRunFromProjectTransferConfigRunName(projectTransferConfigRunName) → {string}
Parse the run from ProjectTransferConfigRun resource.
Parameters:
Name | Type | Description |
---|---|---|
projectTransferConfigRunName |
string |
A fully-qualified path representing project_transfer_config_run resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the run. |
matchTransferConfigFromProjectLocationTransferConfigName(projectLocationTransferConfigName) → {string}
Parse the transfer_config from ProjectLocationTransferConfig resource.
Parameters:
Name | Type | Description |
---|---|---|
projectLocationTransferConfigName |
string |
A fully-qualified path representing project_location_transfer_config resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the transfer_config. |
matchTransferConfigFromProjectLocationTransferConfigRunName(projectLocationTransferConfigRunName) → {string}
Parse the transfer_config from ProjectLocationTransferConfigRun resource.
Parameters:
Name | Type | Description |
---|---|---|
projectLocationTransferConfigRunName |
string |
A fully-qualified path representing project_location_transfer_config_run resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the transfer_config. |
matchTransferConfigFromProjectTransferConfigName(projectTransferConfigName) → {string}
Parse the transfer_config from ProjectTransferConfig resource.
Parameters:
Name | Type | Description |
---|---|---|
projectTransferConfigName |
string |
A fully-qualified path representing project_transfer_config resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the transfer_config. |
matchTransferConfigFromProjectTransferConfigRunName(projectTransferConfigRunName) → {string}
Parse the transfer_config from ProjectTransferConfigRun resource.
Parameters:
Name | Type | Description |
---|---|---|
projectTransferConfigRunName |
string |
A fully-qualified path representing project_transfer_config_run resource. |
Returns:
Type | Description |
---|---|
string |
A string representing the transfer_config. |
projectDataSourcePath(project, data_source) → {string}
Return a fully-qualified projectDataSource resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string | |
data_source |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |
projectLocationDataSourcePath(project, location, data_source) → {string}
Return a fully-qualified projectLocationDataSource resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string | |
location |
string | |
data_source |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |
projectLocationTransferConfigPath(project, location, transfer_config) → {string}
Return a fully-qualified projectLocationTransferConfig resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string | |
location |
string | |
transfer_config |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |
projectLocationTransferConfigRunPath(project, location, transfer_config, run) → {string}
Return a fully-qualified projectLocationTransferConfigRun resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string | |
location |
string | |
transfer_config |
string | |
run |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |
projectPath(project) → {string}
Return a fully-qualified project resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |
projectTransferConfigPath(project, transfer_config) → {string}
Return a fully-qualified projectTransferConfig resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string | |
transfer_config |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |
projectTransferConfigRunPath(project, transfer_config, run) → {string}
Return a fully-qualified projectTransferConfigRun resource name string.
Parameters:
Name | Type | Description |
---|---|---|
project |
string | |
transfer_config |
string | |
run |
string |
Returns:
Type | Description |
---|---|
string |
Resource name string. |