Skip to content

describe_index_policies

describe_index_policies(
    log_group_identifiers: DescribeIndexPoliciesLogGroupIdentifiers,
    *,
    config_overrides: Optional[CloudWatchLogsClientConfig] = None,
    next_token: Optional[NextToken] = None,
) -> DescribeIndexPoliciesResponse

Returns the field index policies of the specified log group. For more information about field index policies, see PutIndexPolicy.

If a specified log group has a log-group level index policy, that policy is returned by this operation.

If a specified log group doesn't have a log-group level index policy, but an account-wide index policy applies to it, that account-wide policy is returned by this operation.

To find information about only account-level policies, use DescribeAccountPolicies instead.

Parameters:

Raises:

Source code in docs_src/capo_cloudwatch_logs/_services/cloud_watch_logs.py
def describe_index_policies(
    self,
    log_group_identifiers: "capo_cloudwatch_logs.types.describe_index_policies_log_group_identifiers.DescribeIndexPoliciesLogGroupIdentifiers",
    *,
    config_overrides: Optional[CloudWatchLogsClientConfig] = None,
    next_token: Optional["capo_cloudwatch_logs.types.next_token.NextToken"] = None,
) -> "capo_cloudwatch_logs.types.describe_index_policies_response.DescribeIndexPoliciesResponse":
    """<p>Returns the field index policies of the specified log group. For more information about field index policies, see <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutIndexPolicy.html">PutIndexPolicy</a>.</p> <p>If a specified log group has a log-group level index policy, that policy is returned by this operation.</p> <p>If a specified log group doesn't have a log-group level index policy, but an account-wide index policy applies to it, that account-wide policy is returned by this operation.</p> <p>To find information about only account-level policies, use <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeAccountPolicies.html">DescribeAccountPolicies</a> instead.</p>

    Args:
        log_group_identifiers: <p>An array containing the name or ARN of the log group that you want to retrieve field index policies for.</p>

    Raises:
        capo_cloudwatch_logs.errors.invalid_parameter_exception.InvalidParameterException: <p>A parameter is specified incorrectly.</p>
        capo_cloudwatch_logs.errors.limit_exceeded_exception.LimitExceededException: <p>You have reached the maximum number of resources that can be created.</p>
        capo_cloudwatch_logs.errors.operation_aborted_exception.OperationAbortedException: <p>Multiple concurrent requests to update the same resource were in conflict.</p>
        capo_cloudwatch_logs.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource does not exist.</p>
        capo_cloudwatch_logs.errors.service_unavailable_exception.ServiceUnavailableException: <p>The service cannot complete the request.</p>
        capo_cloudwatch_logs.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_cloudwatch_logs.types.describe_index_policies_request.DescribeIndexPoliciesRequest]",
    ) -> OperationResponse[
        "capo_cloudwatch_logs.types.describe_index_policies_response.DescribeIndexPoliciesResponse"
    ]:
        import capo_cloudwatch_logs._operations.logs_20140328.describe_index_policies

        output, http_response = (
            capo_cloudwatch_logs._operations.logs_20140328.describe_index_policies.describe_index_policies(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeIndexPolicies")
    )
    input_: capo_cloudwatch_logs.types.describe_index_policies_request.DescribeIndexPoliciesRequest = {
        "log_group_identifiers": log_group_identifiers
    }
    if next_token is not None:
        input_["next_token"] = next_token

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