Skip to content

put_bearer_token_authentication async

put_bearer_token_authentication(
    log_group_identifier: LogGroupIdentifier,
    bearer_token_authentication_enabled: BearerTokenAuthenticationEnabled,
    *,
    config_overrides: Optional[AsyncCloudWatchLogsClientConfig] = None,
) -> None

Enables or disables bearer token authentication for the specified log group. When enabled on a log group, bearer token authentication is enabled on operations until it is explicitly disabled.

For information about the parameters that are common to all actions, see Common Parameters.

Parameters:

  • log_group_identifier (LogGroupIdentifier) –

    The name or ARN of the log group.

    Type: String

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

    Pattern: [\.\-_/#A-Za-z0-9]+

    Required: Yes

  • bearer_token_authentication_enabled (BearerTokenAuthenticationEnabled) –

    Whether to enable bearer token authentication.

    Type: Boolean

    Required: Yes

Raises:

Source code in docs_src/capo_cloudwatch_logs/_services/async_cloud_watch_logs.py
async def put_bearer_token_authentication(
    self,
    log_group_identifier: "capo_cloudwatch_logs.types.log_group_identifier.LogGroupIdentifier",
    bearer_token_authentication_enabled: "capo_cloudwatch_logs.types.bearer_token_authentication_enabled.BearerTokenAuthenticationEnabled",
    *,
    config_overrides: Optional[AsyncCloudWatchLogsClientConfig] = None,
) -> None:
    r"""<p>Enables or disables bearer token authentication for the specified log group. When enabled on a log group, bearer token authentication is enabled on operations until it is explicitly disabled.</p> <p>For information about the parameters that are common to all actions, see <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/CommonParameters.html">Common Parameters</a>.</p>

    Args:
        log_group_identifier: <p>The name or ARN of the log group.</p> <p>Type: String</p> <p>Length Constraints: Minimum length of 1. Maximum length of 512.</p> <p>Pattern: <code>[\.\-_/#A-Za-z0-9]+</code> </p> <p>Required: Yes</p>
        bearer_token_authentication_enabled: <p>Whether to enable bearer token authentication.</p> <p>Type: Boolean</p> <p>Required: Yes</p>

    Raises:
        capo_cloudwatch_logs.errors.access_denied_exception.AccessDeniedException: <p>You don't have sufficient permissions to perform this action.</p>
        capo_cloudwatch_logs.errors.invalid_operation_exception.InvalidOperationException: <p>The operation is not valid on the specified resource.</p>
        capo_cloudwatch_logs.errors.invalid_parameter_exception.InvalidParameterException: <p>A parameter is specified incorrectly.</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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_cloudwatch_logs.types.put_bearer_token_authentication_request.PutBearerTokenAuthenticationRequest]",
    ) -> AsyncOperationResponse[None]:
        import capo_cloudwatch_logs._operations.logs_20140328.put_bearer_token_authentication

        (
            output,
            http_response,
        ) = await capo_cloudwatch_logs._operations.logs_20140328.put_bearer_token_authentication.async_put_bearer_token_authentication(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("PutBearerTokenAuthentication")
    )
    input_: capo_cloudwatch_logs.types.put_bearer_token_authentication_request.PutBearerTokenAuthenticationRequest = {
        "log_group_identifier": log_group_identifier,
        "bearer_token_authentication_enabled": bearer_token_authentication_enabled,
    }

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output