Class DataAgentServiceClient
- All Implemented Interfaces:
BackgroundResource,AutoCloseable
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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) {
DataAgentName name = DataAgentName.of("[PROJECT]", "[LOCATION]", "[DATA_AGENT]");
DataAgent response = dataAgentServiceClient.getDataAgent(name);
}
Note: close() needs to be called on the DataAgentServiceClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
| Method | Description | Method Variants |
|---|---|---|
ListDataAgents |
Lists DataAgents in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListAccessibleDataAgents |
Lists DataAgents that are accessible to the caller in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetDataAgent |
Gets details of a single DataAgent. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateDataAgent |
Creates a new DataAgent in a given project and location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
CreateDataAgentSync |
Creates a new DataAgent in a given project and location synchronously. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateDataAgent |
Updates the parameters of a single DataAgent. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateDataAgentSync |
Updates the parameters of a single DataAgent synchronously. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteDataAgent |
Deletes a single DataAgent. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteDataAgentSync |
Deletes a single DataAgent synchronously. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetIamPolicy |
Gets the IAM policy for DataAgent |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
SetIamPolicy |
Sets the IAM policy for a DataAgent. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListLocations |
Lists information about the supported locations for this service.This method can be called in two ways: * **List all public locations:** Use the path `GET /v1/locations`.* **List project-visible locations:** Use the path`GET /v1/projects/{project_id}/locations`. This may include publiclocations as well as private or other locations specifically visibleto the project. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetLocation |
Gets information about a location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return 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 DataAgentServiceSettings 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
DataAgentServiceSettings dataAgentServiceSettings =
DataAgentServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
DataAgentServiceClient dataAgentServiceClient =
DataAgentServiceClient.create(dataAgentServiceSettings);
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
DataAgentServiceSettings dataAgentServiceSettings =
DataAgentServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
DataAgentServiceClient dataAgentServiceClient =
DataAgentServiceClient.create(dataAgentServiceSettings);
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
DataAgentServiceSettings dataAgentServiceSettings =
DataAgentServiceSettings.newHttpJsonBuilder().build();
DataAgentServiceClient dataAgentServiceClient =
DataAgentServiceClient.create(dataAgentServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic class -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructs an instance of DataAgentServiceClient, using the given settings.protected -
Method Summary
Modifier and TypeMethodDescriptionbooleanawaitTermination(long duration, TimeUnit unit) final voidclose()static final DataAgentServiceClientcreate()Constructs an instance of DataAgentServiceClient with default settings.static final DataAgentServiceClientcreate(DataAgentServiceSettings settings) Constructs an instance of DataAgentServiceClient, using the given settings.static final DataAgentServiceClientcreate(DataAgentServiceStub stub) Constructs an instance of DataAgentServiceClient, using the given stub for making calls.Creates a new DataAgent in a given project and location.createDataAgentAsync(LocationName parent, DataAgent dataAgent, String dataAgentId) Creates a new DataAgent in a given project and location.createDataAgentAsync(String parent, DataAgent dataAgent, String dataAgentId) Creates a new DataAgent in a given project and location.Creates a new DataAgent in a given project and location.Creates a new DataAgent in a given project and location.final DataAgentCreates a new DataAgent in a given project and location synchronously.final DataAgentcreateDataAgentSync(LocationName parent, DataAgent dataAgent, String dataAgentId) Creates a new DataAgent in a given project and location synchronously.final DataAgentcreateDataAgentSync(String parent, DataAgent dataAgent, String dataAgentId) Creates a new DataAgent in a given project and location synchronously.Creates a new DataAgent in a given project and location synchronously.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single DataAgent.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single DataAgent.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteDataAgentAsync(String name) Deletes a single DataAgent.Deletes a single DataAgent.final OperationCallable<DeleteDataAgentRequest,com.google.protobuf.Empty, OperationMetadata> Deletes a single DataAgent.final voidDeletes a single DataAgent synchronously.final voidDeletes a single DataAgent synchronously.final voiddeleteDataAgentSync(String name) Deletes a single DataAgent synchronously.final UnaryCallable<DeleteDataAgentRequest,com.google.protobuf.Empty> Deletes a single DataAgent synchronously.final DataAgentgetDataAgent(DataAgentName name) Gets details of a single DataAgent.final DataAgentgetDataAgent(GetDataAgentRequest request) Gets details of a single DataAgent.final DataAgentgetDataAgent(String name) Gets details of a single DataAgent.Gets details of a single DataAgent.final OperationsClientReturns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.final PolicygetIamPolicy(ResourceName resource) Gets the IAM policy for DataAgentfinal PolicygetIamPolicy(GetIamPolicyRequest request) Gets the IAM policy for DataAgentfinal PolicygetIamPolicy(String resource) Gets the IAM policy for DataAgentGets the IAM policy for DataAgentfinal LocationgetLocation(GetLocationRequest request) Gets information about a location.Gets information about a location.final OperationsClientReturns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.final DataAgentServiceSettingsgetStub()booleanbooleanLists DataAgents that are accessible to the caller in a given project and location.listAccessibleDataAgents(LocationName parent) Lists DataAgents that are accessible to the caller in a given project and location.listAccessibleDataAgents(String parent) Lists DataAgents that are accessible to the caller in a given project and location.Lists DataAgents that are accessible to the caller in a given project and location.final UnaryCallable<ListAccessibleDataAgentsRequest,DataAgentServiceClient.ListAccessibleDataAgentsPagedResponse> Lists DataAgents that are accessible to the caller in a given project and location.listDataAgents(ListDataAgentsRequest request) Lists DataAgents in a given project and location.listDataAgents(LocationName parent) Lists DataAgents in a given project and location.listDataAgents(String parent) Lists DataAgents in a given project and location.Lists DataAgents in a given project and location.Lists DataAgents in a given project and location.listLocations(ListLocationsRequest request) Lists information about the supported locations for this service.This method can be called in two ways:Lists information about the supported locations for this service.This method can be called in two ways:Lists information about the supported locations for this service.This method can be called in two ways:final PolicysetIamPolicy(ResourceName resource) Sets the IAM policy for a DataAgent.final PolicysetIamPolicy(SetIamPolicyRequest request) Sets the IAM policy for a DataAgent.final PolicysetIamPolicy(String resource) Sets the IAM policy for a DataAgent.Sets the IAM policy for a DataAgent.voidshutdown()voidupdateDataAgentAsync(DataAgent dataAgent, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single DataAgent.Updates the parameters of a single DataAgent.Updates the parameters of a single DataAgent.Updates the parameters of a single DataAgent.final DataAgentupdateDataAgentSync(DataAgent dataAgent, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single DataAgent synchronously.final DataAgentUpdates the parameters of a single DataAgent synchronously.Updates the parameters of a single DataAgent synchronously.
-
Constructor Details
-
DataAgentServiceClient
Constructs an instance of DataAgentServiceClient, 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.- Throws:
IOException
-
DataAgentServiceClient
-
-
Method Details
-
create
Constructs an instance of DataAgentServiceClient with default settings.- Throws:
IOException
-
create
public static final DataAgentServiceClient create(DataAgentServiceSettings settings) throws IOException Constructs an instance of DataAgentServiceClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.- Throws:
IOException
-
create
Constructs an instance of DataAgentServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(DataAgentServiceSettings). -
getSettings
-
getStub
-
getOperationsClient
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call. -
getHttpJsonOperationsClient
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call. -
listDataAgents
Lists DataAgents in a given project and location.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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (DataAgent element : dataAgentServiceClient.listDataAgents(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Parent value for ListDataAgentsRequest.- Throws:
ApiException- if the remote call fails
-
listDataAgents
Lists DataAgents in a given project and location.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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (DataAgent element : dataAgentServiceClient.listDataAgents(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Parent value for ListDataAgentsRequest.- Throws:
ApiException- if the remote call fails
-
listDataAgents
public final DataAgentServiceClient.ListDataAgentsPagedResponse listDataAgents(ListDataAgentsRequest request) Lists DataAgents in a given project and location.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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { ListDataAgentsRequest request = ListDataAgentsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .setShowDeleted(true) .build(); for (DataAgent element : dataAgentServiceClient.listDataAgents(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listDataAgentsPagedCallable
public final UnaryCallable<ListDataAgentsRequest,DataAgentServiceClient.ListDataAgentsPagedResponse> listDataAgentsPagedCallable()Lists DataAgents in a given project and location.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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { ListDataAgentsRequest request = ListDataAgentsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .setShowDeleted(true) .build(); ApiFuture<DataAgent> future = dataAgentServiceClient.listDataAgentsPagedCallable().futureCall(request); // Do something. for (DataAgent element : future.get().iterateAll()) { // doThingsWith(element); } } -
listDataAgentsCallable
Lists DataAgents in a given project and location.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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { ListDataAgentsRequest request = ListDataAgentsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .setShowDeleted(true) .build(); while (true) { ListDataAgentsResponse response = dataAgentServiceClient.listDataAgentsCallable().call(request); for (DataAgent element : response.getDataAgentsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
listAccessibleDataAgents
public final DataAgentServiceClient.ListAccessibleDataAgentsPagedResponse listAccessibleDataAgents(LocationName parent) Lists DataAgents that are accessible to the caller in a given project and location.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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (DataAgent element : dataAgentServiceClient.listAccessibleDataAgents(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Parent value for ListAccessibleDataAgentsRequest.- Throws:
ApiException- if the remote call fails
-
listAccessibleDataAgents
public final DataAgentServiceClient.ListAccessibleDataAgentsPagedResponse listAccessibleDataAgents(String parent) Lists DataAgents that are accessible to the caller in a given project and location.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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (DataAgent element : dataAgentServiceClient.listAccessibleDataAgents(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Parent value for ListAccessibleDataAgentsRequest.- Throws:
ApiException- if the remote call fails
-
listAccessibleDataAgents
public final DataAgentServiceClient.ListAccessibleDataAgentsPagedResponse listAccessibleDataAgents(ListAccessibleDataAgentsRequest request) Lists DataAgents that are accessible to the caller in a given project and location.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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { ListAccessibleDataAgentsRequest request = ListAccessibleDataAgentsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .setShowDeleted(true) .build(); for (DataAgent element : dataAgentServiceClient.listAccessibleDataAgents(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listAccessibleDataAgentsPagedCallable
public final UnaryCallable<ListAccessibleDataAgentsRequest,DataAgentServiceClient.ListAccessibleDataAgentsPagedResponse> listAccessibleDataAgentsPagedCallable()Lists DataAgents that are accessible to the caller in a given project and location.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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { ListAccessibleDataAgentsRequest request = ListAccessibleDataAgentsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .setShowDeleted(true) .build(); ApiFuture<DataAgent> future = dataAgentServiceClient.listAccessibleDataAgentsPagedCallable().futureCall(request); // Do something. for (DataAgent element : future.get().iterateAll()) { // doThingsWith(element); } } -
listAccessibleDataAgentsCallable
public final UnaryCallable<ListAccessibleDataAgentsRequest,ListAccessibleDataAgentsResponse> listAccessibleDataAgentsCallable()Lists DataAgents that are accessible to the caller in a given project and location.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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { ListAccessibleDataAgentsRequest request = ListAccessibleDataAgentsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .setShowDeleted(true) .build(); while (true) { ListAccessibleDataAgentsResponse response = dataAgentServiceClient.listAccessibleDataAgentsCallable().call(request); for (DataAgent element : response.getDataAgentsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getDataAgent
Gets details of a single DataAgent.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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { DataAgentName name = DataAgentName.of("[PROJECT]", "[LOCATION]", "[DATA_AGENT]"); DataAgent response = dataAgentServiceClient.getDataAgent(name); }- Parameters:
name- Required. Name of the resource.- Throws:
ApiException- if the remote call fails
-
getDataAgent
Gets details of a single DataAgent.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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { String name = DataAgentName.of("[PROJECT]", "[LOCATION]", "[DATA_AGENT]").toString(); DataAgent response = dataAgentServiceClient.getDataAgent(name); }- Parameters:
name- Required. Name of the resource.- Throws:
ApiException- if the remote call fails
-
getDataAgent
Gets details of a single DataAgent.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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { GetDataAgentRequest request = GetDataAgentRequest.newBuilder() .setName(DataAgentName.of("[PROJECT]", "[LOCATION]", "[DATA_AGENT]").toString()) .build(); DataAgent response = dataAgentServiceClient.getDataAgent(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getDataAgentCallable
Gets details of a single DataAgent.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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { GetDataAgentRequest request = GetDataAgentRequest.newBuilder() .setName(DataAgentName.of("[PROJECT]", "[LOCATION]", "[DATA_AGENT]").toString()) .build(); ApiFuture<DataAgent> future = dataAgentServiceClient.getDataAgentCallable().futureCall(request); // Do something. DataAgent response = future.get(); } -
createDataAgentAsync
public final OperationFuture<DataAgent,OperationMetadata> createDataAgentAsync(LocationName parent, DataAgent dataAgent, String dataAgentId) Creates a new DataAgent in a given project and location.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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); DataAgent dataAgent = DataAgent.newBuilder().build(); String dataAgentId = "dataAgentId1752773622"; DataAgent response = dataAgentServiceClient.createDataAgentAsync(parent, dataAgent, dataAgentId).get(); }- Parameters:
parent- Required. Value for parent.dataAgent- Required. The resource being created.dataAgentId- Optional. Id of the requesting object. Must be unique within the parent. The allowed format is: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`. If not provided, the server will auto-generate a value for the id.- Throws:
ApiException- if the remote call fails
-
createDataAgentAsync
public final OperationFuture<DataAgent,OperationMetadata> createDataAgentAsync(String parent, DataAgent dataAgent, String dataAgentId) Creates a new DataAgent in a given project and location.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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); DataAgent dataAgent = DataAgent.newBuilder().build(); String dataAgentId = "dataAgentId1752773622"; DataAgent response = dataAgentServiceClient.createDataAgentAsync(parent, dataAgent, dataAgentId).get(); }- Parameters:
parent- Required. Value for parent.dataAgent- Required. The resource being created.dataAgentId- Optional. Id of the requesting object. Must be unique within the parent. The allowed format is: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`. If not provided, the server will auto-generate a value for the id.- Throws:
ApiException- if the remote call fails
-
createDataAgentAsync
public final OperationFuture<DataAgent,OperationMetadata> createDataAgentAsync(CreateDataAgentRequest request) Creates a new DataAgent in a given project and location.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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { CreateDataAgentRequest request = CreateDataAgentRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setDataAgentId("dataAgentId1752773622") .setDataAgent(DataAgent.newBuilder().build()) .setRequestId("requestId693933066") .build(); DataAgent response = dataAgentServiceClient.createDataAgentAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createDataAgentOperationCallable
public final OperationCallable<CreateDataAgentRequest,DataAgent, createDataAgentOperationCallable()OperationMetadata> Creates a new DataAgent in a given project and location.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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { CreateDataAgentRequest request = CreateDataAgentRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setDataAgentId("dataAgentId1752773622") .setDataAgent(DataAgent.newBuilder().build()) .setRequestId("requestId693933066") .build(); OperationFuture<DataAgent, OperationMetadata> future = dataAgentServiceClient.createDataAgentOperationCallable().futureCall(request); // Do something. DataAgent response = future.get(); } -
createDataAgentCallable
Creates a new DataAgent in a given project and location.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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { CreateDataAgentRequest request = CreateDataAgentRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setDataAgentId("dataAgentId1752773622") .setDataAgent(DataAgent.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = dataAgentServiceClient.createDataAgentCallable().futureCall(request); // Do something. Operation response = future.get(); } -
createDataAgentSync
public final DataAgent createDataAgentSync(LocationName parent, DataAgent dataAgent, String dataAgentId) Creates a new DataAgent in a given project and location synchronously.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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); DataAgent dataAgent = DataAgent.newBuilder().build(); String dataAgentId = "dataAgentId1752773622"; DataAgent response = dataAgentServiceClient.createDataAgentSync(parent, dataAgent, dataAgentId); }- Parameters:
parent- Required. Value for parent.dataAgent- Required. The resource being created.dataAgentId- Optional. Id of the requesting object. Must be unique within the parent. The allowed format is: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`. If not provided, the server will auto-generate a value for the id.- Throws:
ApiException- if the remote call fails
-
createDataAgentSync
Creates a new DataAgent in a given project and location synchronously.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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); DataAgent dataAgent = DataAgent.newBuilder().build(); String dataAgentId = "dataAgentId1752773622"; DataAgent response = dataAgentServiceClient.createDataAgentSync(parent, dataAgent, dataAgentId); }- Parameters:
parent- Required. Value for parent.dataAgent- Required. The resource being created.dataAgentId- Optional. Id of the requesting object. Must be unique within the parent. The allowed format is: `^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$`. If not provided, the server will auto-generate a value for the id.- Throws:
ApiException- if the remote call fails
-
createDataAgentSync
Creates a new DataAgent in a given project and location synchronously.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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { CreateDataAgentRequest request = CreateDataAgentRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setDataAgentId("dataAgentId1752773622") .setDataAgent(DataAgent.newBuilder().build()) .setRequestId("requestId693933066") .build(); DataAgent response = dataAgentServiceClient.createDataAgentSync(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createDataAgentSyncCallable
Creates a new DataAgent in a given project and location synchronously.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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { CreateDataAgentRequest request = CreateDataAgentRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setDataAgentId("dataAgentId1752773622") .setDataAgent(DataAgent.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<DataAgent> future = dataAgentServiceClient.createDataAgentSyncCallable().futureCall(request); // Do something. DataAgent response = future.get(); } -
updateDataAgentAsync
public final OperationFuture<DataAgent,OperationMetadata> updateDataAgentAsync(DataAgent dataAgent, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single DataAgent.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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { DataAgent dataAgent = DataAgent.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); DataAgent response = dataAgentServiceClient.updateDataAgentAsync(dataAgent, updateMask).get(); }- Parameters:
dataAgent- Required. The resource being updated.updateMask- Optional. Field mask is used to specify the fields to be overwritten in the DataAgent resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields with non-default values present in the request will be overwritten. If a wildcard mask is provided, all fields will be overwritten.- Throws:
ApiException- if the remote call fails
-
updateDataAgentAsync
public final OperationFuture<DataAgent,OperationMetadata> updateDataAgentAsync(UpdateDataAgentRequest request) Updates the parameters of a single DataAgent.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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { UpdateDataAgentRequest request = UpdateDataAgentRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setDataAgent(DataAgent.newBuilder().build()) .setRequestId("requestId693933066") .build(); DataAgent response = dataAgentServiceClient.updateDataAgentAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateDataAgentOperationCallable
public final OperationCallable<UpdateDataAgentRequest,DataAgent, updateDataAgentOperationCallable()OperationMetadata> Updates the parameters of a single DataAgent.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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { UpdateDataAgentRequest request = UpdateDataAgentRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setDataAgent(DataAgent.newBuilder().build()) .setRequestId("requestId693933066") .build(); OperationFuture<DataAgent, OperationMetadata> future = dataAgentServiceClient.updateDataAgentOperationCallable().futureCall(request); // Do something. DataAgent response = future.get(); } -
updateDataAgentCallable
Updates the parameters of a single DataAgent.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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { UpdateDataAgentRequest request = UpdateDataAgentRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setDataAgent(DataAgent.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = dataAgentServiceClient.updateDataAgentCallable().futureCall(request); // Do something. Operation response = future.get(); } -
updateDataAgentSync
public final DataAgent updateDataAgentSync(DataAgent dataAgent, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single DataAgent synchronously.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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { DataAgent dataAgent = DataAgent.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); DataAgent response = dataAgentServiceClient.updateDataAgentSync(dataAgent, updateMask); }- Parameters:
dataAgent- Required. The resource being updated.updateMask- Optional. Field mask is used to specify the fields to be overwritten in the DataAgent resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields with non-default values present in the request will be overwritten. If a wildcard mask is provided, all fields will be overwritten.- Throws:
ApiException- if the remote call fails
-
updateDataAgentSync
Updates the parameters of a single DataAgent synchronously.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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { UpdateDataAgentRequest request = UpdateDataAgentRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setDataAgent(DataAgent.newBuilder().build()) .setRequestId("requestId693933066") .build(); DataAgent response = dataAgentServiceClient.updateDataAgentSync(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateDataAgentSyncCallable
Updates the parameters of a single DataAgent synchronously.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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { UpdateDataAgentRequest request = UpdateDataAgentRequest.newBuilder() .setUpdateMask(FieldMask.newBuilder().build()) .setDataAgent(DataAgent.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<DataAgent> future = dataAgentServiceClient.updateDataAgentSyncCallable().futureCall(request); // Do something. DataAgent response = future.get(); } -
deleteDataAgentAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteDataAgentAsync(DataAgentName name) Deletes a single DataAgent.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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { DataAgentName name = DataAgentName.of("[PROJECT]", "[LOCATION]", "[DATA_AGENT]"); dataAgentServiceClient.deleteDataAgentAsync(name).get(); }- Parameters:
name- Required. Name of the resource.- Throws:
ApiException- if the remote call fails
-
deleteDataAgentAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteDataAgentAsync(String name) Deletes a single DataAgent.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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { String name = DataAgentName.of("[PROJECT]", "[LOCATION]", "[DATA_AGENT]").toString(); dataAgentServiceClient.deleteDataAgentAsync(name).get(); }- Parameters:
name- Required. Name of the resource.- Throws:
ApiException- if the remote call fails
-
deleteDataAgentAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteDataAgentAsync(DeleteDataAgentRequest request) Deletes a single DataAgent.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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { DeleteDataAgentRequest request = DeleteDataAgentRequest.newBuilder() .setName(DataAgentName.of("[PROJECT]", "[LOCATION]", "[DATA_AGENT]").toString()) .setRequestId("requestId693933066") .build(); dataAgentServiceClient.deleteDataAgentAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteDataAgentOperationCallable
public final OperationCallable<DeleteDataAgentRequest,com.google.protobuf.Empty, deleteDataAgentOperationCallable()OperationMetadata> Deletes a single DataAgent.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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { DeleteDataAgentRequest request = DeleteDataAgentRequest.newBuilder() .setName(DataAgentName.of("[PROJECT]", "[LOCATION]", "[DATA_AGENT]").toString()) .setRequestId("requestId693933066") .build(); OperationFuture<Empty, OperationMetadata> future = dataAgentServiceClient.deleteDataAgentOperationCallable().futureCall(request); // Do something. future.get(); } -
deleteDataAgentCallable
Deletes a single DataAgent.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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { DeleteDataAgentRequest request = DeleteDataAgentRequest.newBuilder() .setName(DataAgentName.of("[PROJECT]", "[LOCATION]", "[DATA_AGENT]").toString()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = dataAgentServiceClient.deleteDataAgentCallable().futureCall(request); // Do something. future.get(); } -
deleteDataAgentSync
Deletes a single DataAgent synchronously.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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { DataAgentName name = DataAgentName.of("[PROJECT]", "[LOCATION]", "[DATA_AGENT]"); dataAgentServiceClient.deleteDataAgentSync(name); }- Parameters:
name- Required. Name of the resource.- Throws:
ApiException- if the remote call fails
-
deleteDataAgentSync
Deletes a single DataAgent synchronously.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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { String name = DataAgentName.of("[PROJECT]", "[LOCATION]", "[DATA_AGENT]").toString(); dataAgentServiceClient.deleteDataAgentSync(name); }- Parameters:
name- Required. Name of the resource.- Throws:
ApiException- if the remote call fails
-
deleteDataAgentSync
Deletes a single DataAgent synchronously.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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { DeleteDataAgentRequest request = DeleteDataAgentRequest.newBuilder() .setName(DataAgentName.of("[PROJECT]", "[LOCATION]", "[DATA_AGENT]").toString()) .setRequestId("requestId693933066") .build(); dataAgentServiceClient.deleteDataAgentSync(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteDataAgentSyncCallable
public final UnaryCallable<DeleteDataAgentRequest,com.google.protobuf.Empty> deleteDataAgentSyncCallable()Deletes a single DataAgent synchronously.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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { DeleteDataAgentRequest request = DeleteDataAgentRequest.newBuilder() .setName(DataAgentName.of("[PROJECT]", "[LOCATION]", "[DATA_AGENT]").toString()) .setRequestId("requestId693933066") .build(); ApiFuture<Empty> future = dataAgentServiceClient.deleteDataAgentSyncCallable().futureCall(request); // Do something. future.get(); } -
getIamPolicy
Gets the IAM policy for DataAgentSample 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { ResourceName resource = DataAgentName.of("[PROJECT]", "[LOCATION]", "[DATA_AGENT]"); Policy response = dataAgentServiceClient.getIamPolicy(resource); }- Parameters:
resource- REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.- Throws:
ApiException- if the remote call fails
-
getIamPolicy
Gets the IAM policy for DataAgentSample 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { String resource = ProjectName.of("[PROJECT]").toString(); Policy response = dataAgentServiceClient.getIamPolicy(resource); }- Parameters:
resource- REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.- Throws:
ApiException- if the remote call fails
-
getIamPolicy
Gets the IAM policy for DataAgentSample 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder() .setResource(DataAgentName.of("[PROJECT]", "[LOCATION]", "[DATA_AGENT]").toString()) .setOptions(GetPolicyOptions.newBuilder().build()) .build(); Policy response = dataAgentServiceClient.getIamPolicy(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getIamPolicyCallable
Gets the IAM policy for DataAgentSample 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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder() .setResource(DataAgentName.of("[PROJECT]", "[LOCATION]", "[DATA_AGENT]").toString()) .setOptions(GetPolicyOptions.newBuilder().build()) .build(); ApiFuture<Policy> future = dataAgentServiceClient.getIamPolicyCallable().futureCall(request); // Do something. Policy response = future.get(); } -
setIamPolicy
Sets the IAM policy for a DataAgent.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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { ResourceName resource = DataAgentName.of("[PROJECT]", "[LOCATION]", "[DATA_AGENT]"); Policy response = dataAgentServiceClient.setIamPolicy(resource); }- Parameters:
resource- REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.- Throws:
ApiException- if the remote call fails
-
setIamPolicy
Sets the IAM policy for a DataAgent.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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { String resource = ProjectName.of("[PROJECT]").toString(); Policy response = dataAgentServiceClient.setIamPolicy(resource); }- Parameters:
resource- REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.- Throws:
ApiException- if the remote call fails
-
setIamPolicy
Sets the IAM policy for a DataAgent.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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder() .setResource(DataAgentName.of("[PROJECT]", "[LOCATION]", "[DATA_AGENT]").toString()) .setPolicy(Policy.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); Policy response = dataAgentServiceClient.setIamPolicy(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
setIamPolicyCallable
Sets the IAM policy for a DataAgent.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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { SetIamPolicyRequest request = SetIamPolicyRequest.newBuilder() .setResource(DataAgentName.of("[PROJECT]", "[LOCATION]", "[DATA_AGENT]").toString()) .setPolicy(Policy.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .build(); ApiFuture<Policy> future = dataAgentServiceClient.setIamPolicyCallable().futureCall(request); // Do something. Policy response = future.get(); } -
listLocations
public final DataAgentServiceClient.ListLocationsPagedResponse listLocations(ListLocationsRequest request) Lists information about the supported locations for this service.This method can be called in two ways:* **List all public locations:** Use the path `GET /v1/locations`.* **List project-visible locations:** Use the path`GET /v1/projects/{project_id}/locations`. This may include publiclocations as well as private or other locations specifically visibleto the project.
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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Location element : dataAgentServiceClient.listLocations(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listLocationsPagedCallable
public final UnaryCallable<ListLocationsRequest,DataAgentServiceClient.ListLocationsPagedResponse> listLocationsPagedCallable()Lists information about the supported locations for this service.This method can be called in two ways:* **List all public locations:** Use the path `GET /v1/locations`.* **List project-visible locations:** Use the path`GET /v1/projects/{project_id}/locations`. This may include publiclocations as well as private or other locations specifically visibleto the project.
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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Location> future = dataAgentServiceClient.listLocationsPagedCallable().futureCall(request); // Do something. for (Location element : future.get().iterateAll()) { // doThingsWith(element); } } -
listLocationsCallable
Lists information about the supported locations for this service.This method can be called in two ways:* **List all public locations:** Use the path `GET /v1/locations`.* **List project-visible locations:** Use the path`GET /v1/projects/{project_id}/locations`. This may include publiclocations as well as private or other locations specifically visibleto the project.
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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListLocationsResponse response = dataAgentServiceClient.listLocationsCallable().call(request); for (Location element : response.getLocationsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getLocation
Gets information about a location.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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); Location response = dataAgentServiceClient.getLocation(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getLocationCallable
Gets information about a location.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 (DataAgentServiceClient dataAgentServiceClient = DataAgentServiceClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); ApiFuture<Location> future = dataAgentServiceClient.getLocationCallable().futureCall(request); // Do something. Location response = future.get(); } -
close
public final void close()- Specified by:
closein interfaceAutoCloseable
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceBackgroundResource
-
isShutdown
public boolean isShutdown()- Specified by:
isShutdownin interfaceBackgroundResource
-
isTerminated
public boolean isTerminated()- Specified by:
isTerminatedin interfaceBackgroundResource
-
shutdownNow
public void shutdownNow()- Specified by:
shutdownNowin interfaceBackgroundResource
-
awaitTermination
- Specified by:
awaitTerminationin interfaceBackgroundResource- Throws:
InterruptedException
-