Package google.cloud.bigquery.datatransfer.v1

Index

DataTransferService

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.

CheckValidCreds

rpc CheckValidCreds(CheckValidCredsRequest) returns (CheckValidCredsResponse)

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.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Auth Guide.

CreateTransferConfig

rpc CreateTransferConfig(CreateTransferConfigRequest) returns (TransferConfig)

Creates a new data transfer configuration.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Auth Guide.

DeleteTransferConfig

rpc DeleteTransferConfig(DeleteTransferConfigRequest) returns (Empty)

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

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Auth Guide.

DeleteTransferRun

rpc DeleteTransferRun(DeleteTransferRunRequest) returns (Empty)

Deletes the specified transfer run.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Auth Guide.

GetDataSource

rpc GetDataSource(GetDataSourceRequest) returns (DataSource)

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

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Auth Guide.

GetTransferConfig

rpc GetTransferConfig(GetTransferConfigRequest) returns (TransferConfig)

Returns information about a data transfer config.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Auth Guide.

GetTransferRun

rpc GetTransferRun(GetTransferRunRequest) returns (TransferRun)

Returns information about the particular transfer run.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Auth Guide.

ListDataSources

rpc ListDataSources(ListDataSourcesRequest) returns (ListDataSourcesResponse)

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

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Auth Guide.

ListTransferConfigs

rpc ListTransferConfigs(ListTransferConfigsRequest) returns (ListTransferConfigsResponse)

Returns information about all data transfers in the project.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Auth Guide.

ListTransferLogs

rpc ListTransferLogs(ListTransferLogsRequest) returns (ListTransferLogsResponse)

Returns user facing log messages for the data transfer run.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Auth Guide.

ListTransferRuns

rpc ListTransferRuns(ListTransferRunsRequest) returns (ListTransferRunsResponse)

Returns information about running and completed jobs.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Auth Guide.

ScheduleTransferRuns

rpc ScheduleTransferRuns(ScheduleTransferRunsRequest) returns (ScheduleTransferRunsResponse)

Creates transfer runs for a time range [range_start_time, range_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.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Auth Guide.

UpdateTransferConfig

rpc UpdateTransferConfig(UpdateTransferConfigRequest) returns (TransferConfig)

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

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Auth Guide.

CheckValidCredsRequest

A request to determine whether the user has valid credentials. This method is used to limit the number of OAuth popups in the user interface. The user id is inferred from the API call context. If the data source has the Google+ authorization type, this method returns false, as it cannot be determined whether the credentials are already valid merely based on the user id.

Fields
name

string

The data source in the form: projects/{project_id}/dataSources/{data_source_id}

Authorization requires one or more of the following Google IAM permissions on the specified resource name:

  • resourcemanager.projects.own
  • resourcemanager.projects.update
  • resourcemanager.projects.get
  • bigquery.transfers.get
  • bigquery.transfers.update

CheckValidCredsResponse

A response indicating whether the credentials exist and are valid.

Fields
has_valid_creds

bool

If set to true, the credentials exist and are valid.

CreateTransferConfigRequest

A request to create a data transfer configuration. If new credentials are needed for this transfer configuration, an authorization code must be provided. If an authorization code is provided, the transfer configuration will be associated with the user id corresponding to the authorization code. Otherwise, the transfer configuration will be associated with the calling user.

Fields
parent

string

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}/locations/- In case when '-' is specified as location_id, location is infered from the destination dataset region.

Authorization requires one or more of the following Google IAM permissions on the specified resource parent:

  • resourcemanager.projects.own
  • resourcemanager.projects.update
  • bigquery.transfers.update

transfer_config

TransferConfig

Data transfer configuration to create.

authorization_code

string

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=&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.

DataSource

Represents data source metadata. Metadata is sufficient to render UI and request proper OAuth tokens.

Fields
name

string

Data source resource name.

data_source_id

string

Data source id.

display_name

string

User friendly data source name.

description

string

User friendly data source description string.

client_id

string

Data source client id which should be used to receive refresh token. When not supplied, no offline credentials are populated for data transfer.

scopes[]

string

Api auth scopes for which refresh token needs to be obtained. Only valid when client_id is specified. Ignored otherwise. These are scopes needed by a data source to prepare data and ingest them into BigQuery, e.g., https://www.googleapis.com/auth/bigquery

transfer_type

TransferType

Transfer type. Currently supports only batch transfers, which are transfers that use the BigQuery batch APIs (load or query) to ingest the data.

supports_multiple_transfers

bool

Indicates whether the data source supports multiple transfers to different BigQuery targets.

update_deadline_seconds

int32

The number of seconds to wait for an update from the data source before BigQuery marks the transfer as failed.

default_schedule

string

