Class InsightsConfigServiceClient
- All Implemented Interfaces:
BackgroundResource,AutoCloseable
The InsightsConfig resource is the core configuration object to capture events from your Software Development Lifecycle. It acts as the central hub for managing how Developer Connect understands your application, its runtime environments, and the artifacts deployed within them. A user can create an InsightsConfig, list previously-requested InsightsConfigs or get InsightsConfigs by their ID to determine the status of the InsightsConfig.
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 (InsightsConfigServiceClient insightsConfigServiceClient =
InsightsConfigServiceClient.create()) {
InsightsConfigName name =
InsightsConfigName.of("[PROJECT]", "[LOCATION]", "[INSIGHTS_CONFIG]");
InsightsConfig response = insightsConfigServiceClient.getInsightsConfig(name);
}
Note: close() needs to be called on the InsightsConfigServiceClient 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 |
|---|---|---|
ListInsightsConfigs |
Lists InsightsConfigs 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.
|
CreateInsightsConfig |
Creates a new InsightsConfig 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.
|
GetInsightsConfig |
Gets details of a single Insight. |
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.
|
UpdateInsightsConfig |
Updates the parameters of a single InsightsConfig. |
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.
|
DeleteInsightsConfig |
Deletes a single Insight. |
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.
|
GetDeploymentEvent |
Gets a single Deployment Event. |
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.
|
ListDeploymentEvents |
Lists Deployment Events in a given insights config. |
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 InsightsConfigServiceSettings 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
InsightsConfigServiceSettings insightsConfigServiceSettings =
InsightsConfigServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
InsightsConfigServiceClient insightsConfigServiceClient =
InsightsConfigServiceClient.create(insightsConfigServiceSettings);
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
InsightsConfigServiceSettings insightsConfigServiceSettings =
InsightsConfigServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
InsightsConfigServiceClient insightsConfigServiceClient =
InsightsConfigServiceClient.create(insightsConfigServiceSettings);
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
InsightsConfigServiceSettings insightsConfigServiceSettings =
InsightsConfigServiceSettings.newHttpJsonBuilder().build();
InsightsConfigServiceClient insightsConfigServiceClient =
InsightsConfigServiceClient.create(insightsConfigServiceSettings);
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 InsightsConfigServiceClient, using the given settings.protected -
Method Summary
Modifier and TypeMethodDescriptionbooleanawaitTermination(long duration, TimeUnit unit) final voidclose()static final InsightsConfigServiceClientcreate()Constructs an instance of InsightsConfigServiceClient with default settings.static final InsightsConfigServiceClientcreate(InsightsConfigServiceSettings settings) Constructs an instance of InsightsConfigServiceClient, using the given settings.static final InsightsConfigServiceClientConstructs an instance of InsightsConfigServiceClient, using the given stub for making calls.Creates a new InsightsConfig in a given project and location.createInsightsConfigAsync(LocationName parent, InsightsConfig insightsConfig, String insightsConfigId) Creates a new InsightsConfig in a given project and location.createInsightsConfigAsync(String parent, InsightsConfig insightsConfig, String insightsConfigId) Creates a new InsightsConfig in a given project and location.Creates a new InsightsConfig in a given project and location.Creates a new InsightsConfig in a given project and location.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single Insight.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single Insight.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single Insight.Deletes a single Insight.final OperationCallable<DeleteInsightsConfigRequest,com.google.protobuf.Empty, OperationMetadata> Deletes a single Insight.final DeploymentEventGets a single Deployment Event.final DeploymentEventGets a single Deployment Event.final DeploymentEventgetDeploymentEvent(String name) Gets a single Deployment Event.Gets a single Deployment Event.final OperationsClientReturns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.final InsightsConfigGets details of a single Insight.final InsightsConfigGets details of a single Insight.final InsightsConfiggetInsightsConfig(String name) Gets details of a single Insight.Gets details of a single Insight.final 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.getStub()booleanbooleanLists Deployment Events in a given insights config.Lists Deployment Events in a given insights config.listDeploymentEvents(String parent) Lists Deployment Events in a given insights config.Lists Deployment Events in a given insights config.final UnaryCallable<ListDeploymentEventsRequest,InsightsConfigServiceClient.ListDeploymentEventsPagedResponse> Lists Deployment Events in a given insights config.Lists InsightsConfigs in a given project and location.listInsightsConfigs(LocationName parent) Lists InsightsConfigs in a given project and location.listInsightsConfigs(String parent) Lists InsightsConfigs in a given project and location.Lists InsightsConfigs in a given project and location.final UnaryCallable<ListInsightsConfigsRequest,InsightsConfigServiceClient.ListInsightsConfigsPagedResponse> Lists InsightsConfigs 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:voidshutdown()voidUpdates the parameters of a single InsightsConfig.Updates the parameters of a single InsightsConfig.Updates the parameters of a single InsightsConfig.
-
Constructor Details
-
InsightsConfigServiceClient
Constructs an instance of InsightsConfigServiceClient, 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
-
InsightsConfigServiceClient
-
-
Method Details
-
create
Constructs an instance of InsightsConfigServiceClient with default settings.- Throws:
IOException
-
create
public static final InsightsConfigServiceClient create(InsightsConfigServiceSettings settings) throws IOException Constructs an instance of InsightsConfigServiceClient, 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 InsightsConfigServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(InsightsConfigServiceSettings). -
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. -
listInsightsConfigs
public final InsightsConfigServiceClient.ListInsightsConfigsPagedResponse listInsightsConfigs(LocationName parent) Lists InsightsConfigs 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 (InsightsConfigServiceClient insightsConfigServiceClient = InsightsConfigServiceClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (InsightsConfig element : insightsConfigServiceClient.listInsightsConfigs(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Parent value for ListInsightsConfigsRequest.- Throws:
ApiException- if the remote call fails
-
listInsightsConfigs
public final InsightsConfigServiceClient.ListInsightsConfigsPagedResponse listInsightsConfigs(String parent) Lists InsightsConfigs 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 (InsightsConfigServiceClient insightsConfigServiceClient = InsightsConfigServiceClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (InsightsConfig element : insightsConfigServiceClient.listInsightsConfigs(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Parent value for ListInsightsConfigsRequest.- Throws:
ApiException- if the remote call fails
-
listInsightsConfigs
public final InsightsConfigServiceClient.ListInsightsConfigsPagedResponse listInsightsConfigs(ListInsightsConfigsRequest request) Lists InsightsConfigs 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 (InsightsConfigServiceClient insightsConfigServiceClient = InsightsConfigServiceClient.create()) { ListInsightsConfigsRequest request = ListInsightsConfigsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); for (InsightsConfig element : insightsConfigServiceClient.listInsightsConfigs(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
-
listInsightsConfigsPagedCallable
public final UnaryCallable<ListInsightsConfigsRequest,InsightsConfigServiceClient.ListInsightsConfigsPagedResponse> listInsightsConfigsPagedCallable()Lists InsightsConfigs 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 (InsightsConfigServiceClient insightsConfigServiceClient = InsightsConfigServiceClient.create()) { ListInsightsConfigsRequest request = ListInsightsConfigsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); ApiFuture<InsightsConfig> future = insightsConfigServiceClient.listInsightsConfigsPagedCallable().futureCall(request); // Do something. for (InsightsConfig element : future.get().iterateAll()) { // doThingsWith(element); } } -
listInsightsConfigsCallable
public final UnaryCallable<ListInsightsConfigsRequest,ListInsightsConfigsResponse> listInsightsConfigsCallable()Lists InsightsConfigs 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 (InsightsConfigServiceClient insightsConfigServiceClient = InsightsConfigServiceClient.create()) { ListInsightsConfigsRequest request = ListInsightsConfigsRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); while (true) { ListInsightsConfigsResponse response = insightsConfigServiceClient.listInsightsConfigsCallable().call(request); for (InsightsConfig element : response.getInsightsConfigsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
createInsightsConfigAsync
public final OperationFuture<InsightsConfig,OperationMetadata> createInsightsConfigAsync(LocationName parent, InsightsConfig insightsConfig, String insightsConfigId) Creates a new InsightsConfig 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 (InsightsConfigServiceClient insightsConfigServiceClient = InsightsConfigServiceClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); InsightsConfig insightsConfig = InsightsConfig.newBuilder().build(); String insightsConfigId = "insightsConfigId774395128"; InsightsConfig response = insightsConfigServiceClient .createInsightsConfigAsync(parent, insightsConfig, insightsConfigId) .get(); }- Parameters:
parent- Required. Value for parent.insightsConfig- Required. The resource being created.insightsConfigId- Required. ID of the requesting InsightsConfig.- Throws:
ApiException- if the remote call fails
-
createInsightsConfigAsync
public final OperationFuture<InsightsConfig,OperationMetadata> createInsightsConfigAsync(String parent, InsightsConfig insightsConfig, String insightsConfigId) Creates a new InsightsConfig 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 (InsightsConfigServiceClient insightsConfigServiceClient = InsightsConfigServiceClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); InsightsConfig insightsConfig = InsightsConfig.newBuilder().build(); String insightsConfigId = "insightsConfigId774395128"; InsightsConfig response = insightsConfigServiceClient .createInsightsConfigAsync(parent, insightsConfig, insightsConfigId) .get(); }- Parameters:
parent- Required. Value for parent.insightsConfig- Required. The resource being created.insightsConfigId- Required. ID of the requesting InsightsConfig.- Throws:
ApiException- if the remote call fails
-
createInsightsConfigAsync
public final OperationFuture<InsightsConfig,OperationMetadata> createInsightsConfigAsync(CreateInsightsConfigRequest request) Creates a new InsightsConfig 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 (InsightsConfigServiceClient insightsConfigServiceClient = InsightsConfigServiceClient.create()) { CreateInsightsConfigRequest request = CreateInsightsConfigRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setInsightsConfigId("insightsConfigId774395128") .setInsightsConfig(InsightsConfig.newBuilder().build()) .setValidateOnly(true) .build(); InsightsConfig response = insightsConfigServiceClient.createInsightsConfigAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createInsightsConfigOperationCallable
public final OperationCallable<CreateInsightsConfigRequest,InsightsConfig, createInsightsConfigOperationCallable()OperationMetadata> Creates a new InsightsConfig 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 (InsightsConfigServiceClient insightsConfigServiceClient = InsightsConfigServiceClient.create()) { CreateInsightsConfigRequest request = CreateInsightsConfigRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setInsightsConfigId("insightsConfigId774395128") .setInsightsConfig(InsightsConfig.newBuilder().build()) .setValidateOnly(true) .build(); OperationFuture<InsightsConfig, OperationMetadata> future = insightsConfigServiceClient.createInsightsConfigOperationCallable().futureCall(request); // Do something. InsightsConfig response = future.get(); } -
createInsightsConfigCallable
Creates a new InsightsConfig 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 (InsightsConfigServiceClient insightsConfigServiceClient = InsightsConfigServiceClient.create()) { CreateInsightsConfigRequest request = CreateInsightsConfigRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setInsightsConfigId("insightsConfigId774395128") .setInsightsConfig(InsightsConfig.newBuilder().build()) .setValidateOnly(true) .build(); ApiFuture<Operation> future = insightsConfigServiceClient.createInsightsConfigCallable().futureCall(request); // Do something. Operation response = future.get(); } -
getInsightsConfig
Gets details of a single Insight.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 (InsightsConfigServiceClient insightsConfigServiceClient = InsightsConfigServiceClient.create()) { InsightsConfigName name = InsightsConfigName.of("[PROJECT]", "[LOCATION]", "[INSIGHTS_CONFIG]"); InsightsConfig response = insightsConfigServiceClient.getInsightsConfig(name); }- Parameters:
name- Required. Name of the resource.- Throws:
ApiException- if the remote call fails
-
getInsightsConfig
Gets details of a single Insight.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 (InsightsConfigServiceClient insightsConfigServiceClient = InsightsConfigServiceClient.create()) { String name = InsightsConfigName.of("[PROJECT]", "[LOCATION]", "[INSIGHTS_CONFIG]").toString(); InsightsConfig response = insightsConfigServiceClient.getInsightsConfig(name); }- Parameters:
name- Required. Name of the resource.- Throws:
ApiException- if the remote call fails
-
getInsightsConfig
Gets details of a single Insight.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 (InsightsConfigServiceClient insightsConfigServiceClient = InsightsConfigServiceClient.create()) { GetInsightsConfigRequest request = GetInsightsConfigRequest.newBuilder() .setName( InsightsConfigName.of("[PROJECT]", "[LOCATION]", "[INSIGHTS_CONFIG]").toString()) .build(); InsightsConfig response = insightsConfigServiceClient.getInsightsConfig(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getInsightsConfigCallable
Gets details of a single Insight.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 (InsightsConfigServiceClient insightsConfigServiceClient = InsightsConfigServiceClient.create()) { GetInsightsConfigRequest request = GetInsightsConfigRequest.newBuilder() .setName( InsightsConfigName.of("[PROJECT]", "[LOCATION]", "[INSIGHTS_CONFIG]").toString()) .build(); ApiFuture<InsightsConfig> future = insightsConfigServiceClient.getInsightsConfigCallable().futureCall(request); // Do something. InsightsConfig response = future.get(); } -
updateInsightsConfigAsync
public final OperationFuture<InsightsConfig,OperationMetadata> updateInsightsConfigAsync(UpdateInsightsConfigRequest request) Updates the parameters of a single InsightsConfig.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 (InsightsConfigServiceClient insightsConfigServiceClient = InsightsConfigServiceClient.create()) { UpdateInsightsConfigRequest request = UpdateInsightsConfigRequest.newBuilder() .setInsightsConfig(InsightsConfig.newBuilder().build()) .setRequestId("requestId693933066") .setAllowMissing(true) .setValidateOnly(true) .build(); InsightsConfig response = insightsConfigServiceClient.updateInsightsConfigAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateInsightsConfigOperationCallable
public final OperationCallable<UpdateInsightsConfigRequest,InsightsConfig, updateInsightsConfigOperationCallable()OperationMetadata> Updates the parameters of a single InsightsConfig.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 (InsightsConfigServiceClient insightsConfigServiceClient = InsightsConfigServiceClient.create()) { UpdateInsightsConfigRequest request = UpdateInsightsConfigRequest.newBuilder() .setInsightsConfig(InsightsConfig.newBuilder().build()) .setRequestId("requestId693933066") .setAllowMissing(true) .setValidateOnly(true) .build(); OperationFuture<InsightsConfig, OperationMetadata> future = insightsConfigServiceClient.updateInsightsConfigOperationCallable().futureCall(request); // Do something. InsightsConfig response = future.get(); } -
updateInsightsConfigCallable
Updates the parameters of a single InsightsConfig.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 (InsightsConfigServiceClient insightsConfigServiceClient = InsightsConfigServiceClient.create()) { UpdateInsightsConfigRequest request = UpdateInsightsConfigRequest.newBuilder() .setInsightsConfig(InsightsConfig.newBuilder().build()) .setRequestId("requestId693933066") .setAllowMissing(true) .setValidateOnly(true) .build(); ApiFuture<Operation> future = insightsConfigServiceClient.updateInsightsConfigCallable().futureCall(request); // Do something. Operation response = future.get(); } -
deleteInsightsConfigAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteInsightsConfigAsync(InsightsConfigName name) Deletes a single Insight.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 (InsightsConfigServiceClient insightsConfigServiceClient = InsightsConfigServiceClient.create()) { InsightsConfigName name = InsightsConfigName.of("[PROJECT]", "[LOCATION]", "[INSIGHTS_CONFIG]"); insightsConfigServiceClient.deleteInsightsConfigAsync(name).get(); }- Parameters:
name- Required. Value for parent.- Throws:
ApiException- if the remote call fails
-
deleteInsightsConfigAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteInsightsConfigAsync(String name) Deletes a single Insight.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 (InsightsConfigServiceClient insightsConfigServiceClient = InsightsConfigServiceClient.create()) { String name = InsightsConfigName.of("[PROJECT]", "[LOCATION]", "[INSIGHTS_CONFIG]").toString(); insightsConfigServiceClient.deleteInsightsConfigAsync(name).get(); }- Parameters:
name- Required. Value for parent.- Throws:
ApiException- if the remote call fails
-
deleteInsightsConfigAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteInsightsConfigAsync(DeleteInsightsConfigRequest request) Deletes a single Insight.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 (InsightsConfigServiceClient insightsConfigServiceClient = InsightsConfigServiceClient.create()) { DeleteInsightsConfigRequest request = DeleteInsightsConfigRequest.newBuilder() .setName( InsightsConfigName.of("[PROJECT]", "[LOCATION]", "[INSIGHTS_CONFIG]").toString()) .setRequestId("requestId693933066") .setValidateOnly(true) .setEtag("etag3123477") .build(); insightsConfigServiceClient.deleteInsightsConfigAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteInsightsConfigOperationCallable
public final OperationCallable<DeleteInsightsConfigRequest,com.google.protobuf.Empty, deleteInsightsConfigOperationCallable()OperationMetadata> Deletes a single Insight.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 (InsightsConfigServiceClient insightsConfigServiceClient = InsightsConfigServiceClient.create()) { DeleteInsightsConfigRequest request = DeleteInsightsConfigRequest.newBuilder() .setName( InsightsConfigName.of("[PROJECT]", "[LOCATION]", "[INSIGHTS_CONFIG]").toString()) .setRequestId("requestId693933066") .setValidateOnly(true) .setEtag("etag3123477") .build(); OperationFuture<Empty, OperationMetadata> future = insightsConfigServiceClient.deleteInsightsConfigOperationCallable().futureCall(request); // Do something. future.get(); } -
deleteInsightsConfigCallable
Deletes a single Insight.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 (InsightsConfigServiceClient insightsConfigServiceClient = InsightsConfigServiceClient.create()) { DeleteInsightsConfigRequest request = DeleteInsightsConfigRequest.newBuilder() .setName( InsightsConfigName.of("[PROJECT]", "[LOCATION]", "[INSIGHTS_CONFIG]").toString()) .setRequestId("requestId693933066") .setValidateOnly(true) .setEtag("etag3123477") .build(); ApiFuture<Operation> future = insightsConfigServiceClient.deleteInsightsConfigCallable().futureCall(request); // Do something. future.get(); } -
getDeploymentEvent
Gets a single Deployment Event.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 (InsightsConfigServiceClient insightsConfigServiceClient = InsightsConfigServiceClient.create()) { DeploymentEventName name = DeploymentEventName.of( "[PROJECT]", "[LOCATION]", "[INSIGHTS_CONFIG]", "[DEPLOYMENT_EVENT]"); DeploymentEvent response = insightsConfigServiceClient.getDeploymentEvent(name); }- Parameters:
name- Required. The name of the deployment event to retrieve. Format: projects/{project}/locations/{location}/insightsConfigs/{insights_config}/deploymentEvents/{uuid}- Throws:
ApiException- if the remote call fails
-
getDeploymentEvent
Gets a single Deployment Event.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 (InsightsConfigServiceClient insightsConfigServiceClient = InsightsConfigServiceClient.create()) { String name = DeploymentEventName.of( "[PROJECT]", "[LOCATION]", "[INSIGHTS_CONFIG]", "[DEPLOYMENT_EVENT]") .toString(); DeploymentEvent response = insightsConfigServiceClient.getDeploymentEvent(name); }- Parameters:
name- Required. The name of the deployment event to retrieve. Format: projects/{project}/locations/{location}/insightsConfigs/{insights_config}/deploymentEvents/{uuid}- Throws:
ApiException- if the remote call fails
-
getDeploymentEvent
Gets a single Deployment Event.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 (InsightsConfigServiceClient insightsConfigServiceClient = InsightsConfigServiceClient.create()) { GetDeploymentEventRequest request = GetDeploymentEventRequest.newBuilder() .setName( DeploymentEventName.of( "[PROJECT]", "[LOCATION]", "[INSIGHTS_CONFIG]", "[DEPLOYMENT_EVENT]") .toString()) .build(); DeploymentEvent response = insightsConfigServiceClient.getDeploymentEvent(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getDeploymentEventCallable
Gets a single Deployment Event.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 (InsightsConfigServiceClient insightsConfigServiceClient = InsightsConfigServiceClient.create()) { GetDeploymentEventRequest request = GetDeploymentEventRequest.newBuilder() .setName( DeploymentEventName.of( "[PROJECT]", "[LOCATION]", "[INSIGHTS_CONFIG]", "[DEPLOYMENT_EVENT]") .toString()) .build(); ApiFuture<DeploymentEvent> future = insightsConfigServiceClient.getDeploymentEventCallable().futureCall(request); // Do something. DeploymentEvent response = future.get(); } -
listDeploymentEvents
public final InsightsConfigServiceClient.ListDeploymentEventsPagedResponse listDeploymentEvents(InsightsConfigName parent) Lists Deployment Events in a given insights config.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 (InsightsConfigServiceClient insightsConfigServiceClient = InsightsConfigServiceClient.create()) { InsightsConfigName parent = InsightsConfigName.of("[PROJECT]", "[LOCATION]", "[INSIGHTS_CONFIG]"); for (DeploymentEvent element : insightsConfigServiceClient.listDeploymentEvents(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent insights config that owns this collection of deployment events. Format: projects/{project}/locations/{location}/insightsConfigs/{insights_config}- Throws:
ApiException- if the remote call fails
-
listDeploymentEvents
public final InsightsConfigServiceClient.ListDeploymentEventsPagedResponse listDeploymentEvents(String parent) Lists Deployment Events in a given insights config.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 (InsightsConfigServiceClient insightsConfigServiceClient = InsightsConfigServiceClient.create()) { String parent = InsightsConfigName.of("[PROJECT]", "[LOCATION]", "[INSIGHTS_CONFIG]").toString(); for (DeploymentEvent element : insightsConfigServiceClient.listDeploymentEvents(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent insights config that owns this collection of deployment events. Format: projects/{project}/locations/{location}/insightsConfigs/{insights_config}- Throws:
ApiException- if the remote call fails
-
listDeploymentEvents
public final InsightsConfigServiceClient.ListDeploymentEventsPagedResponse listDeploymentEvents(ListDeploymentEventsRequest request) Lists Deployment Events in a given insights config.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 (InsightsConfigServiceClient insightsConfigServiceClient = InsightsConfigServiceClient.create()) { ListDeploymentEventsRequest request = ListDeploymentEventsRequest.newBuilder() .setParent( InsightsConfigName.of("[PROJECT]", "[LOCATION]", "[INSIGHTS_CONFIG]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .build(); for (DeploymentEvent element : insightsConfigServiceClient.listDeploymentEvents(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
-
listDeploymentEventsPagedCallable
public final UnaryCallable<ListDeploymentEventsRequest,InsightsConfigServiceClient.ListDeploymentEventsPagedResponse> listDeploymentEventsPagedCallable()Lists Deployment Events in a given insights config.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 (InsightsConfigServiceClient insightsConfigServiceClient = InsightsConfigServiceClient.create()) { ListDeploymentEventsRequest request = ListDeploymentEventsRequest.newBuilder() .setParent( InsightsConfigName.of("[PROJECT]", "[LOCATION]", "[INSIGHTS_CONFIG]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .build(); ApiFuture<DeploymentEvent> future = insightsConfigServiceClient.listDeploymentEventsPagedCallable().futureCall(request); // Do something. for (DeploymentEvent element : future.get().iterateAll()) { // doThingsWith(element); } } -
listDeploymentEventsCallable
public final UnaryCallable<ListDeploymentEventsRequest,ListDeploymentEventsResponse> listDeploymentEventsCallable()Lists Deployment Events in a given insights config.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 (InsightsConfigServiceClient insightsConfigServiceClient = InsightsConfigServiceClient.create()) { ListDeploymentEventsRequest request = ListDeploymentEventsRequest.newBuilder() .setParent( InsightsConfigName.of("[PROJECT]", "[LOCATION]", "[INSIGHTS_CONFIG]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .build(); while (true) { ListDeploymentEventsResponse response = insightsConfigServiceClient.listDeploymentEventsCallable().call(request); for (DeploymentEvent element : response.getDeploymentEventsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
listLocations
public final InsightsConfigServiceClient.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 (InsightsConfigServiceClient insightsConfigServiceClient = InsightsConfigServiceClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Location element : insightsConfigServiceClient.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,InsightsConfigServiceClient.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 (InsightsConfigServiceClient insightsConfigServiceClient = InsightsConfigServiceClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Location> future = insightsConfigServiceClient.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 (InsightsConfigServiceClient insightsConfigServiceClient = InsightsConfigServiceClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListLocationsResponse response = insightsConfigServiceClient.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 (InsightsConfigServiceClient insightsConfigServiceClient = InsightsConfigServiceClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); Location response = insightsConfigServiceClient.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 (InsightsConfigServiceClient insightsConfigServiceClient = InsightsConfigServiceClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); ApiFuture<Location> future = insightsConfigServiceClient.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
-