DataTransferServiceClient

DataTransferServiceClient

The Google BigQuery Data Transfer Service API enables BigQuery users to configure the transfer of their data from other Google Products into BigQuery. This service contains methods that are end user exposed. It backs up the frontend.

Constructor

new DataTransferServiceClient(optionsopt)

Construct an instance of DataTransferServiceClient.

Parameters:
Name Type Attributes Description
options object <optional>

The configuration object. See the subsequent parameters for more details.

Properties
Name Type Attributes Description
credentials object <optional>

Credentials object.

Properties
Name Type Attributes Description
client_email string <optional>
private_key string <optional>
email string <optional>

Account email address. Required when using a .pem or .p12 keyFilename.

keyFilename string <optional>

Full path to the a .json, .pem, or .p12 key downloaded from the Google Developers Console. If you provide a path to a JSON file, the projectId option below is not necessary. NOTE: .pem and .p12 require you to specify options.email as well.

port number <optional>

The port on which to connect to the remote host.

projectId string <optional>

The project ID from the Google Developer's Console, e.g. 'grape-spaceship-123'. We will also check the environment variable GCLOUD_PROJECT for your project ID. If your app is running in an environment which supports Application Default Credentials, your project ID will be detected automatically.

promise function <optional>

Custom promise module to use instead of native Promises.

apiEndpoint string <optional>

The domain name of the API remote host.

Source:

Members

(static) apiEndpoint

The DNS address for this API service - same as servicePath(), exists for compatibility reasons.

Source:

(static) port

The port for this API service.

Source:

(static) scopes

The scopes needed to make gRPC calls for every method defined in this service.

Source:

(static) servicePath

The DNS address for this API service.

Source:

Methods

checkValidCreds(request, optionsopt, callbackopt) → {Promise}

Returns true if valid credentials exist for the given data source and requesting user. Some data sources doesn't support service account, so we need to talk to them on behalf of the end user. This API just checks whether we have OAuth token for the particular user, which is a pre-requisite before user can create a transfer config.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
name string

Required. The data source in the form: projects/{project_id}/dataSources/{data_source_id} or projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}.

options Object <optional>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback function <optional>

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing CheckValidCredsResponse.

Source:
Example
const bigqueryDataTransfer = require('@google-cloud/bigquery-data-transfer');

const client = new bigqueryDataTransfer.v1.DataTransferServiceClient({
  // optional auth parameters.
});

const formattedName = client.projectDataSourcePath('[PROJECT]', '[DATA_SOURCE]');
client.checkValidCreds({name: formattedName})
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

createTransferConfig(request, optionsopt, callbackopt) → {Promise}

Creates a new data transfer configuration.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
parent string

Required. The BigQuery project id where the transfer configuration should be created. Must be in the format projects/{project_id}/locations/{location_id} or projects/{project_id}. If specified location and location of the destination bigquery dataset do not match - the request will fail.

transferConfig Object

Required. Data transfer configuration to create.

This object should have the same structure as TransferConfig

authorizationCode string <optional>

Optional OAuth2 authorization code to use with this transfer configuration. This is required if new credentials are needed, as indicated by CheckValidCreds. In order to obtain authorization_code, please make a request to https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=&scope=<data_source_scopes>&redirect_uri=<redirect_uri>

  • client_id should be OAuth client_id of BigQuery DTS API for the given data source returned by ListDataSources method.
  • data_source_scopes are the scopes returned by ListDataSources method.
  • redirect_uri is an optional parameter. If not specified, then authorization code is posted to the opener of authorization flow window. Otherwise it will be sent to the redirect uri. A special value of urn:ietf:wg:oauth:2.0:oob means that authorization code should be returned in the title bar of the browser, with the page text prompting the user to copy the code and paste it in the application.
versionInfo string <optional>

Optional version info. If users want to find a very recent access token, that is, immediately after approving access, users have to set the version_info claim in the token request. To obtain the version_info, users must use the "none+gsession" response type. which be return a version_info back in the authorization response which be be put in a JWT claim in the token request.

serviceAccountName string <optional>