Default data transfer schedule. Examples of valid schedules include: 1st,3rd monday of month 15:30, every wed,fri of jan,jun 13:15, and first sunday of quarter 00:00.

supports_custom_schedule

bool

Specifies whether the data source supports a user defined schedule, or operates on the default schedule. When set to true, user can override default schedule.

parameters[]

DataSourceParameter

Data source parameters.

help_url

string

Url for the help document for this data source.

authorization_type

AuthorizationType

Indicates the type of authorization.

data_refresh_type

DataRefreshType

Specifies whether the data source supports automatic data refresh for the past few days, and how it's supported. For some data sources, data might not be complete until a few days later, so it's useful to refresh data automatically.

default_data_refresh_window_days

int32

Default data refresh window on days. Only meaningful when data_refresh_type = SLIDING_WINDOW.

manual_runs_disabled

bool

Disables backfilling and manual run scheduling for the data source.

minimum_schedule_interval

Duration

The minimum interval between two consecutive scheduled runs.

AuthorizationType

The type of authorization needed for this data source.

Enums
AUTHORIZATION_TYPE_UNSPECIFIED Type unspecified.
AUTHORIZATION_CODE Use OAuth 2 authorization codes that can be exchanged for a refresh token on the backend.
GOOGLE_PLUS_AUTHORIZATION_CODE Return an authorization code for a given Google+ page that can then be exchanged for a refresh token on the backend.

DataRefreshType

Represents how the data source supports data auto refresh.

Enums
DATA_REFRESH_TYPE_UNSPECIFIED The data source won't support data auto refresh, which is default value.
SLIDING_WINDOW The data source supports data auto refresh, and runs will be scheduled for the past few days. Does not allow custom values to be set for each transfer config.
CUSTOM_SLIDING_WINDOW The data source supports data auto refresh, and runs will be scheduled for the past few days. Allows custom values to be set for each transfer config.

DataSourceParameter

Represents a data source parameter with validation rules, so that parameters can be rendered in the UI. These parameters are given to us by supported data sources, and include all needed information for rendering and validation. Thus, whoever uses this api can decide to generate either generic ui, or custom data source specific forms.

Fields
param_id

string

Parameter identifier.

display_name

string

Parameter display name in the user interface.

description

string

Parameter description.

type

Type

Parameter type.

required

bool

Is parameter required.

repeated

bool

Can parameter have multiple values.

validation_regex

string

Regular expression which can be used for parameter validation.

allowed_values[]

string

All possible values for the parameter.

min_value

DoubleValue

For integer and double values specifies minimum allowed value.

max_value

DoubleValue

For integer and double values specifies maxminum allowed value.

fields[]

DataSourceParameter

When parameter is a record, describes child fields.

validation_description

string

Description of the requirements for this field, in case the user input does not fulfill the regex pattern or min/max values.

validation_help_url

string

URL to a help document to further explain the naming requirements.

immutable

bool

Cannot be changed after initial creation.

recurse

bool

If set to true, schema should be taken from the parent with the same parameter_id. Only applicable when parameter type is RECORD.

Type

Parameter type.

Enums
TYPE_UNSPECIFIED Type unspecified.
STRING String parameter.
INTEGER Integer parameter (64-bits). Will be serialized to json as string.
DOUBLE Double precision floating point parameter.
BOOLEAN Boolean parameter.
RECORD Record parameter.
PLUS_PAGE Page ID for a Google+ Page.

DeleteTransferConfigRequest

A request to delete data transfer information. All associated transfer runs and log messages will be deleted as well.

Fields
name

string

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

Authorization requires one or more of the following Google IAM permissions on the specified resource name:

  • resourcemanager.projects.own
  • resourcemanager.projects.update
  • bigquery.transfers.update

DeleteTransferRunRequest

A request to delete data transfer run information.

Fields
name

string

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

Authorization requires one or more of the following Google IAM permissions on the specified resource name:

  • resourcemanager.projects.own
  • resourcemanager.projects.update
  • bigquery.transfers.update

GetDataSourceRequest

A request to get data source info.

Fields
name

string

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

Authorization requires one or more of the following Google IAM permissions on the specified resource name:

  • resourcemanager.projects.own
  • resourcemanager.projects.update
  • resourcemanager.projects.get
  • bigquery.transfers.get
  • bigquery.transfers.update

GetTransferConfigRequest

A request to get data transfer information.

Fields
name

string

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

Authorization requires one or more of the following Google IAM permissions on the specified resource name:

  • resourcemanager.projects.own
  • resourcemanager.projects.update
  • resourcemanager.projects.get
  • bigquery.transfers.get
  • bigquery.transfers.update

GetTransferRunRequest

A request to get data transfer run information.

Fields
name

string

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

