Skip to content

tag_resource async

tag_resource(
    resource_arn: __string,
    tags: Tags,
    *,
    config_overrides: Optional[AsyncKafkaConnectClientConfig] = None,
) -> TagResourceResponse

Attaches tags to the specified resource.

Parameters:

  • resource_arn (__string) –

    The Amazon Resource Name (ARN) of the resource to which you want to attach tags.

  • tags (Tags) –

    The tags that you want to attach to the resource.

Raises:

  • BadRequestException –

    HTTP Status Code 400: Bad request due to incorrect input. Correct your request and then retry it.

  • ConflictException –

    HTTP Status Code 409: Conflict. A resource with this name already exists. Retry your request with another name.

  • ForbiddenException –

    HTTP Status Code 403: Access forbidden. Correct your credentials and then retry your request.

  • InternalServerErrorException –

    HTTP Status Code 500: Unexpected internal server error. Retrying your request might resolve the issue.

  • NotFoundException –

    HTTP Status Code 404: Resource not found due to incorrect input. Correct your request and then retry it.

  • ServiceUnavailableException –

    HTTP Status Code 503: Service Unavailable. Retrying your request in some time might resolve the issue.

  • TooManyRequestsException –

    HTTP Status Code 429: Limit exceeded. Resource limit reached.

  • UnauthorizedException –

    HTTP Status Code 401: Unauthorized request. The provided credentials couldn't be validated.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_kafkaconnect/_services/async_kafka_connect.py
async def tag_resource(
    self,
    resource_arn: "capo_kafkaconnect.types.__string.__string",
    tags: "capo_kafkaconnect.types.tags.Tags",
    *,
    config_overrides: Optional[AsyncKafkaConnectClientConfig] = None,
) -> "capo_kafkaconnect.types.tag_resource_response.TagResourceResponse":
    """<p>Attaches tags to the specified resource.</p>

    Args:
        resource_arn: <p>The Amazon Resource Name (ARN) of the resource to which you want to attach tags.</p>
        tags: <p>The tags that you want to attach to the resource.</p>

    Raises:
        capo_kafkaconnect.errors.bad_request_exception.BadRequestException: <p>HTTP Status Code 400: Bad request due to incorrect input. Correct your request and then retry it.</p>
        capo_kafkaconnect.errors.conflict_exception.ConflictException: <p>HTTP Status Code 409: Conflict. A resource with this name already exists. Retry your request with another name.</p>
        capo_kafkaconnect.errors.forbidden_exception.ForbiddenException: <p>HTTP Status Code 403: Access forbidden. Correct your credentials and then retry your request.</p>
        capo_kafkaconnect.errors.internal_server_error_exception.InternalServerErrorException: <p>HTTP Status Code 500: Unexpected internal server error. Retrying your request might resolve the issue.</p>
        capo_kafkaconnect.errors.not_found_exception.NotFoundException: <p>HTTP Status Code 404: Resource not found due to incorrect input. Correct your request and then retry it.</p>
        capo_kafkaconnect.errors.service_unavailable_exception.ServiceUnavailableException: <p>HTTP Status Code 503: Service Unavailable. Retrying your request in some time might resolve the issue.</p>
        capo_kafkaconnect.errors.too_many_requests_exception.TooManyRequestsException: <p>HTTP Status Code 429: Limit exceeded. Resource limit reached.</p>
        capo_kafkaconnect.errors.unauthorized_exception.UnauthorizedException: <p>HTTP Status Code 401: Unauthorized request. The provided credentials couldn't be validated.</p>
        capo_kafkaconnect.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_kafkaconnect.types.tag_resource_request.TagResourceRequest]",
    ) -> AsyncOperationResponse[
        "capo_kafkaconnect.types.tag_resource_response.TagResourceResponse"
    ]:
        import capo_kafkaconnect._operations.kafka_connect.tag_resource

        (
            output,
            http_response,
        ) = await capo_kafkaconnect._operations.kafka_connect.tag_resource.async_tag_resource(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("TagResource")
    )
    input_: capo_kafkaconnect.types.tag_resource_request.TagResourceRequest = {
        "resource_arn": resource_arn,
        "tags": tags,
    }

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