Class StorageTransferServiceClient (2.23.0-rc)

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.

Equality

Instances of this class created via copy-construction or copy-assignment always compare equal. Instances created with equal std::shared_ptr<*Connection> objects compare equal. Objects that compare equal share the same underlying resources.

Performance

Creating a new instance of this class is a relatively expensive operation, new objects establish new connections to the service. In contrast, copy-construction, move-construction, and the corresponding assignment operations are relatively efficient as the copies share all underlying resources.

Thread Safety

Concurrent access to different instances of this class, even if they compare equal, is guaranteed to work. Two or more threads operating on the same instance of this class is not guaranteed to work. Since copy-construction and move-construction is a relatively efficient operation, consider using such a copy when using this class from multiple threads.

Constructors

StorageTransferServiceClient(StorageTransferServiceClient const &)

Copy and move support

Parameter
NameDescription
StorageTransferServiceClient const &

StorageTransferServiceClient(StorageTransferServiceClient &&)

Copy and move support

Parameter
NameDescription
StorageTransferServiceClient &&

StorageTransferServiceClient(std::shared_ptr< StorageTransferServiceConnection >, Options)

Parameters
NameDescription
connection std::shared_ptr< StorageTransferServiceConnection >
opts Options

Operators

operator=(StorageTransferServiceClient const &)

Copy and move support

Parameter
NameDescription
StorageTransferServiceClient const &
Returns
TypeDescription
StorageTransferServiceClient &

operator=(StorageTransferServiceClient &&)

Copy and move support

Parameter
NameDescription
StorageTransferServiceClient &&
Returns
TypeDescription
StorageTransferServiceClient &

Functions

GetGoogleServiceAccount(google::storagetransfer::v1::GetGoogleServiceAccountRequest const &, Options)

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.

Parameters
NameDescription
request google::storagetransfer::v1::GetGoogleServiceAccountRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.storagetransfer.v1.GetGoogleServiceAccountRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StatusOr< google::storagetransfer::v1::GoogleServiceAccount >

the result of the RPC. The response message type (google.storagetransfer.v1.GoogleServiceAccount) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

CreateTransferJob(google::storagetransfer::v1::CreateTransferJobRequest const &, Options)

Creates a transfer job that runs periodically.

Parameters
NameDescription
request google::storagetransfer::v1::CreateTransferJobRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.storagetransfer.v1.CreateTransferJobRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StatusOr< google::storagetransfer::v1::TransferJob >

the result of the RPC. The response message type (google.storagetransfer.v1.TransferJob) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

UpdateTransferJob(google::storagetransfer::v1::UpdateTransferJobRequest const &, Options)

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).

Parameters
NameDescription
request google::storagetransfer::v1::UpdateTransferJobRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.storagetransfer.v1.UpdateTransferJobRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StatusOr< google::storagetransfer::v1::TransferJob >

the result of the RPC. The response message type (google.storagetransfer.v1.TransferJob) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GetTransferJob(google::storagetransfer::v1::GetTransferJobRequest const &, Options)

Gets a transfer job.

Parameters
NameDescription
request google::storagetransfer::v1::GetTransferJobRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.storagetransfer.v1.GetTransferJobRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StatusOr< google::storagetransfer::v1::TransferJob >

the result of the RPC. The response message type (google.storagetransfer.v1.TransferJob) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

ListTransferJobs(google::storagetransfer::v1::ListTransferJobsRequest, Options)

Lists transfer jobs.

Parameters
NameDescription
request google::storagetransfer::v1::ListTransferJobsRequest

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.storagetransfer.v1.ListTransferJobsRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StreamRange< google::storagetransfer::v1::TransferJob >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.storagetransfer.v1.TransferJob, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

PauseTransferOperation(google::storagetransfer::v1::PauseTransferOperationRequest const &, Options)

Pauses a transfer operation.

Parameters
NameDescription
request google::storagetransfer::v1::PauseTransferOperationRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.storagetransfer.v1.PauseTransferOperationRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
Status

a Status object. If the request failed, the status contains the details of the failure.

ResumeTransferOperation(google::storagetransfer::v1::ResumeTransferOperationRequest const &, Options)

Resumes a transfer operation that is paused.

Parameters
NameDescription
request google::storagetransfer::v1::ResumeTransferOperationRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.storagetransfer.v1.ResumeTransferOperationRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
Status

a Status object. If the request failed, the status contains the details of the failure.

RunTransferJob(google::storagetransfer::v1::RunTransferJobRequest const &, Options)

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.

