Adds one or more tags to a stream. 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.
You must provide either the StreamName or the StreamARN.
This operation requires permission for the KinesisVideo:TagStream action.
A Kinesis video stream can support up to 50 tags.
Parameters:
-
stream_arn
(Optional[ResourceARN], default:
None
)
–
The Amazon Resource Name (ARN) of the resource that you want to add the tag or tags to.
-
stream_name
(Optional[StreamName], default:
None
)
–
The name of the stream that you want to add the tag or tags to.
-
tags
(ResourceTags)
–
A list of tags to associate with the specified stream. Each tag is a key-value pair (the value is optional).
Raises:
Source code in docs_src/capo_kinesis_video/_services/async_kinesis_video.py
| async def tag_stream(
self,
tags: "capo_kinesis_video.types.resource_tags.ResourceTags",
*,
config_overrides: Optional[AsyncKinesisVideoClientConfig] = None,
stream_arn: Optional[
"capo_kinesis_video.types.resource_arn.ResourceARN"
] = None,
stream_name: Optional["capo_kinesis_video.types.stream_name.StreamName"] = None,
) -> "capo_kinesis_video.types.tag_stream_output.TagStreamOutput":
"""<p>Adds one or more tags to a stream. 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> <p>You must provide either the <code>StreamName</code> or the <code>StreamARN</code>.</p> <p>This operation requires permission for the <code>KinesisVideo:TagStream</code> action.</p> <p>A Kinesis video stream can support up to 50 tags.</p>
Args:
stream_arn: <p>The Amazon Resource Name (ARN) of the resource that you want to add the tag or tags to.</p>
stream_name: <p>The name of the stream that you want to add the tag or tags to.</p>
tags: <p>A list of tags to associate with the specified stream. Each tag is a key-value pair (the value is optional).</p>
Raises:
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.invalid_resource_format_exception.InvalidResourceFormatException: <p>The format of the <code>StreamARN</code> is invalid.</p>
capo_kinesis_video.errors.not_authorized_exception.NotAuthorizedException: <p>The caller is not authorized to perform this operation.</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.
"""
async def _handler(
req: "AsyncOperationRequest[capo_kinesis_video.types.tag_stream_input.TagStreamInput]",
) -> AsyncOperationResponse[
"capo_kinesis_video.types.tag_stream_output.TagStreamOutput"
]:
import capo_kinesis_video._operations.kinesis_video_20170930.tag_stream
(
output,
http_response,
) = await capo_kinesis_video._operations.kinesis_video_20170930.tag_stream.async_tag_stream(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("TagStream")
)
input_: capo_kinesis_video.types.tag_stream_input.TagStreamInput = {
"tags": tags
}
if stream_arn is not None:
input_["stream_arn"] = stream_arn
if stream_name is not None:
input_["stream_name"] = stream_name
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|