Menu
Amazon Inspector
API Reference (API Version 2016-02-16)

PreviewAgents

Previews the agents installed on the EC2 instances that are part of the specified assessment target.

Request Syntax

{
   "maxResults": number,
   "nextToken": "string",
   "previewAgentsArn": "string"
}

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

maxResults

You can use this parameter to indicate the maximum number of items you want in the response. The default value is 10. The maximum value is 500.

Type: Integer

Required: No

nextToken

You can use this parameter when paginating results. Set the value of this parameter to null on your first call to the PreviewAgents action. Subsequent calls to the action fill nextToken in the request with the value of NextToken from the previous response to continue listing data.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 300.

Required: No

previewAgentsArn

The ARN of the assessment target whose agents you want to preview.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 300.

Required: Yes

Response Syntax

{
   "agentPreviews": [ 
      { 
         "agentId": "string",
         "autoScalingGroup": "string"
      }
   ],
   "nextToken": "string"
}

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

agentPreviews

The resulting list of agents.

Type: Array of AgentPreview objects

Array Members: Minimum number of 0 items. Maximum number of 100 items.

nextToken

When a response is generated, if there is more data to be listed, this parameter is present in the response and contains the value to use for the nextToken parameter in a subsequent pagination request. If there is no more data to be listed, this parameter is set to null.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 300.

Errors

For information about the errors that are common to all actions, see Common Errors.

AccessDeniedException

You do not have required permissions to access the requested resource.

HTTP Status Code: 400

InternalException

Internal server error.

HTTP Status Code: 500

InvalidCrossAccountRoleException

Amazon Inspector cannot assume the cross-account role that it needs to list your EC2 instances during the assessment run.

HTTP Status Code: 400

InvalidInputException

The request was rejected because an invalid or out-of-range value was supplied for an input parameter.

HTTP Status Code: 400

NoSuchEntityException

The request was rejected because it referenced an entity that does not exist. The error code describes the entity.

HTTP Status Code: 400

Example

Sample Request


               
                  POST / HTTP/1.1
                  Host: inspector.us-west-2.amazonaws.com
                  Accept-Encoding: identity
                  Content-Length: 82
                  X-Amz-Target: InspectorService.PreviewAgents
                  X-Amz-Date: 20160329T224634Z
                  User-Agent: aws-cli/1.10.12 Python/2.7.9 Windows/7 botocore/1.4.3
                  Content-Type: application/x-amz-json-1.1
                  Authorization: AUTHPARAMS
                  {
                    "previewAgentsArn": "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq"
                  }
               
            

Sample Response


               
                  HTTP/1.1 200 OK
                  x-amzn-RequestId: 176c8915-f600-11e5-ac8a-bb6015f4022c
                  Content-Type: application/x-amz-json-1.1
                  Content-Length: 44
                  Date: Tue, 29 Mar 2016 22:46:36 GMT
                  {
                    "agentPreviews": [
                      {
                        "agentId": "i-49113b93"
                      }
                    ]
                  }
               
            

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: