Skip to content

tag_resource async

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

Adds one or more key-value tags to a Kinesis Analytics application. Note that the maximum number of application tags includes system tags. The maximum number of user-defined application tags is 50. For more information, see Using Tagging.

Parameters:

  • resource_arn (KinesisAnalyticsARN) –

    The ARN of the application to assign the tags.

  • tags (Tags) –

    The key-value tags to assign to the application.

Raises:

  • ConcurrentModificationException –

    Exception thrown as a result of concurrent modification to an application. For example, two individuals attempting to edit the same application at the same time.

  • InvalidArgumentException –

    Specified input parameter value is invalid.

  • ResourceInUseException –

    Application is not available for this operation.

  • ResourceNotFoundException –

    Specified application can't be found.

  • TooManyTagsException –

    Application created with too many tags, or too many tags added to an application. Note that the maximum number of application tags includes system tags. The maximum number of user-defined application tags is 50.

  • UnknownServiceError –

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

Source code in docs_src/capo_kinesis_analytics/_services/async_kinesis_analytics.py
async def tag_resource(
    self,
    resource_arn: "capo_kinesis_analytics.types.kinesis_analytics_arn.KinesisAnalyticsARN",
    tags: "capo_kinesis_analytics.types.tags.Tags",
    *,
    config_overrides: Optional[AsyncKinesisAnalyticsClientConfig] = None,
) -> "capo_kinesis_analytics.types.tag_resource_response.TagResourceResponse":
    """<p>Adds one or more key-value tags to a Kinesis Analytics application. Note that the maximum number of application tags includes system tags. The maximum number of user-defined application tags is 50. For more information, see <a href="https://docs.aws.amazon.com/kinesisanalytics/latest/dev/how-tagging.html">Using Tagging</a>.</p>

    Args:
        resource_arn: <p>The ARN of the application to assign the tags.</p>
        tags: <p>The key-value tags to assign to the application.</p>

    Raises:
        capo_kinesis_analytics.errors.concurrent_modification_exception.ConcurrentModificationException: <p>Exception thrown as a result of concurrent modification to an application. For example, two individuals attempting to edit the same application at the same time.</p>
        capo_kinesis_analytics.errors.invalid_argument_exception.InvalidArgumentException: <p>Specified input parameter value is invalid.</p>
        capo_kinesis_analytics.errors.resource_in_use_exception.ResourceInUseException: <p>Application is not available for this operation.</p>
        capo_kinesis_analytics.errors.resource_not_found_exception.ResourceNotFoundException: <p>Specified application can't be found.</p>
        capo_kinesis_analytics.errors.too_many_tags_exception.TooManyTagsException: <p>Application created with too many tags, or too many tags added to an application. Note that the maximum number of application tags includes system tags. The maximum number of user-defined application tags is 50.</p>
        capo_kinesis_analytics.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

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

        (
            output,
            http_response,
        ) = await capo_kinesis_analytics._operations.kinesis_analytics_20150814.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_analytics.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