
com.amazonaws.services.applicationinsights.AmazonApplicationInsightsClient Maven / Gradle / Ivy
/*
* Copyright 2014-2019 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 com.amazonaws.services.applicationinsights;
import org.w3c.dom.*;
import java.net.*;
import java.util.*;
import javax.annotation.Generated;
import org.apache.commons.logging.*;
import com.amazonaws.*;
import com.amazonaws.annotation.SdkInternalApi;
import com.amazonaws.auth.*;
import com.amazonaws.handlers.*;
import com.amazonaws.http.*;
import com.amazonaws.internal.*;
import com.amazonaws.internal.auth.*;
import com.amazonaws.metrics.*;
import com.amazonaws.regions.*;
import com.amazonaws.transform.*;
import com.amazonaws.util.*;
import com.amazonaws.protocol.json.*;
import com.amazonaws.util.AWSRequestMetrics.Field;
import com.amazonaws.annotation.ThreadSafe;
import com.amazonaws.client.AwsSyncClientParams;
import com.amazonaws.client.builder.AdvancedConfig;
import com.amazonaws.services.applicationinsights.AmazonApplicationInsightsClientBuilder;
import com.amazonaws.AmazonServiceException;
import com.amazonaws.services.applicationinsights.model.*;
import com.amazonaws.services.applicationinsights.model.transform.*;
/**
* Client for accessing Application Insights. All service calls made using this client are blocking, and will not return
* until the service call completes.
*
* Amazon CloudWatch Application Insights for .NET and SQL Server
*
* Amazon CloudWatch Application Insights for .NET and SQL Server is a service that helps you detect common problems
* with your .NET and SQL Server-based applications. It enables you to pinpoint the source of issues in your
* applications (built with technologies such as Microsoft IIS, .NET, and Microsoft SQL Server), by providing key
* insights into detected problems.
*
*
* After you onboard your application, CloudWatch Application Insights for .NET and SQL Server identifies, recommends,
* and sets up metrics and logs. It continuously analyzes and correlates your metrics and logs for unusual behavior to
* surface actionable problems with your application. For example, if your application is slow and unresponsive and
* leading to HTTP 500 errors in your Application Load Balancer (ALB), Application Insights informs you that a memory
* pressure problem with your SQL Server database is occurring. It bases this analysis on impactful metrics and log
* errors.
*
*/
@ThreadSafe
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AmazonApplicationInsightsClient extends AmazonWebServiceClient implements AmazonApplicationInsights {
/** Provider for AWS credentials. */
private final AWSCredentialsProvider awsCredentialsProvider;
private static final Log log = LogFactory.getLog(AmazonApplicationInsights.class);
/** Default signing name for the service. */
private static final String DEFAULT_SIGNING_NAME = "applicationinsights";
/** Client configuration factory providing ClientConfigurations tailored to this client */
protected static final ClientConfigurationFactory configFactory = new ClientConfigurationFactory();
private final AdvancedConfig advancedConfig;
private static final com.amazonaws.protocol.json.SdkJsonProtocolFactory protocolFactory = new com.amazonaws.protocol.json.SdkJsonProtocolFactory(
new JsonClientMetadata()
.withProtocolVersion("1.1")
.withSupportsCbor(false)
.withSupportsIon(false)
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("ResourceInUseException").withExceptionUnmarshaller(
com.amazonaws.services.applicationinsights.model.transform.ResourceInUseExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("ResourceNotFoundException").withExceptionUnmarshaller(
com.amazonaws.services.applicationinsights.model.transform.ResourceNotFoundExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("ValidationException").withExceptionUnmarshaller(
com.amazonaws.services.applicationinsights.model.transform.ValidationExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("InternalServerException").withExceptionUnmarshaller(
com.amazonaws.services.applicationinsights.model.transform.InternalServerExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("BadRequestException").withExceptionUnmarshaller(
com.amazonaws.services.applicationinsights.model.transform.BadRequestExceptionUnmarshaller.getInstance()))
.withBaseServiceExceptionClass(com.amazonaws.services.applicationinsights.model.AmazonApplicationInsightsException.class));
public static AmazonApplicationInsightsClientBuilder builder() {
return AmazonApplicationInsightsClientBuilder.standard();
}
/**
* Constructs a new client to invoke service methods on Application Insights using the specified parameters.
*
*
* All service calls made using this new client object are blocking, and will not return until the service call
* completes.
*
* @param clientParams
* Object providing client parameters.
*/
AmazonApplicationInsightsClient(AwsSyncClientParams clientParams) {
this(clientParams, false);
}
/**
* Constructs a new client to invoke service methods on Application Insights using the specified parameters.
*
*
* All service calls made using this new client object are blocking, and will not return until the service call
* completes.
*
* @param clientParams
* Object providing client parameters.
*/
AmazonApplicationInsightsClient(AwsSyncClientParams clientParams, boolean endpointDiscoveryEnabled) {
super(clientParams);
this.awsCredentialsProvider = clientParams.getCredentialsProvider();
this.advancedConfig = clientParams.getAdvancedConfig();
init();
}
private void init() {
setServiceNameIntern(DEFAULT_SIGNING_NAME);
setEndpointPrefix(ENDPOINT_PREFIX);
// calling this.setEndPoint(...) will also modify the signer accordingly
setEndpoint("applicationinsights.us-east-1.amazonaws.com");
HandlerChainFactory chainFactory = new HandlerChainFactory();
requestHandler2s.addAll(chainFactory.newRequestHandlerChain("/com/amazonaws/services/applicationinsights/request.handlers"));
requestHandler2s.addAll(chainFactory.newRequestHandler2Chain("/com/amazonaws/services/applicationinsights/request.handler2s"));
requestHandler2s.addAll(chainFactory.getGlobalHandlers());
}
/**
*
* 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.
* @sample AmazonApplicationInsights.CreateApplication
* @see AWS API Documentation
*/
@Override
public CreateApplicationResult createApplication(CreateApplicationRequest request) {
request = beforeClientExecution(request);
return executeCreateApplication(request);
}
@SdkInternalApi
final CreateApplicationResult executeCreateApplication(CreateApplicationRequest createApplicationRequest) {
ExecutionContext executionContext = createExecutionContext(createApplicationRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateApplicationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createApplicationRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Application Insights");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateApplication");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateApplicationResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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.
* @sample AmazonApplicationInsights.CreateComponent
* @see AWS API Documentation
*/
@Override
public CreateComponentResult createComponent(CreateComponentRequest request) {
request = beforeClientExecution(request);
return executeCreateComponent(request);
}
@SdkInternalApi
final CreateComponentResult executeCreateComponent(CreateComponentRequest createComponentRequest) {
ExecutionContext executionContext = createExecutionContext(createComponentRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateComponentRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createComponentRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Application Insights");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateComponent");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateComponentResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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.
* @sample AmazonApplicationInsights.DeleteApplication
* @see AWS API Documentation
*/
@Override
public DeleteApplicationResult deleteApplication(DeleteApplicationRequest request) {
request = beforeClientExecution(request);
return executeDeleteApplication(request);
}
@SdkInternalApi
final DeleteApplicationResult executeDeleteApplication(DeleteApplicationRequest deleteApplicationRequest) {
ExecutionContext executionContext = createExecutionContext(deleteApplicationRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteApplicationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteApplicationRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Application Insights");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteApplication");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteApplicationResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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.
* @sample AmazonApplicationInsights.DeleteComponent
* @see AWS API Documentation
*/
@Override
public DeleteComponentResult deleteComponent(DeleteComponentRequest request) {
request = beforeClientExecution(request);
return executeDeleteComponent(request);
}
@SdkInternalApi
final DeleteComponentResult executeDeleteComponent(DeleteComponentRequest deleteComponentRequest) {
ExecutionContext executionContext = createExecutionContext(deleteComponentRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteComponentRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteComponentRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Application Insights");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteComponent");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteComponentResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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.
* @sample AmazonApplicationInsights.DescribeApplication
* @see AWS API Documentation
*/
@Override
public DescribeApplicationResult describeApplication(DescribeApplicationRequest request) {
request = beforeClientExecution(request);
return executeDescribeApplication(request);
}
@SdkInternalApi
final DescribeApplicationResult executeDescribeApplication(DescribeApplicationRequest describeApplicationRequest) {
ExecutionContext executionContext = createExecutionContext(describeApplicationRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DescribeApplicationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeApplicationRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Application Insights");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeApplication");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeApplicationResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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.
* @sample AmazonApplicationInsights.DescribeComponent
* @see AWS API Documentation
*/
@Override
public DescribeComponentResult describeComponent(DescribeComponentRequest request) {
request = beforeClientExecution(request);
return executeDescribeComponent(request);
}
@SdkInternalApi
final DescribeComponentResult executeDescribeComponent(DescribeComponentRequest describeComponentRequest) {
ExecutionContext executionContext = createExecutionContext(describeComponentRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DescribeComponentRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeComponentRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Application Insights");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeComponent");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeComponentResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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.
* @sample AmazonApplicationInsights.DescribeComponentConfiguration
* @see AWS API Documentation
*/
@Override
public DescribeComponentConfigurationResult describeComponentConfiguration(DescribeComponentConfigurationRequest request) {
request = beforeClientExecution(request);
return executeDescribeComponentConfiguration(request);
}
@SdkInternalApi
final DescribeComponentConfigurationResult executeDescribeComponentConfiguration(DescribeComponentConfigurationRequest describeComponentConfigurationRequest) {
ExecutionContext executionContext = createExecutionContext(describeComponentConfigurationRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DescribeComponentConfigurationRequestProtocolMarshaller(protocolFactory).marshall(super
.beforeMarshalling(describeComponentConfigurationRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Application Insights");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeComponentConfiguration");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new DescribeComponentConfigurationResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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.
* @sample AmazonApplicationInsights.DescribeComponentConfigurationRecommendation
* @see AWS API Documentation
*/
@Override
public DescribeComponentConfigurationRecommendationResult describeComponentConfigurationRecommendation(
DescribeComponentConfigurationRecommendationRequest request) {
request = beforeClientExecution(request);
return executeDescribeComponentConfigurationRecommendation(request);
}
@SdkInternalApi
final DescribeComponentConfigurationRecommendationResult executeDescribeComponentConfigurationRecommendation(
DescribeComponentConfigurationRecommendationRequest describeComponentConfigurationRecommendationRequest) {
ExecutionContext executionContext = createExecutionContext(describeComponentConfigurationRecommendationRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DescribeComponentConfigurationRecommendationRequestProtocolMarshaller(protocolFactory).marshall(super
.beforeMarshalling(describeComponentConfigurationRecommendationRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Application Insights");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeComponentConfigurationRecommendation");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory
.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new DescribeComponentConfigurationRecommendationResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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.
* @sample AmazonApplicationInsights.DescribeObservation
* @see AWS API Documentation
*/
@Override
public DescribeObservationResult describeObservation(DescribeObservationRequest request) {
request = beforeClientExecution(request);
return executeDescribeObservation(request);
}
@SdkInternalApi
final DescribeObservationResult executeDescribeObservation(DescribeObservationRequest describeObservationRequest) {
ExecutionContext executionContext = createExecutionContext(describeObservationRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DescribeObservationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeObservationRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Application Insights");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeObservation");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeObservationResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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.
* @sample AmazonApplicationInsights.DescribeProblem
* @see AWS API Documentation
*/
@Override
public DescribeProblemResult describeProblem(DescribeProblemRequest request) {
request = beforeClientExecution(request);
return executeDescribeProblem(request);
}
@SdkInternalApi
final DescribeProblemResult executeDescribeProblem(DescribeProblemRequest describeProblemRequest) {
ExecutionContext executionContext = createExecutionContext(describeProblemRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DescribeProblemRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeProblemRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Application Insights");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeProblem");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeProblemResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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.
* @sample AmazonApplicationInsights.DescribeProblemObservations
* @see AWS API Documentation
*/
@Override
public DescribeProblemObservationsResult describeProblemObservations(DescribeProblemObservationsRequest request) {
request = beforeClientExecution(request);
return executeDescribeProblemObservations(request);
}
@SdkInternalApi
final DescribeProblemObservationsResult executeDescribeProblemObservations(DescribeProblemObservationsRequest describeProblemObservationsRequest) {
ExecutionContext executionContext = createExecutionContext(describeProblemObservationsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DescribeProblemObservationsRequestProtocolMarshaller(protocolFactory).marshall(super
.beforeMarshalling(describeProblemObservationsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Application Insights");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeProblemObservations");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new DescribeProblemObservationsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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.
* @sample AmazonApplicationInsights.ListApplications
* @see AWS API Documentation
*/
@Override
public ListApplicationsResult listApplications(ListApplicationsRequest request) {
request = beforeClientExecution(request);
return executeListApplications(request);
}
@SdkInternalApi
final ListApplicationsResult executeListApplications(ListApplicationsRequest listApplicationsRequest) {
ExecutionContext executionContext = createExecutionContext(listApplicationsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListApplicationsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listApplicationsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Application Insights");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListApplications");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListApplicationsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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.
* @sample AmazonApplicationInsights.ListComponents
* @see AWS API Documentation
*/
@Override
public ListComponentsResult listComponents(ListComponentsRequest request) {
request = beforeClientExecution(request);
return executeListComponents(request);
}
@SdkInternalApi
final ListComponentsResult executeListComponents(ListComponentsRequest listComponentsRequest) {
ExecutionContext executionContext = createExecutionContext(listComponentsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListComponentsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listComponentsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Application Insights");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListComponents");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListComponentsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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.
* @sample AmazonApplicationInsights.ListProblems
* @see AWS API Documentation
*/
@Override
public ListProblemsResult listProblems(ListProblemsRequest request) {
request = beforeClientExecution(request);
return executeListProblems(request);
}
@SdkInternalApi
final ListProblemsResult executeListProblems(ListProblemsRequest listProblemsRequest) {
ExecutionContext executionContext = createExecutionContext(listProblemsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListProblemsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listProblemsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Application Insights");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListProblems");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListProblemsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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.
* @sample AmazonApplicationInsights.UpdateApplication
* @see AWS API Documentation
*/
@Override
public UpdateApplicationResult updateApplication(UpdateApplicationRequest request) {
request = beforeClientExecution(request);
return executeUpdateApplication(request);
}
@SdkInternalApi
final UpdateApplicationResult executeUpdateApplication(UpdateApplicationRequest updateApplicationRequest) {
ExecutionContext executionContext = createExecutionContext(updateApplicationRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new UpdateApplicationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateApplicationRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Application Insights");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateApplication");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateApplicationResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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.
* @sample AmazonApplicationInsights.UpdateComponent
* @see AWS API Documentation
*/
@Override
public UpdateComponentResult updateComponent(UpdateComponentRequest request) {
request = beforeClientExecution(request);
return executeUpdateComponent(request);
}
@SdkInternalApi
final UpdateComponentResult executeUpdateComponent(UpdateComponentRequest updateComponentRequest) {
ExecutionContext executionContext = createExecutionContext(updateComponentRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new UpdateComponentRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateComponentRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Application Insights");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateComponent");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateComponentResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* 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.
* @sample AmazonApplicationInsights.UpdateComponentConfiguration
* @see AWS API Documentation
*/
@Override
public UpdateComponentConfigurationResult updateComponentConfiguration(UpdateComponentConfigurationRequest request) {
request = beforeClientExecution(request);
return executeUpdateComponentConfiguration(request);
}
@SdkInternalApi
final UpdateComponentConfigurationResult executeUpdateComponentConfiguration(UpdateComponentConfigurationRequest updateComponentConfigurationRequest) {
ExecutionContext executionContext = createExecutionContext(updateComponentConfigurationRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new UpdateComponentConfigurationRequestProtocolMarshaller(protocolFactory).marshall(super
.beforeMarshalling(updateComponentConfigurationRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Application Insights");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateComponentConfiguration");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new UpdateComponentConfigurationResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* Returns additional metadata for a previously executed successful, request, typically used for debugging issues
* where a service isn't acting as expected. This data isn't considered part of the result data returned by an
* operation, so it's available through this separate, diagnostic interface.
*
* Response metadata is only cached for a limited period of time, so if you need to access this extra diagnostic
* information for an executed request, you should use this method to retrieve it as soon as possible after
* executing the request.
*
* @param request
* The originally executed request
*
* @return The response metadata for the specified request, or null if none is available.
*/
public ResponseMetadata getCachedResponseMetadata(AmazonWebServiceRequest request) {
return client.getResponseMetadataForRequest(request);
}
/**
* Normal invoke with authentication. Credentials are required and may be overriden at the request level.
**/
private Response invoke(Request request, HttpResponseHandler> responseHandler,
ExecutionContext executionContext) {
return invoke(request, responseHandler, executionContext, null, null);
}
/**
* Normal invoke with authentication. Credentials are required and may be overriden at the request level.
**/
private Response invoke(Request request, HttpResponseHandler> responseHandler,
ExecutionContext executionContext, URI cachedEndpoint, URI uriFromEndpointTrait) {
executionContext.setCredentialsProvider(CredentialUtils.getCredentialsProvider(request.getOriginalRequest(), awsCredentialsProvider));
return doInvoke(request, responseHandler, executionContext, cachedEndpoint, uriFromEndpointTrait);
}
/**
* Invoke with no authentication. Credentials are not required and any credentials set on the client or request will
* be ignored for this operation.
**/
private Response anonymousInvoke(Request request,
HttpResponseHandler> responseHandler, ExecutionContext executionContext) {
return doInvoke(request, responseHandler, executionContext, null, null);
}
/**
* Invoke the request using the http client. Assumes credentials (or lack thereof) have been configured in the
* ExecutionContext beforehand.
**/
private Response doInvoke(Request request, HttpResponseHandler> responseHandler,
ExecutionContext executionContext, URI discoveredEndpoint, URI uriFromEndpointTrait) {
if (discoveredEndpoint != null) {
request.setEndpoint(discoveredEndpoint);
request.getOriginalRequest().getRequestClientOptions().appendUserAgent("endpoint-discovery");
} else if (uriFromEndpointTrait != null) {
request.setEndpoint(uriFromEndpointTrait);
} else {
request.setEndpoint(endpoint);
}
request.setTimeOffset(timeOffset);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler(new JsonErrorResponseMetadata());
return client.execute(request, responseHandler, errorResponseHandler, executionContext);
}
@com.amazonaws.annotation.SdkInternalApi
static com.amazonaws.protocol.json.SdkJsonProtocolFactory getProtocolFactory() {
return protocolFactory;
}
}