Optional service account name. If this field is set, transfer config will be created with this service account credentials. It requires that requesting user calling this API has permissions to act as this service account.

options Object <optional>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback function <optional>

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing TransferConfig.

Source:
Example
const bigqueryDataTransfer = require('@google-cloud/bigquery-data-transfer');

const client = new bigqueryDataTransfer.v1.DataTransferServiceClient({
  // optional auth parameters.
});

const formattedParent = client.projectPath('[PROJECT]');
const transferConfig = {};
const request = {
  parent: formattedParent,
  transferConfig: transferConfig,
};
client.createTransferConfig(request)
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

deleteTransferConfig(request, optionsopt, callbackopt) → {Promise}

Deletes a data transfer configuration, including any associated transfer runs and logs.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
name string

Required. The field will contain name of the resource requested, for example: projects/{project_id}/transferConfigs/{config_id} or projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}

options Object <optional>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback function <optional>

The function which will be called with the result of the API call.

Source:
Example
const bigqueryDataTransfer = require('@google-cloud/bigquery-data-transfer');

const client = new bigqueryDataTransfer.v1.DataTransferServiceClient({
  // optional auth parameters.
});

const formattedName = client.projectTransferConfigPath('[PROJECT]', '[TRANSFER_CONFIG]');
client.deleteTransferConfig({name: formattedName}).catch(err => {
  console.error(err);
});

deleteTransferRun(request, optionsopt, callbackopt) → {Promise}

Deletes the specified transfer run.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
name string

Required. The field will contain name of the resource requested, for example: projects/{project_id}/transferConfigs/{config_id}/runs/{run_id} or projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}

options Object <optional>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback function <optional>

The function which will be called with the result of the API call.

Source:
Example
const bigqueryDataTransfer = require('@google-cloud/bigquery-data-transfer');

const client = new bigqueryDataTransfer.v1.DataTransferServiceClient({
  // optional auth parameters.
});

const formattedName = client.projectRunPath('[PROJECT]', '[TRANSFER_CONFIG]', '[RUN]');
client.deleteTransferRun({name: formattedName}).catch(err => {
  console.error(err);
});

getDataSource(request, optionsopt, callbackopt) → {Promise}

Retrieves a supported data source and returns its settings, which can be used for UI rendering.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
name string

Required. The field will contain name of the resource requested, for example: projects/{project_id}/dataSources/{data_source_id} or projects/{project_id}/locations/{location_id}/dataSources/{data_source_id}

options Object <optional>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback function <optional>

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing DataSource.

Source:
Example
const bigqueryDataTransfer = require('@google-cloud/bigquery-data-transfer');

const client = new bigqueryDataTransfer.v1.DataTransferServiceClient({
  // optional auth parameters.
});

const formattedName = client.projectDataSourcePath('[PROJECT]', '[DATA_SOURCE]');
client.getDataSource({name: formattedName})
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

getProjectId(callback)

Return the project ID used by this class.

Parameters:
Name Type Description
callback function

the callback to be called with the current project Id.

Source:

getTransferConfig(request, optionsopt, callbackopt) → {Promise}

Returns information about a data transfer config.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
name string

Required. The field will contain name of the resource requested, for example: projects/{project_id}/transferConfigs/{config_id} or projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}

options Object <optional>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback function <optional>

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing TransferConfig.

Source:
Example
const bigqueryDataTransfer = require('@google-cloud/bigquery-data-transfer');

const client = new bigqueryDataTransfer.v1.DataTransferServiceClient({
  // optional auth parameters.
});

const formattedName = client.projectTransferConfigPath('[PROJECT]', '[TRANSFER_CONFIG]');
client.getTransferConfig({name: formattedName})
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

getTransferRun(request, optionsopt, callbackopt) → {Promise}

Returns information about the particular transfer run.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
name string

Required. The field will contain name of the resource requested, for example: projects/{project_id}/transferConfigs/{config_id}/runs/{run_id} or projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}/runs/{run_id}

options Object <optional>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback function <optional>

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing TransferRun.

Source:
Example
const bigqueryDataTransfer = require('@google-cloud/bigquery-data-transfer');

