Storage Transfer Service V1 API - Class Google::Cloud::StorageTransfer::V1::StorageTransferService::Client (v0.6.1)

Reference documentation and code samples for the Storage Transfer Service V1 API class Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.

Client for the StorageTransferService service.

Storage Transfer Service and its protos. Transfers data between between Google Cloud Storage buckets or from a data source external to Google to a Cloud Storage bucket.

Inherits

  • Object

Methods

.configure

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

Configure the StorageTransferService 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 StorageTransferService clients
::Google::Cloud::StorageTransfer::V1::StorageTransferService::Client.configure do |config|
  config.timeout = 10.0
end

#configure

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

Configure the StorageTransferService 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_agent_pool

def create_agent_pool(request, options = nil) -> ::Google::Cloud::StorageTransfer::V1::AgentPool
def create_agent_pool(project_id: nil, agent_pool: nil, agent_pool_id: nil) -> ::Google::Cloud::StorageTransfer::V1::AgentPool

Creates an agent pool resource.

Overloads
def create_agent_pool(request, options = nil) -> ::Google::Cloud::StorageTransfer::V1::AgentPool
Pass arguments to create_agent_pool via a request object, either of type CreateAgentPoolRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::StorageTransfer::V1::CreateAgentPoolRequest, ::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_agent_pool(project_id: nil, agent_pool: nil, agent_pool_id: nil) -> ::Google::Cloud::StorageTransfer::V1::AgentPool
Pass arguments to create_agent_pool 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
  • project_id (::String) — Required. The ID of the Google Cloud project that owns the agent pool.
  • agent_pool (::Google::Cloud::StorageTransfer::V1::AgentPool, ::Hash) — Required. The agent pool to create.
  • agent_pool_id (::String) — Required. The ID of the agent pool to create.

    The agent_pool_id must meet the following requirements:

    • Length of 128 characters or less.
    • Not start with the string goog.
    • Start with a lowercase ASCII character, followed by:
      • Zero or more: lowercase Latin alphabet characters, numerals, hyphens (-), periods (.), underscores (_), or tildes (~).
      • One or more numerals or lowercase ASCII characters.

    As expressed by the regular expression: ^(?!goog)[a-z]([a-z0-9-._~]*[a-z0-9])?$.

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/storage_transfer/v1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::StorageTransfer::V1::CreateAgentPoolRequest.new

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

# The returned object is of type Google::Cloud::StorageTransfer::V1::AgentPool.
p result

#create_transfer_job

def create_transfer_job(request, options = nil) -> ::Google::Cloud::StorageTransfer::V1::TransferJob
def create_transfer_job(transfer_job: nil) -> ::Google::Cloud::StorageTransfer::V1::TransferJob

Creates a transfer job that runs periodically.

Overloads
def create_transfer_job(request, options = nil) -> ::Google::Cloud::StorageTransfer::V1::TransferJob
Pass arguments to create_transfer_job via a request object, either of type CreateTransferJobRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::StorageTransfer::V1::CreateTransferJobRequest, ::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_job(transfer_job: nil) -> ::Google::Cloud::StorageTransfer::V1::TransferJob
Pass arguments to create_transfer_job 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
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/storage_transfer/v1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::StorageTransfer::V1::CreateTransferJobRequest.new

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

# The returned object is of type Google::Cloud::StorageTransfer::V1::TransferJob.
p result

#delete_agent_pool

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

Deletes an agent pool.

