Class: Google::Apis::StoragetransferV1::StoragetransferService

Inherits:
Core::BaseService show all
Defined in:
generated/google/apis/storagetransfer_v1/service.rb

Overview

Storage Transfer API

Transfers data from external data sources to a Google Cloud Storage bucket or between Google Cloud Storage buckets.

Examples:

require 'google/apis/storagetransfer_v1'

Storagetransfer = Google::Apis::StoragetransferV1 # Alias the module
service = Storagetransfer::StoragetransferService.new

See Also:

Instance Attribute Summary collapse

Attributes inherited from Core::BaseService

#authorization, #base_path, #batch_path, #client, #client_options, #request_options, #root_url, #upload_path

Instance Method Summary collapse

Methods inherited from Core::BaseService

#batch, #batch_upload, #fetch_all, #http

Methods included from Core::Logging

#logger

Constructor Details

#initializeStoragetransferService

Returns a new instance of StoragetransferService



46
47
48
49
# File 'generated/google/apis/storagetransfer_v1/service.rb', line 46

def initialize
  super('https://storagetransfer.googleapis.com/', '')
  @batch_path = 'batch'
end

Instance Attribute Details

#keyString

Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.

Returns:

  • (String)

    API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.



39
40
41
# File 'generated/google/apis/storagetransfer_v1/service.rb', line 39

def key
  @key
end

#quota_userString

Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

