paws.common (version 0.1.0)

tags: Get, set, and delete object tags

Description

Tags are metadata stored in an object's attributes, used to store types and names needed to make AWS API requests.

tag_get returns the value of the given tag, or "" if the tag doesn't exist.

tag_has returns whether the object has the given tag.

tag_add returns the object after adding the given list of tags and values.

tag_del returns the object after recursively deleting tags in tags, or all tags if NULL.

type returns broadly what type an object is, based on its type tag.

Usage

tag_get(object, tag)

tag_has(object, tag)

tag_add(object, tags)

tag_del(object, tags = NULL)

type(object)

Arguments

object

An object.

tag

A tag name.

tags

A list of tags.

  • tag_add: A named vector with tag names and their values.

  • tag_del: A character vector of tags to delete.

Examples

Run this code
# NOT RUN {
foo <- list()
foo <- tag_add(foo, list(tag_name = "tag_value"))
tag_has(foo, "tag_name") # TRUE
tag_get(foo, "tag_name") # "tag_value"
tag_get(foo, "not_exist") # ""
foo <- tag_del(foo)
tag_has(foo, "tag_name") # FALSE

# }

Run the code above in your browser using DataCamp Workspace