com.amazonaws.services.inspector.AmazonInspectorClient Maven / Gradle / Ivy
Show all versions of aws-java-sdk-inspector Show documentation
/*
* 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.inspector;
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.inspector.AmazonInspectorClientBuilder;
import com.amazonaws.AmazonServiceException;
import com.amazonaws.services.inspector.model.*;
import com.amazonaws.services.inspector.model.transform.*;
/**
* Client for accessing Amazon Inspector. All service calls made using this client are blocking, and will not return
* until the service call completes.
*
* Amazon Inspector
*
* Amazon Inspector enables you to analyze the behavior of your AWS resources and to identify potential security issues.
* For more information, see Amazon Inspector User
* Guide.
*
*/
@ThreadSafe
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AmazonInspectorClient extends AmazonWebServiceClient implements AmazonInspector {
/** Provider for AWS credentials. */
private final AWSCredentialsProvider awsCredentialsProvider;
private static final Log log = LogFactory.getLog(AmazonInspector.class);
/** Default signing name for the service. */
private static final String DEFAULT_SIGNING_NAME = "inspector";
/** 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("AssessmentRunInProgressException").withExceptionUnmarshaller(
com.amazonaws.services.inspector.model.transform.AssessmentRunInProgressExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("UnsupportedFeatureException").withExceptionUnmarshaller(
com.amazonaws.services.inspector.model.transform.UnsupportedFeatureExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("LimitExceededException").withExceptionUnmarshaller(
com.amazonaws.services.inspector.model.transform.LimitExceededExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("ServiceTemporarilyUnavailableException").withExceptionUnmarshaller(
com.amazonaws.services.inspector.model.transform.ServiceTemporarilyUnavailableExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("AccessDeniedException").withExceptionUnmarshaller(
com.amazonaws.services.inspector.model.transform.AccessDeniedExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("InvalidInputException").withExceptionUnmarshaller(
com.amazonaws.services.inspector.model.transform.InvalidInputExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("NoSuchEntityException").withExceptionUnmarshaller(
com.amazonaws.services.inspector.model.transform.NoSuchEntityExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("AgentsAlreadyRunningAssessmentException").withExceptionUnmarshaller(
com.amazonaws.services.inspector.model.transform.AgentsAlreadyRunningAssessmentExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("PreviewGenerationInProgressException").withExceptionUnmarshaller(
com.amazonaws.services.inspector.model.transform.PreviewGenerationInProgressExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("InvalidCrossAccountRoleException").withExceptionUnmarshaller(
com.amazonaws.services.inspector.model.transform.InvalidCrossAccountRoleExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("InternalException").withExceptionUnmarshaller(
com.amazonaws.services.inspector.model.transform.InternalExceptionUnmarshaller.getInstance()))
.withBaseServiceExceptionClass(com.amazonaws.services.inspector.model.AmazonInspectorException.class));
/**
* Constructs a new client to invoke service methods on Amazon Inspector. A credentials provider chain will be used
* that searches for credentials in this order:
*
* - Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY
* - Java System Properties - aws.accessKeyId and aws.secretKey
* - Instance profile credentials delivered through the Amazon EC2 metadata service
*
*
*
* All service calls made using this new client object are blocking, and will not return until the service call
* completes.
*
* @see DefaultAWSCredentialsProviderChain
* @deprecated use {@link AmazonInspectorClientBuilder#defaultClient()}
*/
@Deprecated
public AmazonInspectorClient() {
this(DefaultAWSCredentialsProviderChain.getInstance(), configFactory.getConfig());
}
/**
* Constructs a new client to invoke service methods on Amazon Inspector. A credentials provider chain will be used
* that searches for credentials in this order:
*
* - Environment Variables - AWS_ACCESS_KEY_ID and AWS_SECRET_KEY
* - Java System Properties - aws.accessKeyId and aws.secretKey
* - Instance profile credentials delivered through the Amazon EC2 metadata service
*
*
*
* All service calls made using this new client object are blocking, and will not return until the service call
* completes.
*
* @param clientConfiguration
* The client configuration options controlling how this client connects to Amazon Inspector (ex: proxy
* settings, retry counts, etc.).
*
* @see DefaultAWSCredentialsProviderChain
* @deprecated use {@link AmazonInspectorClientBuilder#withClientConfiguration(ClientConfiguration)}
*/
@Deprecated
public AmazonInspectorClient(ClientConfiguration clientConfiguration) {
this(DefaultAWSCredentialsProviderChain.getInstance(), clientConfiguration);
}
/**
* Constructs a new client to invoke service methods on Amazon Inspector using the specified AWS account
* credentials.
*
*
* All service calls made using this new client object are blocking, and will not return until the service call
* completes.
*
* @param awsCredentials
* The AWS credentials (access key ID and secret key) to use when authenticating with AWS services.
* @deprecated use {@link AmazonInspectorClientBuilder#withCredentials(AWSCredentialsProvider)} for example:
* {@code AmazonInspectorClientBuilder.standard().withCredentials(new AWSStaticCredentialsProvider(awsCredentials)).build();}
*/
@Deprecated
public AmazonInspectorClient(AWSCredentials awsCredentials) {
this(awsCredentials, configFactory.getConfig());
}
/**
* Constructs a new client to invoke service methods on Amazon Inspector using the specified AWS account credentials
* and client configuration options.
*
*
* All service calls made using this new client object are blocking, and will not return until the service call
* completes.
*
* @param awsCredentials
* The AWS credentials (access key ID and secret key) to use when authenticating with AWS services.
* @param clientConfiguration
* The client configuration options controlling how this client connects to Amazon Inspector (ex: proxy
* settings, retry counts, etc.).
* @deprecated use {@link AmazonInspectorClientBuilder#withCredentials(AWSCredentialsProvider)} and
* {@link AmazonInspectorClientBuilder#withClientConfiguration(ClientConfiguration)}
*/
@Deprecated
public AmazonInspectorClient(AWSCredentials awsCredentials, ClientConfiguration clientConfiguration) {
super(clientConfiguration);
this.awsCredentialsProvider = new StaticCredentialsProvider(awsCredentials);
this.advancedConfig = AdvancedConfig.EMPTY;
init();
}
/**
* Constructs a new client to invoke service methods on Amazon Inspector using the specified AWS account credentials
* provider.
*
*
* All service calls made using this new client object are blocking, and will not return until the service call
* completes.
*
* @param awsCredentialsProvider
* The AWS credentials provider which will provide credentials to authenticate requests with AWS services.
* @deprecated use {@link AmazonInspectorClientBuilder#withCredentials(AWSCredentialsProvider)}
*/
@Deprecated
public AmazonInspectorClient(AWSCredentialsProvider awsCredentialsProvider) {
this(awsCredentialsProvider, configFactory.getConfig());
}
/**
* Constructs a new client to invoke service methods on Amazon Inspector using the specified AWS account credentials
* provider and client configuration options.
*
*
* All service calls made using this new client object are blocking, and will not return until the service call
* completes.
*
* @param awsCredentialsProvider
* The AWS credentials provider which will provide credentials to authenticate requests with AWS services.
* @param clientConfiguration
* The client configuration options controlling how this client connects to Amazon Inspector (ex: proxy
* settings, retry counts, etc.).
* @deprecated use {@link AmazonInspectorClientBuilder#withCredentials(AWSCredentialsProvider)} and
* {@link AmazonInspectorClientBuilder#withClientConfiguration(ClientConfiguration)}
*/
@Deprecated
public AmazonInspectorClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration) {
this(awsCredentialsProvider, clientConfiguration, null);
}
/**
* Constructs a new client to invoke service methods on Amazon Inspector using the specified AWS account credentials
* provider, client configuration options, and request metric collector.
*
*
* All service calls made using this new client object are blocking, and will not return until the service call
* completes.
*
* @param awsCredentialsProvider
* The AWS credentials provider which will provide credentials to authenticate requests with AWS services.
* @param clientConfiguration
* The client configuration options controlling how this client connects to Amazon Inspector (ex: proxy
* settings, retry counts, etc.).
* @param requestMetricCollector
* optional request metric collector
* @deprecated use {@link AmazonInspectorClientBuilder#withCredentials(AWSCredentialsProvider)} and
* {@link AmazonInspectorClientBuilder#withClientConfiguration(ClientConfiguration)} and
* {@link AmazonInspectorClientBuilder#withMetricsCollector(RequestMetricCollector)}
*/
@Deprecated
public AmazonInspectorClient(AWSCredentialsProvider awsCredentialsProvider, ClientConfiguration clientConfiguration,
RequestMetricCollector requestMetricCollector) {
super(clientConfiguration, requestMetricCollector);
this.awsCredentialsProvider = awsCredentialsProvider;
this.advancedConfig = AdvancedConfig.EMPTY;
init();
}
public static AmazonInspectorClientBuilder builder() {
return AmazonInspectorClientBuilder.standard();
}
/**
* Constructs a new client to invoke service methods on Amazon Inspector 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.
*/
AmazonInspectorClient(AwsSyncClientParams clientParams) {
this(clientParams, false);
}
/**
* Constructs a new client to invoke service methods on Amazon Inspector 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.
*/
AmazonInspectorClient(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("https://inspector.us-east-1.amazonaws.com");
HandlerChainFactory chainFactory = new HandlerChainFactory();
requestHandler2s.addAll(chainFactory.newRequestHandlerChain("/com/amazonaws/services/inspector/request.handlers"));
requestHandler2s.addAll(chainFactory.newRequestHandler2Chain("/com/amazonaws/services/inspector/request.handler2s"));
requestHandler2s.addAll(chainFactory.getGlobalHandlers());
}
/**
*
* Assigns attributes (key and value pairs) to the findings that are specified by the ARNs of the findings.
*
*
* @param addAttributesToFindingsRequest
* @return Result of the AddAttributesToFindings operation returned by the service.
* @throws InternalException
* Internal server error.
* @throws InvalidInputException
* The request was rejected because an invalid or out-of-range value was supplied for an input parameter.
* @throws AccessDeniedException
* You do not have required permissions to access the requested resource.
* @throws NoSuchEntityException
* The request was rejected because it referenced an entity that does not exist. The error code describes
* the entity.
* @throws ServiceTemporarilyUnavailableException
* The serice is temporary unavailable.
* @sample AmazonInspector.AddAttributesToFindings
* @see AWS API Documentation
*/
@Override
public AddAttributesToFindingsResult addAttributesToFindings(AddAttributesToFindingsRequest request) {
request = beforeClientExecution(request);
return executeAddAttributesToFindings(request);
}
@SdkInternalApi
final AddAttributesToFindingsResult executeAddAttributesToFindings(AddAttributesToFindingsRequest addAttributesToFindingsRequest) {
ExecutionContext executionContext = createExecutionContext(addAttributesToFindingsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new AddAttributesToFindingsRequestProtocolMarshaller(protocolFactory).marshall(super
.beforeMarshalling(addAttributesToFindingsRequest));
// 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, "Inspector");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AddAttributesToFindings");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new AddAttributesToFindingsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Creates a new assessment target using the ARN of the resource group that is generated by
* CreateResourceGroup. If resourceGroupArn is not specified, all EC2 instances in the current AWS account
* and region are included in the assessment target. If the service-linked role isn’t
* already registered, this action also creates and registers a service-linked role to grant Amazon Inspector access
* to AWS Services needed to perform security assessments. You can create up to 50 assessment targets per AWS
* account. You can run up to 500 concurrent agents per AWS account. For more information, see Amazon Inspector
* Assessment Targets.
*
*
* @param createAssessmentTargetRequest
* @return Result of the CreateAssessmentTarget operation returned by the service.
* @throws InternalException
* Internal server error.
* @throws InvalidInputException
* The request was rejected because an invalid or out-of-range value was supplied for an input parameter.
* @throws LimitExceededException
* The request was rejected because it attempted to create resources beyond the current AWS account limits.
* The error code describes the limit exceeded.
* @throws AccessDeniedException
* You do not have required permissions to access the requested resource.
* @throws NoSuchEntityException
* The request was rejected because it referenced an entity that does not exist. The error code describes
* the entity.
* @throws InvalidCrossAccountRoleException
* Amazon Inspector cannot assume the cross-account role that it needs to list your EC2 instances during the
* assessment run.
* @throws ServiceTemporarilyUnavailableException
* The serice is temporary unavailable.
* @sample AmazonInspector.CreateAssessmentTarget
* @see AWS API Documentation
*/
@Override
public CreateAssessmentTargetResult createAssessmentTarget(CreateAssessmentTargetRequest request) {
request = beforeClientExecution(request);
return executeCreateAssessmentTarget(request);
}
@SdkInternalApi
final CreateAssessmentTargetResult executeCreateAssessmentTarget(CreateAssessmentTargetRequest createAssessmentTargetRequest) {
ExecutionContext executionContext = createExecutionContext(createAssessmentTargetRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateAssessmentTargetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createAssessmentTargetRequest));
// 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, "Inspector");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateAssessmentTarget");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new CreateAssessmentTargetResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Creates an assessment template for the assessment target that is specified by the ARN of the assessment target.
* If the service-linked
* role isn’t already registered, this action also creates and registers a service-linked role to grant Amazon
* Inspector access to AWS Services needed to perform security assessments.
*
*
* @param createAssessmentTemplateRequest
* @return Result of the CreateAssessmentTemplate operation returned by the service.
* @throws InternalException
* Internal server error.
* @throws InvalidInputException
* The request was rejected because an invalid or out-of-range value was supplied for an input parameter.
* @throws LimitExceededException
* The request was rejected because it attempted to create resources beyond the current AWS account limits.
* The error code describes the limit exceeded.
* @throws AccessDeniedException
* You do not have required permissions to access the requested resource.
* @throws NoSuchEntityException
* The request was rejected because it referenced an entity that does not exist. The error code describes
* the entity.
* @throws ServiceTemporarilyUnavailableException
* The serice is temporary unavailable.
* @sample AmazonInspector.CreateAssessmentTemplate
* @see AWS API Documentation
*/
@Override
public CreateAssessmentTemplateResult createAssessmentTemplate(CreateAssessmentTemplateRequest request) {
request = beforeClientExecution(request);
return executeCreateAssessmentTemplate(request);
}
@SdkInternalApi
final CreateAssessmentTemplateResult executeCreateAssessmentTemplate(CreateAssessmentTemplateRequest createAssessmentTemplateRequest) {
ExecutionContext executionContext = createExecutionContext(createAssessmentTemplateRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateAssessmentTemplateRequestProtocolMarshaller(protocolFactory).marshall(super
.beforeMarshalling(createAssessmentTemplateRequest));
// 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, "Inspector");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateAssessmentTemplate");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new CreateAssessmentTemplateResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Starts the generation of an exclusions preview for the specified assessment template. The exclusions preview
* lists the potential exclusions (ExclusionPreview) that Inspector can detect before it runs the assessment.
*
*
* @param createExclusionsPreviewRequest
* @return Result of the CreateExclusionsPreview operation returned by the service.
* @throws InvalidInputException
* The request was rejected because an invalid or out-of-range value was supplied for an input parameter.
* @throws PreviewGenerationInProgressException
* The request is rejected. The specified assessment template is currently generating an exclusions preview.
* @throws InternalException
* Internal server error.
* @throws AccessDeniedException
* You do not have required permissions to access the requested resource.
* @throws NoSuchEntityException
* The request was rejected because it referenced an entity that does not exist. The error code describes
* the entity.
* @throws ServiceTemporarilyUnavailableException
* The serice is temporary unavailable.
* @sample AmazonInspector.CreateExclusionsPreview
* @see AWS API Documentation
*/
@Override
public CreateExclusionsPreviewResult createExclusionsPreview(CreateExclusionsPreviewRequest request) {
request = beforeClientExecution(request);
return executeCreateExclusionsPreview(request);
}
@SdkInternalApi
final CreateExclusionsPreviewResult executeCreateExclusionsPreview(CreateExclusionsPreviewRequest createExclusionsPreviewRequest) {
ExecutionContext executionContext = createExecutionContext(createExclusionsPreviewRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateExclusionsPreviewRequestProtocolMarshaller(protocolFactory).marshall(super
.beforeMarshalling(createExclusionsPreviewRequest));
// 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, "Inspector");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateExclusionsPreview");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new CreateExclusionsPreviewResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Creates a resource group using the specified set of tags (key and value pairs) that are used to select the EC2
* instances to be included in an Amazon Inspector assessment target. The created resource group is then used to
* create an Amazon Inspector assessment target. For more information, see CreateAssessmentTarget.
*
*
* @param createResourceGroupRequest
* @return Result of the CreateResourceGroup operation returned by the service.
* @throws InternalException
* Internal server error.
* @throws InvalidInputException
* The request was rejected because an invalid or out-of-range value was supplied for an input parameter.
* @throws LimitExceededException
* The request was rejected because it attempted to create resources beyond the current AWS account limits.
* The error code describes the limit exceeded.
* @throws AccessDeniedException
* You do not have required permissions to access the requested resource.
* @throws ServiceTemporarilyUnavailableException
* The serice is temporary unavailable.
* @sample AmazonInspector.CreateResourceGroup
* @see AWS
* API Documentation
*/
@Override
public CreateResourceGroupResult createResourceGroup(CreateResourceGroupRequest request) {
request = beforeClientExecution(request);
return executeCreateResourceGroup(request);
}
@SdkInternalApi
final CreateResourceGroupResult executeCreateResourceGroup(CreateResourceGroupRequest createResourceGroupRequest) {
ExecutionContext executionContext = createExecutionContext(createResourceGroupRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateResourceGroupRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createResourceGroupRequest));
// 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, "Inspector");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateResourceGroup");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateResourceGroupResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Deletes the assessment run that is specified by the ARN of the assessment run.
*
*
* @param deleteAssessmentRunRequest
* @return Result of the DeleteAssessmentRun operation returned by the service.
* @throws InternalException
* Internal server error.
* @throws InvalidInputException
* The request was rejected because an invalid or out-of-range value was supplied for an input parameter.
* @throws AssessmentRunInProgressException
* You cannot perform a specified action if an assessment run is currently in progress.
* @throws AccessDeniedException
* You do not have required permissions to access the requested resource.
* @throws NoSuchEntityException
* The request was rejected because it referenced an entity that does not exist. The error code describes
* the entity.
* @throws ServiceTemporarilyUnavailableException
* The serice is temporary unavailable.
* @sample AmazonInspector.DeleteAssessmentRun
* @see AWS
* API Documentation
*/
@Override
public DeleteAssessmentRunResult deleteAssessmentRun(DeleteAssessmentRunRequest request) {
request = beforeClientExecution(request);
return executeDeleteAssessmentRun(request);
}
@SdkInternalApi
final DeleteAssessmentRunResult executeDeleteAssessmentRun(DeleteAssessmentRunRequest deleteAssessmentRunRequest) {
ExecutionContext executionContext = createExecutionContext(deleteAssessmentRunRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteAssessmentRunRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteAssessmentRunRequest));
// 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, "Inspector");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteAssessmentRun");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteAssessmentRunResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Deletes the assessment target that is specified by the ARN of the assessment target.
*
*
* @param deleteAssessmentTargetRequest
* @return Result of the DeleteAssessmentTarget operation returned by the service.
* @throws InternalException
* Internal server error.
* @throws InvalidInputException
* The request was rejected because an invalid or out-of-range value was supplied for an input parameter.
* @throws AssessmentRunInProgressException
* You cannot perform a specified action if an assessment run is currently in progress.
* @throws AccessDeniedException
* You do not have required permissions to access the requested resource.
* @throws NoSuchEntityException
* The request was rejected because it referenced an entity that does not exist. The error code describes
* the entity.
* @throws ServiceTemporarilyUnavailableException
* The serice is temporary unavailable.
* @sample AmazonInspector.DeleteAssessmentTarget
* @see AWS API Documentation
*/
@Override
public DeleteAssessmentTargetResult deleteAssessmentTarget(DeleteAssessmentTargetRequest request) {
request = beforeClientExecution(request);
return executeDeleteAssessmentTarget(request);
}
@SdkInternalApi
final DeleteAssessmentTargetResult executeDeleteAssessmentTarget(DeleteAssessmentTargetRequest deleteAssessmentTargetRequest) {
ExecutionContext executionContext = createExecutionContext(deleteAssessmentTargetRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteAssessmentTargetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteAssessmentTargetRequest));
// 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, "Inspector");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteAssessmentTarget");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new DeleteAssessmentTargetResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Deletes the assessment template that is specified by the ARN of the assessment template.
*
*
* @param deleteAssessmentTemplateRequest
* @return Result of the DeleteAssessmentTemplate operation returned by the service.
* @throws InternalException
* Internal server error.
* @throws InvalidInputException
* The request was rejected because an invalid or out-of-range value was supplied for an input parameter.
* @throws AssessmentRunInProgressException
* You cannot perform a specified action if an assessment run is currently in progress.
* @throws AccessDeniedException
* You do not have required permissions to access the requested resource.
* @throws NoSuchEntityException
* The request was rejected because it referenced an entity that does not exist. The error code describes
* the entity.
* @throws ServiceTemporarilyUnavailableException
* The serice is temporary unavailable.
* @sample AmazonInspector.DeleteAssessmentTemplate
* @see AWS API Documentation
*/
@Override
public DeleteAssessmentTemplateResult deleteAssessmentTemplate(DeleteAssessmentTemplateRequest request) {
request = beforeClientExecution(request);
return executeDeleteAssessmentTemplate(request);
}
@SdkInternalApi
final DeleteAssessmentTemplateResult executeDeleteAssessmentTemplate(DeleteAssessmentTemplateRequest deleteAssessmentTemplateRequest) {
ExecutionContext executionContext = createExecutionContext(deleteAssessmentTemplateRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteAssessmentTemplateRequestProtocolMarshaller(protocolFactory).marshall(super
.beforeMarshalling(deleteAssessmentTemplateRequest));
// 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, "Inspector");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteAssessmentTemplate");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new DeleteAssessmentTemplateResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Describes the assessment runs that are specified by the ARNs of the assessment runs.
*
*
* @param describeAssessmentRunsRequest
* @return Result of the DescribeAssessmentRuns operation returned by the service.
* @throws InternalException
* Internal server error.
* @throws InvalidInputException
* The request was rejected because an invalid or out-of-range value was supplied for an input parameter.
* @sample AmazonInspector.DescribeAssessmentRuns
* @see AWS API Documentation
*/
@Override
public DescribeAssessmentRunsResult describeAssessmentRuns(DescribeAssessmentRunsRequest request) {
request = beforeClientExecution(request);
return executeDescribeAssessmentRuns(request);
}
@SdkInternalApi
final DescribeAssessmentRunsResult executeDescribeAssessmentRuns(DescribeAssessmentRunsRequest describeAssessmentRunsRequest) {
ExecutionContext executionContext = createExecutionContext(describeAssessmentRunsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DescribeAssessmentRunsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeAssessmentRunsRequest));
// 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, "Inspector");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeAssessmentRuns");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new DescribeAssessmentRunsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Describes the assessment targets that are specified by the ARNs of the assessment targets.
*
*
* @param describeAssessmentTargetsRequest
* @return Result of the DescribeAssessmentTargets operation returned by the service.
* @throws InternalException
* Internal server error.
* @throws InvalidInputException
* The request was rejected because an invalid or out-of-range value was supplied for an input parameter.
* @sample AmazonInspector.DescribeAssessmentTargets
* @see AWS API Documentation
*/
@Override
public DescribeAssessmentTargetsResult describeAssessmentTargets(DescribeAssessmentTargetsRequest request) {
request = beforeClientExecution(request);
return executeDescribeAssessmentTargets(request);
}
@SdkInternalApi
final DescribeAssessmentTargetsResult executeDescribeAssessmentTargets(DescribeAssessmentTargetsRequest describeAssessmentTargetsRequest) {
ExecutionContext executionContext = createExecutionContext(describeAssessmentTargetsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DescribeAssessmentTargetsRequestProtocolMarshaller(protocolFactory).marshall(super
.beforeMarshalling(describeAssessmentTargetsRequest));
// 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, "Inspector");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeAssessmentTargets");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new DescribeAssessmentTargetsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Describes the assessment templates that are specified by the ARNs of the assessment templates.
*
*
* @param describeAssessmentTemplatesRequest
* @return Result of the DescribeAssessmentTemplates operation returned by the service.
* @throws InternalException
* Internal server error.
* @throws InvalidInputException
* The request was rejected because an invalid or out-of-range value was supplied for an input parameter.
* @sample AmazonInspector.DescribeAssessmentTemplates
* @see AWS API Documentation
*/
@Override
public DescribeAssessmentTemplatesResult describeAssessmentTemplates(DescribeAssessmentTemplatesRequest request) {
request = beforeClientExecution(request);
return executeDescribeAssessmentTemplates(request);
}
@SdkInternalApi
final DescribeAssessmentTemplatesResult executeDescribeAssessmentTemplates(DescribeAssessmentTemplatesRequest describeAssessmentTemplatesRequest) {
ExecutionContext executionContext = createExecutionContext(describeAssessmentTemplatesRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DescribeAssessmentTemplatesRequestProtocolMarshaller(protocolFactory).marshall(super
.beforeMarshalling(describeAssessmentTemplatesRequest));
// 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, "Inspector");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeAssessmentTemplates");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new DescribeAssessmentTemplatesResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Describes the IAM role that enables Amazon Inspector to access your AWS account.
*
*
* @param describeCrossAccountAccessRoleRequest
* @return Result of the DescribeCrossAccountAccessRole operation returned by the service.
* @throws InternalException
* Internal server error.
* @sample AmazonInspector.DescribeCrossAccountAccessRole
* @see AWS API Documentation
*/
@Override
public DescribeCrossAccountAccessRoleResult describeCrossAccountAccessRole(DescribeCrossAccountAccessRoleRequest request) {
request = beforeClientExecution(request);
return executeDescribeCrossAccountAccessRole(request);
}
@SdkInternalApi
final DescribeCrossAccountAccessRoleResult executeDescribeCrossAccountAccessRole(DescribeCrossAccountAccessRoleRequest describeCrossAccountAccessRoleRequest) {
ExecutionContext executionContext = createExecutionContext(describeCrossAccountAccessRoleRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DescribeCrossAccountAccessRoleRequestProtocolMarshaller(protocolFactory).marshall(super
.beforeMarshalling(describeCrossAccountAccessRoleRequest));
// 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, "Inspector");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeCrossAccountAccessRole");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new DescribeCrossAccountAccessRoleResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Describes the exclusions that are specified by the exclusions' ARNs.
*
*
* @param describeExclusionsRequest
* @return Result of the DescribeExclusions operation returned by the service.
* @throws InternalException
* Internal server error.
* @throws InvalidInputException
* The request was rejected because an invalid or out-of-range value was supplied for an input parameter.
* @sample AmazonInspector.DescribeExclusions
* @see AWS
* API Documentation
*/
@Override
public DescribeExclusionsResult describeExclusions(DescribeExclusionsRequest request) {
request = beforeClientExecution(request);
return executeDescribeExclusions(request);
}
@SdkInternalApi
final DescribeExclusionsResult executeDescribeExclusions(DescribeExclusionsRequest describeExclusionsRequest) {
ExecutionContext executionContext = createExecutionContext(describeExclusionsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DescribeExclusionsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeExclusionsRequest));
// 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, "Inspector");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeExclusions");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeExclusionsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Describes the findings that are specified by the ARNs of the findings.
*
*
* @param describeFindingsRequest
* @return Result of the DescribeFindings operation returned by the service.
* @throws InternalException
* Internal server error.
* @throws InvalidInputException
* The request was rejected because an invalid or out-of-range value was supplied for an input parameter.
* @sample AmazonInspector.DescribeFindings
* @see AWS API
* Documentation
*/
@Override
public DescribeFindingsResult describeFindings(DescribeFindingsRequest request) {
request = beforeClientExecution(request);
return executeDescribeFindings(request);
}
@SdkInternalApi
final DescribeFindingsResult executeDescribeFindings(DescribeFindingsRequest describeFindingsRequest) {
ExecutionContext executionContext = createExecutionContext(describeFindingsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DescribeFindingsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeFindingsRequest));
// 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, "Inspector");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeFindings");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeFindingsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Describes the resource groups that are specified by the ARNs of the resource groups.
*
*
* @param describeResourceGroupsRequest
* @return Result of the DescribeResourceGroups operation returned by the service.
* @throws InternalException
* Internal server error.
* @throws InvalidInputException
* The request was rejected because an invalid or out-of-range value was supplied for an input parameter.
* @sample AmazonInspector.DescribeResourceGroups
* @see AWS API Documentation
*/
@Override
public DescribeResourceGroupsResult describeResourceGroups(DescribeResourceGroupsRequest request) {
request = beforeClientExecution(request);
return executeDescribeResourceGroups(request);
}
@SdkInternalApi
final DescribeResourceGroupsResult executeDescribeResourceGroups(DescribeResourceGroupsRequest describeResourceGroupsRequest) {
ExecutionContext executionContext = createExecutionContext(describeResourceGroupsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DescribeResourceGroupsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeResourceGroupsRequest));
// 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, "Inspector");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeResourceGroups");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new DescribeResourceGroupsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Describes the rules packages that are specified by the ARNs of the rules packages.
*
*
* @param describeRulesPackagesRequest
* @return Result of the DescribeRulesPackages operation returned by the service.
* @throws InternalException
* Internal server error.
* @throws InvalidInputException
* The request was rejected because an invalid or out-of-range value was supplied for an input parameter.
* @sample AmazonInspector.DescribeRulesPackages
* @see AWS API Documentation
*/
@Override
public DescribeRulesPackagesResult describeRulesPackages(DescribeRulesPackagesRequest request) {
request = beforeClientExecution(request);
return executeDescribeRulesPackages(request);
}
@SdkInternalApi
final DescribeRulesPackagesResult executeDescribeRulesPackages(DescribeRulesPackagesRequest describeRulesPackagesRequest) {
ExecutionContext executionContext = createExecutionContext(describeRulesPackagesRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DescribeRulesPackagesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeRulesPackagesRequest));
// 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, "Inspector");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeRulesPackages");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory
.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new DescribeRulesPackagesResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Produces an assessment report that includes detailed and comprehensive results of a specified assessment run.
*
*
* @param getAssessmentReportRequest
* @return Result of the GetAssessmentReport operation returned by the service.
* @throws InternalException
* Internal server error.
* @throws InvalidInputException
* The request was rejected because an invalid or out-of-range value was supplied for an input parameter.
* @throws AccessDeniedException
* You do not have required permissions to access the requested resource.
* @throws NoSuchEntityException
* The request was rejected because it referenced an entity that does not exist. The error code describes
* the entity.
* @throws AssessmentRunInProgressException
* You cannot perform a specified action if an assessment run is currently in progress.
* @throws UnsupportedFeatureException
* Used by the GetAssessmentReport API. The request was rejected because you tried to generate a
* report for an assessment run that existed before reporting was supported in Amazon Inspector. You can
* only generate reports for assessment runs that took place or will take place after generating reports in
* Amazon Inspector became available.
* @throws ServiceTemporarilyUnavailableException
* The serice is temporary unavailable.
* @sample AmazonInspector.GetAssessmentReport
* @see AWS
* API Documentation
*/
@Override
public GetAssessmentReportResult getAssessmentReport(GetAssessmentReportRequest request) {
request = beforeClientExecution(request);
return executeGetAssessmentReport(request);
}
@SdkInternalApi
final GetAssessmentReportResult executeGetAssessmentReport(GetAssessmentReportRequest getAssessmentReportRequest) {
ExecutionContext executionContext = createExecutionContext(getAssessmentReportRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new GetAssessmentReportRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getAssessmentReportRequest));
// 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, "Inspector");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetAssessmentReport");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetAssessmentReportResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Retrieves the exclusions preview (a list of ExclusionPreview objects) specified by the preview token. You can
* obtain the preview token by running the CreateExclusionsPreview API.
*
*
* @param getExclusionsPreviewRequest
* @return Result of the GetExclusionsPreview operation returned by the service.
* @throws InvalidInputException
* The request was rejected because an invalid or out-of-range value was supplied for an input parameter.
* @throws InternalException
* Internal server error.
* @throws AccessDeniedException
* You do not have required permissions to access the requested resource.
* @throws NoSuchEntityException
* The request was rejected because it referenced an entity that does not exist. The error code describes
* the entity.
* @sample AmazonInspector.GetExclusionsPreview
* @see AWS
* API Documentation
*/
@Override
public GetExclusionsPreviewResult getExclusionsPreview(GetExclusionsPreviewRequest request) {
request = beforeClientExecution(request);
return executeGetExclusionsPreview(request);
}
@SdkInternalApi
final GetExclusionsPreviewResult executeGetExclusionsPreview(GetExclusionsPreviewRequest getExclusionsPreviewRequest) {
ExecutionContext executionContext = createExecutionContext(getExclusionsPreviewRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new GetExclusionsPreviewRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getExclusionsPreviewRequest));
// 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, "Inspector");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetExclusionsPreview");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetExclusionsPreviewResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Information about the data that is collected for the specified assessment run.
*
*
* @param getTelemetryMetadataRequest
* @return Result of the GetTelemetryMetadata operation returned by the service.
* @throws InternalException
* Internal server error.
* @throws InvalidInputException
* The request was rejected because an invalid or out-of-range value was supplied for an input parameter.
* @throws AccessDeniedException
* You do not have required permissions to access the requested resource.
* @throws NoSuchEntityException
* The request was rejected because it referenced an entity that does not exist. The error code describes
* the entity.
* @sample AmazonInspector.GetTelemetryMetadata
* @see AWS
* API Documentation
*/
@Override
public GetTelemetryMetadataResult getTelemetryMetadata(GetTelemetryMetadataRequest request) {
request = beforeClientExecution(request);
return executeGetTelemetryMetadata(request);
}
@SdkInternalApi
final GetTelemetryMetadataResult executeGetTelemetryMetadata(GetTelemetryMetadataRequest getTelemetryMetadataRequest) {
ExecutionContext executionContext = createExecutionContext(getTelemetryMetadataRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new GetTelemetryMetadataRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getTelemetryMetadataRequest));
// 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, "Inspector");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetTelemetryMetadata");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetTelemetryMetadataResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Lists the agents of the assessment runs that are specified by the ARNs of the assessment runs.
*
*
* @param listAssessmentRunAgentsRequest
* @return Result of the ListAssessmentRunAgents operation returned by the service.
* @throws InternalException
* Internal server error.
* @throws InvalidInputException
* The request was rejected because an invalid or out-of-range value was supplied for an input parameter.
* @throws AccessDeniedException
* You do not have required permissions to access the requested resource.
* @throws NoSuchEntityException
* The request was rejected because it referenced an entity that does not exist. The error code describes
* the entity.
* @sample AmazonInspector.ListAssessmentRunAgents
* @see AWS API Documentation
*/
@Override
public ListAssessmentRunAgentsResult listAssessmentRunAgents(ListAssessmentRunAgentsRequest request) {
request = beforeClientExecution(request);
return executeListAssessmentRunAgents(request);
}
@SdkInternalApi
final ListAssessmentRunAgentsResult executeListAssessmentRunAgents(ListAssessmentRunAgentsRequest listAssessmentRunAgentsRequest) {
ExecutionContext executionContext = createExecutionContext(listAssessmentRunAgentsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListAssessmentRunAgentsRequestProtocolMarshaller(protocolFactory).marshall(super
.beforeMarshalling(listAssessmentRunAgentsRequest));
// 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, "Inspector");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListAssessmentRunAgents");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new ListAssessmentRunAgentsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Lists the assessment runs that correspond to the assessment templates that are specified by the ARNs of the
* assessment templates.
*
*
* @param listAssessmentRunsRequest
* @return Result of the ListAssessmentRuns operation returned by the service.
* @throws InternalException
* Internal server error.
* @throws InvalidInputException
* The request was rejected because an invalid or out-of-range value was supplied for an input parameter.
* @throws AccessDeniedException
* You do not have required permissions to access the requested resource.
* @throws NoSuchEntityException
* The request was rejected because it referenced an entity that does not exist. The error code describes
* the entity.
* @sample AmazonInspector.ListAssessmentRuns
* @see AWS
* API Documentation
*/
@Override
public ListAssessmentRunsResult listAssessmentRuns(ListAssessmentRunsRequest request) {
request = beforeClientExecution(request);
return executeListAssessmentRuns(request);
}
@SdkInternalApi
final ListAssessmentRunsResult executeListAssessmentRuns(ListAssessmentRunsRequest listAssessmentRunsRequest) {
ExecutionContext executionContext = createExecutionContext(listAssessmentRunsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListAssessmentRunsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listAssessmentRunsRequest));
// 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, "Inspector");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListAssessmentRuns");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListAssessmentRunsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Lists the ARNs of the assessment targets within this AWS account. For more information about assessment targets,
* see Amazon Inspector
* Assessment Targets.
*
*
* @param listAssessmentTargetsRequest
* @return Result of the ListAssessmentTargets operation returned by the service.
* @throws InternalException
* Internal server error.
* @throws InvalidInputException
* The request was rejected because an invalid or out-of-range value was supplied for an input parameter.
* @throws AccessDeniedException
* You do not have required permissions to access the requested resource.
* @sample AmazonInspector.ListAssessmentTargets
* @see AWS API Documentation
*/
@Override
public ListAssessmentTargetsResult listAssessmentTargets(ListAssessmentTargetsRequest request) {
request = beforeClientExecution(request);
return executeListAssessmentTargets(request);
}
@SdkInternalApi
final ListAssessmentTargetsResult executeListAssessmentTargets(ListAssessmentTargetsRequest listAssessmentTargetsRequest) {
ExecutionContext executionContext = createExecutionContext(listAssessmentTargetsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListAssessmentTargetsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listAssessmentTargetsRequest));
// 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, "Inspector");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListAssessmentTargets");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory
.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new ListAssessmentTargetsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Lists the assessment templates that correspond to the assessment targets that are specified by the ARNs of the
* assessment targets.
*
*
* @param listAssessmentTemplatesRequest
* @return Result of the ListAssessmentTemplates operation returned by the service.
* @throws InternalException
* Internal server error.
* @throws InvalidInputException
* The request was rejected because an invalid or out-of-range value was supplied for an input parameter.
* @throws AccessDeniedException
* You do not have required permissions to access the requested resource.
* @throws NoSuchEntityException
* The request was rejected because it referenced an entity that does not exist. The error code describes
* the entity.
* @sample AmazonInspector.ListAssessmentTemplates
* @see AWS API Documentation
*/
@Override
public ListAssessmentTemplatesResult listAssessmentTemplates(ListAssessmentTemplatesRequest request) {
request = beforeClientExecution(request);
return executeListAssessmentTemplates(request);
}
@SdkInternalApi
final ListAssessmentTemplatesResult executeListAssessmentTemplates(ListAssessmentTemplatesRequest listAssessmentTemplatesRequest) {
ExecutionContext executionContext = createExecutionContext(listAssessmentTemplatesRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListAssessmentTemplatesRequestProtocolMarshaller(protocolFactory).marshall(super
.beforeMarshalling(listAssessmentTemplatesRequest));
// 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, "Inspector");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListAssessmentTemplates");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new ListAssessmentTemplatesResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Lists all the event subscriptions for the assessment template that is specified by the ARN of the assessment
* template. For more information, see SubscribeToEvent and UnsubscribeFromEvent.
*
*
* @param listEventSubscriptionsRequest
* @return Result of the ListEventSubscriptions operation returned by the service.
* @throws InternalException
* Internal server error.
* @throws InvalidInputException
* The request was rejected because an invalid or out-of-range value was supplied for an input parameter.
* @throws AccessDeniedException
* You do not have required permissions to access the requested resource.
* @throws NoSuchEntityException
* The request was rejected because it referenced an entity that does not exist. The error code describes
* the entity.
* @sample AmazonInspector.ListEventSubscriptions
* @see AWS API Documentation
*/
@Override
public ListEventSubscriptionsResult listEventSubscriptions(ListEventSubscriptionsRequest request) {
request = beforeClientExecution(request);
return executeListEventSubscriptions(request);
}
@SdkInternalApi
final ListEventSubscriptionsResult executeListEventSubscriptions(ListEventSubscriptionsRequest listEventSubscriptionsRequest) {
ExecutionContext executionContext = createExecutionContext(listEventSubscriptionsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListEventSubscriptionsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listEventSubscriptionsRequest));
// 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, "Inspector");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListEventSubscriptions");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new ListEventSubscriptionsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* List exclusions that are generated by the assessment run.
*
*
* @param listExclusionsRequest
* @return Result of the ListExclusions operation returned by the service.
* @throws InternalException
* Internal server error.
* @throws InvalidInputException
* The request was rejected because an invalid or out-of-range value was supplied for an input parameter.
* @throws AccessDeniedException
* You do not have required permissions to access the requested resource.
* @throws NoSuchEntityException
* The request was rejected because it referenced an entity that does not exist. The error code describes
* the entity.
* @sample AmazonInspector.ListExclusions
* @see AWS API
* Documentation
*/
@Override
public ListExclusionsResult listExclusions(ListExclusionsRequest request) {
request = beforeClientExecution(request);
return executeListExclusions(request);
}
@SdkInternalApi
final ListExclusionsResult executeListExclusions(ListExclusionsRequest listExclusionsRequest) {
ExecutionContext executionContext = createExecutionContext(listExclusionsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListExclusionsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listExclusionsRequest));
// 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, "Inspector");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListExclusions");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListExclusionsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Lists findings that are generated by the assessment runs that are specified by the ARNs of the assessment runs.
*
*
* @param listFindingsRequest
* @return Result of the ListFindings operation returned by the service.
* @throws InternalException
* Internal server error.
* @throws InvalidInputException
* The request was rejected because an invalid or out-of-range value was supplied for an input parameter.
* @throws AccessDeniedException
* You do not have required permissions to access the requested resource.
* @throws NoSuchEntityException
* The request was rejected because it referenced an entity that does not exist. The error code describes
* the entity.
* @sample AmazonInspector.ListFindings
* @see AWS API
* Documentation
*/
@Override
public ListFindingsResult listFindings(ListFindingsRequest request) {
request = beforeClientExecution(request);
return executeListFindings(request);
}
@SdkInternalApi
final ListFindingsResult executeListFindings(ListFindingsRequest listFindingsRequest) {
ExecutionContext executionContext = createExecutionContext(listFindingsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListFindingsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listFindingsRequest));
// 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, "Inspector");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListFindings");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListFindingsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Lists all available Amazon Inspector rules packages.
*
*
* @param listRulesPackagesRequest
* @return Result of the ListRulesPackages operation returned by the service.
* @throws InternalException
* Internal server error.
* @throws InvalidInputException
* The request was rejected because an invalid or out-of-range value was supplied for an input parameter.
* @throws AccessDeniedException
* You do not have required permissions to access the requested resource.
* @sample AmazonInspector.ListRulesPackages
* @see AWS
* API Documentation
*/
@Override
public ListRulesPackagesResult listRulesPackages(ListRulesPackagesRequest request) {
request = beforeClientExecution(request);
return executeListRulesPackages(request);
}
@SdkInternalApi
final ListRulesPackagesResult executeListRulesPackages(ListRulesPackagesRequest listRulesPackagesRequest) {
ExecutionContext executionContext = createExecutionContext(listRulesPackagesRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListRulesPackagesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listRulesPackagesRequest));
// 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, "Inspector");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListRulesPackages");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListRulesPackagesResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Lists all tags associated with an assessment template.
*
*
* @param listTagsForResourceRequest
* @return Result of the ListTagsForResource operation returned by the service.
* @throws InternalException
* Internal server error.
* @throws InvalidInputException
* The request was rejected because an invalid or out-of-range value was supplied for an input parameter.
* @throws AccessDeniedException
* You do not have required permissions to access the requested resource.
* @throws NoSuchEntityException
* The request was rejected because it referenced an entity that does not exist. The error code describes
* the entity.
* @sample AmazonInspector.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, "Inspector");
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);
}
}
/**
*
* Previews the agents installed on the EC2 instances that are part of the specified assessment target.
*
*
* @param previewAgentsRequest
* @return Result of the PreviewAgents operation returned by the service.
* @throws InternalException
* Internal server error.
* @throws InvalidInputException
* The request was rejected because an invalid or out-of-range value was supplied for an input parameter.
* @throws AccessDeniedException
* You do not have required permissions to access the requested resource.
* @throws NoSuchEntityException
* The request was rejected because it referenced an entity that does not exist. The error code describes
* the entity.
* @throws InvalidCrossAccountRoleException
* Amazon Inspector cannot assume the cross-account role that it needs to list your EC2 instances during the
* assessment run.
* @sample AmazonInspector.PreviewAgents
* @see AWS API
* Documentation
*/
@Override
public PreviewAgentsResult previewAgents(PreviewAgentsRequest request) {
request = beforeClientExecution(request);
return executePreviewAgents(request);
}
@SdkInternalApi
final PreviewAgentsResult executePreviewAgents(PreviewAgentsRequest previewAgentsRequest) {
ExecutionContext executionContext = createExecutionContext(previewAgentsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new PreviewAgentsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(previewAgentsRequest));
// 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, "Inspector");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PreviewAgents");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new PreviewAgentsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Registers the IAM role that grants Amazon Inspector access to AWS Services needed to perform security
* assessments.
*
*
* @param registerCrossAccountAccessRoleRequest
* @return Result of the RegisterCrossAccountAccessRole operation returned by the service.
* @throws InternalException
* Internal server error.
* @throws InvalidInputException
* The request was rejected because an invalid or out-of-range value was supplied for an input parameter.
* @throws AccessDeniedException
* You do not have required permissions to access the requested resource.
* @throws InvalidCrossAccountRoleException
* Amazon Inspector cannot assume the cross-account role that it needs to list your EC2 instances during the
* assessment run.
* @throws ServiceTemporarilyUnavailableException
* The serice is temporary unavailable.
* @sample AmazonInspector.RegisterCrossAccountAccessRole
* @see AWS API Documentation
*/
@Override
public RegisterCrossAccountAccessRoleResult registerCrossAccountAccessRole(RegisterCrossAccountAccessRoleRequest request) {
request = beforeClientExecution(request);
return executeRegisterCrossAccountAccessRole(request);
}
@SdkInternalApi
final RegisterCrossAccountAccessRoleResult executeRegisterCrossAccountAccessRole(RegisterCrossAccountAccessRoleRequest registerCrossAccountAccessRoleRequest) {
ExecutionContext executionContext = createExecutionContext(registerCrossAccountAccessRoleRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new RegisterCrossAccountAccessRoleRequestProtocolMarshaller(protocolFactory).marshall(super
.beforeMarshalling(registerCrossAccountAccessRoleRequest));
// 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, "Inspector");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "RegisterCrossAccountAccessRole");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new RegisterCrossAccountAccessRoleResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Removes entire attributes (key and value pairs) from the findings that are specified by the ARNs of the findings
* where an attribute with the specified key exists.
*
*
* @param removeAttributesFromFindingsRequest
* @return Result of the RemoveAttributesFromFindings operation returned by the service.
* @throws InternalException
* Internal server error.
* @throws InvalidInputException
* The request was rejected because an invalid or out-of-range value was supplied for an input parameter.
* @throws AccessDeniedException
* You do not have required permissions to access the requested resource.
* @throws NoSuchEntityException
* The request was rejected because it referenced an entity that does not exist. The error code describes
* the entity.
* @throws ServiceTemporarilyUnavailableException
* The serice is temporary unavailable.
* @sample AmazonInspector.RemoveAttributesFromFindings
* @see AWS API Documentation
*/
@Override
public RemoveAttributesFromFindingsResult removeAttributesFromFindings(RemoveAttributesFromFindingsRequest request) {
request = beforeClientExecution(request);
return executeRemoveAttributesFromFindings(request);
}
@SdkInternalApi
final RemoveAttributesFromFindingsResult executeRemoveAttributesFromFindings(RemoveAttributesFromFindingsRequest removeAttributesFromFindingsRequest) {
ExecutionContext executionContext = createExecutionContext(removeAttributesFromFindingsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new RemoveAttributesFromFindingsRequestProtocolMarshaller(protocolFactory).marshall(super
.beforeMarshalling(removeAttributesFromFindingsRequest));
// 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, "Inspector");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "RemoveAttributesFromFindings");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new RemoveAttributesFromFindingsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Sets tags (key and value pairs) to the assessment template that is specified by the ARN of the assessment
* template.
*
*
* @param setTagsForResourceRequest
* @return Result of the SetTagsForResource operation returned by the service.
* @throws InternalException
* Internal server error.
* @throws InvalidInputException
* The request was rejected because an invalid or out-of-range value was supplied for an input parameter.
* @throws AccessDeniedException
* You do not have required permissions to access the requested resource.
* @throws NoSuchEntityException
* The request was rejected because it referenced an entity that does not exist. The error code describes
* the entity.
* @throws ServiceTemporarilyUnavailableException
* The serice is temporary unavailable.
* @sample AmazonInspector.SetTagsForResource
* @see AWS
* API Documentation
*/
@Override
public SetTagsForResourceResult setTagsForResource(SetTagsForResourceRequest request) {
request = beforeClientExecution(request);
return executeSetTagsForResource(request);
}
@SdkInternalApi
final SetTagsForResourceResult executeSetTagsForResource(SetTagsForResourceRequest setTagsForResourceRequest) {
ExecutionContext executionContext = createExecutionContext(setTagsForResourceRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new SetTagsForResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(setTagsForResourceRequest));
// 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, "Inspector");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "SetTagsForResource");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new SetTagsForResourceResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Starts the assessment run specified by the ARN of the assessment template. For this API to function properly, you
* must not exceed the limit of running up to 500 concurrent agents per AWS account.
*
*
* @param startAssessmentRunRequest
* @return Result of the StartAssessmentRun operation returned by the service.
* @throws InternalException
* Internal server error.
* @throws InvalidInputException
* The request was rejected because an invalid or out-of-range value was supplied for an input parameter.
* @throws LimitExceededException
* The request was rejected because it attempted to create resources beyond the current AWS account limits.
* The error code describes the limit exceeded.
* @throws AccessDeniedException
* You do not have required permissions to access the requested resource.
* @throws NoSuchEntityException
* The request was rejected because it referenced an entity that does not exist. The error code describes
* the entity.
* @throws InvalidCrossAccountRoleException
* Amazon Inspector cannot assume the cross-account role that it needs to list your EC2 instances during the
* assessment run.
* @throws AgentsAlreadyRunningAssessmentException
* You started an assessment run, but one of the instances is already participating in another assessment
* run.
* @throws ServiceTemporarilyUnavailableException
* The serice is temporary unavailable.
* @sample AmazonInspector.StartAssessmentRun
* @see AWS
* API Documentation
*/
@Override
public StartAssessmentRunResult startAssessmentRun(StartAssessmentRunRequest request) {
request = beforeClientExecution(request);
return executeStartAssessmentRun(request);
}
@SdkInternalApi
final StartAssessmentRunResult executeStartAssessmentRun(StartAssessmentRunRequest startAssessmentRunRequest) {
ExecutionContext executionContext = createExecutionContext(startAssessmentRunRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new StartAssessmentRunRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(startAssessmentRunRequest));
// 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, "Inspector");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StartAssessmentRun");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new StartAssessmentRunResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Stops the assessment run that is specified by the ARN of the assessment run.
*
*
* @param stopAssessmentRunRequest
* @return Result of the StopAssessmentRun operation returned by the service.
* @throws InternalException
* Internal server error.
* @throws InvalidInputException
* The request was rejected because an invalid or out-of-range value was supplied for an input parameter.
* @throws AccessDeniedException
* You do not have required permissions to access the requested resource.
* @throws NoSuchEntityException
* The request was rejected because it referenced an entity that does not exist. The error code describes
* the entity.
* @throws ServiceTemporarilyUnavailableException
* The serice is temporary unavailable.
* @sample AmazonInspector.StopAssessmentRun
* @see AWS
* API Documentation
*/
@Override
public StopAssessmentRunResult stopAssessmentRun(StopAssessmentRunRequest request) {
request = beforeClientExecution(request);
return executeStopAssessmentRun(request);
}
@SdkInternalApi
final StopAssessmentRunResult executeStopAssessmentRun(StopAssessmentRunRequest stopAssessmentRunRequest) {
ExecutionContext executionContext = createExecutionContext(stopAssessmentRunRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new StopAssessmentRunRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(stopAssessmentRunRequest));
// 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, "Inspector");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StopAssessmentRun");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new StopAssessmentRunResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Enables the process of sending Amazon Simple Notification Service (SNS) notifications about a specified event to
* a specified SNS topic.
*
*
* @param subscribeToEventRequest
* @return Result of the SubscribeToEvent operation returned by the service.
* @throws InternalException
* Internal server error.
* @throws InvalidInputException
* The request was rejected because an invalid or out-of-range value was supplied for an input parameter.
* @throws LimitExceededException
* The request was rejected because it attempted to create resources beyond the current AWS account limits.
* The error code describes the limit exceeded.
* @throws AccessDeniedException
* You do not have required permissions to access the requested resource.
* @throws NoSuchEntityException
* The request was rejected because it referenced an entity that does not exist. The error code describes
* the entity.
* @throws ServiceTemporarilyUnavailableException
* The serice is temporary unavailable.
* @sample AmazonInspector.SubscribeToEvent
* @see AWS API
* Documentation
*/
@Override
public SubscribeToEventResult subscribeToEvent(SubscribeToEventRequest request) {
request = beforeClientExecution(request);
return executeSubscribeToEvent(request);
}
@SdkInternalApi
final SubscribeToEventResult executeSubscribeToEvent(SubscribeToEventRequest subscribeToEventRequest) {
ExecutionContext executionContext = createExecutionContext(subscribeToEventRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new SubscribeToEventRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(subscribeToEventRequest));
// 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, "Inspector");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "SubscribeToEvent");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new SubscribeToEventResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Disables the process of sending Amazon Simple Notification Service (SNS) notifications about a specified event to
* a specified SNS topic.
*
*
* @param unsubscribeFromEventRequest
* @return Result of the UnsubscribeFromEvent operation returned by the service.
* @throws InternalException
* Internal server error.
* @throws InvalidInputException
* The request was rejected because an invalid or out-of-range value was supplied for an input parameter.
* @throws AccessDeniedException
* You do not have required permissions to access the requested resource.
* @throws NoSuchEntityException
* The request was rejected because it referenced an entity that does not exist. The error code describes
* the entity.
* @throws ServiceTemporarilyUnavailableException
* The serice is temporary unavailable.
* @sample AmazonInspector.UnsubscribeFromEvent
* @see AWS
* API Documentation
*/
@Override
public UnsubscribeFromEventResult unsubscribeFromEvent(UnsubscribeFromEventRequest request) {
request = beforeClientExecution(request);
return executeUnsubscribeFromEvent(request);
}
@SdkInternalApi
final UnsubscribeFromEventResult executeUnsubscribeFromEvent(UnsubscribeFromEventRequest unsubscribeFromEventRequest) {
ExecutionContext executionContext = createExecutionContext(unsubscribeFromEventRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new UnsubscribeFromEventRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(unsubscribeFromEventRequest));
// 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, "Inspector");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UnsubscribeFromEvent");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UnsubscribeFromEventResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Updates the assessment target that is specified by the ARN of the assessment target.
*
*
* If resourceGroupArn is not specified, all EC2 instances in the current AWS account and region are included in the
* assessment target.
*
*
* @param updateAssessmentTargetRequest
* @return Result of the UpdateAssessmentTarget operation returned by the service.
* @throws InternalException
* Internal server error.
* @throws InvalidInputException
* The request was rejected because an invalid or out-of-range value was supplied for an input parameter.
* @throws AccessDeniedException
* You do not have required permissions to access the requested resource.
* @throws NoSuchEntityException
* The request was rejected because it referenced an entity that does not exist. The error code describes
* the entity.
* @throws ServiceTemporarilyUnavailableException
* The serice is temporary unavailable.
* @sample AmazonInspector.UpdateAssessmentTarget
* @see AWS API Documentation
*/
@Override
public UpdateAssessmentTargetResult updateAssessmentTarget(UpdateAssessmentTargetRequest request) {
request = beforeClientExecution(request);
return executeUpdateAssessmentTarget(request);
}
@SdkInternalApi
final UpdateAssessmentTargetResult executeUpdateAssessmentTarget(UpdateAssessmentTargetRequest updateAssessmentTargetRequest) {
ExecutionContext executionContext = createExecutionContext(updateAssessmentTargetRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new UpdateAssessmentTargetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateAssessmentTargetRequest));
// 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, "Inspector");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateAssessmentTarget");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new UpdateAssessmentTargetResultJsonUnmarshaller());
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();
}
}