AddAttributesToFindings - Amazon Inspector Classic

AddAttributesToFindings

Assigns attributes (key and value pairs) to the findings that are specified by the ARNs of the findings.

Request Syntax

{ "attributes": [ { "key": "string", "value": "string" } ], "findingArns": [ "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.

attributes

The array of attributes that you want to assign to specified findings.

Type: Array of Attribute objects

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

Required: Yes

findingArns

The ARNs that specify the findings that you want to assign attributes to.

Type: Array of strings

Array Members: Minimum number of 1 item. Maximum number of 10 items.

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

Required: Yes

Response Syntax

{ "failedItems": { "string" : { "failureCode": "string", "retryable": boolean } } }

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.

failedItems

Attribute details that cannot be described. An error code is provided for each failed item.

Type: String to FailedItemDetails object map

Key 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.

InternalException

Internal server error.

HTTP Status Code: 500

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

ServiceTemporarilyUnavailableException

The serice is temporary unavailable.

HTTP Status Code: 400

Examples

Example

This example illustrates one usage of AddAttributesToFindings.

Sample Request

POST / HTTP/1.1 Host: inspector.us-west-2.amazonaws.com Accept-Encoding: identity Content-Length: 189 X-Amz-Target: InspectorService.AddAttributesToFindings X-Amz-Date: 20160329T233810Z 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 { "attributes": [ { "key": "Example", "value": "example" } ], "findingArns": [ "arn:aws:inspector:us-west-2:123456789012:target/0-0kFIPusq/template/0-8l1VIE0D/run/0-Z02cjjug/finding/0-T8yM9mEU" ] }

Sample Response

HTTP/1.1 200 OK x-amzn-RequestId: 4c8b9c50-f607-11e5-9380-d76f0924b6d7 Content-Type: application/x-amz-json-1.1 Content-Length: 18 Date: Tue, 29 Mar 2016 23:38:11 GMT { "failedItems": {} }

See Also

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