const client = new bigqueryDataTransfer.v1.DataTransferServiceClient({
  // optional auth parameters.
});

const formattedName = client.projectRunPath('[PROJECT]', '[TRANSFER_CONFIG]', '[RUN]');
client.getTransferRun({name: formattedName})
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

listDataSources(request, optionsopt, callbackopt) → {Promise}

Lists supported data sources and returns their settings, which can be used for UI rendering.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
parent string

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}

pageSize number <optional>

The maximum number of resources contained in the underlying API response. If page streaming is performed per-resource, this parameter does not affect the return value. If page streaming is performed per-page, this determines the maximum number of resources in a page.

options Object <optional>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback function <optional>

The function which will be called with the result of the API call.

The second parameter to the callback is Array of DataSource.

When autoPaginate: false is specified through options, it contains the result in a single response. If the response indicates the next page exists, the third parameter is set to be used for the next request object. The fourth parameter keeps the raw response object of an object representing ListDataSourcesResponse.

Source:
Example
const bigqueryDataTransfer = require('@google-cloud/bigquery-data-transfer');

const client = new bigqueryDataTransfer.v1.DataTransferServiceClient({
  // optional auth parameters.
});

// Iterate over all elements.
const formattedParent = client.projectPath('[PROJECT]');

client.listDataSources({parent: formattedParent})
  .then(responses => {
    const resources = responses[0];
    for (const resource of resources) {
      // doThingsWith(resource)
    }
  })
  .catch(err => {
    console.error(err);
  });

// Or obtain the paged response.
const formattedParent = client.projectPath('[PROJECT]');


const options = {autoPaginate: false};
const callback = responses => {
  // The actual resources in a response.
  const resources = responses[0];
  // The next request if the response shows that there are more responses.
  const nextRequest = responses[1];
  // The actual response object, if necessary.
  // const rawResponse = responses[2];
  for (const resource of resources) {
    // doThingsWith(resource);
  }
  if (nextRequest) {
    // Fetch the next page.
    return client.listDataSources(nextRequest, options).then(callback);
  }
}
client.listDataSources({parent: formattedParent}, options)
  .then(callback)
  .catch(err => {
    console.error(err);
  });

listDataSourcesStream(request, optionsopt) → {Stream}

Equivalent to listDataSources, but returns a NodeJS Stream object.

This fetches the paged responses for listDataSources continuously and invokes the callback registered for 'data' event for each element in the responses.

The returned object has 'end' method when no more elements are required.

autoPaginate option will be ignored.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
parent string

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}

pageSize number <optional>

The maximum number of resources contained in the underlying API response. If page streaming is performed per-resource, this parameter does not affect the return value. If page streaming is performed per-page, this determines the maximum number of resources in a page.

options Object <optional>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

Source:
See:
Example
const bigqueryDataTransfer = require('@google-cloud/bigquery-data-transfer');

const client = new bigqueryDataTransfer.v1.DataTransferServiceClient({
  // optional auth parameters.
});

const formattedParent = client.projectPath('[PROJECT]');
client.listDataSourcesStream({parent: formattedParent})
  .on('data', element => {
    // doThingsWith(element)
  }).on('error', err => {
    console.log(err);
  });

listTransferConfigs(request, optionsopt, callbackopt) → {Promise}

Returns information about all data transfers in the project.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
parent string

Required. The BigQuery project id for which data sources should be returned: projects/{project_id} or projects/{project_id}/locations/{location_id}

dataSourceIds Array.<string> <optional>

When specified, only configurations of requested data sources are returned.

pageSize number <optional>

The maximum number of resources contained in the underlying API response. If page streaming is performed per-resource, this parameter does not affect the return value. If page streaming is performed per-page, this determines the maximum number of resources in a page.

options Object <optional>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback function <optional>

The function which will be called with the result of the API call.

The second parameter to the callback is Array of TransferConfig.

When autoPaginate: false is specified through options, it contains the result in a single response. If the response indicates the next page exists, the third parameter is set to be used for the next request object. The fourth parameter keeps the raw response object of an object representing ListTransferConfigsResponse.

Source:
Example
const bigqueryDataTransfer = require('@google-cloud/bigquery-data-transfer');

const client = new bigqueryDataTransfer.v1.DataTransferServiceClient({
  // optional auth parameters.
});

// Iterate over all elements.
const formattedParent = client.projectPath('[PROJECT]');

client.listTransferConfigs({parent: formattedParent})
  .then(responses => {
    const resources = responses[0];
    for (const resource of resources) {
      // doThingsWith(resource)
    }
  })
  .catch(err => {
    console.error(err);
  });

// Or obtain the paged response.
const formattedParent = client.projectPath('[PROJECT]');


const options = {autoPaginate: false};
const callback = responses => {
  // The actual resources in a response.
  const resources = responses[0];
  // The next request if the response shows that there are more responses.
  const nextRequest = responses[1];
  // The actual response object, if necessary.
  // const rawResponse = responses[2];
  for (const resource of resources) {
    // doThingsWith(resource);
  }
  if (nextRequest) {
    // Fetch the next page.
    return client.listTransferConfigs(nextRequest, options).then(callback);
  }
}
client.listTransferConfigs({parent: formattedParent}, options)
  .then(callback)
  .catch(err => {
    console.error(err);
  });

listTransferConfigsStream(request, optionsopt) → {Stream}

Equivalent to listTransferConfigs, but returns a NodeJS Stream object.

This fetches the paged responses for listTransferConfigs continuously and invokes the callback registered for 'data' event for each element in the responses.

The returned object has 'end' method when no more elements are required.

autoPaginate option will be ignored.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
parent string

Required. The BigQuery project id for which data sources should be returned: projects/{project_id} or projects/{project_id}/locations/{location_id}

dataSourceIds Array.<string> <optional>

When specified, only configurations of requested data sources are returned.

pageSize number <optional>

The maximum number of resources contained in the underlying API response. If page streaming is performed per-resource, this parameter does not affect the return value. If page streaming is performed per-page, this determines the maximum number of resources in a page.

options Object <optional>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

Source:
See:
Example
const bigqueryDataTransfer = require('@google-cloud/bigquery-data-transfer');

const client = new bigqueryDataTransfer.v1.DataTransferServiceClient({
  // optional auth parameters.
});

const formattedParent = client.projectPath('[PROJECT]');
client.listTransferConfigsStream({parent: formattedParent})
  .on('data', element => {
    // doThingsWith(element)
  }).on('error', err => {
    console.log(err);
  });

listTransferLogs(request, optionsopt, callbackopt) → {Promise}

Returns user facing log messages for the data transfer run.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
parent string

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}

pageSize number <optional>

The maximum number of resources contained in the underlying API response. If page streaming is performed per-resource, this parameter does not affect the return value. If page streaming is performed per-page, this determines the maximum number of resources in a page.

messageTypes Array.<number> <optional>

Message types to return. If not populated - INFO, WARNING and ERROR messages are returned.

The number should be among the values of MessageSeverity

options Object <optional>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback function <optional>

The function which will be called with the result of the API call.

The second parameter to the callback is Array of TransferMessage.

When autoPaginate: false is specified through options, it contains the result in a single response. If the response indicates the next page exists, the third parameter is set to be used for the next request object. The fourth parameter keeps the raw response object of an object representing ListTransferLogsResponse.

Source:
Example
const bigqueryDataTransfer = require('@google-cloud/bigquery-data-transfer');

const client = new bigqueryDataTransfer.v1.DataTransferServiceClient({
  // optional auth parameters.
});

// Iterate over all elements.
const formattedParent = client.projectRunPath('[PROJECT]', '[TRANSFER_CONFIG]', '[RUN]');

client.listTransferLogs({parent: formattedParent})
  .then(responses => {
    const resources = responses[0];
    for (const resource of resources) {
      // doThingsWith(resource)
    }
  })
  .catch(err => {
    console.error(err);
  });

// Or obtain the paged response.
const formattedParent = client.projectRunPath('[PROJECT]', '[TRANSFER_CONFIG]', '[RUN]');