Returns:

  • (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.



44
45
46
# File 'generated/google/apis/storagetransfer_v1/service.rb', line 44

def quota_user
  @quota_user
end

Instance Method Details

#cancel_transfer_operation(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StoragetransferV1::Empty

Cancels a transfer. Use the get method to check whether the cancellation succeeded or whether the operation completed despite cancellation.

Parameters:

  • name (String)

    The name of the operation resource to be cancelled.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



255
256
257
258
259
260
261
262
263
# File 'generated/google/apis/storagetransfer_v1/service.rb', line 255

def cancel_transfer_operation(name, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:post, 'v1/{+name}:cancel', options)
  command.response_representation = Google::Apis::StoragetransferV1::Empty::Representation
  command.response_class = Google::Apis::StoragetransferV1::Empty
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#create_transfer_job(transfer_job_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StoragetransferV1::TransferJob

Creates a transfer job that runs periodically.

Parameters:

  • transfer_job_object (Google::Apis::StoragetransferV1::TransferJob) (defaults to: nil)
  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



109
110
111
112
113
114
115
116
117
118
# File 'generated/google/apis/storagetransfer_v1/service.rb', line 109

def create_transfer_job(transfer_job_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:post, 'v1/transferJobs', options)
  command.request_representation = Google::Apis::StoragetransferV1::TransferJob::Representation
  command.request_object = transfer_job_object
  command.response_representation = Google::Apis::StoragetransferV1::TransferJob::Representation
  command.response_class = Google::Apis::StoragetransferV1::TransferJob
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_transfer_operation(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StoragetransferV1::Empty

This method is not supported and the server returns UNIMPLEMENTED.

Parameters:

  • name (String)

    The name of the operation resource to be deleted.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



285
286
287
288
289
290
291
292
293
# File 'generated/google/apis/storagetransfer_v1/service.rb', line 285

def delete_transfer_operation(name, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:delete, 'v1/{+name}', options)
  command.response_representation = Google::Apis::StoragetransferV1::Empty::Representation
  command.response_class = Google::Apis::StoragetransferV1::Empty
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_google_service_account(project_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StoragetransferV1::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.

Parameters:

  • project_id (String)

    The ID of the Google Cloud Platform Console project that the Google service account is associated with. Required.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



80
81
82
83
84
85
86
87
88
# File 'generated/google/apis/storagetransfer_v1/service.rb', line 80

def (project_id, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:get, 'v1/googleServiceAccounts/{projectId}', options)
  command.response_representation = Google::Apis::StoragetransferV1::GoogleServiceAccount::Representation
  command.response_class = Google::Apis::StoragetransferV1::GoogleServiceAccount
  command.params['projectId'] = project_id unless project_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_transfer_job(job_name, project_id: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StoragetransferV1::TransferJob

Gets a transfer job.

Parameters:

  • job_name (String)

    The job to get. Required.

  • project_id (String)

    The ID of the Google Cloud Platform Console project that owns the job. Required.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



144
145
146
147
148
149
150
151
152
153
# File 'generated/google/apis/storagetransfer_v1/service.rb', line 144

def get_transfer_job(job_name, project_id: nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:get, 'v1/{+jobName}', options)
  command.response_representation = Google::Apis::StoragetransferV1::TransferJob::Representation
  command.response_class = Google::Apis::StoragetransferV1::TransferJob
  command.params['jobName'] = job_name unless job_name.nil?
  command.query['projectId'] = project_id unless project_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_transfer_operation(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StoragetransferV1::Operation

Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.

Parameters:

  • name (String)

    The name of the operation resource.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



317
318
319
320
321
322
323
324
325
# File 'generated/google/apis/storagetransfer_v1/service.rb', line 317

def get_transfer_operation(name, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::StoragetransferV1::Operation::Representation
  command.response_class = Google::Apis::StoragetransferV1::Operation
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_transfer_jobs(filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StoragetransferV1::ListTransferJobsResponse

Lists transfer jobs.

Parameters:

  • filter (String)

    A list of query parameters specified as JSON text in the form of "project_id":"my_project_id", "job_names":["jobid1","jobid2",...], "job_statuses":["status1","status2",...]. Since job_names and job_statuses support multiple values, their values must be specified with array notation. project_id is required. job_names and job_statuses are optional. The valid values for job_statuses are case-insensitive: ENABLED, DISABLED, and DELETED.

  • page_size (Fixnum)

    The list page size. The max allowed value is 256.

  • page_token (String)

    The list page token.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



186
187
188
189
190
191
192
193
194
195
196
# File 'generated/google/apis/storagetransfer_v1/service.rb', line 186

def list_transfer_jobs(filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:get, 'v1/transferJobs', options)
  command.response_representation = Google::Apis::StoragetransferV1::ListTransferJobsResponse::Representation
  command.response_class = Google::Apis::StoragetransferV1::ListTransferJobsResponse
  command.query['filter'] = filter unless filter.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_transfer_operations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StoragetransferV1::ListOperationsResponse

Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED. NOTE: the name binding allows API services to override the binding to use different resource name schemes, such as users/*/operations. To override the binding, API services can add a binding such as "/v1/name=users/*/operations" to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.

Parameters:

  • name (String)

    The value transferOperations.

  • filter (String)

    A list of query parameters specified as JSON text in the form of \"project_id\ " : \"my_project_id\", \"job_names\" : [\"jobid1\", \"jobid2\",...], \" operation_names\" : [\"opid1\", \"opid2\",...], \"transfer_statuses\":[\" status1\", \"status2\",...]. Since job_names, operation_names, and transfer_statuses support multiple values, they must be specified with array notation. job_names, operation_names, and transfer_statuses are optional.

  • page_size (Fixnum)

    The list page size. The max allowed value is 256.

  • page_token (String)

    The list page token.

  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



366
367
368
369
370
371
372
373
374
375
376
377
# File 'generated/google/apis/storagetransfer_v1/service.rb', line 366

def list_transfer_operations(name, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:get, 'v1/{+name}', options)
  command.response_representation = Google::Apis::StoragetransferV1::ListOperationsResponse::Representation
  command.response_class = Google::Apis::StoragetransferV1::ListOperationsResponse
  command.params['name'] = name unless name.nil?
  command.query['filter'] = filter unless filter.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#patch_transfer_job(job_name, update_transfer_job_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StoragetransferV1::TransferJob

Updates a transfer job. Updating a job's transfer spec does not affect transfer operations that are running already. Updating the scheduling of a job is not allowed.

Parameters:

  • job_name (String)

    The name of job to update. Required.

  • update_transfer_job_request_object (Google::Apis::StoragetransferV1::UpdateTransferJobRequest) (defaults to: nil)
  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



222
223
224
225
226
227
228
229
230
231
232
# File 'generated/google/apis/storagetransfer_v1/service.rb', line 222

def patch_transfer_job(job_name, update_transfer_job_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:patch, 'v1/{+jobName}', options)
  command.request_representation = Google::Apis::StoragetransferV1::UpdateTransferJobRequest::Representation
  command.request_object = update_transfer_job_request_object
  command.response_representation = Google::Apis::StoragetransferV1::TransferJob::Representation
  command.response_class = Google::Apis::StoragetransferV1::TransferJob
  command.params['jobName'] = job_name unless job_name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#pause_transfer_operation(name, pause_transfer_operation_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StoragetransferV1::Empty

Pauses a transfer operation.

Parameters:

  • name (String)

    The name of the transfer operation. Required.

  • pause_transfer_operation_request_object (Google::Apis::StoragetransferV1::PauseTransferOperationRequest) (defaults to: nil)
  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



401
402
403
404
405
406
407
408
409
410
411
# File 'generated/google/apis/storagetransfer_v1/service.rb', line 401

def pause_transfer_operation(name, pause_transfer_operation_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:post, 'v1/{+name}:pause', options)
  command.request_representation = Google::Apis::StoragetransferV1::PauseTransferOperationRequest::Representation
  command.request_object = pause_transfer_operation_request_object
  command.response_representation = Google::Apis::StoragetransferV1::Empty::Representation
  command.response_class = Google::Apis::StoragetransferV1::Empty
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#resume_transfer_operation(name, resume_transfer_operation_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StoragetransferV1::Empty

Resumes a transfer operation that is paused.

Parameters:

  • name (String)

    The name of the transfer operation. Required.

  • resume_transfer_operation_request_object (Google::Apis::StoragetransferV1::ResumeTransferOperationRequest) (defaults to: nil)
  • fields (String)

    Selector specifying which fields to include in a partial response.

  • quota_user (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



435
436
437
438
439
440
441
442
443
444
445
# File 'generated/google/apis/storagetransfer_v1/service.rb', line 435

def resume_transfer_operation(name, resume_transfer_operation_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  command =  make_simple_command(:post, 'v1/{+name}:resume', options)
  command.request_representation = Google::Apis::StoragetransferV1::ResumeTransferOperationRequest::Representation
  command.request_object = resume_transfer_operation_request_object
  command.response_representation = Google::Apis::StoragetransferV1::Empty::Representation
  command.response_class = Google::Apis::StoragetransferV1::Empty
  command.params['name'] = name unless name.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end