Authorization requires one or more of the following Google IAM permissions on the specified resource name:

  • resourcemanager.projects.own
  • resourcemanager.projects.update
  • resourcemanager.projects.get
  • bigquery.transfers.get
  • bigquery.transfers.update

ListDataSourcesRequest

Request to list supported data sources and their data transfer settings.

Fields
parent

string

The BigQuery project id for which data sources should be returned. Must be in the form: projects/{project_id}

Authorization requires one or more of the following Google IAM permissions on the specified resource parent:

  • resourcemanager.projects.own
  • resourcemanager.projects.update
  • resourcemanager.projects.get
  • bigquery.transfers.get
  • bigquery.transfers.update

page_token

string

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.

page_size

int32

Page size. The default page size is the maximum value of 1000 results.

ListDataSourcesResponse

Returns list of supported data sources and their metadata.

Fields
data_sources[]

DataSource

List of supported data sources and their transfer settings.

next_page_token

string

Output only. The next-pagination token. For multiple-page list results, this token can be used as the ListDataSourcesRequest.page_token to request the next page of list results.

ListTransferConfigsRequest

A request to list data transfers configured for a BigQuery project.

Fields
parent

string

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

Authorization requires one or more of the following Google IAM permissions on the specified resource parent:

  • resourcemanager.projects.own
  • resourcemanager.projects.update
  • resourcemanager.projects.get
  • bigquery.transfers.get
  • bigquery.transfers.update

data_source_ids[]

string

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

page_token

string

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.

page_size

int32

Page size. The default page size is the maximum value of 1000 results.

ListTransferConfigsResponse

The returned list of pipelines in the project.

Fields
transfer_configs[]

TransferConfig

Output only. The stored pipeline transfer configurations.

next_page_token

string

Output only. The next-pagination token. For multiple-page list results, this token can be used as the ListTransferConfigsRequest.page_token to request the next page of list results.

ListTransferLogsRequest

A request to get user facing log messages associated with data transfer run.

Fields
parent

string

Transfer run name in the form: projects/{project_id}/transferConfigs/{config_Id}/runs/{run_id}.

Authorization requires one or more of the following Google IAM permissions on the specified resource parent:

  • resourcemanager.projects.own
  • resourcemanager.projects.update
  • resourcemanager.projects.get
  • bigquery.transfers.get
  • bigquery.transfers.update

page_token

string

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.

page_size

int32

Page size. The default page size is the maximum value of 1000 results.

message_types[]

MessageSeverity

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

ListTransferLogsResponse

The returned list transfer run messages.

Fields
transfer_messages[]

TransferMessage

Output only. The stored pipeline transfer messages.

next_page_token

string

Output only. The next-pagination token. For multiple-page list results, this token can be used as the GetTransferRunLogRequest.page_token to request the next page of list results.

ListTransferRunsRequest

A request to list data transfer runs. UI can use this method to show/filter specific data transfer runs. The data source can use this method to request all scheduled transfer runs.

Fields
parent

string

Name of transfer configuration for which transfer runs should be retrieved. Format of transfer configuration resource name is: projects/{project_id}/transferConfigs/{config_id}.

Authorization requires one or more of the following Google IAM permissions on the specified resource parent:

  • resourcemanager.projects.own
  • resourcemanager.projects.update
  • resourcemanager.projects.get
  • bigquery.transfers.get
  • bigquery.transfers.update

states[]

TransferState

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

page_token

string

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.

page_size

int32

Page size. The default page size is the maximum value of 1000 results.

run_attempt

RunAttempt

Indicates how run attempts are to be pulled.

RunAttempt

Represents which runs should be pulled.

Enums
RUN_ATTEMPT_UNSPECIFIED All runs should be returned.
LATEST Only latest run per day should be returned.

ListTransferRunsResponse

The returned list of pipelines in the project.

Fields
transfer_runs[]

TransferRun

Output only. The stored pipeline transfer runs.

next_page_token

string

Output only. The next-pagination token. For multiple-page list results, this token can be used as the ListTransferRunsRequest.page_token to request the next page of list results.

ScheduleTransferRunsRequest

A request to schedule transfer runs for a time range.

Fields
parent

string

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

Authorization requires one or more of the following Google IAM permissions on the specified resource parent:

  • resourcemanager.projects.own
  • resourcemanager.projects.update
  • bigquery.transfers.update

start_time

Timestamp

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

end_time

Timestamp

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

ScheduleTransferRunsResponse

A response to schedule transfer runs for a time range.

Fields
runs[]

TransferRun

The transfer runs that were scheduled.

TransferConfig

Represents a data transfer configuration. A transfer configuration contains all metadata needed to perform a data transfer. For example, destination_dataset_id specifies where data should be stored. When a new transfer configuration is created, the specified destination_dataset_id is created when needed and shared with the appropriate data source service account.

Fields
name

string