const options = {autoPaginate: false};
const callback = responses => {
  // The actual resources in a response.
  const resources = responses[0];
  // The next request if the response shows that there are more responses.
  const nextRequest = responses[1];
  // The actual response object, if necessary.
  // const rawResponse = responses[2];
  for (const resource of resources) {
    // doThingsWith(resource);
  }
  if (nextRequest) {
    // Fetch the next page.
    return client.listTransferLogs(nextRequest, options).then(callback);
  }
}
client.listTransferLogs({parent: formattedParent}, options)
  .then(callback)
  .catch(err => {
    console.error(err);
  });

listTransferLogsStream(request, optionsopt) → {Stream}

Equivalent to listTransferLogs, but returns a NodeJS Stream object.

This fetches the paged responses for listTransferLogs continuously and invokes the callback registered for 'data' event for each element in the responses.

The returned object has 'end' method when no more elements are required.

autoPaginate option will be ignored.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
parent string

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}

pageSize number <optional>

The maximum number of resources contained in the underlying API response. If page streaming is performed per-resource, this parameter does not affect the return value. If page streaming is performed per-page, this determines the maximum number of resources in a page.

messageTypes Array.<number> <optional>

Message types to return. If not populated - INFO, WARNING and ERROR messages are returned.

The number should be among the values of MessageSeverity

options Object <optional>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

Source:
See:
Example
const bigqueryDataTransfer = require('@google-cloud/bigquery-data-transfer');

const client = new bigqueryDataTransfer.v1.DataTransferServiceClient({
  // optional auth parameters.
});

const formattedParent = client.projectRunPath('[PROJECT]', '[TRANSFER_CONFIG]', '[RUN]');
client.listTransferLogsStream({parent: formattedParent})
  .on('data', element => {
    // doThingsWith(element)
  }).on('error', err => {
    console.log(err);
  });

listTransferRuns(request, optionsopt, callbackopt) → {Promise}

Returns information about running and completed jobs.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
parent string

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}.

states Array.<number> <optional>

When specified, only transfer runs with requested states are returned.

The number should be among the values of TransferState

pageSize number <optional>

The maximum number of resources contained in the underlying API response. If page streaming is performed per-resource, this parameter does not affect the return value. If page streaming is performed per-page, this determines the maximum number of resources in a page.

runAttempt number <optional>

Indicates how run attempts are to be pulled.

The number should be among the values of RunAttempt

options Object <optional>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback function <optional>

The function which will be called with the result of the API call.

The second parameter to the callback is Array of TransferRun.

When autoPaginate: false is specified through options, it contains the result in a single response. If the response indicates the next page exists, the third parameter is set to be used for the next request object. The fourth parameter keeps the raw response object of an object representing ListTransferRunsResponse.

Source:
Example
const bigqueryDataTransfer = require('@google-cloud/bigquery-data-transfer');

const client = new bigqueryDataTransfer.v1.DataTransferServiceClient({
  // optional auth parameters.
});

// Iterate over all elements.
const formattedParent = client.projectTransferConfigPath('[PROJECT]', '[TRANSFER_CONFIG]');

client.listTransferRuns({parent: formattedParent})
  .then(responses => {
    const resources = responses[0];
    for (const resource of resources) {
      // doThingsWith(resource)
    }
  })
  .catch(err => {
    console.error(err);
  });

// Or obtain the paged response.
const formattedParent = client.projectTransferConfigPath('[PROJECT]', '[TRANSFER_CONFIG]');


const options = {autoPaginate: false};
const callback = responses => {
  // The actual resources in a response.
  const resources = responses[0];
  // The next request if the response shows that there are more responses.
  const nextRequest = responses[1];
  // The actual response object, if necessary.
  // const rawResponse = responses[2];
  for (const resource of resources) {
    // doThingsWith(resource);
  }
  if (nextRequest) {
    // Fetch the next page.
    return client.listTransferRuns(nextRequest, options).then(callback);
  }
}
client.listTransferRuns({parent: formattedParent}, options)
  .then(callback)
  .catch(err => {
    console.error(err);
  });

listTransferRunsStream(request, optionsopt) → {Stream}

