Class: Google::Apis::StoragetransferV1::StoragetransferService
- Inherits:
-
Core::BaseService
- Object
- Core::BaseService
- Google::Apis::StoragetransferV1::StoragetransferService
- Defined in:
- lib/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.
Constant Summary collapse
- DEFAULT_ENDPOINT_TEMPLATE =
"https://storagetransfer.$UNIVERSE_DOMAIN$/"
Instance Attribute Summary collapse
-
#key ⇒ String
API key.
-
#quota_user ⇒ String
Available to use for quota purposes for server-side applications.
Instance Method Summary collapse
-
#cancel_transfer_operation(name, cancel_operation_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StoragetransferV1::Empty
Cancels a transfer.
-
#create_project_agent_pool(project_id, agent_pool_object = nil, agent_pool_id: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StoragetransferV1::AgentPool
Creates an agent pool resource.
-
#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.
-
#delete_project_agent_pool(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StoragetransferV1::Empty
Deletes an agent pool.
-
#delete_transfer_job(job_name, project_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StoragetransferV1::Empty
Deletes a transfer job.
-
#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.
-
#get_project_agent_pool(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StoragetransferV1::AgentPool
Gets an agent pool.
-
#get_transfer_job(job_name, project_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StoragetransferV1::TransferJob
Gets a transfer job.
-
#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.
-
#initialize ⇒ StoragetransferService
constructor
A new instance of StoragetransferService.
-
#list_project_agent_pools(project_id, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StoragetransferV1::ListAgentPoolsResponse
Lists agent pools.
-
#list_transfer_jobs(filter, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StoragetransferV1::ListTransferJobsResponse
Lists transfer jobs.
-
#list_transfer_operations(name, filter, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StoragetransferV1::ListOperationsResponse
Lists transfer operations.
-
#patch_project_agent_pool(name, agent_pool_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StoragetransferV1::AgentPool
Updates an existing agent pool resource.
-
#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.
-
#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.
-
#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.
-
#run_transfer_job(job_name, run_transfer_job_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StoragetransferV1::Operation
Starts a new operation for the specified transfer job.
Constructor Details
#initialize ⇒ StoragetransferService
Returns a new instance of StoragetransferService.
48 49 50 51 52 53 |
# File 'lib/google/apis/storagetransfer_v1/service.rb', line 48 def initialize super(DEFAULT_ENDPOINT_TEMPLATE, '', client_name: 'google-apis-storagetransfer_v1', client_version: Google::Apis::StoragetransferV1::GEM_VERSION) @batch_path = 'batch' end |
Instance Attribute Details
#key ⇒ String
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.
41 42 43 |
# File 'lib/google/apis/storagetransfer_v1/service.rb', line 41 def key @key end |
#quota_user ⇒ String
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.
46 47 48 |
# File 'lib/google/apis/storagetransfer_v1/service.rb', line 46 def quota_user @quota_user end |
Instance Method Details
#cancel_transfer_operation(name, cancel_operation_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StoragetransferV1::Empty
Cancels a transfer. Use the transferOperations.get method to check if the
cancellation succeeded or if the operation completed despite the cancel
request. When you cancel an operation, the currently running transfer is
interrupted. For recurring transfer jobs, the next instance of the transfer
job will still run. For example, if your job is configured to run every day at
1pm and you cancel Monday's operation at 1:05pm, Monday's transfer will stop.
However, a transfer job will still be attempted on Tuesday. This applies only
to currently running operations. If an operation is not currently running,
cancel
does nothing. Caution: Canceling a transfer job can leave your data
in an unknown state. We recommend that you restore the state at both the
destination and the source after the cancel
request completes so that your
data is in a consistent state. When you cancel a job, the next job computes a
delta of files and may repair any inconsistent state. For instance, if you run
a job every day, and today's job found 10 new files and transferred five files
before you canceled the job, tomorrow's transfer operation will compute a new
delta with the five files that were not copied today plus any new files
discovered tomorrow.
529 530 531 532 533 534 535 536 537 538 539 |
# File 'lib/google/apis/storagetransfer_v1/service.rb', line 529 def cancel_transfer_operation(name, cancel_operation_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+name}:cancel', ) command.request_representation = Google::Apis::StoragetransferV1::CancelOperationRequest::Representation command.request_object = cancel_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 |
#create_project_agent_pool(project_id, agent_pool_object = nil, agent_pool_id: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StoragetransferV1::AgentPool
Creates an agent pool resource.
121 122 123 124 125 126 127 128 129 130 131 132 |
# File 'lib/google/apis/storagetransfer_v1/service.rb', line 121 def create_project_agent_pool(project_id, agent_pool_object = nil, agent_pool_id: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/projects/{+projectId}/agentPools', ) command.request_representation = Google::Apis::StoragetransferV1::AgentPool::Representation command.request_object = agent_pool_object command.response_representation = Google::Apis::StoragetransferV1::AgentPool::Representation command.response_class = Google::Apis::StoragetransferV1::AgentPool command.params['projectId'] = project_id unless project_id.nil? command.query['agentPoolId'] = agent_pool_id unless agent_pool_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 |
#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.
296 297 298 299 300 301 302 303 304 305 |
# File 'lib/google/apis/storagetransfer_v1/service.rb', line 296 def create_transfer_job(transfer_job_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/transferJobs', ) 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_project_agent_pool(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StoragetransferV1::Empty
Deletes an agent pool.
154 155 156 157 158 159 160 161 162 |
# File 'lib/google/apis/storagetransfer_v1/service.rb', line 154 def delete_project_agent_pool(name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:delete, 'v1/{+name}', ) 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 |
#delete_transfer_job(job_name, project_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StoragetransferV1::Empty
Deletes a transfer job. Deleting a transfer job sets its status to DELETED.
329 330 331 332 333 334 335 336 337 338 |
# File 'lib/google/apis/storagetransfer_v1/service.rb', line 329 def delete_transfer_job(job_name, project_id, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:delete, 'v1/{+jobName}', ) command.response_representation = Google::Apis::StoragetransferV1::Empty::Representation command.response_class = Google::Apis::StoragetransferV1::Empty 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_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 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.
82 83 84 85 86 87 88 89 90 |
# File 'lib/google/apis/storagetransfer_v1/service.rb', line 82 def get_google_service_account(project_id, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/googleServiceAccounts/{projectId}', ) 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_project_agent_pool(name, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StoragetransferV1::AgentPool
Gets an agent pool.
184 185 186 187 188 189 190 191 192 |
# File 'lib/google/apis/storagetransfer_v1/service.rb', line 184 def get_project_agent_pool(name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+name}', ) command.response_representation = Google::Apis::StoragetransferV1::AgentPool::Representation command.response_class = Google::Apis::StoragetransferV1::AgentPool 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_transfer_job(job_name, project_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StoragetransferV1::TransferJob
Gets a transfer job.
362 363 364 365 366 367 368 369 370 371 |
# File 'lib/google/apis/storagetransfer_v1/service.rb', line 362 def get_transfer_job(job_name, project_id, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+jobName}', ) 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.
562 563 564 565 566 567 568 569 570 |
# File 'lib/google/apis/storagetransfer_v1/service.rb', line 562 def get_transfer_operation(name, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+name}', ) 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_project_agent_pools(project_id, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StoragetransferV1::ListAgentPoolsResponse
Lists agent pools.
224 225 226 227 228 229 230 231 232 233 234 235 |
# File 'lib/google/apis/storagetransfer_v1/service.rb', line 224 def list_project_agent_pools(project_id, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/projects/{+projectId}/agentPools', ) command.response_representation = Google::Apis::StoragetransferV1::ListAgentPoolsResponse::Representation command.response_class = Google::Apis::StoragetransferV1::ListAgentPoolsResponse command.params['projectId'] = project_id unless project_id.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 |
#list_transfer_jobs(filter, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StoragetransferV1::ListTransferJobsResponse
Lists transfer jobs.
409 410 411 412 413 414 415 416 417 418 419 |
# File 'lib/google/apis/storagetransfer_v1/service.rb', line 409 def list_transfer_jobs(filter, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/transferJobs', ) 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, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StoragetransferV1::ListOperationsResponse
Lists transfer operations. Operations are ordered by their creation time in reverse chronological order.
612 613 614 615 616 617 618 619 620 621 622 623 |
# File 'lib/google/apis/storagetransfer_v1/service.rb', line 612 def list_transfer_operations(name, filter, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:get, 'v1/{+name}', ) 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_project_agent_pool(name, agent_pool_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StoragetransferV1::AgentPool
Updates an existing agent pool resource.
264 265 266 267 268 269 270 271 272 273 274 275 |
# File 'lib/google/apis/storagetransfer_v1/service.rb', line 264 def patch_project_agent_pool(name, agent_pool_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:patch, 'v1/{+name}', ) command.request_representation = Google::Apis::StoragetransferV1::AgentPool::Representation command.request_object = agent_pool_object command.response_representation = Google::Apis::StoragetransferV1::AgentPool::Representation command.response_class = Google::Apis::StoragetransferV1::AgentPool command.params['name'] = name unless name.nil? command.query['updateMask'] = update_mask unless update_mask.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. 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).
445 446 447 448 449 450 451 452 453 454 455 |
# File 'lib/google/apis/storagetransfer_v1/service.rb', line 445 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}', ) 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.
646 647 648 649 650 651 652 653 654 655 656 |
# File 'lib/google/apis/storagetransfer_v1/service.rb', line 646 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', ) 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.
679 680 681 682 683 684 685 686 687 688 689 |
# File 'lib/google/apis/storagetransfer_v1/service.rb', line 679 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', ) 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 |
#run_transfer_job(job_name, run_transfer_job_request_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::StoragetransferV1::Operation
Starts a new operation for the specified transfer job. A TransferJob
has a
maximum of one active TransferOperation
. If this method is called while a
TransferOperation
is active, an error is returned.
480 481 482 483 484 485 486 487 488 489 490 |
# File 'lib/google/apis/storagetransfer_v1/service.rb', line 480 def run_transfer_job(job_name, run_transfer_job_request_object = nil, fields: nil, quota_user: nil, options: nil, &block) command = make_simple_command(:post, 'v1/{+jobName}:run', ) command.request_representation = Google::Apis::StoragetransferV1::RunTransferJobRequest::Representation command.request_object = run_transfer_job_request_object command.response_representation = Google::Apis::StoragetransferV1::Operation::Representation command.response_class = Google::Apis::StoragetransferV1::Operation 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 |