Inspector / Client / add_attributes_to_findings

add_attributes_to_findings#

Inspector.Client.add_attributes_to_findings(**kwargs)#

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

See also: AWS API Documentation

Request Syntax

response = client.add_attributes_to_findings(
    findingArns=[
        'string',
    ],
    attributes=[
        {
            'key': 'string',
            'value': 'string'
        },
    ]
)
Parameters:
  • findingArns (list) –

    [REQUIRED]

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

    • (string) –

  • attributes (list) –

    [REQUIRED]

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

    • (dict) –

      This data type is used as a request parameter in the AddAttributesToFindings and CreateAssessmentTemplate actions.

      • key (string) – [REQUIRED]

        The attribute key.

      • value (string) –

        The value assigned to the attribute key.

Return type:

dict

Returns:

Response Syntax

{
    'failedItems': {
        'string': {
            'failureCode': 'INVALID_ARN'|'DUPLICATE_ARN'|'ITEM_DOES_NOT_EXIST'|'ACCESS_DENIED'|'LIMIT_EXCEEDED'|'INTERNAL_ERROR',
            'retryable': True|False
        }
    }
}

Response Structure

  • (dict) –

    • failedItems (dict) –

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

      • (string) –

        • (dict) –

          Includes details about the failed items.

          • failureCode (string) –

            The status code of a failed item.

          • retryable (boolean) –

            Indicates whether you can immediately retry a request for this item for a specified resource.

Exceptions

  • Inspector.Client.exceptions.InternalException

  • Inspector.Client.exceptions.InvalidInputException

  • Inspector.Client.exceptions.AccessDeniedException

  • Inspector.Client.exceptions.NoSuchEntityException

  • Inspector.Client.exceptions.ServiceTemporarilyUnavailableException

Examples

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

response = client.add_attributes_to_findings(
    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',
    ],
)

print(response)

Expected Output:

{
    'failedItems': {
    },
    'ResponseMetadata': {
        '...': '...',
    },
}