Parameters
NameDescription
request google::storagetransfer::v1::RunTransferJobRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.storagetransfer.v1.RunTransferJobRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
future< StatusOr< google::storagetransfer::v1::TransferOperation > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.storagetransfer.v1.TransferOperation proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

DeleteTransferJob(google::storagetransfer::v1::DeleteTransferJobRequest const &, Options)

Deletes a transfer job.

Deleting a transfer job sets its status to DELETED.

Parameters
NameDescription
request google::storagetransfer::v1::DeleteTransferJobRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.storagetransfer.v1.DeleteTransferJobRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
Status

a Status object. If the request failed, the status contains the details of the failure.

CreateAgentPool(std::string const &, google::storagetransfer::v1::AgentPool const &, std::string const &, Options)

Creates an agent pool resource.

Parameters
NameDescription
project_id std::string const &

Required. The ID of the Google Cloud project that owns the agent pool.

agent_pool google::storagetransfer::v1::AgentPool const &

Required. The agent pool to create.

agent_pool_id std::string const &

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])?$.
opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StatusOr< google::storagetransfer::v1::AgentPool >

the result of the RPC. The response message type (google.storagetransfer.v1.AgentPool) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

CreateAgentPool(google::storagetransfer::v1::CreateAgentPoolRequest const &, Options)

Creates an agent pool resource.

Parameters
NameDescription
request google::storagetransfer::v1::CreateAgentPoolRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.storagetransfer.v1.CreateAgentPoolRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StatusOr< google::storagetransfer::v1::AgentPool >

the result of the RPC. The response message type (google.storagetransfer.v1.AgentPool) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

UpdateAgentPool(google::storagetransfer::v1::AgentPool const &, google::protobuf::FieldMask const &, Options)

Updates an existing agent pool resource.

Parameters
NameDescription
agent_pool google::storagetransfer::v1::AgentPool const &

Required. The agent pool to update. agent_pool is expected to specify following fields:

update_mask google::protobuf::FieldMask const &

The field mask of the fields in agentPool to update in this request. The following agentPool fields can be updated:

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StatusOr< google::storagetransfer::v1::AgentPool >

the result of the RPC. The response message type (google.storagetransfer.v1.AgentPool) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

UpdateAgentPool(google::storagetransfer::v1::UpdateAgentPoolRequest const &, Options)

Updates an existing agent pool resource.

Parameters
NameDescription
request google::storagetransfer::v1::UpdateAgentPoolRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.storagetransfer.v1.UpdateAgentPoolRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StatusOr< google::storagetransfer::v1::AgentPool >

the result of the RPC. The response message type (google.storagetransfer.v1.AgentPool) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GetAgentPool(std::string const &, Options)

Gets an agent pool.

Parameters
NameDescription
name std::string const &

Required. The name of the agent pool to get.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StatusOr< google::storagetransfer::v1::AgentPool >

the result of the RPC. The response message type (google.storagetransfer.v1.AgentPool) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GetAgentPool(google::storagetransfer::v1::GetAgentPoolRequest const &, Options)

Gets an agent pool.

Parameters
NameDescription
request google::storagetransfer::v1::GetAgentPoolRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.storagetransfer.v1.GetAgentPoolRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StatusOr< google::storagetransfer::v1::AgentPool >

the result of the RPC. The response message type (google.storagetransfer.v1.AgentPool) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

ListAgentPools(std::string const &, Options)

Lists agent pools.

Parameters
NameDescription
project_id std::string const &

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

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StreamRange< google::storagetransfer::v1::AgentPool >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.storagetransfer.v1.AgentPool, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

ListAgentPools(google::storagetransfer::v1::ListAgentPoolsRequest, Options)

Lists agent pools.

Parameters
NameDescription
request google::storagetransfer::v1::ListAgentPoolsRequest

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.storagetransfer.v1.ListAgentPoolsRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
StreamRange< google::storagetransfer::v1::AgentPool >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.storagetransfer.v1.AgentPool, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

DeleteAgentPool(std::string const &, Options)

Deletes an agent pool.

Parameters
NameDescription
name std::string const &

Required. The name of the agent pool to delete.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
Status

a Status object. If the request failed, the status contains the details of the failure.

DeleteAgentPool(google::storagetransfer::v1::DeleteAgentPoolRequest const &, Options)

Deletes an agent pool.

Parameters
NameDescription
request google::storagetransfer::v1::DeleteAgentPoolRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.storagetransfer.v1.DeleteAgentPoolRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
TypeDescription
Status

a Status object. If the request failed, the status contains the details of the failure.