
com.amazonaws.services.applicationsignals.AmazonApplicationSignalsClient Maven / Gradle / Ivy
/*
* Copyright 2019-2024 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.applicationsignals;
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.applicationsignals.AmazonApplicationSignalsClientBuilder;
import com.amazonaws.AmazonServiceException;
import com.amazonaws.services.applicationsignals.model.*;
import com.amazonaws.services.applicationsignals.model.transform.*;
/**
* Client for accessing Amazon CloudWatch Application Signals. All service calls made using this client are blocking,
* and will not return until the service call completes.
*
*
* Use CloudWatch Application Signals for comprehensive observability of your cloud-based applications. It enables
* real-time service health dashboards and helps you track long-term performance trends against your business goals. The
* application-centric view provides you with unified visibility across your applications, services, and dependencies,
* so you can proactively monitor and efficiently triage any issues that may arise, ensuring optimal customer
* experience.
*
*
* Application Signals provides the following benefits:
*
*
* -
*
* Automatically collect metrics and traces from your applications, and display key metrics such as call volume,
* availability, latency, faults, and errors.
*
*
* -
*
* Create and monitor service level objectives (SLOs).
*
*
* -
*
* See a map of your application topology that Application Signals automatically discovers, that gives you a visual
* representation of your applications, dependencies, and their connectivity.
*
*
*
*
* Application Signals works with CloudWatch RUM, CloudWatch Synthetics canaries, and Amazon Web Services Service
* Catalog AppRegistry, to display your client pages, Synthetics canaries, and application names within dashboards and
* maps.
*
*/
@ThreadSafe
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AmazonApplicationSignalsClient extends AmazonWebServiceClient implements AmazonApplicationSignals {
/** Provider for AWS credentials. */
private final AWSCredentialsProvider awsCredentialsProvider;
private static final Log log = LogFactory.getLog(AmazonApplicationSignals.class);
/** Default signing name for the service. */
private static final String DEFAULT_SIGNING_NAME = "application-signals";
/** 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)
.withContentTypeOverride("application/json")
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("AccessDeniedException").withExceptionUnmarshaller(
com.amazonaws.services.applicationsignals.model.transform.AccessDeniedExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("ConflictException").withExceptionUnmarshaller(
com.amazonaws.services.applicationsignals.model.transform.ConflictExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("ResourceNotFoundException").withExceptionUnmarshaller(
com.amazonaws.services.applicationsignals.model.transform.ResourceNotFoundExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("ThrottlingException").withExceptionUnmarshaller(
com.amazonaws.services.applicationsignals.model.transform.ThrottlingExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("ValidationException").withExceptionUnmarshaller(
com.amazonaws.services.applicationsignals.model.transform.ValidationExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("ServiceQuotaExceededException").withExceptionUnmarshaller(
com.amazonaws.services.applicationsignals.model.transform.ServiceQuotaExceededExceptionUnmarshaller.getInstance()))
.withBaseServiceExceptionClass(com.amazonaws.services.applicationsignals.model.AmazonApplicationSignalsException.class));
public static AmazonApplicationSignalsClientBuilder builder() {
return AmazonApplicationSignalsClientBuilder.standard();
}
/**
* Constructs a new client to invoke service methods on Amazon CloudWatch Application Signals 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.
*/
AmazonApplicationSignalsClient(AwsSyncClientParams clientParams) {
this(clientParams, false);
}
/**
* Constructs a new client to invoke service methods on Amazon CloudWatch Application Signals 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.
*/
AmazonApplicationSignalsClient(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("application-signals.us-east-1.amazonaws.com");
HandlerChainFactory chainFactory = new HandlerChainFactory();
requestHandler2s.addAll(chainFactory.newRequestHandlerChain("/com/amazonaws/services/applicationsignals/request.handlers"));
requestHandler2s.addAll(chainFactory.newRequestHandler2Chain("/com/amazonaws/services/applicationsignals/request.handler2s"));
requestHandler2s.addAll(chainFactory.getGlobalHandlers());
}
/**
*
* Use this operation to retrieve one or more service level objective (SLO) budget reports.
*
*
* An error budget is the amount of time in unhealthy periods that your service can accumulate during an
* interval before your overall SLO budget health is breached and the SLO is considered to be unmet. For example, an
* SLO with a threshold of 99.95% and a monthly interval translates to an error budget of 21.9 minutes of downtime
* in a 30-day month.
*
*
* Budget reports include a health indicator, the attainment value, and remaining budget.
*
*
* For more information about SLO error budgets, see SLO concepts.
*
*
* @param batchGetServiceLevelObjectiveBudgetReportRequest
* @return Result of the BatchGetServiceLevelObjectiveBudgetReport operation returned by the service.
* @throws ValidationException
* The resource is not valid.
* @throws ThrottlingException
* The request was throttled because of quota limits.
* @sample AmazonApplicationSignals.BatchGetServiceLevelObjectiveBudgetReport
* @see AWS API Documentation
*/
@Override
public BatchGetServiceLevelObjectiveBudgetReportResult batchGetServiceLevelObjectiveBudgetReport(BatchGetServiceLevelObjectiveBudgetReportRequest request) {
request = beforeClientExecution(request);
return executeBatchGetServiceLevelObjectiveBudgetReport(request);
}
@SdkInternalApi
final BatchGetServiceLevelObjectiveBudgetReportResult executeBatchGetServiceLevelObjectiveBudgetReport(
BatchGetServiceLevelObjectiveBudgetReportRequest batchGetServiceLevelObjectiveBudgetReportRequest) {
ExecutionContext executionContext = createExecutionContext(batchGetServiceLevelObjectiveBudgetReportRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new BatchGetServiceLevelObjectiveBudgetReportRequestProtocolMarshaller(protocolFactory).marshall(super
.beforeMarshalling(batchGetServiceLevelObjectiveBudgetReportRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Application Signals");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "BatchGetServiceLevelObjectiveBudgetReport");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory
.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new BatchGetServiceLevelObjectiveBudgetReportResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Creates a service level objective (SLO), which can help you ensure that your critical business operations are
* meeting customer expectations. Use SLOs to set and track specific target levels for the reliability and
* availability of your applications and services. SLOs use service level indicators (SLIs) to calculate whether the
* application is performing at the level that you want.
*
*
* Create an SLO to set a target for a service or operation’s availability or latency. CloudWatch measures this
* target frequently you can find whether it has been breached.
*
*
* When you create an SLO, you set an attainment goal for it. An attainment goal is the ratio of good
* periods that meet the threshold requirements to the total periods within the interval. For example, an attainment
* goal of 99.9% means that within your interval, you are targeting 99.9% of the periods to be in healthy state.
*
*
* After you have created an SLO, you can retrieve error budget reports for it. An error budget is the number
* of periods or amount of time that your service can accumulate during an interval before your overall SLO budget
* health is breached and the SLO is considered to be unmet. for example, an SLO with a threshold that 99.95% of
* requests must be completed under 2000ms every month translates to an error budget of 21.9 minutes of downtime per
* month.
*
*
* When you call this operation, Application Signals creates the
* AWSServiceRoleForCloudWatchApplicationSignals service-linked role, if it doesn't already exist in your
* account. This service- linked role has the following permissions:
*
*
* -
*
* xray:GetServiceGraph
*
*
* -
*
* logs:StartQuery
*
*
* -
*
* logs:GetQueryResults
*
*
* -
*
* cloudwatch:GetMetricData
*
*
* -
*
* cloudwatch:ListMetrics
*
*
* -
*
* tag:GetResources
*
*
* -
*
* autoscaling:DescribeAutoScalingGroups
*
*
*
*
* You can easily set SLO targets for your applications that are discovered by Application Signals, using critical
* metrics such as latency and availability. You can also set SLOs against any CloudWatch metric or math expression
* that produces a time series.
*
*
* For more information about SLOs, see
* Service level objectives (SLOs).
*
*
* @param createServiceLevelObjectiveRequest
* @return Result of the CreateServiceLevelObjective operation returned by the service.
* @throws ValidationException
* The resource is not valid.
* @throws ThrottlingException
* The request was throttled because of quota limits.
* @throws AccessDeniedException
* You don't have sufficient permissions to perform this action.
* @throws ServiceQuotaExceededException
* This request exceeds a service quota.
* @throws ConflictException
* This operation attempted to create a resource that already exists.
* @sample AmazonApplicationSignals.CreateServiceLevelObjective
* @see AWS API Documentation
*/
@Override
public CreateServiceLevelObjectiveResult createServiceLevelObjective(CreateServiceLevelObjectiveRequest request) {
request = beforeClientExecution(request);
return executeCreateServiceLevelObjective(request);
}
@SdkInternalApi
final CreateServiceLevelObjectiveResult executeCreateServiceLevelObjective(CreateServiceLevelObjectiveRequest createServiceLevelObjectiveRequest) {
ExecutionContext executionContext = createExecutionContext(createServiceLevelObjectiveRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateServiceLevelObjectiveRequestProtocolMarshaller(protocolFactory).marshall(super
.beforeMarshalling(createServiceLevelObjectiveRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Application Signals");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateServiceLevelObjective");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new CreateServiceLevelObjectiveResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Deletes the specified service level objective.
*
*
* @param deleteServiceLevelObjectiveRequest
* @return Result of the DeleteServiceLevelObjective operation returned by the service.
* @throws ValidationException
* The resource is not valid.
* @throws ResourceNotFoundException
* Resource not found.
* @throws ThrottlingException
* The request was throttled because of quota limits.
* @sample AmazonApplicationSignals.DeleteServiceLevelObjective
* @see AWS API Documentation
*/
@Override
public DeleteServiceLevelObjectiveResult deleteServiceLevelObjective(DeleteServiceLevelObjectiveRequest request) {
request = beforeClientExecution(request);
return executeDeleteServiceLevelObjective(request);
}
@SdkInternalApi
final DeleteServiceLevelObjectiveResult executeDeleteServiceLevelObjective(DeleteServiceLevelObjectiveRequest deleteServiceLevelObjectiveRequest) {
ExecutionContext executionContext = createExecutionContext(deleteServiceLevelObjectiveRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteServiceLevelObjectiveRequestProtocolMarshaller(protocolFactory).marshall(super
.beforeMarshalling(deleteServiceLevelObjectiveRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Application Signals");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteServiceLevelObjective");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new DeleteServiceLevelObjectiveResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Returns information about a service discovered by Application Signals.
*
*
* @param getServiceRequest
* @return Result of the GetService operation returned by the service.
* @throws ValidationException
* The resource is not valid.
* @throws ThrottlingException
* The request was throttled because of quota limits.
* @sample AmazonApplicationSignals.GetService
* @see AWS
* API Documentation
*/
@Override
public GetServiceResult getService(GetServiceRequest request) {
request = beforeClientExecution(request);
return executeGetService(request);
}
@SdkInternalApi
final GetServiceResult executeGetService(GetServiceRequest getServiceRequest) {
ExecutionContext executionContext = createExecutionContext(getServiceRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new GetServiceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getServiceRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Application Signals");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetService");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetServiceResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Returns information about one SLO created in the account.
*
*
* @param getServiceLevelObjectiveRequest
* @return Result of the GetServiceLevelObjective operation returned by the service.
* @throws ValidationException
* The resource is not valid.
* @throws ResourceNotFoundException
* Resource not found.
* @throws ThrottlingException
* The request was throttled because of quota limits.
* @sample AmazonApplicationSignals.GetServiceLevelObjective
* @see AWS API Documentation
*/
@Override
public GetServiceLevelObjectiveResult getServiceLevelObjective(GetServiceLevelObjectiveRequest request) {
request = beforeClientExecution(request);
return executeGetServiceLevelObjective(request);
}
@SdkInternalApi
final GetServiceLevelObjectiveResult executeGetServiceLevelObjective(GetServiceLevelObjectiveRequest getServiceLevelObjectiveRequest) {
ExecutionContext executionContext = createExecutionContext(getServiceLevelObjectiveRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new GetServiceLevelObjectiveRequestProtocolMarshaller(protocolFactory).marshall(super
.beforeMarshalling(getServiceLevelObjectiveRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Application Signals");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetServiceLevelObjective");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new GetServiceLevelObjectiveResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Returns a list of service dependencies of the service that you specify. A dependency is an infrastructure
* component that an operation of this service connects with. Dependencies can include Amazon Web Services services,
* Amazon Web Services resources, and third-party services.
*
*
* @param listServiceDependenciesRequest
* @return Result of the ListServiceDependencies operation returned by the service.
* @throws ValidationException
* The resource is not valid.
* @throws ThrottlingException
* The request was throttled because of quota limits.
* @sample AmazonApplicationSignals.ListServiceDependencies
* @see AWS API Documentation
*/
@Override
public ListServiceDependenciesResult listServiceDependencies(ListServiceDependenciesRequest request) {
request = beforeClientExecution(request);
return executeListServiceDependencies(request);
}
@SdkInternalApi
final ListServiceDependenciesResult executeListServiceDependencies(ListServiceDependenciesRequest listServiceDependenciesRequest) {
ExecutionContext executionContext = createExecutionContext(listServiceDependenciesRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListServiceDependenciesRequestProtocolMarshaller(protocolFactory).marshall(super
.beforeMarshalling(listServiceDependenciesRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Application Signals");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListServiceDependencies");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new ListServiceDependenciesResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Returns the list of dependents that invoked the specified service during the provided time range. Dependents
* include other services, CloudWatch Synthetics canaries, and clients that are instrumented with CloudWatch RUM app
* monitors.
*
*
* @param listServiceDependentsRequest
* @return Result of the ListServiceDependents operation returned by the service.
* @throws ValidationException
* The resource is not valid.
* @throws ThrottlingException
* The request was throttled because of quota limits.
* @sample AmazonApplicationSignals.ListServiceDependents
* @see AWS API Documentation
*/
@Override
public ListServiceDependentsResult listServiceDependents(ListServiceDependentsRequest request) {
request = beforeClientExecution(request);
return executeListServiceDependents(request);
}
@SdkInternalApi
final ListServiceDependentsResult executeListServiceDependents(ListServiceDependentsRequest listServiceDependentsRequest) {
ExecutionContext executionContext = createExecutionContext(listServiceDependentsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListServiceDependentsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listServiceDependentsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Application Signals");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListServiceDependents");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory
.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new ListServiceDependentsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Returns a list of SLOs created in this account.
*
*
* @param listServiceLevelObjectivesRequest
* @return Result of the ListServiceLevelObjectives operation returned by the service.
* @throws ValidationException
* The resource is not valid.
* @throws ThrottlingException
* The request was throttled because of quota limits.
* @sample AmazonApplicationSignals.ListServiceLevelObjectives
* @see AWS API Documentation
*/
@Override
public ListServiceLevelObjectivesResult listServiceLevelObjectives(ListServiceLevelObjectivesRequest request) {
request = beforeClientExecution(request);
return executeListServiceLevelObjectives(request);
}
@SdkInternalApi
final ListServiceLevelObjectivesResult executeListServiceLevelObjectives(ListServiceLevelObjectivesRequest listServiceLevelObjectivesRequest) {
ExecutionContext executionContext = createExecutionContext(listServiceLevelObjectivesRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListServiceLevelObjectivesRequestProtocolMarshaller(protocolFactory).marshall(super
.beforeMarshalling(listServiceLevelObjectivesRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Application Signals");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListServiceLevelObjectives");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new ListServiceLevelObjectivesResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Returns a list of the operations of this service that have been discovered by Application Signals. Only
* the operations that were invoked during the specified time range are returned.
*
*
* @param listServiceOperationsRequest
* @return Result of the ListServiceOperations operation returned by the service.
* @throws ValidationException
* The resource is not valid.
* @throws ThrottlingException
* The request was throttled because of quota limits.
* @sample AmazonApplicationSignals.ListServiceOperations
* @see AWS API Documentation
*/
@Override
public ListServiceOperationsResult listServiceOperations(ListServiceOperationsRequest request) {
request = beforeClientExecution(request);
return executeListServiceOperations(request);
}
@SdkInternalApi
final ListServiceOperationsResult executeListServiceOperations(ListServiceOperationsRequest listServiceOperationsRequest) {
ExecutionContext executionContext = createExecutionContext(listServiceOperationsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListServiceOperationsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listServiceOperationsRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Application Signals");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListServiceOperations");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory
.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new ListServiceOperationsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Returns a list of services that have been discovered by Application Signals. A service represents a minimum
* logical and transactional unit that completes a business function. Services are discovered through Application
* Signals instrumentation.
*
*
* @param listServicesRequest
* @return Result of the ListServices operation returned by the service.
* @throws ValidationException
* The resource is not valid.
* @throws ThrottlingException
* The request was throttled because of quota limits.
* @sample AmazonApplicationSignals.ListServices
* @see AWS API Documentation
*/
@Override
public ListServicesResult listServices(ListServicesRequest request) {
request = beforeClientExecution(request);
return executeListServices(request);
}
@SdkInternalApi
final ListServicesResult executeListServices(ListServicesRequest listServicesRequest) {
ExecutionContext executionContext = createExecutionContext(listServicesRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListServicesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listServicesRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Application Signals");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListServices");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListServicesResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Displays the tags associated with a CloudWatch resource. Tags can be assigned to service level objectives.
*
*
* @param listTagsForResourceRequest
* @return Result of the ListTagsForResource operation returned by the service.
* @throws ResourceNotFoundException
* Resource not found.
* @throws ThrottlingException
* The request was throttled because of quota limits.
* @sample AmazonApplicationSignals.ListTagsForResource
* @see AWS API Documentation
*/
@Override
public ListTagsForResourceResult listTagsForResource(ListTagsForResourceRequest request) {
request = beforeClientExecution(request);
return executeListTagsForResource(request);
}
@SdkInternalApi
final ListTagsForResourceResult executeListTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) {
ExecutionContext executionContext = createExecutionContext(listTagsForResourceRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListTagsForResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listTagsForResourceRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Application Signals");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListTagsForResource");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListTagsForResourceResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Enables this Amazon Web Services account to be able to use CloudWatch Application Signals by creating the
* AWSServiceRoleForCloudWatchApplicationSignals service-linked role. This service- linked role has the
* following permissions:
*
*
* -
*
* xray:GetServiceGraph
*
*
* -
*
* logs:StartQuery
*
*
* -
*
* logs:GetQueryResults
*
*
* -
*
* cloudwatch:GetMetricData
*
*
* -
*
* cloudwatch:ListMetrics
*
*
* -
*
* tag:GetResources
*
*
* -
*
* autoscaling:DescribeAutoScalingGroups
*
*
*
*
* After completing this step, you still need to instrument your Java and Python applications to send data to
* Application Signals. For more information, see
* Enabling Application Signals.
*
*
* @param startDiscoveryRequest
* @return Result of the StartDiscovery operation returned by the service.
* @throws ValidationException
* The resource is not valid.
* @throws ThrottlingException
* The request was throttled because of quota limits.
* @throws AccessDeniedException
* You don't have sufficient permissions to perform this action.
* @sample AmazonApplicationSignals.StartDiscovery
* @see AWS API Documentation
*/
@Override
public StartDiscoveryResult startDiscovery(StartDiscoveryRequest request) {
request = beforeClientExecution(request);
return executeStartDiscovery(request);
}
@SdkInternalApi
final StartDiscoveryResult executeStartDiscovery(StartDiscoveryRequest startDiscoveryRequest) {
ExecutionContext executionContext = createExecutionContext(startDiscoveryRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new StartDiscoveryRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(startDiscoveryRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Application Signals");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StartDiscovery");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new StartDiscoveryResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Assigns one or more tags (key-value pairs) to the specified CloudWatch resource, such as a service level
* objective.
*
*
* Tags can help you organize and categorize your resources. You can also use them to scope user permissions by
* granting a user permission to access or change only resources with certain tag values.
*
*
* Tags don't have any semantic meaning to Amazon Web Services and are interpreted strictly as strings of
* characters.
*
*
* You can use the TagResource
action with an alarm that already has tags. If you specify a new tag key
* for the alarm, this tag is appended to the list of tags associated with the alarm. If you specify a tag key that
* is already associated with the alarm, the new tag value that you specify replaces the previous value for that
* tag.
*
*
* You can associate as many as 50 tags with a CloudWatch resource.
*
*
* @param tagResourceRequest
* @return Result of the TagResource operation returned by the service.
* @throws ResourceNotFoundException
* Resource not found.
* @throws ThrottlingException
* The request was throttled because of quota limits.
* @throws ServiceQuotaExceededException
* This request exceeds a service quota.
* @sample AmazonApplicationSignals.TagResource
* @see AWS API Documentation
*/
@Override
public TagResourceResult tagResource(TagResourceRequest request) {
request = beforeClientExecution(request);
return executeTagResource(request);
}
@SdkInternalApi
final TagResourceResult executeTagResource(TagResourceRequest tagResourceRequest) {
ExecutionContext executionContext = createExecutionContext(tagResourceRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new TagResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(tagResourceRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Application Signals");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "TagResource");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new TagResourceResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Removes one or more tags from the specified resource.
*
*
* @param untagResourceRequest
* @return Result of the UntagResource operation returned by the service.
* @throws ResourceNotFoundException
* Resource not found.
* @throws ThrottlingException
* The request was throttled because of quota limits.
* @sample AmazonApplicationSignals.UntagResource
* @see AWS API Documentation
*/
@Override
public UntagResourceResult untagResource(UntagResourceRequest request) {
request = beforeClientExecution(request);
return executeUntagResource(request);
}
@SdkInternalApi
final UntagResourceResult executeUntagResource(UntagResourceRequest untagResourceRequest) {
ExecutionContext executionContext = createExecutionContext(untagResourceRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new UntagResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(untagResourceRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Application Signals");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UntagResource");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UntagResourceResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Updates an existing service level objective (SLO). If you omit parameters, the previous values of those
* parameters are retained.
*
*
* @param updateServiceLevelObjectiveRequest
* @return Result of the UpdateServiceLevelObjective operation returned by the service.
* @throws ValidationException
* The resource is not valid.
* @throws ResourceNotFoundException
* Resource not found.
* @throws ThrottlingException
* The request was throttled because of quota limits.
* @sample AmazonApplicationSignals.UpdateServiceLevelObjective
* @see AWS API Documentation
*/
@Override
public UpdateServiceLevelObjectiveResult updateServiceLevelObjective(UpdateServiceLevelObjectiveRequest request) {
request = beforeClientExecution(request);
return executeUpdateServiceLevelObjective(request);
}
@SdkInternalApi
final UpdateServiceLevelObjectiveResult executeUpdateServiceLevelObjective(UpdateServiceLevelObjectiveRequest updateServiceLevelObjectiveRequest) {
ExecutionContext executionContext = createExecutionContext(updateServiceLevelObjectiveRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new UpdateServiceLevelObjectiveRequestProtocolMarshaller(protocolFactory).marshall(super
.beforeMarshalling(updateServiceLevelObjectiveRequest));
// Binds the request metrics to the current request.
request.setAWSRequestMetrics(awsRequestMetrics);
request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Application Signals");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateServiceLevelObjective");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new UpdateServiceLevelObjectiveResultJsonUnmarshaller());
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;
}
@Override
public void shutdown() {
super.shutdown();
}
}