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.
- (config) — Configure the Client client.
- config (Client::Configuration)
# 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.
- (config) — Configure the Client client.
- config (Client::Configuration)
#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.
def create_transfer_job(request, options = nil) -> ::Google::Cloud::StorageTransfer::V1::TransferJob
create_transfer_job
via a request object, either of type
CreateTransferJobRequest or an equivalent Hash.
- 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
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).
- transfer_job (::Google::Cloud::StorageTransfer::V1::TransferJob, ::Hash) — Required. The job to create.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::StorageTransfer::V1::TransferJob)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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
#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 Platform Console 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.
def get_google_service_account(request, options = nil) -> ::Google::Cloud::StorageTransfer::V1::GoogleServiceAccount
get_google_service_account
via a request object, either of type
GetGoogleServiceAccountRequest or an equivalent Hash.
- 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
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).
- project_id (::String) — Required. The ID of the Google Cloud Platform Console project that the Google service account is associated with.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::StorageTransfer::V1::GoogleServiceAccount)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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.
def get_transfer_job(request, options = nil) -> ::Google::Cloud::StorageTransfer::V1::TransferJob
get_transfer_job
via a request object, either of type
GetTransferJobRequest or an equivalent Hash.
- 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
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).
- job_name (::String) — Required. The job to get.
- project_id (::String) — Required. The ID of the Google Cloud Platform Console project that owns the job.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::StorageTransfer::V1::TransferJob)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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.
- (config) — Configure the StorageTransferService client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# 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_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.
def list_transfer_jobs(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::StorageTransfer::V1::TransferJob>
list_transfer_jobs
via a request object, either of type
ListTransferJobsRequest or an equivalent Hash.
- 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>
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).
-
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
andjobStatuses
support multiple values, their values must be specified with array notation.projectId
is required.jobNames
andjobStatuses
are optional. The valid values forjobStatuses
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.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::StorageTransfer::V1::TransferJob>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::StorageTransfer::V1::TransferJob>)
- (::Google::Cloud::Error) — if the RPC is aborted.
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 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::StorageTransfer::V1::TransferJob. p response 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.
def pause_transfer_operation(request, options = nil) -> ::Google::Protobuf::Empty
pause_transfer_operation
via a request object, either of type
PauseTransferOperationRequest or an equivalent Hash.
- 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
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).
- name (::String) — Required. The name of the transfer operation.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Protobuf::Empty)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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.
def resume_transfer_operation(request, options = nil) -> ::Google::Protobuf::Empty
resume_transfer_operation
via a request object, either of type
ResumeTransferOperationRequest or an equivalent Hash.
- 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
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).
- name (::String) — Required. The name of the transfer operation.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Protobuf::Empty)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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 wil be returned.
def run_transfer_job(request, options = nil) -> ::Gapic::Operation
run_transfer_job
via a request object, either of type
RunTransferJobRequest or an equivalent Hash.
- 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
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).
- job_name (::String) — Required. The name of the transfer job.
- project_id (::String) — Required. The ID of the Google Cloud Platform Console project that owns the transfer job.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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 this # object to check the status of an operation, cancel it, or wait # for results. Here is how to block until completion: result.wait_until_done! timeout: 60 if result.response? p result.response else puts "Error!" end
#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).
def update_transfer_job(request, options = nil) -> ::Google::Cloud::StorageTransfer::V1::TransferJob
update_transfer_job
via a request object, either of type
UpdateTransferJobRequest or an equivalent Hash.
- 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
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).
- job_name (::String) — Required. The name of job to update.
- project_id (::String) — Required. The ID of the Google Cloud Platform Console project that owns the job.
-
transfer_job (::Google::Cloud::StorageTransfer::V1::TransferJob, ::Hash) — Required. The job to update.
transferJob
is expected to specify only four fields: description, transfer_spec, notification_config, and status. AnUpdateTransferJobRequest
that specifies other fields are rejected with the error INVALID_ARGUMENT. Updating a job status to DELETED requiresstoragetransfer.jobs.delete
permissions. -
update_transfer_job_field_mask (::Google::Protobuf::FieldMask, ::Hash) — The field mask of the fields in
transferJob
that are to be updated in this request. Fields intransferJob
that can be updated are: description, transfer_spec, notification_config, and status. To update thetransfer_spec
of the job, a complete transfer specification must be provided. An incomplete specification missing any required fields is rejected with the error INVALID_ARGUMENT.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::StorageTransfer::V1::TransferJob)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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