The resource name of the transfer config. Transfer config names have the form projects/{project_id}/transferConfigs/{config_id}. Where config_id is usually a uuid, even though it is not guaranteed or required. The name is ignored when creating a transfer config.

destination_dataset_id

string

The BigQuery target dataset id.

display_name

string

User specified display name for the data transfer.

data_source_id

string

Data source id. Cannot be changed once data transfer is created.

params

Struct

Data transfer specific parameters.

schedule

string

Data transfer schedule. If the data source does not support a custom schedule, this should be empty. If it is empty, the default value for the data source will be used. The specified times are in UTC. Examples of valid format: 1st,3rd monday of month 15:30, every wed,fri of jan,jun 13:15, and first sunday of quarter 00:00. See more explanation about the format here: https://cloud.google.com/appengine/docs/flexible/python/scheduling-jobs-with-cron-yaml#the_schedule_format NOTE: the granularity should be at least 8 hours, or less frequent.

data_refresh_window_days

int32

The number of days to look back to automatically refresh the data. For example, if data_refresh_window_days = 10, then every day BigQuery reingests data for [today-10, today-1], rather than ingesting data for just [today-1]. Only valid if the data source supports the feature. Set the value to 0 to use the default value.

disabled

bool

Is this config disabled. When set to true, no runs are scheduled for a given transfer.

update_time

Timestamp

Output only. Data transfer modification time. Ignored by server on input.

next_run_time

Timestamp

Output only. Next time when data transfer will run.

state

TransferState

Output only. State of the most recently updated transfer run.

user_id

int64

Output only. Unique ID of the user on whose behalf transfer is done. Applicable only to data sources that do not support service accounts. When set to 0, the data source service account credentials are used.

dataset_region

string

Output only. Region in which BigQuery dataset is located.

TransferMessage

Represents a user facing message for a particular data transfer run.

Fields
message_time

Timestamp

Time when message was logged.

severity

MessageSeverity

Message severity.

message_text

string

Message text.

MessageSeverity

Represents data transfer user facing message severity.

Enums
MESSAGE_SEVERITY_UNSPECIFIED No severity specified.
INFO Informational message.
WARNING Warning message.
ERROR Error message.

TransferRun

Represents a data transfer run. Next id: 23

Fields
name

string

The resource name of the transfer run. Transfer run names have the form projects/{project_id}/locations/{location}/transferConfigs/{config_id}/runs/{run_id}. The name is ignored when creating a transfer run.

destination_dataset_id

string

The BigQuery target dataset id.

schedule_time

Timestamp

Minimum time after which a transfer run can be started.

params

Struct

Data transfer specific parameters.

run_time

Timestamp

For batch transfer runs, specifies the date and time that data should be ingested.

error_status

Status

Status of the transfer run.

start_time

Timestamp

Output only. Time when transfer run was started. Parameter ignored by server for input requests.

end_time

Timestamp

Output only. Time when transfer run ended. Parameter ignored by server for input requests.

update_time

Timestamp

Output only. Last time the data transfer run state was updated.

data_source_id

string

Output only. Data source id.

state

TransferState

Data transfer run state. Ignored for input requests.

user_id

int64

Output only. Unique ID of the user on whose behalf transfer is done. Applicable only to data sources that do not support service accounts. When set to 0, the data source service account credentials are used. May be negative.

schedule

string

Output only. Describes the schedule of this transfer run if it was created as part of a regular schedule. For batch transfer runs that are scheduled manually, this is empty. NOTE: the system might choose to delay the schedule depending on the current load, so schedule_time doesn't always matches this.

TransferState

Represents data transfer run state.

Enums
TRANSFER_STATE_UNSPECIFIED State placeholder.
PENDING Data transfer is scheduled and is waiting to be picked up by data transfer backend.
RUNNING Data transfer is in progress.
SUCCEEDED Data transfer completed successsfully.
FAILED Data transfer failed.
CANCELLED Data transfer is cancelled.

TransferType

Represents data transfer type.

Enums
TRANSFER_TYPE_UNSPECIFIED Invalid or Unknown transfer type placeholder.
BATCH Batch data transfer.
STREAMING Streaming data transfer. Streaming data source currently doesn't support multiple transfer configs per project.

UpdateTransferConfigRequest

A request to update a transfer configuration. To update the user id of the transfer configuration, an authorization code needs to be provided.

Fields
transfer_config

TransferConfig

Data transfer configuration to create.

Authorization requires one or more of the following Google IAM permissions on the specified resource transfer_config:

  • resourcemanager.projects.own
  • resourcemanager.projects.update
  • bigquery.transfers.update

authorization_code

string

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=&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.

update_mask

FieldMask

Required list of fields to be updated in this request.

Monitor your resources on the go

Get the Google Cloud Console app to help you manage your projects.

Send feedback about...