software.amazon.awssdk.services.applicationinsights.DefaultApplicationInsightsClient Maven / Gradle / Ivy
Show all versions of applicationinsights Show documentation
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package software.amazon.awssdk.services.applicationinsights;
import java.util.Collections;
import java.util.List;
import java.util.function.Consumer;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.awscore.client.handler.AwsSyncClientHandler;
import software.amazon.awssdk.awscore.exception.AwsServiceException;
import software.amazon.awssdk.core.ApiName;
import software.amazon.awssdk.core.RequestOverrideConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientOption;
import software.amazon.awssdk.core.client.handler.ClientExecutionParams;
import software.amazon.awssdk.core.client.handler.SyncClientHandler;
import software.amazon.awssdk.core.exception.SdkClientException;
import software.amazon.awssdk.core.http.HttpResponseHandler;
import software.amazon.awssdk.core.metrics.CoreMetric;
import software.amazon.awssdk.core.util.VersionInfo;
import software.amazon.awssdk.metrics.MetricCollector;
import software.amazon.awssdk.metrics.MetricPublisher;
import software.amazon.awssdk.metrics.NoOpMetricCollector;
import software.amazon.awssdk.protocols.core.ExceptionMetadata;
import software.amazon.awssdk.protocols.json.AwsJsonProtocol;
import software.amazon.awssdk.protocols.json.AwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.BaseAwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.JsonOperationMetadata;
import software.amazon.awssdk.services.applicationinsights.model.AccessDeniedException;
import software.amazon.awssdk.services.applicationinsights.model.ApplicationInsightsException;
import software.amazon.awssdk.services.applicationinsights.model.ApplicationInsightsRequest;
import software.amazon.awssdk.services.applicationinsights.model.BadRequestException;
import software.amazon.awssdk.services.applicationinsights.model.CreateApplicationRequest;
import software.amazon.awssdk.services.applicationinsights.model.CreateApplicationResponse;
import software.amazon.awssdk.services.applicationinsights.model.CreateComponentRequest;
import software.amazon.awssdk.services.applicationinsights.model.CreateComponentResponse;
import software.amazon.awssdk.services.applicationinsights.model.CreateLogPatternRequest;
import software.amazon.awssdk.services.applicationinsights.model.CreateLogPatternResponse;
import software.amazon.awssdk.services.applicationinsights.model.DeleteApplicationRequest;
import software.amazon.awssdk.services.applicationinsights.model.DeleteApplicationResponse;
import software.amazon.awssdk.services.applicationinsights.model.DeleteComponentRequest;
import software.amazon.awssdk.services.applicationinsights.model.DeleteComponentResponse;
import software.amazon.awssdk.services.applicationinsights.model.DeleteLogPatternRequest;
import software.amazon.awssdk.services.applicationinsights.model.DeleteLogPatternResponse;
import software.amazon.awssdk.services.applicationinsights.model.DescribeApplicationRequest;
import software.amazon.awssdk.services.applicationinsights.model.DescribeApplicationResponse;
import software.amazon.awssdk.services.applicationinsights.model.DescribeComponentConfigurationRecommendationRequest;
import software.amazon.awssdk.services.applicationinsights.model.DescribeComponentConfigurationRecommendationResponse;
import software.amazon.awssdk.services.applicationinsights.model.DescribeComponentConfigurationRequest;
import software.amazon.awssdk.services.applicationinsights.model.DescribeComponentConfigurationResponse;
import software.amazon.awssdk.services.applicationinsights.model.DescribeComponentRequest;
import software.amazon.awssdk.services.applicationinsights.model.DescribeComponentResponse;
import software.amazon.awssdk.services.applicationinsights.model.DescribeLogPatternRequest;
import software.amazon.awssdk.services.applicationinsights.model.DescribeLogPatternResponse;
import software.amazon.awssdk.services.applicationinsights.model.DescribeObservationRequest;
import software.amazon.awssdk.services.applicationinsights.model.DescribeObservationResponse;
import software.amazon.awssdk.services.applicationinsights.model.DescribeProblemObservationsRequest;
import software.amazon.awssdk.services.applicationinsights.model.DescribeProblemObservationsResponse;
import software.amazon.awssdk.services.applicationinsights.model.DescribeProblemRequest;
import software.amazon.awssdk.services.applicationinsights.model.DescribeProblemResponse;
import software.amazon.awssdk.services.applicationinsights.model.InternalServerException;
import software.amazon.awssdk.services.applicationinsights.model.ListApplicationsRequest;
import software.amazon.awssdk.services.applicationinsights.model.ListApplicationsResponse;
import software.amazon.awssdk.services.applicationinsights.model.ListComponentsRequest;
import software.amazon.awssdk.services.applicationinsights.model.ListComponentsResponse;
import software.amazon.awssdk.services.applicationinsights.model.ListConfigurationHistoryRequest;
import software.amazon.awssdk.services.applicationinsights.model.ListConfigurationHistoryResponse;
import software.amazon.awssdk.services.applicationinsights.model.ListLogPatternSetsRequest;
import software.amazon.awssdk.services.applicationinsights.model.ListLogPatternSetsResponse;
import software.amazon.awssdk.services.applicationinsights.model.ListLogPatternsRequest;
import software.amazon.awssdk.services.applicationinsights.model.ListLogPatternsResponse;
import software.amazon.awssdk.services.applicationinsights.model.ListProblemsRequest;
import software.amazon.awssdk.services.applicationinsights.model.ListProblemsResponse;
import software.amazon.awssdk.services.applicationinsights.model.ListTagsForResourceRequest;
import software.amazon.awssdk.services.applicationinsights.model.ListTagsForResourceResponse;
import software.amazon.awssdk.services.applicationinsights.model.ResourceInUseException;
import software.amazon.awssdk.services.applicationinsights.model.ResourceNotFoundException;
import software.amazon.awssdk.services.applicationinsights.model.TagResourceRequest;
import software.amazon.awssdk.services.applicationinsights.model.TagResourceResponse;
import software.amazon.awssdk.services.applicationinsights.model.TagsAlreadyExistException;
import software.amazon.awssdk.services.applicationinsights.model.TooManyTagsException;
import software.amazon.awssdk.services.applicationinsights.model.UntagResourceRequest;
import software.amazon.awssdk.services.applicationinsights.model.UntagResourceResponse;
import software.amazon.awssdk.services.applicationinsights.model.UpdateApplicationRequest;
import software.amazon.awssdk.services.applicationinsights.model.UpdateApplicationResponse;
import software.amazon.awssdk.services.applicationinsights.model.UpdateComponentConfigurationRequest;
import software.amazon.awssdk.services.applicationinsights.model.UpdateComponentConfigurationResponse;
import software.amazon.awssdk.services.applicationinsights.model.UpdateComponentRequest;
import software.amazon.awssdk.services.applicationinsights.model.UpdateComponentResponse;
import software.amazon.awssdk.services.applicationinsights.model.UpdateLogPatternRequest;
import software.amazon.awssdk.services.applicationinsights.model.UpdateLogPatternResponse;
import software.amazon.awssdk.services.applicationinsights.model.ValidationException;
import software.amazon.awssdk.services.applicationinsights.paginators.ListApplicationsIterable;
import software.amazon.awssdk.services.applicationinsights.paginators.ListComponentsIterable;
import software.amazon.awssdk.services.applicationinsights.paginators.ListConfigurationHistoryIterable;
import software.amazon.awssdk.services.applicationinsights.paginators.ListLogPatternSetsIterable;
import software.amazon.awssdk.services.applicationinsights.paginators.ListLogPatternsIterable;
import software.amazon.awssdk.services.applicationinsights.paginators.ListProblemsIterable;
import software.amazon.awssdk.services.applicationinsights.transform.CreateApplicationRequestMarshaller;
import software.amazon.awssdk.services.applicationinsights.transform.CreateComponentRequestMarshaller;
import software.amazon.awssdk.services.applicationinsights.transform.CreateLogPatternRequestMarshaller;
import software.amazon.awssdk.services.applicationinsights.transform.DeleteApplicationRequestMarshaller;
import software.amazon.awssdk.services.applicationinsights.transform.DeleteComponentRequestMarshaller;
import software.amazon.awssdk.services.applicationinsights.transform.DeleteLogPatternRequestMarshaller;
import software.amazon.awssdk.services.applicationinsights.transform.DescribeApplicationRequestMarshaller;
import software.amazon.awssdk.services.applicationinsights.transform.DescribeComponentConfigurationRecommendationRequestMarshaller;
import software.amazon.awssdk.services.applicationinsights.transform.DescribeComponentConfigurationRequestMarshaller;
import software.amazon.awssdk.services.applicationinsights.transform.DescribeComponentRequestMarshaller;
import software.amazon.awssdk.services.applicationinsights.transform.DescribeLogPatternRequestMarshaller;
import software.amazon.awssdk.services.applicationinsights.transform.DescribeObservationRequestMarshaller;
import software.amazon.awssdk.services.applicationinsights.transform.DescribeProblemObservationsRequestMarshaller;
import software.amazon.awssdk.services.applicationinsights.transform.DescribeProblemRequestMarshaller;
import software.amazon.awssdk.services.applicationinsights.transform.ListApplicationsRequestMarshaller;
import software.amazon.awssdk.services.applicationinsights.transform.ListComponentsRequestMarshaller;
import software.amazon.awssdk.services.applicationinsights.transform.ListConfigurationHistoryRequestMarshaller;
import software.amazon.awssdk.services.applicationinsights.transform.ListLogPatternSetsRequestMarshaller;
import software.amazon.awssdk.services.applicationinsights.transform.ListLogPatternsRequestMarshaller;
import software.amazon.awssdk.services.applicationinsights.transform.ListProblemsRequestMarshaller;
import software.amazon.awssdk.services.applicationinsights.transform.ListTagsForResourceRequestMarshaller;
import software.amazon.awssdk.services.applicationinsights.transform.TagResourceRequestMarshaller;
import software.amazon.awssdk.services.applicationinsights.transform.UntagResourceRequestMarshaller;
import software.amazon.awssdk.services.applicationinsights.transform.UpdateApplicationRequestMarshaller;
import software.amazon.awssdk.services.applicationinsights.transform.UpdateComponentConfigurationRequestMarshaller;
import software.amazon.awssdk.services.applicationinsights.transform.UpdateComponentRequestMarshaller;
import software.amazon.awssdk.services.applicationinsights.transform.UpdateLogPatternRequestMarshaller;
import software.amazon.awssdk.utils.Logger;
/**
* Internal implementation of {@link ApplicationInsightsClient}.
*
* @see ApplicationInsightsClient#builder()
*/
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
final class DefaultApplicationInsightsClient implements ApplicationInsightsClient {
private static final Logger log = Logger.loggerFor(DefaultApplicationInsightsClient.class);
private final SyncClientHandler clientHandler;
private final AwsJsonProtocolFactory protocolFactory;
private final SdkClientConfiguration clientConfiguration;
protected DefaultApplicationInsightsClient(SdkClientConfiguration clientConfiguration) {
this.clientHandler = new AwsSyncClientHandler(clientConfiguration);
this.clientConfiguration = clientConfiguration;
this.protocolFactory = init(AwsJsonProtocolFactory.builder()).build();
}
@Override
public final String serviceName() {
return SERVICE_NAME;
}
/**
*
* Adds an application that is created from a resource group.
*
*
* @param createApplicationRequest
* @return Result of the CreateApplication operation returned by the service.
* @throws ResourceInUseException
* The resource is already created or in use.
* @throws ResourceNotFoundException
* The resource does not exist in the customer account.
* @throws ValidationException
* The parameter is not valid.
* @throws InternalServerException
* The server encountered an internal error and is unable to complete the request.
* @throws TagsAlreadyExistException
* Tags are already registered for the specified application ARN.
* @throws AccessDeniedException
* User does not have permissions to perform this action.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ApplicationInsightsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationInsightsClient.CreateApplication
* @see AWS API Documentation
*/
@Override
public CreateApplicationResponse createApplication(CreateApplicationRequest createApplicationRequest)
throws ResourceInUseException, ResourceNotFoundException, ValidationException, InternalServerException,
TagsAlreadyExistException, AccessDeniedException, AwsServiceException, SdkClientException,
ApplicationInsightsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreateApplicationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createApplicationRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Application Insights");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateApplication");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateApplication").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(createApplicationRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateApplicationRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Creates a custom component by grouping similar standalone instances to monitor.
*
*
* @param createComponentRequest
* @return Result of the CreateComponent operation returned by the service.
* @throws ResourceInUseException
* The resource is already created or in use.
* @throws ResourceNotFoundException
* The resource does not exist in the customer account.
* @throws ValidationException
* The parameter is not valid.
* @throws InternalServerException
* The server encountered an internal error and is unable to complete the request.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ApplicationInsightsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationInsightsClient.CreateComponent
* @see AWS API Documentation
*/
@Override
public CreateComponentResponse createComponent(CreateComponentRequest createComponentRequest) throws ResourceInUseException,
ResourceNotFoundException, ValidationException, InternalServerException, AwsServiceException, SdkClientException,
ApplicationInsightsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreateComponentResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createComponentRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Application Insights");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateComponent");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateComponent").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(createComponentRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateComponentRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Adds an log pattern to a LogPatternSet
.
*
*
* @param createLogPatternRequest
* @return Result of the CreateLogPattern operation returned by the service.
* @throws ResourceInUseException
* The resource is already created or in use.
* @throws ResourceNotFoundException
* The resource does not exist in the customer account.
* @throws ValidationException
* The parameter is not valid.
* @throws InternalServerException
* The server encountered an internal error and is unable to complete the request.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ApplicationInsightsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationInsightsClient.CreateLogPattern
* @see AWS API Documentation
*/
@Override
public CreateLogPatternResponse createLogPattern(CreateLogPatternRequest createLogPatternRequest)
throws ResourceInUseException, ResourceNotFoundException, ValidationException, InternalServerException,
AwsServiceException, SdkClientException, ApplicationInsightsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreateLogPatternResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createLogPatternRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Application Insights");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateLogPattern");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateLogPattern").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(createLogPatternRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateLogPatternRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Removes the specified application from monitoring. Does not delete the application.
*
*
* @param deleteApplicationRequest
* @return Result of the DeleteApplication operation returned by the service.
* @throws ResourceNotFoundException
* The resource does not exist in the customer account.
* @throws ValidationException
* The parameter is not valid.
* @throws BadRequestException
* The request is not understood by the server.
* @throws InternalServerException
* The server encountered an internal error and is unable to complete the request.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ApplicationInsightsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationInsightsClient.DeleteApplication
* @see AWS API Documentation
*/
@Override
public DeleteApplicationResponse deleteApplication(DeleteApplicationRequest deleteApplicationRequest)
throws ResourceNotFoundException, ValidationException, BadRequestException, InternalServerException,
AwsServiceException, SdkClientException, ApplicationInsightsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteApplicationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteApplicationRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Application Insights");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteApplication");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteApplication").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(deleteApplicationRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteApplicationRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Ungroups a custom component. When you ungroup custom components, all applicable monitors that are set up for the
* component are removed and the instances revert to their standalone status.
*
*
* @param deleteComponentRequest
* @return Result of the DeleteComponent operation returned by the service.
* @throws ResourceNotFoundException
* The resource does not exist in the customer account.
* @throws ValidationException
* The parameter is not valid.
* @throws InternalServerException
* The server encountered an internal error and is unable to complete the request.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ApplicationInsightsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationInsightsClient.DeleteComponent
* @see AWS API Documentation
*/
@Override
public DeleteComponentResponse deleteComponent(DeleteComponentRequest deleteComponentRequest)
throws ResourceNotFoundException, ValidationException, InternalServerException, AwsServiceException,
SdkClientException, ApplicationInsightsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteComponentResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteComponentRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Application Insights");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteComponent");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteComponent").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(deleteComponentRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteComponentRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Removes the specified log pattern from a LogPatternSet
.
*
*
* @param deleteLogPatternRequest
* @return Result of the DeleteLogPattern operation returned by the service.
* @throws ResourceNotFoundException
* The resource does not exist in the customer account.
* @throws ValidationException
* The parameter is not valid.
* @throws BadRequestException
* The request is not understood by the server.
* @throws InternalServerException
* The server encountered an internal error and is unable to complete the request.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ApplicationInsightsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationInsightsClient.DeleteLogPattern
* @see AWS API Documentation
*/
@Override
public DeleteLogPatternResponse deleteLogPattern(DeleteLogPatternRequest deleteLogPatternRequest)
throws ResourceNotFoundException, ValidationException, BadRequestException, InternalServerException,
AwsServiceException, SdkClientException, ApplicationInsightsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteLogPatternResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteLogPatternRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Application Insights");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteLogPattern");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteLogPattern").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(deleteLogPatternRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteLogPatternRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Describes the application.
*
*
* @param describeApplicationRequest
* @return Result of the DescribeApplication operation returned by the service.
* @throws ResourceNotFoundException
* The resource does not exist in the customer account.
* @throws ValidationException
* The parameter is not valid.
* @throws InternalServerException
* The server encountered an internal error and is unable to complete the request.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ApplicationInsightsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationInsightsClient.DescribeApplication
* @see AWS API Documentation
*/
@Override
public DescribeApplicationResponse describeApplication(DescribeApplicationRequest describeApplicationRequest)
throws ResourceNotFoundException, ValidationException, InternalServerException, AwsServiceException,
SdkClientException, ApplicationInsightsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeApplicationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeApplicationRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Application Insights");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeApplication");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DescribeApplication").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(describeApplicationRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeApplicationRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Describes a component and lists the resources that are grouped together in a component.
*
*
* @param describeComponentRequest
* @return Result of the DescribeComponent operation returned by the service.
* @throws ResourceNotFoundException
* The resource does not exist in the customer account.
* @throws ValidationException
* The parameter is not valid.
* @throws InternalServerException
* The server encountered an internal error and is unable to complete the request.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ApplicationInsightsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationInsightsClient.DescribeComponent
* @see AWS API Documentation
*/
@Override
public DescribeComponentResponse describeComponent(DescribeComponentRequest describeComponentRequest)
throws ResourceNotFoundException, ValidationException, InternalServerException, AwsServiceException,
SdkClientException, ApplicationInsightsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DescribeComponentResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeComponentRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Application Insights");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeComponent");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DescribeComponent").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(describeComponentRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeComponentRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Describes the monitoring configuration of the component.
*
*
* @param describeComponentConfigurationRequest
* @return Result of the DescribeComponentConfiguration operation returned by the service.
* @throws ResourceNotFoundException
* The resource does not exist in the customer account.
* @throws ValidationException
* The parameter is not valid.
* @throws InternalServerException
* The server encountered an internal error and is unable to complete the request.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ApplicationInsightsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationInsightsClient.DescribeComponentConfiguration
* @see AWS API Documentation
*/
@Override
public DescribeComponentConfigurationResponse describeComponentConfiguration(
DescribeComponentConfigurationRequest describeComponentConfigurationRequest) throws ResourceNotFoundException,
ValidationException, InternalServerException, AwsServiceException, SdkClientException, ApplicationInsightsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeComponentConfigurationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
describeComponentConfigurationRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Application Insights");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeComponentConfiguration");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeComponentConfiguration").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(describeComponentConfigurationRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeComponentConfigurationRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Describes the recommended monitoring configuration of the component.
*
*
* @param describeComponentConfigurationRecommendationRequest
* @return Result of the DescribeComponentConfigurationRecommendation operation returned by the service.
* @throws ResourceNotFoundException
* The resource does not exist in the customer account.
* @throws ValidationException
* The parameter is not valid.
* @throws InternalServerException
* The server encountered an internal error and is unable to complete the request.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ApplicationInsightsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationInsightsClient.DescribeComponentConfigurationRecommendation
* @see AWS API Documentation
*/
@Override
public DescribeComponentConfigurationRecommendationResponse describeComponentConfigurationRecommendation(
DescribeComponentConfigurationRecommendationRequest describeComponentConfigurationRecommendationRequest)
throws ResourceNotFoundException, ValidationException, InternalServerException, AwsServiceException,
SdkClientException, ApplicationInsightsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, DescribeComponentConfigurationRecommendationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
describeComponentConfigurationRecommendationRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Application Insights");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeComponentConfigurationRecommendation");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeComponentConfigurationRecommendation")
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(describeComponentConfigurationRecommendationRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeComponentConfigurationRecommendationRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Describe a specific log pattern from a LogPatternSet
.
*
*
* @param describeLogPatternRequest
* @return Result of the DescribeLogPattern operation returned by the service.
* @throws ResourceNotFoundException
* The resource does not exist in the customer account.
* @throws ValidationException
* The parameter is not valid.
* @throws InternalServerException
* The server encountered an internal error and is unable to complete the request.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ApplicationInsightsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationInsightsClient.DescribeLogPattern
* @see AWS API Documentation
*/
@Override
public DescribeLogPatternResponse describeLogPattern(DescribeLogPatternRequest describeLogPatternRequest)
throws ResourceNotFoundException, ValidationException, InternalServerException, AwsServiceException,
SdkClientException, ApplicationInsightsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeLogPatternResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeLogPatternRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Application Insights");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeLogPattern");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DescribeLogPattern").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(describeLogPatternRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeLogPatternRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Describes an anomaly or error with the application.
*
*
* @param describeObservationRequest
* @return Result of the DescribeObservation operation returned by the service.
* @throws InternalServerException
* The server encountered an internal error and is unable to complete the request.
* @throws ValidationException
* The parameter is not valid.
* @throws ResourceNotFoundException
* The resource does not exist in the customer account.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ApplicationInsightsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationInsightsClient.DescribeObservation
* @see AWS API Documentation
*/
@Override
public DescribeObservationResponse describeObservation(DescribeObservationRequest describeObservationRequest)
throws InternalServerException, ValidationException, ResourceNotFoundException, AwsServiceException,
SdkClientException, ApplicationInsightsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeObservationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeObservationRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Application Insights");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeObservation");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DescribeObservation").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(describeObservationRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeObservationRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Describes an application problem.
*
*
* @param describeProblemRequest
* @return Result of the DescribeProblem operation returned by the service.
* @throws InternalServerException
* The server encountered an internal error and is unable to complete the request.
* @throws ValidationException
* The parameter is not valid.
* @throws ResourceNotFoundException
* The resource does not exist in the customer account.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ApplicationInsightsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationInsightsClient.DescribeProblem
* @see AWS API Documentation
*/
@Override
public DescribeProblemResponse describeProblem(DescribeProblemRequest describeProblemRequest) throws InternalServerException,
ValidationException, ResourceNotFoundException, AwsServiceException, SdkClientException, ApplicationInsightsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DescribeProblemResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeProblemRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Application Insights");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeProblem");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DescribeProblem").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(describeProblemRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeProblemRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Describes the anomalies or errors associated with the problem.
*
*
* @param describeProblemObservationsRequest
* @return Result of the DescribeProblemObservations operation returned by the service.
* @throws InternalServerException
* The server encountered an internal error and is unable to complete the request.
* @throws ValidationException
* The parameter is not valid.
* @throws ResourceNotFoundException
* The resource does not exist in the customer account.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ApplicationInsightsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationInsightsClient.DescribeProblemObservations
* @see AWS API Documentation
*/
@Override
public DescribeProblemObservationsResponse describeProblemObservations(
DescribeProblemObservationsRequest describeProblemObservationsRequest) throws InternalServerException,
ValidationException, ResourceNotFoundException, AwsServiceException, SdkClientException, ApplicationInsightsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeProblemObservationsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeProblemObservationsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Application Insights");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeProblemObservations");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeProblemObservations").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(describeProblemObservationsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeProblemObservationsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists the IDs of the applications that you are monitoring.
*
*
* @param listApplicationsRequest
* @return Result of the ListApplications operation returned by the service.
* @throws ValidationException
* The parameter is not valid.
* @throws InternalServerException
* The server encountered an internal error and is unable to complete the request.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ApplicationInsightsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationInsightsClient.ListApplications
* @see AWS API Documentation
*/
@Override
public ListApplicationsResponse listApplications(ListApplicationsRequest listApplicationsRequest) throws ValidationException,
InternalServerException, AwsServiceException, SdkClientException, ApplicationInsightsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListApplicationsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listApplicationsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Application Insights");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListApplications");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListApplications").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listApplicationsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListApplicationsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists the IDs of the applications that you are monitoring.
*
*
*
* This is a variant of
* {@link #listApplications(software.amazon.awssdk.services.applicationinsights.model.ListApplicationsRequest)}
* operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will
* internally handle making service calls for you.
*
*
* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no
* guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response
* pages by making service calls until there are no pages left or your iteration stops. If there are errors in your
* request, you will see the failures only after you start iterating through the iterable.
*
*
*
* The following are few ways to iterate through the response pages:
*
* 1) Using a Stream
*
*
* {@code
* software.amazon.awssdk.services.applicationinsights.paginators.ListApplicationsIterable responses = client.listApplicationsPaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.applicationinsights.paginators.ListApplicationsIterable responses = client
* .listApplicationsPaginator(request);
* for (software.amazon.awssdk.services.applicationinsights.model.ListApplicationsResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.applicationinsights.paginators.ListApplicationsIterable responses = client.listApplicationsPaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* Please notice that the configuration of MaxResults won't limit the number of results you get with the
* paginator. It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #listApplications(software.amazon.awssdk.services.applicationinsights.model.ListApplicationsRequest)}
* operation.
*
*
* @param listApplicationsRequest
* @return A custom iterable that can be used to iterate through all the response pages.
* @throws ValidationException
* The parameter is not valid.
* @throws InternalServerException
* The server encountered an internal error and is unable to complete the request.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ApplicationInsightsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationInsightsClient.ListApplications
* @see AWS API Documentation
*/
@Override
public ListApplicationsIterable listApplicationsPaginator(ListApplicationsRequest listApplicationsRequest)
throws ValidationException, InternalServerException, AwsServiceException, SdkClientException,
ApplicationInsightsException {
return new ListApplicationsIterable(this, applyPaginatorUserAgent(listApplicationsRequest));
}
/**
*
* Lists the auto-grouped, standalone, and custom components of the application.
*
*
* @param listComponentsRequest
* @return Result of the ListComponents operation returned by the service.
* @throws ResourceNotFoundException
* The resource does not exist in the customer account.
* @throws ValidationException
* The parameter is not valid.
* @throws InternalServerException
* The server encountered an internal error and is unable to complete the request.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ApplicationInsightsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationInsightsClient.ListComponents
* @see AWS API Documentation
*/
@Override
public ListComponentsResponse listComponents(ListComponentsRequest listComponentsRequest) throws ResourceNotFoundException,
ValidationException, InternalServerException, AwsServiceException, SdkClientException, ApplicationInsightsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListComponentsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listComponentsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Application Insights");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListComponents");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListComponents").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listComponentsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListComponentsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists the auto-grouped, standalone, and custom components of the application.
*
*
*
* This is a variant of
* {@link #listComponents(software.amazon.awssdk.services.applicationinsights.model.ListComponentsRequest)}
* operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will
* internally handle making service calls for you.
*
*
* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no
* guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response
* pages by making service calls until there are no pages left or your iteration stops. If there are errors in your
* request, you will see the failures only after you start iterating through the iterable.
*
*
*
* The following are few ways to iterate through the response pages:
*
* 1) Using a Stream
*
*
* {@code
* software.amazon.awssdk.services.applicationinsights.paginators.ListComponentsIterable responses = client.listComponentsPaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.applicationinsights.paginators.ListComponentsIterable responses = client
* .listComponentsPaginator(request);
* for (software.amazon.awssdk.services.applicationinsights.model.ListComponentsResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.applicationinsights.paginators.ListComponentsIterable responses = client.listComponentsPaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* Please notice that the configuration of MaxResults won't limit the number of results you get with the
* paginator. It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #listComponents(software.amazon.awssdk.services.applicationinsights.model.ListComponentsRequest)}
* operation.
*
*
* @param listComponentsRequest
* @return A custom iterable that can be used to iterate through all the response pages.
* @throws ResourceNotFoundException
* The resource does not exist in the customer account.
* @throws ValidationException
* The parameter is not valid.
* @throws InternalServerException
* The server encountered an internal error and is unable to complete the request.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ApplicationInsightsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationInsightsClient.ListComponents
* @see AWS API Documentation
*/
@Override
public ListComponentsIterable listComponentsPaginator(ListComponentsRequest listComponentsRequest)
throws ResourceNotFoundException, ValidationException, InternalServerException, AwsServiceException,
SdkClientException, ApplicationInsightsException {
return new ListComponentsIterable(this, applyPaginatorUserAgent(listComponentsRequest));
}
/**
*
* Lists the INFO, WARN, and ERROR events for periodic configuration updates performed by Application Insights.
* Examples of events represented are:
*
*
* -
*
* INFO: creating a new alarm or updating an alarm threshold.
*
*
* -
*
* WARN: alarm not created due to insufficient data points used to predict thresholds.
*
*
* -
*
* ERROR: alarm not created due to permission errors or exceeding quotas.
*
*
*
*
* @param listConfigurationHistoryRequest
* @return Result of the ListConfigurationHistory operation returned by the service.
* @throws ValidationException
* The parameter is not valid.
* @throws ResourceNotFoundException
* The resource does not exist in the customer account.
* @throws InternalServerException
* The server encountered an internal error and is unable to complete the request.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ApplicationInsightsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationInsightsClient.ListConfigurationHistory
* @see AWS API Documentation
*/
@Override
public ListConfigurationHistoryResponse listConfigurationHistory(
ListConfigurationHistoryRequest listConfigurationHistoryRequest) throws ValidationException,
ResourceNotFoundException, InternalServerException, AwsServiceException, SdkClientException,
ApplicationInsightsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListConfigurationHistoryResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listConfigurationHistoryRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Application Insights");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListConfigurationHistory");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListConfigurationHistory").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listConfigurationHistoryRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListConfigurationHistoryRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists the INFO, WARN, and ERROR events for periodic configuration updates performed by Application Insights.
* Examples of events represented are:
*
*
* -
*
* INFO: creating a new alarm or updating an alarm threshold.
*
*
* -
*
* WARN: alarm not created due to insufficient data points used to predict thresholds.
*
*
* -
*
* ERROR: alarm not created due to permission errors or exceeding quotas.
*
*
*
*
*
* This is a variant of
* {@link #listConfigurationHistory(software.amazon.awssdk.services.applicationinsights.model.ListConfigurationHistoryRequest)}
* operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will
* internally handle making service calls for you.
*
*
* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no
* guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response
* pages by making service calls until there are no pages left or your iteration stops. If there are errors in your
* request, you will see the failures only after you start iterating through the iterable.
*
*
*
* The following are few ways to iterate through the response pages:
*
* 1) Using a Stream
*
*
* {@code
* software.amazon.awssdk.services.applicationinsights.paginators.ListConfigurationHistoryIterable responses = client.listConfigurationHistoryPaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.applicationinsights.paginators.ListConfigurationHistoryIterable responses = client
* .listConfigurationHistoryPaginator(request);
* for (software.amazon.awssdk.services.applicationinsights.model.ListConfigurationHistoryResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.applicationinsights.paginators.ListConfigurationHistoryIterable responses = client.listConfigurationHistoryPaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* Please notice that the configuration of MaxResults won't limit the number of results you get with the
* paginator. It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #listConfigurationHistory(software.amazon.awssdk.services.applicationinsights.model.ListConfigurationHistoryRequest)}
* operation.
*
*
* @param listConfigurationHistoryRequest
* @return A custom iterable that can be used to iterate through all the response pages.
* @throws ValidationException
* The parameter is not valid.
* @throws ResourceNotFoundException
* The resource does not exist in the customer account.
* @throws InternalServerException
* The server encountered an internal error and is unable to complete the request.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ApplicationInsightsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationInsightsClient.ListConfigurationHistory
* @see AWS API Documentation
*/
@Override
public ListConfigurationHistoryIterable listConfigurationHistoryPaginator(
ListConfigurationHistoryRequest listConfigurationHistoryRequest) throws ValidationException,
ResourceNotFoundException, InternalServerException, AwsServiceException, SdkClientException,
ApplicationInsightsException {
return new ListConfigurationHistoryIterable(this, applyPaginatorUserAgent(listConfigurationHistoryRequest));
}
/**
*
* Lists the log pattern sets in the specific application.
*
*
* @param listLogPatternSetsRequest
* @return Result of the ListLogPatternSets operation returned by the service.
* @throws ResourceNotFoundException
* The resource does not exist in the customer account.
* @throws ValidationException
* The parameter is not valid.
* @throws InternalServerException
* The server encountered an internal error and is unable to complete the request.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ApplicationInsightsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationInsightsClient.ListLogPatternSets
* @see AWS API Documentation
*/
@Override
public ListLogPatternSetsResponse listLogPatternSets(ListLogPatternSetsRequest listLogPatternSetsRequest)
throws ResourceNotFoundException, ValidationException, InternalServerException, AwsServiceException,
SdkClientException, ApplicationInsightsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListLogPatternSetsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listLogPatternSetsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Application Insights");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListLogPatternSets");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListLogPatternSets").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listLogPatternSetsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListLogPatternSetsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists the log pattern sets in the specific application.
*
*
*
* This is a variant of
* {@link #listLogPatternSets(software.amazon.awssdk.services.applicationinsights.model.ListLogPatternSetsRequest)}
* operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will
* internally handle making service calls for you.
*
*
* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no
* guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response
* pages by making service calls until there are no pages left or your iteration stops. If there are errors in your
* request, you will see the failures only after you start iterating through the iterable.
*
*
*
* The following are few ways to iterate through the response pages:
*
* 1) Using a Stream
*
*
* {@code
* software.amazon.awssdk.services.applicationinsights.paginators.ListLogPatternSetsIterable responses = client.listLogPatternSetsPaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.applicationinsights.paginators.ListLogPatternSetsIterable responses = client
* .listLogPatternSetsPaginator(request);
* for (software.amazon.awssdk.services.applicationinsights.model.ListLogPatternSetsResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.applicationinsights.paginators.ListLogPatternSetsIterable responses = client.listLogPatternSetsPaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* Please notice that the configuration of MaxResults won't limit the number of results you get with the
* paginator. It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #listLogPatternSets(software.amazon.awssdk.services.applicationinsights.model.ListLogPatternSetsRequest)}
* operation.
*
*
* @param listLogPatternSetsRequest
* @return A custom iterable that can be used to iterate through all the response pages.
* @throws ResourceNotFoundException
* The resource does not exist in the customer account.
* @throws ValidationException
* The parameter is not valid.
* @throws InternalServerException
* The server encountered an internal error and is unable to complete the request.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ApplicationInsightsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationInsightsClient.ListLogPatternSets
* @see AWS API Documentation
*/
@Override
public ListLogPatternSetsIterable listLogPatternSetsPaginator(ListLogPatternSetsRequest listLogPatternSetsRequest)
throws ResourceNotFoundException, ValidationException, InternalServerException, AwsServiceException,
SdkClientException, ApplicationInsightsException {
return new ListLogPatternSetsIterable(this, applyPaginatorUserAgent(listLogPatternSetsRequest));
}
/**
*
* Lists the log patterns in the specific log LogPatternSet
.
*
*
* @param listLogPatternsRequest
* @return Result of the ListLogPatterns operation returned by the service.
* @throws ResourceNotFoundException
* The resource does not exist in the customer account.
* @throws ValidationException
* The parameter is not valid.
* @throws InternalServerException
* The server encountered an internal error and is unable to complete the request.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ApplicationInsightsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationInsightsClient.ListLogPatterns
* @see AWS API Documentation
*/
@Override
public ListLogPatternsResponse listLogPatterns(ListLogPatternsRequest listLogPatternsRequest)
throws ResourceNotFoundException, ValidationException, InternalServerException, AwsServiceException,
SdkClientException, ApplicationInsightsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListLogPatternsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listLogPatternsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Application Insights");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListLogPatterns");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListLogPatterns").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listLogPatternsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListLogPatternsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists the log patterns in the specific log LogPatternSet
.
*
*
*
* This is a variant of
* {@link #listLogPatterns(software.amazon.awssdk.services.applicationinsights.model.ListLogPatternsRequest)}
* operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will
* internally handle making service calls for you.
*
*
* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no
* guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response
* pages by making service calls until there are no pages left or your iteration stops. If there are errors in your
* request, you will see the failures only after you start iterating through the iterable.
*
*
*
* The following are few ways to iterate through the response pages:
*
* 1) Using a Stream
*
*
* {@code
* software.amazon.awssdk.services.applicationinsights.paginators.ListLogPatternsIterable responses = client.listLogPatternsPaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.applicationinsights.paginators.ListLogPatternsIterable responses = client
* .listLogPatternsPaginator(request);
* for (software.amazon.awssdk.services.applicationinsights.model.ListLogPatternsResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.applicationinsights.paginators.ListLogPatternsIterable responses = client.listLogPatternsPaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* Please notice that the configuration of MaxResults won't limit the number of results you get with the
* paginator. It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #listLogPatterns(software.amazon.awssdk.services.applicationinsights.model.ListLogPatternsRequest)}
* operation.
*
*
* @param listLogPatternsRequest
* @return A custom iterable that can be used to iterate through all the response pages.
* @throws ResourceNotFoundException
* The resource does not exist in the customer account.
* @throws ValidationException
* The parameter is not valid.
* @throws InternalServerException
* The server encountered an internal error and is unable to complete the request.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ApplicationInsightsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationInsightsClient.ListLogPatterns
* @see AWS API Documentation
*/
@Override
public ListLogPatternsIterable listLogPatternsPaginator(ListLogPatternsRequest listLogPatternsRequest)
throws ResourceNotFoundException, ValidationException, InternalServerException, AwsServiceException,
SdkClientException, ApplicationInsightsException {
return new ListLogPatternsIterable(this, applyPaginatorUserAgent(listLogPatternsRequest));
}
/**
*
* Lists the problems with your application.
*
*
* @param listProblemsRequest
* @return Result of the ListProblems operation returned by the service.
* @throws ValidationException
* The parameter is not valid.
* @throws ResourceNotFoundException
* The resource does not exist in the customer account.
* @throws InternalServerException
* The server encountered an internal error and is unable to complete the request.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ApplicationInsightsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationInsightsClient.ListProblems
* @see AWS API Documentation
*/
@Override
public ListProblemsResponse listProblems(ListProblemsRequest listProblemsRequest) throws ValidationException,
ResourceNotFoundException, InternalServerException, AwsServiceException, SdkClientException,
ApplicationInsightsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListProblemsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listProblemsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Application Insights");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListProblems");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListProblems").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listProblemsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListProblemsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists the problems with your application.
*
*
*
* This is a variant of
* {@link #listProblems(software.amazon.awssdk.services.applicationinsights.model.ListProblemsRequest)} operation.
* The return type is a custom iterable that can be used to iterate through all the pages. SDK will internally
* handle making service calls for you.
*
*
* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no
* guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response
* pages by making service calls until there are no pages left or your iteration stops. If there are errors in your
* request, you will see the failures only after you start iterating through the iterable.
*
*
*
* The following are few ways to iterate through the response pages:
*
* 1) Using a Stream
*
*
* {@code
* software.amazon.awssdk.services.applicationinsights.paginators.ListProblemsIterable responses = client.listProblemsPaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.applicationinsights.paginators.ListProblemsIterable responses = client
* .listProblemsPaginator(request);
* for (software.amazon.awssdk.services.applicationinsights.model.ListProblemsResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.applicationinsights.paginators.ListProblemsIterable responses = client.listProblemsPaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* Please notice that the configuration of MaxResults won't limit the number of results you get with the
* paginator. It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #listProblems(software.amazon.awssdk.services.applicationinsights.model.ListProblemsRequest)}
* operation.
*
*
* @param listProblemsRequest
* @return A custom iterable that can be used to iterate through all the response pages.
* @throws ValidationException
* The parameter is not valid.
* @throws ResourceNotFoundException
* The resource does not exist in the customer account.
* @throws InternalServerException
* The server encountered an internal error and is unable to complete the request.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ApplicationInsightsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationInsightsClient.ListProblems
* @see AWS API Documentation
*/
@Override
public ListProblemsIterable listProblemsPaginator(ListProblemsRequest listProblemsRequest) throws ValidationException,
ResourceNotFoundException, InternalServerException, AwsServiceException, SdkClientException,
ApplicationInsightsException {
return new ListProblemsIterable(this, applyPaginatorUserAgent(listProblemsRequest));
}
/**
*
* Retrieve a list of the tags (keys and values) that are associated with a specified application. A tag is a
* label that you optionally define and associate with an application. Each tag consists of a required tag
* key and an optional associated tag value. A tag key is a general label that acts as a category for
* more specific tag values. A tag value acts as a descriptor within a tag key.
*
*
* @param listTagsForResourceRequest
* @return Result of the ListTagsForResource operation returned by the service.
* @throws ResourceNotFoundException
* The resource does not exist in the customer account.
* @throws ValidationException
* The parameter is not valid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ApplicationInsightsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationInsightsClient.ListTagsForResource
* @see AWS API Documentation
*/
@Override
public ListTagsForResourceResponse listTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest)
throws ResourceNotFoundException, ValidationException, AwsServiceException, SdkClientException,
ApplicationInsightsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListTagsForResourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listTagsForResourceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Application Insights");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListTagsForResource");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListTagsForResource").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listTagsForResourceRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListTagsForResourceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Add one or more tags (keys and values) to a specified application. A tag is a label that you optionally
* define and associate with an application. Tags can help you categorize and manage application in different ways,
* such as by purpose, owner, environment, or other criteria.
*
*
* Each tag consists of a required tag key and an associated tag value, both of which you define. A
* tag key is a general label that acts as a category for more specific tag values. A tag value acts as a descriptor
* within a tag key.
*
*
* @param tagResourceRequest
* @return Result of the TagResource operation returned by the service.
* @throws ResourceNotFoundException
* The resource does not exist in the customer account.
* @throws TooManyTagsException
* The number of the provided tags is beyond the limit, or the number of total tags you are trying to attach
* to the specified resource exceeds the limit.
* @throws ValidationException
* The parameter is not valid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ApplicationInsightsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationInsightsClient.TagResource
* @see AWS API Documentation
*/
@Override
public TagResourceResponse tagResource(TagResourceRequest tagResourceRequest) throws ResourceNotFoundException,
TooManyTagsException, ValidationException, AwsServiceException, SdkClientException, ApplicationInsightsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
TagResourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, tagResourceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Application Insights");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "TagResource");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("TagResource").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(tagResourceRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new TagResourceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Remove one or more tags (keys and values) from a specified application.
*
*
* @param untagResourceRequest
* @return Result of the UntagResource operation returned by the service.
* @throws ResourceNotFoundException
* The resource does not exist in the customer account.
* @throws ValidationException
* The parameter is not valid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ApplicationInsightsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationInsightsClient.UntagResource
* @see AWS API Documentation
*/
@Override
public UntagResourceResponse untagResource(UntagResourceRequest untagResourceRequest) throws ResourceNotFoundException,
ValidationException, AwsServiceException, SdkClientException, ApplicationInsightsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
UntagResourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, untagResourceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Application Insights");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UntagResource");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("UntagResource").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(untagResourceRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UntagResourceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Updates the application.
*
*
* @param updateApplicationRequest
* @return Result of the UpdateApplication operation returned by the service.
* @throws InternalServerException
* The server encountered an internal error and is unable to complete the request.
* @throws ResourceNotFoundException
* The resource does not exist in the customer account.
* @throws ValidationException
* The parameter is not valid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ApplicationInsightsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationInsightsClient.UpdateApplication
* @see AWS API Documentation
*/
@Override
public UpdateApplicationResponse updateApplication(UpdateApplicationRequest updateApplicationRequest)
throws InternalServerException, ResourceNotFoundException, ValidationException, AwsServiceException,
SdkClientException, ApplicationInsightsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
UpdateApplicationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, updateApplicationRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Application Insights");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateApplication");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("UpdateApplication").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(updateApplicationRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UpdateApplicationRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Updates the custom component name and/or the list of resources that make up the component.
*
*
* @param updateComponentRequest
* @return Result of the UpdateComponent operation returned by the service.
* @throws ResourceInUseException
* The resource is already created or in use.
* @throws ResourceNotFoundException
* The resource does not exist in the customer account.
* @throws ValidationException
* The parameter is not valid.
* @throws InternalServerException
* The server encountered an internal error and is unable to complete the request.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ApplicationInsightsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationInsightsClient.UpdateComponent
* @see AWS API Documentation
*/
@Override
public UpdateComponentResponse updateComponent(UpdateComponentRequest updateComponentRequest) throws ResourceInUseException,
ResourceNotFoundException, ValidationException, InternalServerException, AwsServiceException, SdkClientException,
ApplicationInsightsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
UpdateComponentResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, updateComponentRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Application Insights");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateComponent");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("UpdateComponent").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(updateComponentRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UpdateComponentRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Updates the monitoring configurations for the component. The configuration input parameter is an escaped JSON of
* the configuration and should match the schema of what is returned by
* DescribeComponentConfigurationRecommendation
.
*
*
* @param updateComponentConfigurationRequest
* @return Result of the UpdateComponentConfiguration operation returned by the service.
* @throws ResourceNotFoundException
* The resource does not exist in the customer account.
* @throws ValidationException
* The parameter is not valid.
* @throws InternalServerException
* The server encountered an internal error and is unable to complete the request.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ApplicationInsightsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationInsightsClient.UpdateComponentConfiguration
* @see AWS API Documentation
*/
@Override
public UpdateComponentConfigurationResponse updateComponentConfiguration(
UpdateComponentConfigurationRequest updateComponentConfigurationRequest) throws ResourceNotFoundException,
ValidationException, InternalServerException, AwsServiceException, SdkClientException, ApplicationInsightsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, UpdateComponentConfigurationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, updateComponentConfigurationRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Application Insights");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateComponentConfiguration");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("UpdateComponentConfiguration").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(updateComponentConfigurationRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UpdateComponentConfigurationRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Adds a log pattern to a LogPatternSet
.
*
*
* @param updateLogPatternRequest
* @return Result of the UpdateLogPattern operation returned by the service.
* @throws ResourceInUseException
* The resource is already created or in use.
* @throws ResourceNotFoundException
* The resource does not exist in the customer account.
* @throws ValidationException
* The parameter is not valid.
* @throws InternalServerException
* The server encountered an internal error and is unable to complete the request.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ApplicationInsightsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ApplicationInsightsClient.UpdateLogPattern
* @see AWS API Documentation
*/
@Override
public UpdateLogPatternResponse updateLogPattern(UpdateLogPatternRequest updateLogPatternRequest)
throws ResourceInUseException, ResourceNotFoundException, ValidationException, InternalServerException,
AwsServiceException, SdkClientException, ApplicationInsightsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
UpdateLogPatternResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
List metricPublishers = resolveMetricPublishers(clientConfiguration, updateLogPatternRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Application Insights");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateLogPattern");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("UpdateLogPattern").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(updateLogPatternRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UpdateLogPatternRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
private static List resolveMetricPublishers(SdkClientConfiguration clientConfiguration,
RequestOverrideConfiguration requestOverrideConfiguration) {
List publishers = null;
if (requestOverrideConfiguration != null) {
publishers = requestOverrideConfiguration.metricPublishers();
}
if (publishers == null || publishers.isEmpty()) {
publishers = clientConfiguration.option(SdkClientOption.METRIC_PUBLISHERS);
}
if (publishers == null) {
publishers = Collections.emptyList();
}
return publishers;
}
private HttpResponseHandler createErrorResponseHandler(BaseAwsJsonProtocolFactory protocolFactory,
JsonOperationMetadata operationMetadata) {
return protocolFactory.createErrorResponseHandler(operationMetadata);
}
private > T init(T builder) {
return builder
.clientConfiguration(clientConfiguration)
.defaultServiceExceptionSupplier(ApplicationInsightsException::builder)
.protocol(AwsJsonProtocol.AWS_JSON)
.protocolVersion("1.1")
.registerModeledException(
ExceptionMetadata.builder().errorCode("AccessDeniedException")
.exceptionBuilderSupplier(AccessDeniedException::builder).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("TooManyTagsException")
.exceptionBuilderSupplier(TooManyTagsException::builder).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("ResourceInUseException")
.exceptionBuilderSupplier(ResourceInUseException::builder).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("ResourceNotFoundException")
.exceptionBuilderSupplier(ResourceNotFoundException::builder).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("TagsAlreadyExistException")
.exceptionBuilderSupplier(TagsAlreadyExistException::builder).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("ValidationException")
.exceptionBuilderSupplier(ValidationException::builder).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("InternalServerException")
.exceptionBuilderSupplier(InternalServerException::builder).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("BadRequestException")
.exceptionBuilderSupplier(BadRequestException::builder).build());
}
@Override
public void close() {
clientHandler.close();
}
private T applyPaginatorUserAgent(T request) {
Consumer userAgentApplier = b -> b.addApiName(ApiName.builder()
.version(VersionInfo.SDK_VERSION).name("PAGINATED").build());
AwsRequestOverrideConfiguration overrideConfiguration = request.overrideConfiguration()
.map(c -> c.toBuilder().applyMutation(userAgentApplier).build())
.orElse((AwsRequestOverrideConfiguration.builder().applyMutation(userAgentApplier).build()));
return (T) request.toBuilder().overrideConfiguration(overrideConfiguration).build();
}
}