Equivalent to listTransferRuns, but returns a NodeJS Stream object.

This fetches the paged responses for listTransferRuns continuously and invokes the callback registered for 'data' event for each element in the responses.

The returned object has 'end' method when no more elements are required.

autoPaginate option will be ignored.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
parent string

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}.

states Array.<number> <optional>

When specified, only transfer runs with requested states are returned.

The number should be among the values of TransferState

pageSize number <optional>

The maximum number of resources contained in the underlying API response. If page streaming is performed per-resource, this parameter does not affect the return value. If page streaming is performed per-page, this determines the maximum number of resources in a page.

runAttempt number <optional>

Indicates how run attempts are to be pulled.

The number should be among the values of RunAttempt

options Object <optional>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

Source:
See:
Example
const bigqueryDataTransfer = require('@google-cloud/bigquery-data-transfer');

const client = new bigqueryDataTransfer.v1.DataTransferServiceClient({
  // optional auth parameters.
});

const formattedParent = client.projectTransferConfigPath('[PROJECT]', '[TRANSFER_CONFIG]');
client.listTransferRunsStream({parent: formattedParent})
  .on('data', element => {
    // doThingsWith(element)
  }).on('error', err => {
    console.log(err);
  });

locationDataSourcePath(project, location, dataSource) → {String}

Return a fully-qualified location_data_source resource name string.

Parameters:
Name Type Description
project String
location String
dataSource String
Source:

locationPath(project, location) → {String}

Return a fully-qualified location resource name string.

Parameters:
Name Type Description
project String
location String
Source:

locationRunPath(project, location, transferConfig, run) → {String}

Return a fully-qualified location_run resource name string.

Parameters:
Name Type Description
project String
location String
transferConfig String
run String
Source:

locationTransferConfigPath(project, location, transferConfig) → {String}

Return a fully-qualified location_transfer_config resource name string.

Parameters:
Name Type Description
project String
location String
transferConfig String
Source:

matchDataSourceFromLocationDataSourceName(locationDataSourceName) → {String}

Parse the locationDataSourceName from a location_data_source resource.

Parameters:
Name Type Description
locationDataSourceName String

A fully-qualified path representing a location_data_source resources.

Source:

matchDataSourceFromProjectDataSourceName(projectDataSourceName) → {String}

Parse the projectDataSourceName from a project_data_source resource.

Parameters:
Name Type Description
projectDataSourceName String

A fully-qualified path representing a project_data_source resources.

Source:

matchLocationFromLocationDataSourceName(locationDataSourceName) → {String}

Parse the locationDataSourceName from a location_data_source resource.

Parameters:
Name Type Description
locationDataSourceName String

A fully-qualified path representing a location_data_source resources.

Source:

matchLocationFromLocationName(locationName) → {String}

Parse the locationName from a location resource.

Parameters:
Name Type Description
locationName String

A fully-qualified path representing a location resources.

Source:

matchLocationFromLocationRunName(locationRunName) → {String}

Parse the locationRunName from a location_run resource.

Parameters:
Name Type Description
locationRunName String

A fully-qualified path representing a location_run resources.

Source:

matchLocationFromLocationTransferConfigName(locationTransferConfigName) → {String}

Parse the locationTransferConfigName from a location_transfer_config resource.

Parameters:
Name Type Description
locationTransferConfigName String

A fully-qualified path representing a location_transfer_config resources.

Source:

matchProjectFromLocationDataSourceName(locationDataSourceName) → {String}

Parse the locationDataSourceName from a location_data_source resource.

Parameters:
Name Type Description
locationDataSourceName String

A fully-qualified path representing a location_data_source resources.

Source:

matchProjectFromLocationName(locationName) → {String}

Parse the locationName from a location resource.

Parameters:
Name Type Description
locationName String

A fully-qualified path representing a location resources.

Source:

matchProjectFromLocationRunName(locationRunName) → {String}

Parse the locationRunName from a location_run resource.

Parameters:
Name Type Description
locationRunName String

A fully-qualified path representing a location_run resources.

Source:

matchProjectFromLocationTransferConfigName(locationTransferConfigName) → {String}

