Skip to content

tag_resource

tag_resource(
    resource_arn: ResourceARN,
    tags: TagList,
    *,
    config_overrides: Optional[KinesisVideoClientConfig] = None,
) -> TagResourceOutput

Adds one or more tags to a signaling channel. A tag is a key-value pair (the value is optional) that you can define and assign to Amazon Web Services resources. If you specify a tag that already exists, the tag value is replaced with the value that you specify in the request. For more information, see Using Cost Allocation Tags in the Billing and Cost Management and Cost Management User Guide.

Parameters:

  • resource_arn (ResourceARN) –

    The Amazon Resource Name (ARN) of the signaling channel to which you want to add tags.

  • tags (TagList) –

    A list of tags to associate with the specified signaling channel. Each tag is a key-value pair.

Raises:

Source code in docs_src/capo_kinesis_video/_services/kinesis_video.py
def tag_resource(
    self,
    resource_arn: "capo_kinesis_video.types.resource_arn.ResourceARN",
    tags: "capo_kinesis_video.types.tag_list.TagList",
    *,
    config_overrides: Optional[KinesisVideoClientConfig] = None,
) -> "capo_kinesis_video.types.tag_resource_output.TagResourceOutput":
    """<p>Adds one or more tags to a signaling channel. A <i>tag</i> is a key-value pair (the value is optional) that you can define and assign to Amazon Web Services resources. If you specify a tag that already exists, the tag value is replaced with the value that you specify in the request. For more information, see <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html">Using Cost Allocation Tags</a> in the <i>Billing and Cost Management and Cost Management User Guide</i>.</p>

    Args:
        resource_arn: <p>The Amazon Resource Name (ARN) of the signaling channel to which you want to add tags.</p>
        tags: <p>A list of tags to associate with the specified signaling channel. Each tag is a key-value pair.</p>

    Raises:
        capo_kinesis_video.errors.access_denied_exception.AccessDeniedException: <p>You do not have required permissions to perform this operation.</p>
        capo_kinesis_video.errors.client_limit_exceeded_exception.ClientLimitExceededException: <p>Kinesis Video Streams has throttled the request because you have exceeded the limit of allowed client calls. Try making the call later.</p>
        capo_kinesis_video.errors.invalid_argument_exception.InvalidArgumentException: <p>The value for this input parameter is invalid.</p>
        capo_kinesis_video.errors.resource_not_found_exception.ResourceNotFoundException: <p>Amazon Kinesis Video Streams can't find the stream that you specified.</p>
        capo_kinesis_video.errors.tags_per_resource_exceeded_limit_exception.TagsPerResourceExceededLimitException: <p>You have exceeded the limit of tags that you can associate with the resource. A Kinesis video stream can support up to 50 tags. </p>
        capo_kinesis_video.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_kinesis_video.types.tag_resource_input.TagResourceInput]",
    ) -> OperationResponse[
        "capo_kinesis_video.types.tag_resource_output.TagResourceOutput"
    ]:
        import capo_kinesis_video._operations.kinesis_video_20170930.tag_resource

        output, http_response = (
            capo_kinesis_video._operations.kinesis_video_20170930.tag_resource.tag_resource(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("TagResource")
    )
    input_: capo_kinesis_video.types.tag_resource_input.TagResourceInput = {
        "resource_arn": resource_arn,
        "tags": tags,
    }

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