Skip to content

describe_action_targets

describe_action_targets(
    *,
    config_overrides: Optional[SecurityHubClientConfig] = None,
    action_target_arns: Optional[ArnList] = None,
    next_token: Optional[NextToken] = None,
    max_results: Optional[MaxResults] = None,
) -> DescribeActionTargetsResponse

Returns a list of the custom action targets in Security Hub CSPM in your account.

Parameters:

  • action_target_arns (Optional[ArnList], default: None ) –

    A list of custom action target ARNs for the custom action targets to retrieve.

  • next_token (Optional[NextToken], default: None ) –

    The token that is required for pagination. On your first call to the DescribeActionTargets operation, set the value of this parameter to NULL.

    For subsequent calls to the operation, to continue listing data, set the value of this parameter to the value returned from the previous response.

  • max_results (Optional[MaxResults], default: None ) –

    The maximum number of results to return.

Raises:

Examples:

To return custom action targets The following example returns a list of custom action targets. You use custom actions on findings and insights in Security Hub to trigger target actions in Amazon CloudWatch Events.

>>> client.describe_action_targets(action_target_arns=['arn:aws:securityhub:us-west-1:123456789012:action/custom/Remediation'])
Source code in docs_src/capo_securityhub/_services/security_hub.py
def describe_action_targets(
    self,
    *,
    config_overrides: Optional[SecurityHubClientConfig] = None,
    action_target_arns: Optional["capo_securityhub.types.arn_list.ArnList"] = None,
    next_token: Optional["capo_securityhub.types.next_token.NextToken"] = None,
    max_results: Optional["capo_securityhub.types.max_results.MaxResults"] = None,
) -> "capo_securityhub.types.describe_action_targets_response.DescribeActionTargetsResponse":
    """<p>Returns a list of the custom action targets in Security Hub CSPM in your account.</p>

    Args:
        action_target_arns: <p>A list of custom action target ARNs for the custom action targets to retrieve.</p>
        next_token: <p>The token that is required for pagination. On your first call to the <code>DescribeActionTargets</code> operation, set the value of this parameter to <code>NULL</code>.</p> <p>For subsequent calls to the operation, to continue listing data, set the value of this parameter to the value returned from the previous response.</p>
        max_results: <p>The maximum number of results to return.</p>

    Raises:
        capo_securityhub.errors.internal_exception.InternalException: <p>Internal server error.</p>
        capo_securityhub.errors.invalid_access_exception.InvalidAccessException: <p>The account doesn't have permission to perform this action.</p>
        capo_securityhub.errors.invalid_input_exception.InvalidInputException: <p>The request was rejected because you supplied an invalid or out-of-range value for an input parameter.</p>
        capo_securityhub.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request was rejected because we can't find the specified resource.</p>
        capo_securityhub.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To return custom action targets
        The following example returns a list of custom action targets. You use custom actions on findings and insights in Security Hub to trigger target actions in Amazon CloudWatch Events.

        >>> client.describe_action_targets(action_target_arns=['arn:aws:securityhub:us-west-1:123456789012:action/custom/Remediation'])
    """

    def _handler(
        req: "OperationRequest[capo_securityhub.types.describe_action_targets_request.DescribeActionTargetsRequest]",
    ) -> OperationResponse[
        "capo_securityhub.types.describe_action_targets_response.DescribeActionTargetsResponse"
    ]:
        import capo_securityhub._operations.security_hub_api_service.describe_action_targets

        output, http_response = (
            capo_securityhub._operations.security_hub_api_service.describe_action_targets.describe_action_targets(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeActionTargets")
    )
    input_: capo_securityhub.types.describe_action_targets_request.DescribeActionTargetsRequest = {}
    if action_target_arns is not None:
        input_["action_target_arns"] = action_target_arns
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output