CodeStarNotifications / Client / list_targets

list_targets#

CodeStarNotifications.Client.list_targets(**kwargs)#

Returns a list of the notification rule targets for an Amazon Web Services account.

See also: AWS API Documentation

Request Syntax

response = client.list_targets(
    Filters=[
        {
            'Name': 'TARGET_TYPE'|'TARGET_ADDRESS'|'TARGET_STATUS',
            'Value': 'string'
        },
    ],
    NextToken='string',
    MaxResults=123
)
Parameters:
  • Filters (list) –

    The filters to use to return information by service or resource type. Valid filters include target type, target address, and target status.

    Note

    A filter with the same name can appear more than once when used with OR statements. Filters with different names should be applied with AND statements.

    • (dict) –

      Information about a filter to apply to the list of returned targets. You can filter by target type, address, or status. For example, to filter results to notification rules that have active Chatbot topics as targets, you could specify a ListTargetsFilter Name as TargetType and a Value of SNS, and a Name of TARGET_STATUS and a Value of ACTIVE.

      • Name (string) – [REQUIRED]

        The name of the attribute you want to use to filter the returned targets.

      • Value (string) – [REQUIRED]

        The value of the attribute you want to use to filter the returned targets. For example, if you specify SNS for the Target type, you could specify an Amazon Resource Name (ARN) for a topic as the value.

  • NextToken (string) – An enumeration token that, when provided in a request, returns the next batch of the results.

  • MaxResults (integer) – A non-negative integer used to limit the number of returned results. The maximum number of results that can be returned is 100.

Return type:

dict

Returns:

Response Syntax

{
    'Targets': [
        {
            'TargetAddress': 'string',
            'TargetType': 'string',
            'TargetStatus': 'PENDING'|'ACTIVE'|'UNREACHABLE'|'INACTIVE'|'DEACTIVATED'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) –

    • Targets (list) –

      The list of notification rule targets.

      • (dict) –

        Information about the targets specified for a notification rule.

        • TargetAddress (string) –

          The Amazon Resource Name (ARN) of the Chatbot topic or Chatbot client.

        • TargetType (string) –

          The type of the target (for example, SNS).

          • Chatbot topics are specified as SNS.

          • Chatbot clients are specified as AWSChatbotSlack.

        • TargetStatus (string) –

          The status of the target.

    • NextToken (string) –

      An enumeration token that can be used in a request to return the next batch of results.

Exceptions