get_storage_metadata {AzureStor} | R Documentation |
Get/set user-defined metadata for a storage object
get_storage_metadata(object, ...)
## S3 method for class 'blob_container'
get_storage_metadata(object, blob, ...)
## S3 method for class 'file_share'
get_storage_metadata(object, file, isdir, ...)
## S3 method for class 'adls_filesystem'
get_storage_metadata(object, file, ...)
set_storage_metadata(object, ...)
## S3 method for class 'blob_container'
set_storage_metadata(object, blob, ..., keep_existing = TRUE)
## S3 method for class 'file_share'
set_storage_metadata(object, file, isdir, ..., keep_existing = TRUE)
## S3 method for class 'adls_filesystem'
set_storage_metadata(object, file, ..., keep_existing = TRUE)
object |
A blob container, file share or ADLS filesystem object. |
... |
For the metadata setters, name-value pairs to set as metadata for a blob or file. |
blob, file |
Optionally the name of an individual blob, file or directory within a container. |
isdir |
For the file share method, whether the |
keep_existing |
For the metadata setters, whether to retain existing metadata information. |
These methods let you get and set user-defined properties (metadata) for storage objects.
get_storage_metadata
returns a named list of metadata properties. If the blob
or file
argument is present, the properties will be for the blob/file specified. If this argument is omitted, the properties will be for the container itself.
set_storage_metadata
returns the same list after setting the object's metadata, invisibly.
blob_container, file_share, adls_filesystem
get_storage_properties for standard properties
## Not run:
fs <- storage_container("https://mystorage.dfs.core.windows.net/myshare", key="access_key")
create_storage_dir("newdir")
storage_upload(share, "iris.csv", "newdir/iris.csv")
set_storage_metadata(fs, "newdir/iris.csv", name1="value1")
# will be list(name1="value1")
get_storage_metadata(fs, "newdir/iris.csv")
set_storage_metadata(fs, "newdir/iris.csv", name2="value2")
# will be list(name1="value1", name2="value2")
get_storage_metadata(fs, "newdir/iris.csv")
set_storage_metadata(fs, "newdir/iris.csv", name3="value3", keep_existing=FALSE)
# will be list(name3="value3")
get_storage_metadata(fs, "newdir/iris.csv")
# deleting all metadata
set_storage_metadata(fs, "newdir/iris.csv", keep_existing=FALSE)
## End(Not run)