Class Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client (v0.4.6)

Client for the DataTransferService service.

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.

Inherits

  • Object

Methods

.configure

def self.configure() { |config| ... } -> Client::Configuration

Configure the DataTransferService Client class.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# Modify the configuration for all DataTransferService clients
::Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.configure do |config|
  config.timeout = 10.0
end

#check_valid_creds

def check_valid_creds(request, options = nil) -> ::Google::Cloud::Bigquery::DataTransfer::V1::CheckValidCredsResponse
def check_valid_creds(name: nil) -> ::Google::Cloud::Bigquery::DataTransfer::V1::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.

Overloads
def check_valid_creds(request, options = nil) -> ::Google::Cloud::Bigquery::DataTransfer::V1::CheckValidCredsResponse
Pass arguments to check_valid_creds via a request object, either of type CheckValidCredsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Bigquery::DataTransfer::V1::CheckValidCredsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def check_valid_creds(name: nil) -> ::Google::Cloud::Bigquery::DataTransfer::V1::CheckValidCredsResponse
Pass arguments to check_valid_creds via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • 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}.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/bigquery/data_transfer/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigquery::DataTransfer::V1::CheckValidCredsRequest.new

# Call the check_valid_creds method.
result = client.check_valid_creds request

# The returned object is of type Google::Cloud::Bigquery::DataTransfer::V1::CheckValidCredsResponse.
p result

#configure

def configure() { |config| ... } -> Client::Configuration

Configure the DataTransferService Client instance.

The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter

#create_transfer_config

def create_transfer_config(request, options = nil) -> ::Google::Cloud::Bigquery::DataTransfer::V1::TransferConfig
def create_transfer_config(parent: nil, transfer_config: nil, authorization_code: nil, version_info: nil, service_account_name: nil) -> ::Google::Cloud::Bigquery::DataTransfer::V1::TransferConfig

Creates a new data transfer configuration.

Overloads
def create_transfer_config(request, options = nil) -> ::Google::Cloud::Bigquery::DataTransfer::V1::TransferConfig
Pass arguments to create_transfer_config via a request object, either of type CreateTransferConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Bigquery::DataTransfer::V1::CreateTransferConfigRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def create_transfer_config(parent: nil, transfer_config: nil, authorization_code: nil, version_info: nil, service_account_name: nil) -> ::Google::Cloud::Bigquery::DataTransfer::V1::TransferConfig
Pass arguments to create_transfer_config via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • 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.
  • transfer_config (::Google::Cloud::Bigquery::DataTransfer::V1::TransferConfig, ::Hash) — Required. 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=

    • 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.
  • version_info (::String) — 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.
  • service_account_name (::String) — 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.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/bigquery/data_transfer/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigquery::DataTransfer::V1::CreateTransferConfigRequest.new

# Call the create_transfer_config method.
result = client.create_transfer_config request

# The returned object is of type Google::Cloud::Bigquery::DataTransfer::V1::TransferConfig.
p result

#delete_transfer_config

def delete_transfer_config(request, options = nil) -> ::Google::Protobuf::Empty
def delete_transfer_config(name: nil) -> ::Google::Protobuf::Empty

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