Overloads
def delete_agent_pool(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_agent_pool via a request object, either of type DeleteAgentPoolRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::StorageTransfer::V1::DeleteAgentPoolRequest, ::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_agent_pool(name: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_agent_pool 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 name of the agent pool to delete.
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/storage_transfer/v1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::StorageTransfer::V1::DeleteAgentPoolRequest.new

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

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

#delete_transfer_job

def delete_transfer_job(request, options = nil) -> ::Google::Protobuf::Empty
def delete_transfer_job(job_name: nil, project_id: nil) -> ::Google::Protobuf::Empty

Deletes a transfer job. Deleting a transfer job sets its status to DELETED.

Overloads
def delete_transfer_job(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_transfer_job via a request object, either of type DeleteTransferJobRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::StorageTransfer::V1::DeleteTransferJobRequest, ::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_job(job_name: nil, project_id: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_transfer_job 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
  • job_name (::String) — Required. The job to delete.
  • project_id (::String) — Required. The ID of the Google Cloud project that owns the job.
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/storage_transfer/v1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::StorageTransfer::V1::DeleteTransferJobRequest.new

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

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

#get_agent_pool

def get_agent_pool(request, options = nil) -> ::Google::Cloud::StorageTransfer::V1::AgentPool
def get_agent_pool(name: nil) -> ::Google::Cloud::StorageTransfer::V1::AgentPool

Gets an agent pool.

Overloads
def get_agent_pool(request, options = nil) -> ::Google::Cloud::StorageTransfer::V1::AgentPool
Pass arguments to get_agent_pool via a request object, either of type GetAgentPoolRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::StorageTransfer::V1::GetAgentPoolRequest, ::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_agent_pool(name: nil) -> ::Google::Cloud::StorageTransfer::V1::AgentPool
Pass arguments to get_agent_pool 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 name of the agent pool to get.
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/storage_transfer/v1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::StorageTransfer::V1::GetAgentPoolRequest.new

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

# The returned object is of type Google::Cloud::StorageTransfer::V1::AgentPool.
p result

#get_google_service_account

def get_google_service_account(request, options = nil) -> ::Google::Cloud::StorageTransfer::V1::GoogleServiceAccount
def get_google_service_account(project_id: nil) -> ::Google::Cloud::StorageTransfer::V1::GoogleServiceAccount

Returns the Google service account that is used by Storage Transfer Service to access buckets in the project where transfers run or in other projects. Each Google service account is associated with one Google Cloud project. Users should add this service account to the Google Cloud Storage bucket ACLs to grant access to Storage Transfer Service. This service account is created and owned by Storage Transfer Service and can only be used by Storage Transfer Service.

Overloads
def get_google_service_account(request, options = nil) -> ::Google::Cloud::StorageTransfer::V1::GoogleServiceAccount
Pass arguments to get_google_service_account via a request object, either of type GetGoogleServiceAccountRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::StorageTransfer::V1::GetGoogleServiceAccountRequest, ::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_google_service_account(project_id: nil) -> ::Google::Cloud::StorageTransfer::V1::GoogleServiceAccount
Pass arguments to get_google_service_account 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
  • project_id (::String) — Required. The ID of the Google Cloud project that the Google service account is associated with.
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/storage_transfer/v1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::StorageTransfer::V1::GetGoogleServiceAccountRequest.new

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

# The returned object is of type Google::Cloud::StorageTransfer::V1::GoogleServiceAccount.
p result

#get_transfer_job

def get_transfer_job(request, options = nil) -> ::Google::Cloud::StorageTransfer::V1::TransferJob
def get_transfer_job(job_name: nil, project_id: nil) -> ::Google::Cloud::StorageTransfer::V1::TransferJob

Gets a transfer job.

Overloads
def get_transfer_job(request, options = nil) -> ::Google::Cloud::StorageTransfer::V1::TransferJob
Pass arguments to get_transfer_job via a request object, either of type GetTransferJobRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::StorageTransfer::V1::GetTransferJobRequest, ::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_job(job_name: nil, project_id: nil) -> ::Google::Cloud::StorageTransfer::V1::TransferJob
Pass arguments to get_transfer_job 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
  • job_name (::String) — Required. The job to get.
  • project_id (::String) — Required. The ID of the Google Cloud project that owns the job.
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/storage_transfer/v1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::StorageTransfer::V1::GetTransferJobRequest.new

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

# The returned object is of type Google::Cloud::StorageTransfer::V1::TransferJob.
p result

#initialize

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

Create a new StorageTransferService client object.

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

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

#list_agent_pools

def list_agent_pools(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::StorageTransfer::V1::AgentPool>
def list_agent_pools(project_id: nil, filter: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::StorageTransfer::V1::AgentPool>

Lists agent pools.

Overloads
def list_agent_pools(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::StorageTransfer::V1::AgentPool>
Pass arguments to list_agent_pools via a request object, either of type ListAgentPoolsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::StorageTransfer::V1::ListAgentPoolsRequest, ::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_agent_pools(project_id: nil, filter: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::StorageTransfer::V1::AgentPool>
Pass arguments to list_agent_pools 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
  • project_id (::String) — Required. The ID of the Google Cloud project that owns the job.
  • filter (::String) — An optional list of query parameters specified as JSON text in the form of:

    {"agentPoolNames":["agentpool1","agentpool2",...]}

    Since agentPoolNames support multiple values, its values must be specified with array notation. When the filter is either empty or not provided, the list returns all agent pools for the project.

  • page_size (::Integer) — The list page size. The max allowed value is 256.
  • page_token (::String) — The list page token.
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/storage_transfer/v1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::StorageTransfer::V1::ListAgentPoolsRequest.new

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

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::StorageTransfer::V1::AgentPool.
  p item
end

#list_transfer_jobs

def list_transfer_jobs(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::StorageTransfer::V1::TransferJob>
def list_transfer_jobs(filter: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::StorageTransfer::V1::TransferJob>

Lists transfer jobs.

Overloads
def list_transfer_jobs(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::StorageTransfer::V1::TransferJob>
Pass arguments to list_transfer_jobs via a request object, either of type ListTransferJobsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::StorageTransfer::V1::ListTransferJobsRequest, ::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_jobs(filter: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::StorageTransfer::V1::TransferJob>
Pass arguments to list_transfer_jobs 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
  • filter (::String) — Required. A list of query parameters specified as JSON text in the form of: {"projectId":"my_project_id", "jobNames":["jobid1","jobid2",...], "jobStatuses":["status1","status2",...]}

    Since jobNames and jobStatuses support multiple values, their values must be specified with array notation. projectId is required. jobNames and jobStatuses are optional. The valid values for jobStatuses are case-insensitive: ENABLED, DISABLED, and DELETED.

  • page_size (::Integer) — The list page size. The max allowed value is 256.
  • page_token (::String) — The list page token.
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/storage_transfer/v1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::StorageTransfer::V1::ListTransferJobsRequest.new

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

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::StorageTransfer::V1::TransferJob.
  p item
end

#operations_client

def operations_client() -> ::Google::Cloud::StorageTransfer::V1::StorageTransferService::Operations

Get the associated client for long-running operations.

#pause_transfer_operation

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

Pauses a transfer operation.

Overloads
def pause_transfer_operation(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to pause_transfer_operation via a request object, either of type PauseTransferOperationRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::StorageTransfer::V1::PauseTransferOperationRequest, ::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 pause_transfer_operation(name: nil) -> ::Google::Protobuf::Empty
Pass arguments to pause_transfer_operation 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 name of the transfer operation.
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/storage_transfer/v1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::StorageTransfer::V1::PauseTransferOperationRequest.new

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

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

#resume_transfer_operation

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

Resumes a transfer operation that is paused.

Overloads
def resume_transfer_operation(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to resume_transfer_operation via a request object, either of type ResumeTransferOperationRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::StorageTransfer::V1::ResumeTransferOperationRequest, ::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 resume_transfer_operation(name: nil) -> ::Google::Protobuf::Empty
Pass arguments to resume_transfer_operation 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 name of the transfer operation.
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/storage_transfer/v1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::StorageTransfer::V1::ResumeTransferOperationRequest.new

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

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

#run_transfer_job

def run_transfer_job(request, options = nil) -> ::Gapic::Operation
def run_transfer_job(job_name: nil, project_id: nil) -> ::Gapic::Operation

Attempts to start a new TransferOperation for the current TransferJob. A TransferJob has a maximum of one active TransferOperation. If this method is called while a TransferOperation is active, an error will be returned.

Overloads
def run_transfer_job(request, options = nil) -> ::Gapic::Operation
Pass arguments to run_transfer_job via a request object, either of type RunTransferJobRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::StorageTransfer::V1::RunTransferJobRequest, ::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 run_transfer_job(job_name: nil, project_id: nil) -> ::Gapic::Operation
Pass arguments to run_transfer_job 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
  • job_name (::String) — Required. The name of the transfer job.
  • project_id (::String) — Required. The ID of the Google Cloud project that owns the transfer job.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/storage_transfer/v1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::StorageTransfer::V1::RunTransferJobRequest.new

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

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#update_agent_pool

def update_agent_pool(request, options = nil) -> ::Google::Cloud::StorageTransfer::V1::AgentPool
def update_agent_pool(agent_pool: nil, update_mask: nil) -> ::Google::Cloud::StorageTransfer::V1::AgentPool

Updates an existing agent pool resource.

Overloads
def update_agent_pool(request, options = nil) -> ::Google::Cloud::StorageTransfer::V1::AgentPool
Pass arguments to update_agent_pool via a request object, either of type UpdateAgentPoolRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::StorageTransfer::V1::UpdateAgentPoolRequest, ::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_agent_pool(agent_pool: nil, update_mask: nil) -> ::Google::Cloud::StorageTransfer::V1::AgentPool
Pass arguments to update_agent_pool 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/storage_transfer/v1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::StorageTransfer::V1::UpdateAgentPoolRequest.new

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

# The returned object is of type Google::Cloud::StorageTransfer::V1::AgentPool.
p result

#update_transfer_job

def update_transfer_job(request, options = nil) -> ::Google::Cloud::StorageTransfer::V1::TransferJob
def update_transfer_job(job_name: nil, project_id: nil, transfer_job: nil, update_transfer_job_field_mask: nil) -> ::Google::Cloud::StorageTransfer::V1::TransferJob

Updates a transfer job. Updating a job's transfer spec does not affect transfer operations that are running already.

Note: The job's status field can be modified using this RPC (for example, to set a job's status to DELETED, DISABLED, or ENABLED).

Overloads
def update_transfer_job(request, options = nil) -> ::Google::Cloud::StorageTransfer::V1::TransferJob
Pass arguments to update_transfer_job via a request object, either of type UpdateTransferJobRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::StorageTransfer::V1::UpdateTransferJobRequest, ::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_job(job_name: nil, project_id: nil, transfer_job: nil, update_transfer_job_field_mask: nil) -> ::Google::Cloud::StorageTransfer::V1::TransferJob
Pass arguments to update_transfer_job 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/storage_transfer/v1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::StorageTransfer::V1::UpdateTransferJobRequest.new

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

# The returned object is of type Google::Cloud::StorageTransfer::V1::TransferJob.
p result