Parse the locationTransferConfigName from a location_transfer_config resource.

Parameters:
Name Type Description
locationTransferConfigName String

A fully-qualified path representing a location_transfer_config resources.

Source:

matchProjectFromProjectDataSourceName(projectDataSourceName) → {String}

Parse the projectDataSourceName from a project_data_source resource.

Parameters:
Name Type Description
projectDataSourceName String

A fully-qualified path representing a project_data_source resources.

Source:

matchProjectFromProjectName(projectName) → {String}

Parse the projectName from a project resource.

Parameters:
Name Type Description
projectName String

A fully-qualified path representing a project resources.

Source:

matchProjectFromProjectRunName(projectRunName) → {String}

Parse the projectRunName from a project_run resource.

Parameters:
Name Type Description
projectRunName String

A fully-qualified path representing a project_run resources.

Source:

matchProjectFromProjectTransferConfigName(projectTransferConfigName) → {String}

Parse the projectTransferConfigName from a project_transfer_config resource.

Parameters:
Name Type Description
projectTransferConfigName String

A fully-qualified path representing a project_transfer_config resources.

Source:

matchRunFromLocationRunName(locationRunName) → {String}

Parse the locationRunName from a location_run resource.

Parameters:
Name Type Description
locationRunName String

A fully-qualified path representing a location_run resources.

Source:

matchRunFromProjectRunName(projectRunName) → {String}

Parse the projectRunName from a project_run resource.

Parameters:
Name Type Description
projectRunName String

A fully-qualified path representing a project_run resources.

Source:

matchTransferConfigFromLocationRunName(locationRunName) → {String}

Parse the locationRunName from a location_run resource.

Parameters:
Name Type Description
locationRunName String

A fully-qualified path representing a location_run resources.

Source:

matchTransferConfigFromLocationTransferConfigName(locationTransferConfigName) → {String}

Parse the locationTransferConfigName from a location_transfer_config resource.

Parameters:
Name Type Description
locationTransferConfigName String

A fully-qualified path representing a location_transfer_config resources.

Source:

matchTransferConfigFromProjectRunName(projectRunName) → {String}

Parse the projectRunName from a project_run resource.

Parameters:
Name Type Description
projectRunName String

A fully-qualified path representing a project_run resources.

Source:

matchTransferConfigFromProjectTransferConfigName(projectTransferConfigName) → {String}

Parse the projectTransferConfigName from a project_transfer_config resource.

Parameters:
Name Type Description
projectTransferConfigName String

A fully-qualified path representing a project_transfer_config resources.

Source:

projectDataSourcePath(project, dataSource) → {String}

Return a fully-qualified project_data_source resource name string.

Parameters:
Name Type Description
project String
dataSource String
Source:

projectPath(project) → {String}

Return a fully-qualified project resource name string.

Parameters:
Name Type Description
project String
Source:

projectRunPath(project, transferConfig, run) → {String}

Return a fully-qualified project_run resource name string.

Parameters:
Name Type Description
project String
transferConfig String
run String
Source:

projectTransferConfigPath(project, transferConfig) → {String}

Return a fully-qualified project_transfer_config resource name string.

Parameters:
Name Type Description
project String
transferConfig String
Source:

scheduleTransferRuns(request, optionsopt, callbackopt) → {Promise}

Creates transfer runs for a time range [start_time, end_time]. For each date - or whatever granularity the data source supports - in the range, one transfer run is created. Note that runs are created per UTC time in the time range. DEPRECATED: use StartManualTransferRuns instead.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Description
parent string

Required. Transfer configuration name in the form: projects/{project_id}/transferConfigs/{config_id} or projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}.

startTime Object

Required. Start time of the range of transfer runs. For example, "2017-05-25T00:00:00+00:00".

This object should have the same structure as Timestamp

endTime Object

Required. End time of the range of transfer runs. For example, "2017-05-30T00:00:00+00:00".

This object should have the same structure as Timestamp

options Object <optional>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback function <optional>

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing ScheduleTransferRunsResponse.