Overloads
def delete_transfer_config(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_transfer_config via a request object, either of type Google::Cloud::Bigquery::DataTransfer::V1::DeleteTransferConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Bigquery::DataTransfer::V1::DeleteTransferConfigRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def delete_transfer_config(name: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_transfer_config via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • 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}
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/bigquery/data_transfer/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigquery::DataTransfer::V1::DeleteTransferConfigRequest.new

# Call the delete_transfer_config method.
result = client.delete_transfer_config request

# The returned object is of type Google::Protobuf::Empty.
p result

#delete_transfer_run

def delete_transfer_run(request, options = nil) -> ::Google::Protobuf::Empty
def delete_transfer_run(name: nil) -> ::Google::Protobuf::Empty

Deletes the specified transfer run.

Overloads
def delete_transfer_run(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_transfer_run via a request object, either of type Google::Cloud::Bigquery::DataTransfer::V1::DeleteTransferRunRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Bigquery::DataTransfer::V1::DeleteTransferRunRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def delete_transfer_run(name: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_transfer_run via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • 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}
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/bigquery/data_transfer/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigquery::DataTransfer::V1::DeleteTransferRunRequest.new

# Call the delete_transfer_run method.
result = client.delete_transfer_run request

# The returned object is of type Google::Protobuf::Empty.
p result

#get_data_source

def get_data_source(request, options = nil) -> ::Google::Cloud::Bigquery::DataTransfer::V1::DataSource
def get_data_source(name: nil) -> ::Google::Cloud::Bigquery::DataTransfer::V1::DataSource

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

Overloads
def get_data_source(request, options = nil) -> ::Google::Cloud::Bigquery::DataTransfer::V1::DataSource
Pass arguments to get_data_source via a request object, either of type GetDataSourceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Bigquery::DataTransfer::V1::GetDataSourceRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_data_source(name: nil) -> ::Google::Cloud::Bigquery::DataTransfer::V1::DataSource
Pass arguments to get_data_source via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • 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}
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/bigquery/data_transfer/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigquery::DataTransfer::V1::GetDataSourceRequest.new

# Call the get_data_source method.
result = client.get_data_source request

# The returned object is of type Google::Cloud::Bigquery::DataTransfer::V1::DataSource.
p result

#get_transfer_config

def get_transfer_config(request, options = nil) -> ::Google::Cloud::Bigquery::DataTransfer::V1::TransferConfig
def get_transfer_config(name: nil) -> ::Google::Cloud::Bigquery::DataTransfer::V1::TransferConfig

Returns information about a data transfer config.

Overloads
def get_transfer_config(request, options = nil) -> ::Google::Cloud::Bigquery::DataTransfer::V1::TransferConfig
Pass arguments to get_transfer_config via a request object, either of type GetTransferConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Bigquery::DataTransfer::V1::GetTransferConfigRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_transfer_config(name: nil) -> ::Google::Cloud::Bigquery::DataTransfer::V1::TransferConfig
Pass arguments to get_transfer_config via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • 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}
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/bigquery/data_transfer/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigquery::DataTransfer::V1::GetTransferConfigRequest.new

# Call the get_transfer_config method.
result = client.get_transfer_config request

# The returned object is of type Google::Cloud::Bigquery::DataTransfer::V1::TransferConfig.
p result

#get_transfer_run

def get_transfer_run(request, options = nil) -> ::Google::Cloud::Bigquery::DataTransfer::V1::TransferRun
def get_transfer_run(name: nil) -> ::Google::Cloud::Bigquery::DataTransfer::V1::TransferRun

Returns information about the particular transfer run.

Overloads
def get_transfer_run(request, options = nil) -> ::Google::Cloud::Bigquery::DataTransfer::V1::TransferRun
Pass arguments to get_transfer_run via a request object, either of type GetTransferRunRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Bigquery::DataTransfer::V1::GetTransferRunRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_transfer_run(name: nil) -> ::Google::Cloud::Bigquery::DataTransfer::V1::TransferRun
Pass arguments to get_transfer_run via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • 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}
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/bigquery/data_transfer/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigquery::DataTransfer::V1::GetTransferRunRequest.new

# Call the get_transfer_run method.
result = client.get_transfer_run request

# The returned object is of type Google::Cloud::Bigquery::DataTransfer::V1::TransferRun.
p result

#initialize

def initialize() { |config| ... } -> Client

Create a new DataTransferService client object.

Yields
  • (config) — Configure the DataTransferService client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
Example
# Create a client using the default configuration
client = ::Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new do |config|
  config.timeout = 10.0
end

#list_data_sources

