def AddInstanceTags(r, instance, tags, dry_run=False):
    """
    Adds tags to an instance.

    @type instance: str
    @param instance: instance to add tags to
    @type tags: list of str
    @param tags: tags to add to the instance
    @type dry_run: bool
    @param dry_run: whether to perform a dry run

    @rtype: int
    @return: job id
    """

    query = {
        "tag": tags,
        "dry-run": dry_run,
    }

    return r.request("put", "/2/instances/%s/tags" % instance, query=query)
Adds tags to an instance.

    @type instance: str
    @param instance: instance to add tags to
    @type tags: list of str
    @param tags: tags to add to the instance
    @type dry_run: bool
    @param dry_run: whether to perform a dry run

    @rtype: int
    @return: job id