Skip to content

tag_resource

tag_resource(
    resource: ContainerARN,
    tags: TagList,
    *,
    config_overrides: Optional[MediaStoreClientConfig] = None,
) -> TagResourceOutput

Adds tags to the specified AWS Elemental MediaStore container. Tags are key:value pairs that you can associate with AWS resources. For example, the tag key might be "customer" and the tag value might be "companyA." You can specify one or more tags to add to each container. You can add up to 50 tags to each container. For more information about tagging, including naming and usage conventions, see Tagging Resources in MediaStore.

Parameters:

  • resource (ContainerARN) –

    The Amazon Resource Name (ARN) for the container.

  • tags (TagList) –

    An array of key:value pairs that you want to add to the container. You need to specify only the tags that you want to add or update. For example, suppose a container already has two tags (customer:CompanyA and priority:High). You want to change the priority tag and also add a third tag (type:Contract). For TagResource, you specify the following tags: priority:Medium, type:Contract. The result is that your container has three tags: customer:CompanyA, priority:Medium, and type:Contract.

Raises:

Source code in docs_src/capo_mediastore/_services/media_store.py
def tag_resource(
    self,
    resource: "capo_mediastore.types.container_arn.ContainerARN",
    tags: "capo_mediastore.types.tag_list.TagList",
    *,
    config_overrides: Optional[MediaStoreClientConfig] = None,
) -> "capo_mediastore.types.tag_resource_output.TagResourceOutput":
    """<p>Adds tags to the specified AWS Elemental MediaStore container. Tags are key:value pairs that you can associate with AWS resources. For example, the tag key might be "customer" and the tag value might be "companyA." You can specify one or more tags to add to each container. You can add up to 50 tags to each container. For more information about tagging, including naming and usage conventions, see <a href="https://docs.aws.amazon.com/mediastore/latest/ug/tagging.html">Tagging Resources in MediaStore</a>.</p>

    Args:
        resource: <p>The Amazon Resource Name (ARN) for the container. </p>
        tags: <p>An array of key:value pairs that you want to add to the container. You need to specify only the tags that you want to add or update. For example, suppose a container already has two tags (customer:CompanyA and priority:High). You want to change the priority tag and also add a third tag (type:Contract). For TagResource, you specify the following tags: priority:Medium, type:Contract. The result is that your container has three tags: customer:CompanyA, priority:Medium, and type:Contract.</p>

    Raises:
        capo_mediastore.errors.container_in_use_exception.ContainerInUseException: <p>The container that you specified in the request already exists or is being updated.</p>
        capo_mediastore.errors.container_not_found_exception.ContainerNotFoundException: <p>The container that you specified in the request does not exist.</p>
        capo_mediastore.errors.internal_server_error.InternalServerError: <p>The service is temporarily unavailable.</p>
        capo_mediastore.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

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

        output, http_response = (
            capo_mediastore._operations.media_store_20170901.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_mediastore.types.tag_resource_input.TagResourceInput = {
        "resource": resource,
        "tags": tags,
    }

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