Skip to content

tag_resource async

tag_resource(
    tags: TagMap,
    resource_arn: ResourceARN,
    *,
    config_overrides: Optional[AsyncKinesisClientConfig] = None,
    stream_id: Optional[StreamId] = None,
) -> None

Adds or updates tags for the specified Kinesis resource. Each tag is a label consisting of a user-defined key and value. Tags can help you manage, identify, organize, search for, and filter resources. You can assign up to 50 tags to a Kinesis resource.

Parameters:

  • tags (TagMap) –

    An array of tags to be added to the Kinesis resource. A tag consists of a required key and an optional value. You can add up to 50 tags per resource.

    Tags may only contain Unicode letters, digits, white space, or these symbols: _ . : / = + - @.

  • resource_arn (ResourceARN) –

    The Amazon Resource Name (ARN) of the Kinesis resource to which to add tags.

  • stream_id (Optional[StreamId], default: None ) –

    Not Implemented. Reserved for future use.

Raises:

  • AccessDeniedException –

    Specifies that you do not have the permissions required to perform this operation.

  • InvalidArgumentException –

    A specified parameter exceeds its restrictions, is not supported, or can't be used. For more information, see the returned message.

  • LimitExceededException –

    The requested resource exceeds the maximum number allowed, or the number of concurrent stream requests exceeds the maximum number allowed.

  • ResourceInUseException –

    The resource is not available for this operation. For successful operation, the resource must be in the ACTIVE state.

  • ResourceNotFoundException –

    The requested resource could not be found. The stream might not be specified correctly.

  • UnknownServiceError –

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

Source code in docs_src/capo_kinesis/_services/async_kinesis.py
async def tag_resource(
    self,
    tags: "capo_kinesis.types.tag_map.TagMap",
    resource_arn: "capo_kinesis.types.resource_arn.ResourceARN",
    *,
    config_overrides: Optional[AsyncKinesisClientConfig] = None,
    stream_id: Optional["capo_kinesis.types.stream_id.StreamId"] = None,
) -> None:
    """<p>Adds or updates tags for the specified Kinesis resource. Each tag is a label consisting of a user-defined key and value. Tags can help you manage, identify, organize, search for, and filter resources. You can assign up to 50 tags to a Kinesis resource.</p>

    Args:
        tags: <p>An array of tags to be added to the Kinesis resource. A tag consists of a required key and an optional value. You can add up to 50 tags per resource.</p> <p>Tags may only contain Unicode letters, digits, white space, or these symbols: _ . : / = + - @.</p>
        resource_arn: <p>The Amazon Resource Name (ARN) of the Kinesis resource to which to add tags.</p>
        stream_id: <p>Not Implemented. Reserved for future use.</p>

    Raises:
        capo_kinesis.errors.access_denied_exception.AccessDeniedException: <p>Specifies that you do not have the permissions required to perform this operation.</p>
        capo_kinesis.errors.invalid_argument_exception.InvalidArgumentException: <p>A specified parameter exceeds its restrictions, is not supported, or can't be used. For more information, see the returned message.</p>
        capo_kinesis.errors.limit_exceeded_exception.LimitExceededException: <p>The requested resource exceeds the maximum number allowed, or the number of concurrent stream requests exceeds the maximum number allowed. </p>
        capo_kinesis.errors.resource_in_use_exception.ResourceInUseException: <p>The resource is not available for this operation. For successful operation, the resource must be in the <code>ACTIVE</code> state.</p>
        capo_kinesis.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource could not be found. The stream might not be specified correctly.</p>
        capo_kinesis.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_kinesis.types.tag_resource_input.TagResourceInput]",
    ) -> AsyncOperationResponse[None]:
        import capo_kinesis._operations.kinesis_20131202.tag_resource

        (
            output,
            http_response,
        ) = await capo_kinesis._operations.kinesis_20131202.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_kinesis.types.tag_resource_input.TagResourceInput = {
        "tags": tags,
        "resource_arn": resource_arn,
    }
    if stream_id is not None:
        input_["stream_id"] = stream_id

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