R6 Class representing a resource for managing volumes.
Super class
sevenbridges2::Item
-> Volume
Public fields
URL
List of URL endpoints for this resource.
id
Volume ID, constructed from
{division}/{volume_name}
or{volume_owner}/{volume_name}
.name
The name of the volume. It must be unique from all other volumes for this user. Required if
from_path
parameter is not provided.description
The description of the volume.
access_mode
Signifies whether this volume should be used for read-write (RW) or read-only (RO) operations. The access mode is consulted independently of the credentials granted to Seven Bridges when the volume was created, so it is possible to use a read-write credentials to register both read-write and read-only volumes using it. Default:
"RW"
.service
This object in form of string more closely describes the mapping of the volume to the cloud service where the data is stored.
created_on
The date and time this volume was created.
modified_on
The date and time this volume was last modified.
active
If a volume is deactivated, this field will be set to
FALSE
.
Methods
Method print()
Print method for Volume class.
Method reload()
Reload Volume object information.
Arguments
...
Other arguments that can be passed to core
api()
function like 'fields', etc.
Method update()
Update a volume. This function updates the details of a specific volume.
Arguments
description
The new description of the volume.
access_mode
Signifies whether this volume should be used for read-write (RW) or read-only (RO) operations. The access mode is consulted independently of the credentials granted to Seven Bridges when the volume was created, so it is possible to use a read-write credentials to register both read-write and read-only volumes using it. Default:
"RW"
.service
This object in form of string more closely describes the mapping of the volume to the cloud service where the data is stored.
Method deactivate()
Deactivate volume.
Once deactivated, you cannot import from, export to, or browse within a
volume. As such, the content of the files imported from this volume will
no longer be accessible on the Platform. However, you can update the
volume and manage members.
Note that you cannot deactivate the volume if you have running imports
or exports unless you force the operation using the query parameter
force=TRUE.
Note that to delete a volume, first you must deactivate it and delete
all files which have been imported from the volume to the Platform.
Arguments
...
Other query parameters or arguments that can be passed to core
api()
function like 'force'. Use it within query parameter, likequery = list(force = TRUE)
.
Method reactivate()
Reactivate volume.
This function reactivates the previously deactivated volume by updating
the active
field of the volume to TRUE
.
Arguments
...
Other query parameters or arguments that can be passed to core
api()
function like 'force'. Use it within query parameter, likequery = list(force = TRUE)
.
Method delete()
Delete volume. This call deletes a volume you've created to refer to storage on Amazon Web Services, Google Cloud Storage, Azure or Ali cloud. To be able to delete a volume, you first need to deactivate it and then delete all files on the Platform that were previously imported from the volume.
Method list_contents()
List volume contents. This call lists the contents of a specific volume.
Usage
Volume$list_contents(
prefix = NULL,
limit = getOption("sevenbridges2")$limit,
link = NULL,
continuation_token = NULL,
...
)
Arguments
prefix
This is parent parameter in volume context. If specified, the content of the parent directory on the current volume is listed.
limit
The maximum number of collection items to return for a single request. Minimum value is
1
. The maximum value is100
and the default value is50
. This is a pagination-specific attribute.link
Link to use in the next chunk of results. Contains limit and continuation_token. If provided it will overwrite other arguments' values passed.
continuation_token
Continuation token received to use for next chunk of results. Behaves similarly like offset parameter.
...
Other arguments that can be passed to core
api()
function like 'fields' for example. With fields parameter you can specify a subset of fields to include in the response. You can use:href
,location
,volume
,type
,metadata
,_all
. Default:_all
.
Returns
VolumeContentCollection
object containing
list of VolumeFile
and VolumePrefix
objects.
Method get_file()
Get volume file information. This function returns the specific Volume File.
Arguments
location
Volume file id, which is represented as file location.
link
Link to the file resource received from listing volume's contents. Cannot be used together with location.
...
Other arguments that can be passed to core
api()
function like 'fields', etc.
Returns
VolumeFile
object.
Method list_members()
List members of a volume. This function returns the members of a specific volume.
Arguments
limit
The maximum number of collection items to return for a single request. Minimum value is
1
. The maximum value is100
and the default value is50
. This is a pagination-specific attribute.offset
The zero-based starting index in the entire collection of the first item to return. The default value is
0
. This is a pagination-specific attribute....
Other parameters that can be passed to core
api()
function like 'fields', etc.
Returns
Collection
containing Member
objects.
Method add_member()
Add member to a volume. This function adds members to the specified volume.
Usage
Volume$add_member(
user,
permissions = list(read = TRUE, copy = FALSE, write = FALSE, admin = FALSE)
)
Arguments
user
The Seven Bridges Platform username of the person you want to add to the volume or object of class Member containing user's username.
permissions
List of permissions granted to the user being added. Permissions include listing the contents of a volume, importing files from the volume to the Platform, exporting files from the Platform to the volume, and admin privileges.
It can contain fields: 'read', 'copy', 'write' and 'admin' with logical fields - TRUE if certain permission is allowed to the user, or FALSE if it's not. Example:permissions = list(read = TRUE, copy = TRUE, write = FALSE, admin = FALSE)
Returns
Member
object.
Method remove_member()
Remove member from a volume. This function removes members from the specified volume.
Method get_member()
Get member's details. This function returns member's information.
Arguments
user
The Seven Bridges Platform username of the person you want to get information about or object of class Member containing user's username.
...
Other arguments that can be passed to core
api()
function like 'fields', etc.
Returns
Member
object.
Method modify_member_permissions()
Modify volume member's permissions. This function modifies the permissions for a member of a specific volume. Note that this does not overwrite all previously set permissions for the member.
Usage
Volume$modify_member_permissions(
user,
permissions = list(read = TRUE, copy = FALSE, write = FALSE, admin = FALSE)
)
Arguments
user
The Seven Bridges Platform username of the person you want to modify permissions for or object of class Member containing user's username.
permissions
List of specific (or all) permissions you want to update for the member of the volume. Permissions include listing the contents of a volume, importing files from the volume to the Platform, exporting files from the Platform to the volume, and admin privileges. It can contain fields: 'read', 'copy', 'write' and 'admin' with logical fields - TRUE if certain permission is allowed to the user, or FALSE if it's not. Example:
permissions = list(read = TRUE, copy = TRUE, write = FALSE, admin = FALSE)
Returns
Permission
object.
Method list_imports()
This call lists import jobs initiated by particular user from this volume.
Arguments
project
String project id or Project object. List all volume imports to this project. Optional.
state
String. The state of the import job. Possible values are:
PENDING
: the import is queued;RUNNING
: the import is running;COMPLETED
: the import has completed successfully;FAILED
: the import has failed.
Example:
state = c("RUNNING", "FAILED")
limit
The maximum number of collection items to return for a single request. Minimum value is
1
. The maximum value is100
and the default value is50
. This is a pagination-specific attribute.offset
The zero-based starting index in the entire collection of the first item to return. The default value is
0
. This is a pagination-specific attribute....
Other arguments that can be passed to core
api()
function like 'fields', etc.
Returns
Collection
containing list of
Import
job objects.
Method list_exports()
This call lists export jobs initiated by a user into this volume. Note that when you export a file from a project on the Platform into a volume, you write to your cloud storage bucket.
Arguments
state
The state of the export job. Possible values are:
PENDING
: the export is queued;RUNNING
: the export is running;COMPLETED
: the export has completed successfully;FAILED
: the export has failed.
Example:
state = c("RUNNING", "FAILED")
limit
The maximum number of collection items to return for a single request. Minimum value is
1
. The maximum value is100
and the default value is50
. This is a pagination-specific attribute.offset
The zero-based starting index in the entire collection of the first item to return. The default value is
0
. This is a pagination-specific attribute....
Other arguments that can be passed to core
api()
function like 'fields', etc.
Returns
Collection
containing list of
Export
job objects.
Examples
## ------------------------------------------------
## Method `Volume$print`
## ------------------------------------------------
if (FALSE) {
# x is API response when volume is requested
volume_object <- Volume$new(
res = x,
href = x$href,
auth = auth,
response = attr(x, "response")
)
# Print volume object
volume_object$print()
}
## ------------------------------------------------
## Method `Volume$reload`
## ------------------------------------------------
if (FALSE) {
# x is API response when volume is requested
volume_object <- Volume$new(
res = x,
href = x$href,
auth = auth,
response = attr(x, "response")
)
# Reload volume object
volume_object$reload()
}
## ------------------------------------------------
## Method `Volume$update`
## ------------------------------------------------
if (FALSE) {
# x is API response when volume is requested
volume_object <- Volume$new(
res = x,
href = x$href,
auth = auth,
response = attr(x, "response")
)
# Update volume object
volume_object$update(description = description)
}
## ------------------------------------------------
## Method `Volume$deactivate`
## ------------------------------------------------
if (FALSE) {
# x is API response when volume is requested
volume_object <- Volume$new(
res = x,
href = x$href,
auth = auth,
response = attr(x, "response")
)
# Deactivate volume
volume_object$deactivate()
}
## ------------------------------------------------
## Method `Volume$reactivate`
## ------------------------------------------------
if (FALSE) {
# x is API response when volume is requested
volume_object <- Volume$new(
res = x,
href = x$href,
auth = auth,
response = attr(x, "response")
)
# Deactivate volume
volume_object$deactivate()
# Reactivate volume
volume_object$reactivate()
}
## ------------------------------------------------
## Method `Volume$delete`
## ------------------------------------------------
if (FALSE) {
# x is API response when volume is requested
volume_object <- Volume$new(
res = x,
href = x$href,
auth = auth,
response = attr(x, "response")
)
# Delete volume
volume_object$delete()
}
## ------------------------------------------------
## Method `Volume$list_contents`
## ------------------------------------------------
if (FALSE) {
# x is API response when volume is requested
volume_object <- Volume$new(
res = x,
href = x$href,
auth = auth,
response = attr(x, "response")
)
# List volume contents
volume_object$list_contents()
}
## ------------------------------------------------
## Method `Volume$get_file`
## ------------------------------------------------
if (FALSE) {
# x is API response when volume is requested
volume_object <- Volume$new(
res = x,
href = x$href,
auth = auth,
response = attr(x, "response")
)
# Get volume file
volume_object$get_file(location = location)
}
## ------------------------------------------------
## Method `Volume$list_members`
## ------------------------------------------------
if (FALSE) {
# x is API response when volume is requested
volume_object <- Volume$new(
res = x,
href = x$href,
auth = auth,
response = attr(x, "response")
)
# List volume members
volume_object$list_members()
}
## ------------------------------------------------
## Method `Volume$add_member`
## ------------------------------------------------
if (FALSE) {
# x is API response when volume is requested
volume_object <- Volume$new(
res = x,
href = x$href,
auth = auth,
response = attr(x, "response")
)
# Add volume member
volume_object$add_member(
user = user,
permissions = list(read = TRUE, copy = FALSE)
)
}
## ------------------------------------------------
## Method `Volume$remove_member`
## ------------------------------------------------
if (FALSE) {
# x is API response when volume is requested
volume_object <- Volume$new(
res = x,
href = x$href,
auth = auth,
response = attr(x, "response")
)
# Remove volume member
volume_object$remove_member(user = user)
}
## ------------------------------------------------
## Method `Volume$get_member`
## ------------------------------------------------
if (FALSE) {
# x is API response when volume is requested
volume_object <- Volume$new(
res = x,
href = x$href,
auth = auth,
response = attr(x, "response")
)
# Get volume member
volume_object$get_member(user = user)
}
## ------------------------------------------------
## Method `Volume$modify_member_permissions`
## ------------------------------------------------
if (FALSE) {
# x is API response when volume is requested
volume_object <- Volume$new(
res = x,
href = x$href,
auth = auth,
response = attr(x, "response")
)
# Modify volume member permissions
volume_object$modify_member_permissions(
user = user,
permission = list(read = TRUE, copy = TRUE)
)
}
## ------------------------------------------------
## Method `Volume$list_imports`
## ------------------------------------------------
if (FALSE) {
# x is API response when volume is requested
volume_object <- Volume$new(
res = x,
href = x$href,
auth = auth,
response = attr(x, "response")
)
# List volume imports
volume_object$list_imports(
project = project,
state = c("RUNNING", "FAILED")
)
}
## ------------------------------------------------
## Method `Volume$list_exports`
## ------------------------------------------------
if (FALSE) {
# x is API response when volume is requested
volume_object <- Volume$new(
res = x,
href = x$href,
auth = auth,
response = attr(x, "response")
)
# List volume exports
volume_object$list_exports(state = c("RUNNING", "FAILED"))
}