Source:
Example
const bigqueryDataTransfer = require('@google-cloud/bigquery-data-transfer');

const client = new bigqueryDataTransfer.v1.DataTransferServiceClient({
  // optional auth parameters.
});

const formattedParent = client.projectTransferConfigPath('[PROJECT]', '[TRANSFER_CONFIG]');
const startTime = {};
const endTime = {};
const request = {
  parent: formattedParent,
  startTime: startTime,
  endTime: endTime,
};
client.scheduleTransferRuns(request)
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

startManualTransferRuns(request, optionsopt, callbackopt) → {Promise}

Start manual transfer runs to be executed now with schedule_time equal to current time. The transfer runs can be created for a time range where the run_time is between start_time (inclusive) and end_time (exclusive), or for a specific run_time.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
parent string <optional>

Transfer configuration name in the form: projects/{project_id}/transferConfigs/{config_id} or projects/{project_id}/locations/{location_id}/transferConfigs/{config_id}.

requestedTimeRange Object <optional>

Time range for the transfer runs that should be started.

This object should have the same structure as TimeRange

requestedRunTime Object <optional>

Specific run_time for a transfer run to be started. The requested_run_time must not be in the future.

This object should have the same structure as Timestamp

options Object <optional>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback function <optional>

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing StartManualTransferRunsResponse.

Source:
Example
const bigqueryDataTransfer = require('@google-cloud/bigquery-data-transfer');

const client = new bigqueryDataTransfer.v1.DataTransferServiceClient({
  // optional auth parameters.
});


client.startManualTransferRuns({})
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });

updateTransferConfig(request, optionsopt, callbackopt) → {Promise}

Updates a data transfer configuration. All fields must be set, even if they are not updated.

Parameters:
Name Type Attributes Description
request Object

The request object that will be sent.

Properties
Name Type Attributes Description
transferConfig Object

Required. Data transfer configuration to create.

This object should have the same structure as TransferConfig

updateMask Object

Required. Required list of fields to be updated in this request.

This object should have the same structure as FieldMask

authorizationCode string <optional>

Optional OAuth2 authorization code to use with this transfer configuration. If it is provided, the transfer configuration will be associated with the authorizing user. In order to obtain authorization_code, please make a request to https://www.gstatic.com/bigquerydatatransfer/oauthz/auth?client_id=&scope=<data_source_scopes>&redirect_uri=<redirect_uri>

  • client_id should be OAuth client_id of BigQuery DTS API for the given data source returned by ListDataSources method.
  • data_source_scopes are the scopes returned by ListDataSources method.
  • redirect_uri is an optional parameter. If not specified, then authorization code is posted to the opener of authorization flow window. Otherwise it will be sent to the redirect uri. A special value of urn:ietf:wg:oauth:2.0:oob means that authorization code should be returned in the title bar of the browser, with the page text prompting the user to copy the code and paste it in the application.
versionInfo string <optional>

Optional version info. If users want to find a very recent access token, that is, immediately after approving access, users have to set the version_info claim in the token request. To obtain the version_info, users must use the "none+gsession" response type. which be return a version_info back in the authorization response which be be put in a JWT claim in the token request.

serviceAccountName string <optional>

Optional service account name. If this field is set and "service_account_name" is set in update_mask, transfer config will be updated to use this service account credentials. It requires that requesting user calling this API has permissions to act as this service account.

options Object <optional>

Optional parameters. You can override the default settings for this call, e.g, timeout, retries, paginations, etc. See gax.CallOptions for the details.

callback function <optional>

The function which will be called with the result of the API call.

The second parameter to the callback is an object representing TransferConfig.

Source:
Example
const bigqueryDataTransfer = require('@google-cloud/bigquery-data-transfer');

const client = new bigqueryDataTransfer.v1.DataTransferServiceClient({
  // optional auth parameters.
});

const transferConfig = {};
const updateMask = {};
const request = {
  transferConfig: transferConfig,
  updateMask: updateMask,
};
client.updateTransferConfig(request)
  .then(responses => {
    const response = responses[0];
    // doThingsWith(response)
  })
  .catch(err => {
    console.error(err);
  });