- 1.53.0 (latest)
- 1.52.0
- 1.51.0
- 1.49.0
- 1.48.0
- 1.47.0
- 1.46.0
- 1.45.0
- 1.44.0
- 1.43.0
- 1.42.0
- 1.41.0
- 1.40.0
- 1.39.0
- 1.37.0
- 1.36.0
- 1.35.0
- 1.34.0
- 1.33.0
- 1.32.0
- 1.31.0
- 1.30.0
- 1.29.0
- 1.28.0
- 1.27.0
- 1.24.0
- 1.23.0
- 1.22.0
- 1.21.0
- 1.20.0
- 1.19.0
- 1.18.0
- 1.17.0
- 1.16.0
- 1.15.0
- 1.14.0
- 1.13.0
- 1.12.0
- 1.11.0
- 1.9.0
- 1.8.0
- 1.7.0
- 1.6.0
- 1.5.0
- 1.4.0
- 1.0.4
public class StorageTransferServiceClient implements BackgroundResource
Service Description: 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.
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (StorageTransferServiceClient storageTransferServiceClient =
StorageTransferServiceClient.create()) {
TransferProto.GetGoogleServiceAccountRequest request =
TransferProto.GetGoogleServiceAccountRequest.newBuilder()
.setProjectId("projectId-894832108")
.build();
TransferTypes.GoogleServiceAccount response =
storageTransferServiceClient.getGoogleServiceAccount(request);
}
Note: close() needs to be called on the StorageTransferServiceClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
The surface of this class includes several types of Java methods for each of the API's methods:
- A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
- A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
- A "callable" method. This type of method takes no parameters and returns an immutable API callable object, which can be used to initiate calls to the service.
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of StorageTransferServiceSettings to create(). For example:
To customize credentials:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
StorageTransferServiceSettings storageTransferServiceSettings =
StorageTransferServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
StorageTransferServiceClient storageTransferServiceClient =
StorageTransferServiceClient.create(storageTransferServiceSettings);
To customize the endpoint:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
StorageTransferServiceSettings storageTransferServiceSettings =
StorageTransferServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
StorageTransferServiceClient storageTransferServiceClient =
StorageTransferServiceClient.create(storageTransferServiceSettings);
To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
StorageTransferServiceSettings storageTransferServiceSettings =
StorageTransferServiceSettings.newHttpJsonBuilder().build();
StorageTransferServiceClient storageTransferServiceClient =
StorageTransferServiceClient.create(storageTransferServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
Implements
BackgroundResourceStatic Methods
create()
public static final StorageTransferServiceClient create()
Constructs an instance of StorageTransferServiceClient with default settings.
Type | Description |
StorageTransferServiceClient |
Type | Description |
IOException |
create(StorageTransferServiceSettings settings)
public static final StorageTransferServiceClient create(StorageTransferServiceSettings settings)
Constructs an instance of StorageTransferServiceClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.
Name | Description |
settings |
StorageTransferServiceSettings |
Type | Description |
StorageTransferServiceClient |
Type | Description |
IOException |
create(StorageTransferServiceStub stub)
public static final StorageTransferServiceClient create(StorageTransferServiceStub stub)
Constructs an instance of StorageTransferServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(StorageTransferServiceSettings).
Name | Description |
stub |
StorageTransferServiceStub |
Type | Description |
StorageTransferServiceClient |
Constructors
StorageTransferServiceClient(StorageTransferServiceSettings settings)
protected StorageTransferServiceClient(StorageTransferServiceSettings settings)
Constructs an instance of StorageTransferServiceClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.
Name | Description |
settings |
StorageTransferServiceSettings |
StorageTransferServiceClient(StorageTransferServiceStub stub)
protected StorageTransferServiceClient(StorageTransferServiceStub stub)
Name | Description |
stub |
StorageTransferServiceStub |
Methods
awaitTermination(long duration, TimeUnit unit)
public boolean awaitTermination(long duration, TimeUnit unit)
Name | Description |
duration |
long |
unit |
TimeUnit |
Type | Description |
boolean |
Type | Description |
InterruptedException |
close()
public final void close()
createAgentPool(TransferProto.CreateAgentPoolRequest request)
public final TransferTypes.AgentPool createAgentPool(TransferProto.CreateAgentPoolRequest request)
Creates an agent pool resource.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (StorageTransferServiceClient storageTransferServiceClient =
StorageTransferServiceClient.create()) {
TransferProto.CreateAgentPoolRequest request =
TransferProto.CreateAgentPoolRequest.newBuilder()
.setProjectId("projectId-894832108")
.setAgentPool(TransferTypes.AgentPool.newBuilder().build())
.setAgentPoolId("agentPoolId1562124732")
.build();
TransferTypes.AgentPool response = storageTransferServiceClient.createAgentPool(request);
}
Name | Description |
request |
TransferProto.CreateAgentPoolRequest The request object containing all of the parameters for the API call. |
Type | Description |
TransferTypes.AgentPool |
createAgentPool(String projectId, TransferTypes.AgentPool agentPool, String agentPoolId)
public final TransferTypes.AgentPool createAgentPool(String projectId, TransferTypes.AgentPool agentPool, String agentPoolId)
Creates an agent pool resource.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (StorageTransferServiceClient storageTransferServiceClient =
StorageTransferServiceClient.create()) {
String projectId = "projectId-894832108";
TransferTypes.AgentPool agentPool = TransferTypes.AgentPool.newBuilder().build();
String agentPoolId = "agentPoolId1562124732";
TransferTypes.AgentPool response =
storageTransferServiceClient.createAgentPool(projectId, agentPool, agentPoolId);
}
Name | Description |
projectId |
String Required. The ID of the Google Cloud project that owns the agent pool. |
agentPool |
TransferTypes.AgentPool Required. The agent pool to create. |
agentPoolId |
String Required. The ID of the agent pool to create. The
As expressed by the regular expression: |
Type | Description |
TransferTypes.AgentPool |
createAgentPoolCallable()
public final UnaryCallable<TransferProto.CreateAgentPoolRequest,TransferTypes.AgentPool> createAgentPoolCallable()
Creates an agent pool resource.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (StorageTransferServiceClient storageTransferServiceClient =
StorageTransferServiceClient.create()) {
TransferProto.CreateAgentPoolRequest request =
TransferProto.CreateAgentPoolRequest.newBuilder()
.setProjectId("projectId-894832108")
.setAgentPool(TransferTypes.AgentPool.newBuilder().build())
.setAgentPoolId("agentPoolId1562124732")
.build();
ApiFuture<TransferTypes.AgentPool> future =
storageTransferServiceClient.createAgentPoolCallable().futureCall(request);
// Do something.
TransferTypes.AgentPool response = future.get();
}
Type | Description |
UnaryCallable<CreateAgentPoolRequest,AgentPool> |
createTransferJob(TransferProto.CreateTransferJobRequest request)
public final TransferTypes.TransferJob createTransferJob(TransferProto.CreateTransferJobRequest request)
Creates a transfer job that runs periodically.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (StorageTransferServiceClient storageTransferServiceClient =
StorageTransferServiceClient.create()) {
TransferProto.CreateTransferJobRequest request =
TransferProto.CreateTransferJobRequest.newBuilder()
.setTransferJob(TransferTypes.TransferJob.newBuilder().build())
.build();
TransferTypes.TransferJob response = storageTransferServiceClient.createTransferJob(request);
}
Name | Description |
request |
TransferProto.CreateTransferJobRequest The request object containing all of the parameters for the API call. |
Type | Description |
TransferTypes.TransferJob |
createTransferJobCallable()
public final UnaryCallable<TransferProto.CreateTransferJobRequest,TransferTypes.TransferJob> createTransferJobCallable()
Creates a transfer job that runs periodically.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (StorageTransferServiceClient storageTransferServiceClient =
StorageTransferServiceClient.create()) {
TransferProto.CreateTransferJobRequest request =
TransferProto.CreateTransferJobRequest.newBuilder()
.setTransferJob(TransferTypes.TransferJob.newBuilder().build())
.build();
ApiFuture<TransferTypes.TransferJob> future =
storageTransferServiceClient.createTransferJobCallable().futureCall(request);
// Do something.
TransferTypes.TransferJob response = future.get();
}
Type | Description |
UnaryCallable<CreateTransferJobRequest,TransferJob> |
deleteAgentPool(TransferProto.DeleteAgentPoolRequest request)
public final void deleteAgentPool(TransferProto.DeleteAgentPoolRequest request)
Deletes an agent pool.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (StorageTransferServiceClient storageTransferServiceClient =
StorageTransferServiceClient.create()) {
TransferProto.DeleteAgentPoolRequest request =
TransferProto.DeleteAgentPoolRequest.newBuilder().setName("name3373707").build();
storageTransferServiceClient.deleteAgentPool(request);
}
Name | Description |
request |
TransferProto.DeleteAgentPoolRequest The request object containing all of the parameters for the API call. |
deleteAgentPool(String name)
public final void deleteAgentPool(String name)
Deletes an agent pool.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (StorageTransferServiceClient storageTransferServiceClient =
StorageTransferServiceClient.create()) {
String name = "name3373707";
storageTransferServiceClient.deleteAgentPool(name);
}
Name | Description |
name |
String Required. The name of the agent pool to delete. |
deleteAgentPoolCallable()
public final UnaryCallable<TransferProto.DeleteAgentPoolRequest,Empty> deleteAgentPoolCallable()
Deletes an agent pool.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (StorageTransferServiceClient storageTransferServiceClient =
StorageTransferServiceClient.create()) {
TransferProto.DeleteAgentPoolRequest request =
TransferProto.DeleteAgentPoolRequest.newBuilder().setName("name3373707").build();
ApiFuture<Empty> future =
storageTransferServiceClient.deleteAgentPoolCallable().futureCall(request);
// Do something.
future.get();
}
Type | Description |
UnaryCallable<DeleteAgentPoolRequest,Empty> |
deleteTransferJob(TransferProto.DeleteTransferJobRequest request)
public final void deleteTransferJob(TransferProto.DeleteTransferJobRequest request)
Deletes a transfer job. Deleting a transfer job sets its status to DELETED.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (StorageTransferServiceClient storageTransferServiceClient =
StorageTransferServiceClient.create()) {
TransferProto.DeleteTransferJobRequest request =
TransferProto.DeleteTransferJobRequest.newBuilder()
.setJobName("jobName-1438096408")
.setProjectId("projectId-894832108")
.build();
storageTransferServiceClient.deleteTransferJob(request);
}
Name | Description |
request |
TransferProto.DeleteTransferJobRequest The request object containing all of the parameters for the API call. |
deleteTransferJobCallable()
public final UnaryCallable<TransferProto.DeleteTransferJobRequest,Empty> deleteTransferJobCallable()
Deletes a transfer job. Deleting a transfer job sets its status to DELETED.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (StorageTransferServiceClient storageTransferServiceClient =
StorageTransferServiceClient.create()) {
TransferProto.DeleteTransferJobRequest request =
TransferProto.DeleteTransferJobRequest.newBuilder()
.setJobName("jobName-1438096408")
.setProjectId("projectId-894832108")
.build();
ApiFuture<Empty> future =
storageTransferServiceClient.deleteTransferJobCallable().futureCall(request);
// Do something.
future.get();
}
Type | Description |
UnaryCallable<DeleteTransferJobRequest,Empty> |
getAgentPool(TransferProto.GetAgentPoolRequest request)
public final TransferTypes.AgentPool getAgentPool(TransferProto.GetAgentPoolRequest request)
Gets an agent pool.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (StorageTransferServiceClient storageTransferServiceClient =
StorageTransferServiceClient.create()) {
TransferProto.GetAgentPoolRequest request =
TransferProto.GetAgentPoolRequest.newBuilder().setName("name3373707").build();
TransferTypes.AgentPool response = storageTransferServiceClient.getAgentPool(request);
}
Name | Description |
request |
TransferProto.GetAgentPoolRequest The request object containing all of the parameters for the API call. |
Type | Description |
TransferTypes.AgentPool |
getAgentPool(String name)
public final TransferTypes.AgentPool getAgentPool(String name)
Gets an agent pool.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (StorageTransferServiceClient storageTransferServiceClient =
StorageTransferServiceClient.create()) {
String name = "name3373707";
TransferTypes.AgentPool response = storageTransferServiceClient.getAgentPool(name);
}
Name | Description |
name |
String Required. The name of the agent pool to get. |
Type | Description |
TransferTypes.AgentPool |
getAgentPoolCallable()
public final UnaryCallable<TransferProto.GetAgentPoolRequest,TransferTypes.AgentPool> getAgentPoolCallable()
Gets an agent pool.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (StorageTransferServiceClient storageTransferServiceClient =
StorageTransferServiceClient.create()) {
TransferProto.GetAgentPoolRequest request =
TransferProto.GetAgentPoolRequest.newBuilder().setName("name3373707").build();
ApiFuture<TransferTypes.AgentPool> future =
storageTransferServiceClient.getAgentPoolCallable().futureCall(request);
// Do something.
TransferTypes.AgentPool response = future.get();
}
Type | Description |
UnaryCallable<GetAgentPoolRequest,AgentPool> |
getGoogleServiceAccount(TransferProto.GetGoogleServiceAccountRequest request)
public final TransferTypes.GoogleServiceAccount getGoogleServiceAccount(TransferProto.GetGoogleServiceAccountRequest request)
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.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (StorageTransferServiceClient storageTransferServiceClient =
StorageTransferServiceClient.create()) {
TransferProto.GetGoogleServiceAccountRequest request =
TransferProto.GetGoogleServiceAccountRequest.newBuilder()
.setProjectId("projectId-894832108")
.build();
TransferTypes.GoogleServiceAccount response =
storageTransferServiceClient.getGoogleServiceAccount(request);
}
Name | Description |
request |
TransferProto.GetGoogleServiceAccountRequest The request object containing all of the parameters for the API call. |
Type | Description |
TransferTypes.GoogleServiceAccount |
getGoogleServiceAccountCallable()
public final UnaryCallable<TransferProto.GetGoogleServiceAccountRequest,TransferTypes.GoogleServiceAccount> getGoogleServiceAccountCallable()
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.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (StorageTransferServiceClient storageTransferServiceClient =
StorageTransferServiceClient.create()) {
TransferProto.GetGoogleServiceAccountRequest request =
TransferProto.GetGoogleServiceAccountRequest.newBuilder()
.setProjectId("projectId-894832108")
.build();
ApiFuture<TransferTypes.GoogleServiceAccount> future =
storageTransferServiceClient.getGoogleServiceAccountCallable().futureCall(request);
// Do something.
TransferTypes.GoogleServiceAccount response = future.get();
}
Type | Description |
UnaryCallable<GetGoogleServiceAccountRequest,GoogleServiceAccount> |
getHttpJsonOperationsClient()
public final OperationsClient getHttpJsonOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
Type | Description |
OperationsClient |
getOperationsClient()
public final OperationsClient getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
Type | Description |
OperationsClient |
getSettings()
public final StorageTransferServiceSettings getSettings()
Type | Description |
StorageTransferServiceSettings |
getStub()
public StorageTransferServiceStub getStub()
Type | Description |
StorageTransferServiceStub |
getTransferJob(TransferProto.GetTransferJobRequest request)
public final TransferTypes.TransferJob getTransferJob(TransferProto.GetTransferJobRequest request)
Gets a transfer job.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (StorageTransferServiceClient storageTransferServiceClient =
StorageTransferServiceClient.create()) {
TransferProto.GetTransferJobRequest request =
TransferProto.GetTransferJobRequest.newBuilder()
.setJobName("jobName-1438096408")
.setProjectId("projectId-894832108")
.build();
TransferTypes.TransferJob response = storageTransferServiceClient.getTransferJob(request);
}
Name | Description |
request |
TransferProto.GetTransferJobRequest The request object containing all of the parameters for the API call. |
Type | Description |
TransferTypes.TransferJob |
getTransferJobCallable()
public final UnaryCallable<TransferProto.GetTransferJobRequest,TransferTypes.TransferJob> getTransferJobCallable()
Gets a transfer job.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (StorageTransferServiceClient storageTransferServiceClient =
StorageTransferServiceClient.create()) {
TransferProto.GetTransferJobRequest request =
TransferProto.GetTransferJobRequest.newBuilder()
.setJobName("jobName-1438096408")
.setProjectId("projectId-894832108")
.build();
ApiFuture<TransferTypes.TransferJob> future =
storageTransferServiceClient.getTransferJobCallable().futureCall(request);
// Do something.
TransferTypes.TransferJob response = future.get();
}
Type | Description |
UnaryCallable<GetTransferJobRequest,TransferJob> |
isShutdown()
public boolean isShutdown()
Type | Description |
boolean |
isTerminated()
public boolean isTerminated()
Type | Description |
boolean |
listAgentPools(TransferProto.ListAgentPoolsRequest request)
public final StorageTransferServiceClient.ListAgentPoolsPagedResponse listAgentPools(TransferProto.ListAgentPoolsRequest request)
Lists agent pools.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (StorageTransferServiceClient storageTransferServiceClient =
StorageTransferServiceClient.create()) {
TransferProto.ListAgentPoolsRequest request =
TransferProto.ListAgentPoolsRequest.newBuilder()
.setProjectId("projectId-894832108")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (TransferTypes.AgentPool element :
storageTransferServiceClient.listAgentPools(request).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
request |
TransferProto.ListAgentPoolsRequest The request object containing all of the parameters for the API call. |
Type | Description |
StorageTransferServiceClient.ListAgentPoolsPagedResponse |
listAgentPools(String projectId)
public final StorageTransferServiceClient.ListAgentPoolsPagedResponse listAgentPools(String projectId)
Lists agent pools.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (StorageTransferServiceClient storageTransferServiceClient =
StorageTransferServiceClient.create()) {
String projectId = "projectId-894832108";
for (TransferTypes.AgentPool element :
storageTransferServiceClient.listAgentPools(projectId).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
projectId |
String Required. The ID of the Google Cloud project that owns the job. |
Type | Description |
StorageTransferServiceClient.ListAgentPoolsPagedResponse |
listAgentPoolsCallable()
public final UnaryCallable<TransferProto.ListAgentPoolsRequest,TransferProto.ListAgentPoolsResponse> listAgentPoolsCallable()
Lists agent pools.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (StorageTransferServiceClient storageTransferServiceClient =
StorageTransferServiceClient.create()) {
TransferProto.ListAgentPoolsRequest request =
TransferProto.ListAgentPoolsRequest.newBuilder()
.setProjectId("projectId-894832108")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
TransferProto.ListAgentPoolsResponse response =
storageTransferServiceClient.listAgentPoolsCallable().call(request);
for (TransferTypes.AgentPool element : response.getAgentPoolsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
Type | Description |
UnaryCallable<ListAgentPoolsRequest,ListAgentPoolsResponse> |
listAgentPoolsPagedCallable()
public final UnaryCallable<TransferProto.ListAgentPoolsRequest,StorageTransferServiceClient.ListAgentPoolsPagedResponse> listAgentPoolsPagedCallable()
Lists agent pools.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (StorageTransferServiceClient storageTransferServiceClient =
StorageTransferServiceClient.create()) {
TransferProto.ListAgentPoolsRequest request =
TransferProto.ListAgentPoolsRequest.newBuilder()
.setProjectId("projectId-894832108")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<TransferTypes.AgentPool> future =
storageTransferServiceClient.listAgentPoolsPagedCallable().futureCall(request);
// Do something.
for (TransferTypes.AgentPool element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
Type | Description |
UnaryCallable<ListAgentPoolsRequest,ListAgentPoolsPagedResponse> |
listTransferJobs(TransferProto.ListTransferJobsRequest request)
public final StorageTransferServiceClient.ListTransferJobsPagedResponse listTransferJobs(TransferProto.ListTransferJobsRequest request)
Lists transfer jobs.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (StorageTransferServiceClient storageTransferServiceClient =
StorageTransferServiceClient.create()) {
TransferProto.ListTransferJobsRequest request =
TransferProto.ListTransferJobsRequest.newBuilder()
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (TransferTypes.TransferJob element :
storageTransferServiceClient.listTransferJobs(request).iterateAll()) {
// doThingsWith(element);
}
}
Name | Description |
request |
TransferProto.ListTransferJobsRequest The request object containing all of the parameters for the API call. |
Type | Description |
StorageTransferServiceClient.ListTransferJobsPagedResponse |
listTransferJobsCallable()
public final UnaryCallable<TransferProto.ListTransferJobsRequest,TransferProto.ListTransferJobsResponse> listTransferJobsCallable()
Lists transfer jobs.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (StorageTransferServiceClient storageTransferServiceClient =
StorageTransferServiceClient.create()) {
TransferProto.ListTransferJobsRequest request =
TransferProto.ListTransferJobsRequest.newBuilder()
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
TransferProto.ListTransferJobsResponse response =
storageTransferServiceClient.listTransferJobsCallable().call(request);
for (TransferTypes.TransferJob element : response.getTransferJobsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
Type | Description |
UnaryCallable<ListTransferJobsRequest,ListTransferJobsResponse> |
listTransferJobsPagedCallable()
public final UnaryCallable<TransferProto.ListTransferJobsRequest,StorageTransferServiceClient.ListTransferJobsPagedResponse> listTransferJobsPagedCallable()
Lists transfer jobs.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (StorageTransferServiceClient storageTransferServiceClient =
StorageTransferServiceClient.create()) {
TransferProto.ListTransferJobsRequest request =
TransferProto.ListTransferJobsRequest.newBuilder()
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<TransferTypes.TransferJob> future =
storageTransferServiceClient.listTransferJobsPagedCallable().futureCall(request);
// Do something.
for (TransferTypes.TransferJob element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
Type | Description |
UnaryCallable<ListTransferJobsRequest,ListTransferJobsPagedResponse> |
pauseTransferOperation(TransferProto.PauseTransferOperationRequest request)
public final void pauseTransferOperation(TransferProto.PauseTransferOperationRequest request)
Pauses a transfer operation.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (StorageTransferServiceClient storageTransferServiceClient =
StorageTransferServiceClient.create()) {
TransferProto.PauseTransferOperationRequest request =
TransferProto.PauseTransferOperationRequest.newBuilder().setName("name3373707").build();
storageTransferServiceClient.pauseTransferOperation(request);
}
Name | Description |
request |
TransferProto.PauseTransferOperationRequest The request object containing all of the parameters for the API call. |
pauseTransferOperationCallable()
public final UnaryCallable<TransferProto.PauseTransferOperationRequest,Empty> pauseTransferOperationCallable()
Pauses a transfer operation.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (StorageTransferServiceClient storageTransferServiceClient =
StorageTransferServiceClient.create()) {
TransferProto.PauseTransferOperationRequest request =
TransferProto.PauseTransferOperationRequest.newBuilder().setName("name3373707").build();
ApiFuture<Empty> future =
storageTransferServiceClient.pauseTransferOperationCallable().futureCall(request);
// Do something.
future.get();
}
Type | Description |
UnaryCallable<PauseTransferOperationRequest,Empty> |
resumeTransferOperation(TransferProto.ResumeTransferOperationRequest request)
public final void resumeTransferOperation(TransferProto.ResumeTransferOperationRequest request)
Resumes a transfer operation that is paused.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (StorageTransferServiceClient storageTransferServiceClient =
StorageTransferServiceClient.create()) {
TransferProto.ResumeTransferOperationRequest request =
TransferProto.ResumeTransferOperationRequest.newBuilder().setName("name3373707").build();
storageTransferServiceClient.resumeTransferOperation(request);
}
Name | Description |
request |
TransferProto.ResumeTransferOperationRequest The request object containing all of the parameters for the API call. |
resumeTransferOperationCallable()
public final UnaryCallable<TransferProto.ResumeTransferOperationRequest,Empty> resumeTransferOperationCallable()
Resumes a transfer operation that is paused.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (StorageTransferServiceClient storageTransferServiceClient =
StorageTransferServiceClient.create()) {
TransferProto.ResumeTransferOperationRequest request =
TransferProto.ResumeTransferOperationRequest.newBuilder().setName("name3373707").build();
ApiFuture<Empty> future =
storageTransferServiceClient.resumeTransferOperationCallable().futureCall(request);
// Do something.
future.get();
}
Type | Description |
UnaryCallable<ResumeTransferOperationRequest,Empty> |
runTransferJobAsync(TransferProto.RunTransferJobRequest request)
public final OperationFuture<Empty,TransferTypes.TransferOperation> runTransferJobAsync(TransferProto.RunTransferJobRequest request)
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.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (StorageTransferServiceClient storageTransferServiceClient =
StorageTransferServiceClient.create()) {
TransferProto.RunTransferJobRequest request =
TransferProto.RunTransferJobRequest.newBuilder()
.setJobName("jobName-1438096408")
.setProjectId("projectId-894832108")
.build();
storageTransferServiceClient.runTransferJobAsync(request).get();
}
Name | Description |
request |
TransferProto.RunTransferJobRequest The request object containing all of the parameters for the API call. |
Type | Description |
OperationFuture<Empty,TransferOperation> |
runTransferJobCallable()
public final UnaryCallable<TransferProto.RunTransferJobRequest,Operation> runTransferJobCallable()
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.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (StorageTransferServiceClient storageTransferServiceClient =
StorageTransferServiceClient.create()) {
TransferProto.RunTransferJobRequest request =
TransferProto.RunTransferJobRequest.newBuilder()
.setJobName("jobName-1438096408")
.setProjectId("projectId-894832108")
.build();
ApiFuture<Operation> future =
storageTransferServiceClient.runTransferJobCallable().futureCall(request);
// Do something.
future.get();
}
Type | Description |
UnaryCallable<RunTransferJobRequest,Operation> |
runTransferJobOperationCallable()
public final OperationCallable<TransferProto.RunTransferJobRequest,Empty,TransferTypes.TransferOperation> runTransferJobOperationCallable()
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.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (StorageTransferServiceClient storageTransferServiceClient =
StorageTransferServiceClient.create()) {
TransferProto.RunTransferJobRequest request =
TransferProto.RunTransferJobRequest.newBuilder()
.setJobName("jobName-1438096408")
.setProjectId("projectId-894832108")
.build();
OperationFuture<Empty, TransferTypes.TransferOperation> future =
storageTransferServiceClient.runTransferJobOperationCallable().futureCall(request);
// Do something.
future.get();
}
Type | Description |
OperationCallable<RunTransferJobRequest,Empty,TransferOperation> |
shutdown()
public void shutdown()
shutdownNow()
public void shutdownNow()
updateAgentPool(TransferProto.UpdateAgentPoolRequest request)
public final TransferTypes.AgentPool updateAgentPool(TransferProto.UpdateAgentPoolRequest request)
Updates an existing agent pool resource.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (StorageTransferServiceClient storageTransferServiceClient =
StorageTransferServiceClient.create()) {
TransferProto.UpdateAgentPoolRequest request =
TransferProto.UpdateAgentPoolRequest.newBuilder()
.setAgentPool(TransferTypes.AgentPool.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
TransferTypes.AgentPool response = storageTransferServiceClient.updateAgentPool(request);
}
Name | Description |
request |
TransferProto.UpdateAgentPoolRequest The request object containing all of the parameters for the API call. |
Type | Description |
TransferTypes.AgentPool |
updateAgentPool(TransferTypes.AgentPool agentPool, FieldMask updateMask)
public final TransferTypes.AgentPool updateAgentPool(TransferTypes.AgentPool agentPool, FieldMask updateMask)
Updates an existing agent pool resource.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (StorageTransferServiceClient storageTransferServiceClient =
StorageTransferServiceClient.create()) {
TransferTypes.AgentPool agentPool = TransferTypes.AgentPool.newBuilder().build();
FieldMask updateMask = FieldMask.newBuilder().build();
TransferTypes.AgentPool response =
storageTransferServiceClient.updateAgentPool(agentPool, updateMask);
}
Name | Description |
agentPool |
TransferTypes.AgentPool Required. The agent pool to update.
|
updateMask |
FieldMask The field mask of the
fields in
|
Type | Description |
TransferTypes.AgentPool |
updateAgentPoolCallable()
public final UnaryCallable<TransferProto.UpdateAgentPoolRequest,TransferTypes.AgentPool> updateAgentPoolCallable()
Updates an existing agent pool resource.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (StorageTransferServiceClient storageTransferServiceClient =
StorageTransferServiceClient.create()) {
TransferProto.UpdateAgentPoolRequest request =
TransferProto.UpdateAgentPoolRequest.newBuilder()
.setAgentPool(TransferTypes.AgentPool.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<TransferTypes.AgentPool> future =
storageTransferServiceClient.updateAgentPoolCallable().futureCall(request);
// Do something.
TransferTypes.AgentPool response = future.get();
}
Type | Description |
UnaryCallable<UpdateAgentPoolRequest,AgentPool> |
updateTransferJob(TransferProto.UpdateTransferJobRequest request)
public final TransferTypes.TransferJob updateTransferJob(TransferProto.UpdateTransferJobRequest request)
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).
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (StorageTransferServiceClient storageTransferServiceClient =
StorageTransferServiceClient.create()) {
TransferProto.UpdateTransferJobRequest request =
TransferProto.UpdateTransferJobRequest.newBuilder()
.setJobName("jobName-1438096408")
.setProjectId("projectId-894832108")
.setTransferJob(TransferTypes.TransferJob.newBuilder().build())
.setUpdateTransferJobFieldMask(FieldMask.newBuilder().build())
.build();
TransferTypes.TransferJob response = storageTransferServiceClient.updateTransferJob(request);
}
Name | Description |
request |
TransferProto.UpdateTransferJobRequest The request object containing all of the parameters for the API call. |
Type | Description |
TransferTypes.TransferJob |
updateTransferJobCallable()
public final UnaryCallable<TransferProto.UpdateTransferJobRequest,TransferTypes.TransferJob> updateTransferJobCallable()
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).
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (StorageTransferServiceClient storageTransferServiceClient =
StorageTransferServiceClient.create()) {
TransferProto.UpdateTransferJobRequest request =
TransferProto.UpdateTransferJobRequest.newBuilder()
.setJobName("jobName-1438096408")
.setProjectId("projectId-894832108")
.setTransferJob(TransferTypes.TransferJob.newBuilder().build())
.setUpdateTransferJobFieldMask(FieldMask.newBuilder().build())
.build();
ApiFuture<TransferTypes.TransferJob> future =
storageTransferServiceClient.updateTransferJobCallable().futureCall(request);
// Do something.
TransferTypes.TransferJob response = future.get();
}
Type | Description |
UnaryCallable<UpdateTransferJobRequest,TransferJob> |