def list_data_sources(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::DataTransfer::V1::DataSource>
def list_data_sources(parent: nil, page_token: nil, page_size: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::DataTransfer::V1::DataSource>

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

Overloads
def list_data_sources(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::DataTransfer::V1::DataSource>
Pass arguments to list_data_sources via a request object, either of type ListDataSourcesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Bigquery::DataTransfer::V1::ListDataSourcesRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_data_sources(parent: nil, page_token: nil, page_size: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::DataTransfer::V1::DataSource>
Pass arguments to list_data_sources via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • 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}
  • 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 (::Integer) — Page size. The default page size is the maximum value of 1000 results.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/bigquery/data_transfer/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigquery::DataTransfer::V1::ListDataSourcesRequest.new

# Call the list_data_sources method.
result = client.list_data_sources request

# The returned object is of type Gapic::PagedEnumerable. You can
# iterate over all elements by calling #each, and the enumerable
# will lazily make API calls to fetch subsequent pages. Other
# methods are also available for managing paging directly.
result.each do |response|
  # Each element is of type ::Google::Cloud::Bigquery::DataTransfer::V1::DataSource.
  p response
end

#list_transfer_configs

def list_transfer_configs(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::DataTransfer::V1::TransferConfig>
def list_transfer_configs(parent: nil, data_source_ids: nil, page_token: nil, page_size: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::DataTransfer::V1::TransferConfig>

Returns information about all transfer configs owned by a project in the specified location.

Overloads
def list_transfer_configs(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::DataTransfer::V1::TransferConfig>
Pass arguments to list_transfer_configs via a request object, either of type ListTransferConfigsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Bigquery::DataTransfer::V1::ListTransferConfigsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_transfer_configs(parent: nil, data_source_ids: nil, page_token: nil, page_size: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::DataTransfer::V1::TransferConfig>
Pass arguments to list_transfer_configs via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The BigQuery project id for which data sources should be returned: projects/{project_id} or projects/{project_id}/locations/{location_id}
  • data_source_ids (::Array<::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 (::Integer) — Page size. The default page size is the maximum value of 1000 results.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/bigquery/data_transfer/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigquery::DataTransfer::V1::ListTransferConfigsRequest.new

# Call the list_transfer_configs method.
result = client.list_transfer_configs request

# The returned object is of type Gapic::PagedEnumerable. You can
# iterate over all elements by calling #each, and the enumerable
# will lazily make API calls to fetch subsequent pages. Other
# methods are also available for managing paging directly.
result.each do |response|
  # Each element is of type ::Google::Cloud::Bigquery::DataTransfer::V1::TransferConfig.
  p response
end

#list_transfer_logs

def list_transfer_logs(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::DataTransfer::V1::TransferMessage>
def list_transfer_logs(parent: nil, page_token: nil, page_size: nil, message_types: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::DataTransfer::V1::TransferMessage>

Returns user facing log messages for the data transfer run.

Overloads
def list_transfer_logs(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::DataTransfer::V1::TransferMessage>
Pass arguments to list_transfer_logs via a request object, either of type ListTransferLogsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Bigquery::DataTransfer::V1::ListTransferLogsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_transfer_logs(parent: nil, page_token: nil, page_size: nil, message_types: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::DataTransfer::V1::TransferMessage>
Pass arguments to list_transfer_logs via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • 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}
  • 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 (::Integer) — Page size. The default page size is the maximum value of 1000 results.
  • message_types (::Array<::Google::Cloud::Bigquery::DataTransfer::V1::TransferMessage::MessageSeverity>) — Message types to return. If not populated - INFO, WARNING and ERROR messages are returned.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/bigquery/data_transfer/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigquery::DataTransfer::V1::ListTransferLogsRequest.new

# Call the list_transfer_logs method.
result = client.list_transfer_logs request

# The returned object is of type Gapic::PagedEnumerable. You can
# iterate over all elements by calling #each, and the enumerable
# will lazily make API calls to fetch subsequent pages. Other
# methods are also available for managing paging directly.
result.each do |response|
  # Each element is of type ::Google::Cloud::Bigquery::DataTransfer::V1::TransferMessage.
  p response
end

#list_transfer_runs

def list_transfer_runs(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::DataTransfer::V1::TransferRun>
def list_transfer_runs(parent: nil, states: nil, page_token: nil, page_size: nil, run_attempt: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::DataTransfer::V1::TransferRun>

Returns information about running and completed jobs.

Overloads
def list_transfer_runs(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::DataTransfer::V1::TransferRun>
Pass arguments to list_transfer_runs via a request object, either of type ListTransferRunsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Bigquery::DataTransfer::V1::ListTransferRunsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_transfer_runs(parent: nil, states: nil, page_token: nil, page_size: nil, run_attempt: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Bigquery::DataTransfer::V1::TransferRun>
Pass arguments to list_transfer_runs via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • 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<::Google::Cloud::Bigquery::DataTransfer::V1::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 (::Integer) — Page size. The default page size is the maximum value of 1000 results.
  • run_attempt (::Google::Cloud::Bigquery::DataTransfer::V1::ListTransferRunsRequest::RunAttempt) — Indicates how run attempts are to be pulled.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/bigquery/data_transfer/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigquery::DataTransfer::V1::ListTransferRunsRequest.new

# Call the list_transfer_runs method.
result = client.list_transfer_runs request

# The returned object is of type Gapic::PagedEnumerable. You can
# iterate over all elements by calling #each, and the enumerable
# will lazily make API calls to fetch subsequent pages. Other
# methods are also available for managing paging directly.
result.each do |response|
  # Each element is of type ::Google::Cloud::Bigquery::DataTransfer::V1::TransferRun.
  p response
end

#schedule_transfer_runs

def schedule_transfer_runs(request, options = nil) -> ::Google::Cloud::Bigquery::DataTransfer::V1::ScheduleTransferRunsResponse
def schedule_transfer_runs(parent: nil, start_time: nil, end_time: nil) -> ::Google::Cloud::Bigquery::DataTransfer::V1::ScheduleTransferRunsResponse

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.

Overloads
def schedule_transfer_runs(request, options = nil) -> ::Google::Cloud::Bigquery::DataTransfer::V1::ScheduleTransferRunsResponse
Pass arguments to schedule_transfer_runs via a request object, either of type ScheduleTransferRunsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Bigquery::DataTransfer::V1::ScheduleTransferRunsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def schedule_transfer_runs(parent: nil, start_time: nil, end_time: nil) -> ::Google::Cloud::Bigquery::DataTransfer::V1::ScheduleTransferRunsResponse
Pass arguments to schedule_transfer_runs via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • 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}.
  • start_time (::Google::Protobuf::Timestamp, ::Hash) — Required. Start time of the range of transfer runs. For example, "2017-05-25T00:00:00+00:00".
  • end_time (::Google::Protobuf::Timestamp, ::Hash) — Required. End time of the range of transfer runs. For example, "2017-05-30T00:00:00+00:00".
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/bigquery/data_transfer/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigquery::DataTransfer::V1::ScheduleTransferRunsRequest.new

# Call the schedule_transfer_runs method.
result = client.schedule_transfer_runs request

# The returned object is of type Google::Cloud::Bigquery::DataTransfer::V1::ScheduleTransferRunsResponse.
p result

#start_manual_transfer_runs

def start_manual_transfer_runs(request, options = nil) -> ::Google::Cloud::Bigquery::DataTransfer::V1::StartManualTransferRunsResponse
def start_manual_transfer_runs(parent: nil, requested_time_range: nil, requested_run_time: nil) -> ::Google::Cloud::Bigquery::DataTransfer::V1::StartManualTransferRunsResponse

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.

Overloads
def start_manual_transfer_runs(request, options = nil) -> ::Google::Cloud::Bigquery::DataTransfer::V1::StartManualTransferRunsResponse
Pass arguments to start_manual_transfer_runs via a request object, either of type StartManualTransferRunsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Bigquery::DataTransfer::V1::StartManualTransferRunsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def start_manual_transfer_runs(parent: nil, requested_time_range: nil, requested_run_time: nil) -> ::Google::Cloud::Bigquery::DataTransfer::V1::StartManualTransferRunsResponse
Pass arguments to start_manual_transfer_runs via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/bigquery/data_transfer/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigquery::DataTransfer::V1::StartManualTransferRunsRequest.new

# Call the start_manual_transfer_runs method.
result = client.start_manual_transfer_runs request

# The returned object is of type Google::Cloud::Bigquery::DataTransfer::V1::StartManualTransferRunsResponse.
p result

#update_transfer_config

def update_transfer_config(request, options = nil) -> ::Google::Cloud::Bigquery::DataTransfer::V1::TransferConfig
def update_transfer_config(transfer_config: nil, authorization_code: nil, update_mask: nil, version_info: nil, service_account_name: nil) -> ::Google::Cloud::Bigquery::DataTransfer::V1::TransferConfig

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

Overloads
def update_transfer_config(request, options = nil) -> ::Google::Cloud::Bigquery::DataTransfer::V1::TransferConfig
Pass arguments to update_transfer_config via a request object, either of type UpdateTransferConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Bigquery::DataTransfer::V1::UpdateTransferConfigRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def update_transfer_config(transfer_config: nil, authorization_code: nil, update_mask: nil, version_info: nil, service_account_name: nil) -> ::Google::Cloud::Bigquery::DataTransfer::V1::TransferConfig
Pass arguments to update_transfer_config via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • transfer_config (::Google::Cloud::Bigquery::DataTransfer::V1::TransferConfig, ::Hash) — Required. Data transfer configuration to create.
  • 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=

    • 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 (::Google::Protobuf::FieldMask, ::Hash) — Required. Required list of fields to be updated in this request.
  • version_info (::String) — 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.
  • service_account_name (::String) — 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.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/bigquery/data_transfer/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Bigquery::DataTransfer::V1::DataTransferService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Bigquery::DataTransfer::V1::UpdateTransferConfigRequest.new

# Call the update_transfer_config method.
result = client.update_transfer_config request

# The returned object is of type Google::Cloud::Bigquery::DataTransfer::V1::TransferConfig.
p result