Title: | The 'Seven Bridges Platform' API Client |
---|---|
Description: | R client and utilities for 'Seven Bridges Platform' API, from 'Cancer Genomics Cloud' to other 'Seven Bridges' supported platforms. API documentation is hosted publicly at <https://docs.sevenbridges.com/docs/the-api>. |
Authors: | Marko Trifunovic [aut, cre], Marija Gacic [aut], Vladimir Obucina [aut], Velsera [cph, fnd] |
Maintainer: | Marko Trifunovic <[email protected]> |
License: | Apache License 2.0 |
Version: | 0.3.0 |
Built: | 2025-02-24 22:21:15 UTC |
Source: | https://github.com/sbg/sevenbridges2 |
Used for advanced users and the core method for higher level API in this package.
api( token = NULL, path = NULL, method = c("GET", "POST", "PUT", "DELETE", "PATCH"), query = NULL, body = list(), encode = c("json", "form", "multipart"), limit = getOption("sevenbridges2")$limit, offset = getOption("sevenbridges2")$offset, advance_access = getOption("sevenbridges2")$advance_access, authorization = FALSE, fields = "_all", base_url = NULL, url = NULL, ... )
api( token = NULL, path = NULL, method = c("GET", "POST", "PUT", "DELETE", "PATCH"), query = NULL, body = list(), encode = c("json", "form", "multipart"), limit = getOption("sevenbridges2")$limit, offset = getOption("sevenbridges2")$offset, advance_access = getOption("sevenbridges2")$advance_access, authorization = FALSE, fields = "_all", base_url = NULL, url = NULL, ... )
token |
API authentication token or |
path |
Path connected with |
method |
One of |
query |
Query parameters passed to httr package GET/POST call. |
body |
Body content passed to httr package GET/POST/PUT/DELETE/PATCH call. |
encode |
If the body is a named list, how should it be
encoded? Can be one of |
limit |
The maximum number of collection items to return
for a single request. Minimum value is |
offset |
The zero-based starting index in the entire collection
of the first item to return. The default value is |
advance_access |
Enable advance access features?
Default is |
authorization |
Is the |
fields |
Selector specifying a subset of fields to include in the
response. All API calls take this optional query parameter.
This parameter enables you to specify the fields you want to be returned
when listing resources (e.g. all your projects) or getting details of a
specific resource (e.g. a given project). |
base_url |
Platform URL, default is NULL. |
url |
Full url of the resource. If |
... |
Other arguments passed to GET/POST/PUT/DELETE/PATCH call. |
Response in form of a list.
https://docs.sevenbridges.com/page/api
token <- "your_token" # list projects ## Not run: api(token = token, path = "projects", method = "GET") ## End(Not run)
token <- "your_token" # list projects ## Not run: api(token = token, path = "projects", method = "GET") ## End(Not run)
R6 Class representing a resource for managing apps.
sevenbridges2::Item
-> App
URL
List of URL endpoints for this resource.
id
Character used as an app ID - short app name.
project
Project ID if any, when returned by an API call.
name
App name.
revision
App's revision number.
copy_of
The original application of which this is a copy.
latest_revision
App's latest revision number.
raw
App's raw CWL (JSON or YAML).
new()
Create a new App object.
App$new(res = NA, ...)
res
Response containing App object information.
...
Other response arguments.
A new App
object.
print()
Print method for App class.
App$print()
\dontrun{ # x is API response when app is requested app_object <- App$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) app_object$print() }
reload()
Reload App object information. Suitable also for loading raw CWL in the 'raw' field, if it's not already populated.
App$reload(...)
...
Other arguments that can be passed to core api()
function
like 'fields', etc.
App
object.
\dontrun{ # x is API response when app is requested app_object <- App$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) app_object$reload() }
copy()
A method that copies the current app to the specified project.
App$copy(project, name = NULL, strategy = "clone", use_revision = FALSE, ...)
project
Project object or project ID. If you opt for the latter,
remember that the project ID should be specified in
<project_owner>/<project-name>
format, e.g. rfranklin/my-project
, or as <division>/<project-name>
depending on the account
type.
name
The new name the app will have in the target project. Optional.
strategy
The method for copying the app. Supported strategies:
clone
- copy all revisions; get updates from the same app as
the copied app (default)
direct
: copy latest revision; get updates from the copied app
clone_direct
: copy all revisions; get updates from the copied
app
transient
: copy latest revision; get updates from the same
app as the copied app.
use_revision
Parameter specifying which app's revision should be
copied. If set to FALSE
(default), the latest revision of the app will
be copied.
...
Other arguments that can be passed to core api()
function
like 'fields', etc.
Copied App
object.
\dontrun{ # x is API response when app is requested app_object <- App$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) app_object$copy(project) }
get_revision()
Get app's revision.
App$get_revision(revision = self$revision, in_place = FALSE, ...)
revision
Revision of the app.
in_place
If TRUE
, replace current app object with new for
specified app revision.
...
Other arguments that can be passed to core api()
function
like 'fields', etc.
This call allows you to obtain a particular revision of an app, which is not necessarily the most recent version.
App
object.
\dontrun{ # x is API response when app is requested app_object <- App$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) app_object$get_revision() }
create_revision()
Create a new app revision.
App$create_revision( raw = NULL, from_path = NULL, raw_format = c("JSON", "YAML"), in_place = FALSE, ... )
raw
A list containing a raw CWL for the app revision you are
about to create. To generate such a list, you might want to load some
existing JSON / YAML file. In case that your CWL file is in JSON format,
please use the fromJSON
function from the jsonlite
package to
minimize potential problems with parsing the JSON file. If you want to
load a CWL file in YAML format, it is highly recommended to use the
read_yaml
function from the yaml
package. Keep in mind that this
parameter should not be used together with the file_path
parameter.
from_path
A path to a file containing the raw CWL for the app
(JSON or YAML). This parameter should not be used together with the
raw
parameter.
raw_format
The type of format used (JSON or YAML).
in_place
If TRUE
, replace current app object with newly
created revision.
...
Other arguments that can be passed to core api()
function
like 'fields', etc.
This call creates a new revision for an existing app. It adds a new CWL
app description, and stores it as the named revision for the specified
app. The revision number must not already exist and should follow the
sequence of previously created revisions.
More documentation about how to create the app via API can be found
here.
App
object.
\dontrun{ # x is API response when app is requested app_object <- App$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Create App object using raw CWL app_object$create_revision(raw) }
sync()
Synchronize a copied app with its parent app.
App$sync(...)
...
Other arguments that can be passed to core api()
function
like 'fields', etc.
This call synchronizes a copied app with the source app from which it has been copied.
App
object.
\dontrun{ # x is API response when app is requested app_object <- App$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) app_object$sync() }
input_matrix()
Get inputs matrix for the app - what are expected inputs required or not, with their details about the expected types, descriptions etc.
App$input_matrix()
Data frame.
output_matrix()
Get outputs matrix for the app - what are the expected outputs of the task running this app, with their details about the expected types, descriptions etc.
App$output_matrix()
Data frame.
create_task()
This call creates a new task. You can create either a single task or a batch task by using the app's default batching, override batching, or disable batching completely. A parent task is a task that specifies criteria by which to batch its inputs into a series of further sub-tasks, called child tasks. The documentation on batching tasks for more details on batching criteria.
App$create_task( project, revision = NULL, name = NULL, description = NULL, execution_settings = NULL, inputs = NULL, output_location = NULL, batch = NULL, batch_input = NULL, batch_by = NULL, use_interruptible_instances = NULL, action = NULL, ... )
project
The ID string of a project or a Project object where you want to create the task in.
revision
The app revision (version) number.
name
The name of the task.
description
An optional description of the task.
execution_settings
Named list with detailed task execution parameters. Detailed task execution parameters:
instance_type
: Possible value is the specific instance type,
e.g. "instance_type" = "c4.2xlarge;ebs-gp2;2000"
;
max_parallel_instances
: Maximum number of instances
running at the same time. Takes any integer value equal to or
greater than 1, e.g. "max_parallel_instances" = 2.
;
use_memoization
: Set to FALSE
by default. Set to TRUE
to enable
memoization;
use_elastic_disk
: Set to TRUE
to enable
Elastic Disk.
Here is an example:
execution_settings <- list( "instance_type" = "c4.2xlarge;ebs-gp2;2000", "max_parallel_instances" = 2, "use_memoization" = TRUE, "use_elastic_disk" = TRUE )
inputs
List of objects. See the section on specifying task inputs for information on creating task input objects. Here is an example with various input types:
inputs <- list( "input_file"= "<file_id/file_object>", "input_directory" = "<folder_id/folder_object>", "input_array_string" = list("<string_elem_1>", "<string_elem_2>"), "input_boolean" = TRUE, "input_double" = 54.6, "input_enum" = "enum_1", "input_float" = 11.2, "input_integer" = "asdf", "input_long" = 4212, "input_string" = "test_string", "input_record" = list( "input_record_field_file" = "<file_id/file_object>", "input_record_field_integer" = 42 ) )
output_location
The output location list allows you to define the exact location where your task outputs will be stored. The location can either be defined for the entire project using the main_location parameter, or individually per each output node, by setting the nodes_override parameter to true and defining individual output node locations within nodes_location. See below for more details.
main_location
- Defines the output location for all
output nodes in the task. Can be a string path within the project in
which the task is created, for example /Analysis/<task_id>_<task_name>/
or a path on an attached volume,
such as
volumes://volume_name/<project_id>/html
.
Parts of the path enclosed in angle brackets <> are tokens that are
dynamically replaced with corresponding values during task
execution.
main_location_alias
: The string location (path) in the
project that will point to the actual location where the outputs are
stored. Used if main_location is defined as a volume path (starting
with volumes://), to provide an easy way of accessing output data
directly from project files.
nodes_override
: Enables defining of output locations
for output nodes individually through nodes_location (see below).
Set to TRUE
to be able to define individual locations per output
node. Default: FALSE
.
Even if nodes_override is set to TRUE
, it is not necessary to
define output locations for each of the output nodes individually.
Data from those output nodes that don't have their locations
explicitly defined through nodes_location is either placed in
main_location (if defined) or at the project files root if a main
output location is not defined for the task.
nodes_location
: List of output paths for individual
task output nodes in the following format for each output node: <output-node-id> = list(
"output_location" = "<output-path>",
"output_location_alias" = "<alias-path>"
)
Example:
b64html = list( "output_location" = "volumes://outputs/tasks/mar-19", "output_location_alias" = "/rfranklin/tasks/picard" )
In the example above, b64html is the ID of the output node for which you want to define the output location, while the parameters are defined as follows:
output_location
- Can be a path within the project in which
the task is created, for example /Analysis/<task_id>_<task_name>/
or a path on an attached volume,
such as
volumes://volume_name/<project_id>/html
. Also accepts tokens.
output_location_alias
- The location (path) in the project
that will point to the exact location where the output is stored.
Used if output_location is defined as a volume path
(starting with volumes://).
batch
This is set to FALSE
by default. Set to TRUE
to
create a batch task and specify the batch_input
and batch-by
criteria as described below.
batch_input
The ID of the input on which you wish to batch. You would typically batch on the input consisting of a list of files. If this parameter is omitted, the default batching criteria defined for the app will be used.
batch_by
Batching criteria in form of list. For example:
batch_by = list( type = "CRITERIA", criteria = list("metadata.condition") )
use_interruptible_instances
This field can be TRUE
or FALSE
.
Set this field to TRUE
to allow the use of
spot instances.
action
If set to run
, the task will be run immediately upon
creation.
...
Other arguments that can be passed to core api()
function
like 'fields', etc.
Task
object.
\dontrun{ # x is API response when app is requested app_object <- App$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Create a DRAFT task app_object$create_task(project = project) }
clone()
The objects of this class are cloneable with this method.
App$clone(deep = FALSE)
deep
Whether to make a deep clone.
## ------------------------------------------------ ## Method `App$print` ## ------------------------------------------------ ## Not run: # x is API response when app is requested app_object <- App$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) app_object$print() ## End(Not run) ## ------------------------------------------------ ## Method `App$reload` ## ------------------------------------------------ ## Not run: # x is API response when app is requested app_object <- App$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) app_object$reload() ## End(Not run) ## ------------------------------------------------ ## Method `App$copy` ## ------------------------------------------------ ## Not run: # x is API response when app is requested app_object <- App$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) app_object$copy(project) ## End(Not run) ## ------------------------------------------------ ## Method `App$get_revision` ## ------------------------------------------------ ## Not run: # x is API response when app is requested app_object <- App$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) app_object$get_revision() ## End(Not run) ## ------------------------------------------------ ## Method `App$create_revision` ## ------------------------------------------------ ## Not run: # x is API response when app is requested app_object <- App$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Create App object using raw CWL app_object$create_revision(raw) ## End(Not run) ## ------------------------------------------------ ## Method `App$sync` ## ------------------------------------------------ ## Not run: # x is API response when app is requested app_object <- App$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) app_object$sync() ## End(Not run) ## ------------------------------------------------ ## Method `App$create_task` ## ------------------------------------------------ ## Not run: # x is API response when app is requested app_object <- App$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Create a DRAFT task app_object$create_task(project = project) ## End(Not run)
## ------------------------------------------------ ## Method `App$print` ## ------------------------------------------------ ## Not run: # x is API response when app is requested app_object <- App$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) app_object$print() ## End(Not run) ## ------------------------------------------------ ## Method `App$reload` ## ------------------------------------------------ ## Not run: # x is API response when app is requested app_object <- App$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) app_object$reload() ## End(Not run) ## ------------------------------------------------ ## Method `App$copy` ## ------------------------------------------------ ## Not run: # x is API response when app is requested app_object <- App$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) app_object$copy(project) ## End(Not run) ## ------------------------------------------------ ## Method `App$get_revision` ## ------------------------------------------------ ## Not run: # x is API response when app is requested app_object <- App$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) app_object$get_revision() ## End(Not run) ## ------------------------------------------------ ## Method `App$create_revision` ## ------------------------------------------------ ## Not run: # x is API response when app is requested app_object <- App$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Create App object using raw CWL app_object$create_revision(raw) ## End(Not run) ## ------------------------------------------------ ## Method `App$sync` ## ------------------------------------------------ ## Not run: # x is API response when app is requested app_object <- App$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) app_object$sync() ## End(Not run) ## ------------------------------------------------ ## Method `App$create_task` ## ------------------------------------------------ ## Not run: # x is API response when app is requested app_object <- App$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Create a DRAFT task app_object$create_task(project = project) ## End(Not run)
R6 Class representing apps resource endpoint.
sevenbridges2::Resource
-> Apps
URL
List of URL endpoints for this resource.
new()
Create new Apps resource object.
Apps$new(...)
...
Other response arguments.
query()
This call lists all the apps available to you.
Apps$query( project = NULL, visibility = c("private", "public"), query_terms = NULL, id = NULL, limit = getOption("sevenbridges2")$limit, offset = getOption("sevenbridges2")$offset, fields = "!raw", ... )
project
Project ID string in the form
<project_owner>/<project_short_name>
or <division_name>/<project_short_name>
or Project object,
to restrict the results to apps from that project only.
visibility
Set this to public
to see all public apps on
the Seven Bridges Platform.
query_terms
A list of search terms used to filter apps based on
their details. Each term is case-insensitive and can relate to the
app's name, label, toolkit, toolkit version, category, tagline, or
description.
You can provide a single term (e.g., list("Compressor")
) or multiple
terms (e.g., list("Expression", "Abundance")
) to search for apps
that match all the specified terms. If a term matches any part of the
app's details, the app will be included in the results.
Search terms can also include phrases
(e.g., list("Abundance estimates input")
), which will search for
exact matches within app descriptions or other fields.
id
Use this parameter to query apps based on their ID.
limit
The maximum number of collection items to return
for a single request. Minimum value is 1
.
The maximum value is 100
and the default value is 50
.
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.
fields
Selector specifying a subset of fields to include in the response. For querying apps it is set to return all fields except 'raw' which stores CWL in form of a list. Please be careful when setting to return all fields, since the execution of this API request could be time-consuming.
...
Other arguments that can be passed to core api()
function.
Collection
containing App
objects.
\dontrun{ apps_object <- Apps$new( auth = auth ) # List public apps apps_object$query(visibility = "public") }
get()
This call returns information about the specified app.
The app should be one in a project that you can access;
this could be an app that has been uploaded to the Seven Bridges
Platform by a project member, or a publicly available app that has
been copied to the project.
More about this operation you can find in our
API documentation.
Apps$get(id, revision = NULL, ...)
id
The full <project_id>/<app_short_name>
path for this API call is known as App ID. You can also get the App ID
for an app by making the call to list all apps available to you.
revision
The number of the app revision you want to get.
...
Other arguments that can be passed to core api()
function
like 'fields', etc.
App
object.
\dontrun{ apps_object <- Apps$new( auth = auth ) # Get app object apps_object$get(id = "<some_id>") }
copy()
This call copies the specified app to the specified project. The app should be one in a project that you can access; this could be an app that has been uploaded to the Seven Bridges Platform by a project member, or a publicly available app that has been copied to the project.
Apps$copy( app, project, name = NULL, strategy = c("clone", "direct", "clone_direct", "transient"), ... )
app
App object or the short name of the app you are copying.
Optionally, to copy a specific revision of the app, use the
<app_short_name>/<revision_number>
format, for example
rfranklin/my-project/bamtools-index-2-4-0/1
project
The Project object or project ID you want to copy the app to.
name
The new name the app will have in the target project. If its name will not change, omit this key.
strategy
The method for copying the app. Can be one of:
clone
: copy all revisions; get updates from the same app
as the copied app (default);
direct
: copy latest revision; get updates from the copied app;
clone_direct
: copy all revisions; get updates from the
copied app;
transient
: copy latest revision; get updates from the same
app as the copied app.
Read more about the strategies here.
...
Other arguments that can be passed to core api()
function
like 'fields', etc.
Copied App
object.
\dontrun{ apps_object <- Apps$new( auth = auth ) # Copy app object to a project apps_object$copy(app = app, project = project) }
create()
This call allows you to add an app using raw CWL.
Apps$create( raw = NULL, from_path = NULL, project, name, raw_format = c("JSON", "YAML"), ... )
raw
The body of the request should be a CWL app description saved
as a JSON
or YAML
file. For a template of this description, try
making the call to get raw CWL for an app about an app already in one of
your projects. Shouldn't be used together with from_path
parameter.
from_path
File containing CWL app description. Shouldn't be used together with raw parameter.
project
String project ID or Project object in which you want to store the app.
name
A short name for the app (without any non-alphanumeric characters or spaces)
raw_format
The type of format used (JSON
or YAML
).
...
Other arguments that can be passed to core api()
function
like 'fields', etc.
App
object.
\dontrun{ apps_object <- Apps$new( auth = auth ) # Create new app object apps_object$create( raw = raw, project = project, name = name, raw_format = "YAML" ) }
clone()
The objects of this class are cloneable with this method.
Apps$clone(deep = FALSE)
deep
Whether to make a deep clone.
## ------------------------------------------------ ## Method `Apps$query` ## ------------------------------------------------ ## Not run: apps_object <- Apps$new( auth = auth ) # List public apps apps_object$query(visibility = "public") ## End(Not run) ## ------------------------------------------------ ## Method `Apps$get` ## ------------------------------------------------ ## Not run: apps_object <- Apps$new( auth = auth ) # Get app object apps_object$get(id = "<some_id>") ## End(Not run) ## ------------------------------------------------ ## Method `Apps$copy` ## ------------------------------------------------ ## Not run: apps_object <- Apps$new( auth = auth ) # Copy app object to a project apps_object$copy(app = app, project = project) ## End(Not run) ## ------------------------------------------------ ## Method `Apps$create` ## ------------------------------------------------ ## Not run: apps_object <- Apps$new( auth = auth ) # Create new app object apps_object$create( raw = raw, project = project, name = name, raw_format = "YAML" ) ## End(Not run)
## ------------------------------------------------ ## Method `Apps$query` ## ------------------------------------------------ ## Not run: apps_object <- Apps$new( auth = auth ) # List public apps apps_object$query(visibility = "public") ## End(Not run) ## ------------------------------------------------ ## Method `Apps$get` ## ------------------------------------------------ ## Not run: apps_object <- Apps$new( auth = auth ) # Get app object apps_object$get(id = "<some_id>") ## End(Not run) ## ------------------------------------------------ ## Method `Apps$copy` ## ------------------------------------------------ ## Not run: apps_object <- Apps$new( auth = auth ) # Copy app object to a project apps_object$copy(app = app, project = project) ## End(Not run) ## ------------------------------------------------ ## Method `Apps$create` ## ------------------------------------------------ ## Not run: apps_object <- Apps$new( auth = auth ) # Create new app object apps_object$create( raw = raw, project = project, name = name, raw_format = "YAML" ) ## End(Not run)
R6 Class representing a resource for managing asynchronous jobs.
sevenbridges2::Item
-> AsyncJob
id
Asynchronous job ID.
type
The type of job. Can be one of: COPY, DELETE, MOVE.
state
The following states are available: SUBMITTED, RESOLVING, RUNNING and FINISHED.
result
The result of the job.
total_files
The total number of files that were processed for the job.
completed_files
The number of files that were successfully completed.
failed_files
The number of files that failed.
started_on
The time and date the job started.
finished_on
The time and date the job has finished.
new()
Create a new AsyncJob object.
AsyncJob$new(res = NA, ...)
res
Response containing AsyncJob object information.
...
Other response arguments.
A new AsyncJob
object.
print()
Print method for AsyncJob class.
AsyncJob$print()
\dontrun{ # x is API response when app is requested asyncjob_object <- AsyncJob$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) asyncjob_object$print() }
reload()
Reload AsyncJob object information.
AsyncJob$reload(...)
...
Other arguments that can be passed to core api()
function
like 'fields', etc.
AsyncJob
object.
\dontrun{ # x is API response when app is requested asyncjob_object <- AsyncJob$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) asyncjob_object$reload() }
clone()
The objects of this class are cloneable with this method.
AsyncJob$clone(deep = FALSE)
deep
Whether to make a deep clone.
## ------------------------------------------------ ## Method `AsyncJob$print` ## ------------------------------------------------ ## Not run: # x is API response when app is requested asyncjob_object <- AsyncJob$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) asyncjob_object$print() ## End(Not run) ## ------------------------------------------------ ## Method `AsyncJob$reload` ## ------------------------------------------------ ## Not run: # x is API response when app is requested asyncjob_object <- AsyncJob$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) asyncjob_object$reload() ## End(Not run)
## ------------------------------------------------ ## Method `AsyncJob$print` ## ------------------------------------------------ ## Not run: # x is API response when app is requested asyncjob_object <- AsyncJob$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) asyncjob_object$print() ## End(Not run) ## ------------------------------------------------ ## Method `AsyncJob$reload` ## ------------------------------------------------ ## Not run: # x is API response when app is requested asyncjob_object <- AsyncJob$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) asyncjob_object$reload() ## End(Not run)
Authentication object with methods to access API endpoints.
Every object could be requested from this Auth object and any action
could start from this object using cascading style. Please check
vignette("Authentication_and_Billing", package = "sevenbridges2")
for more information.
This is the main object for authentication to platforms powered by Seven Bridges.
from
Authentication method.
platform
The platform to use.
url
Base URL for API.
sysenv_url
Name of the system environment variable storing the API base URL.
sysenv_token
Name of the system environment variable storing the auth token.
config_file
Location of the user configuration file.
profile_name
Profile name in the user configuration file.
fs
FS (FileSystem) object, for mount and unmount file system.
authorization
Is the token
an API
authentication token (FALSE
) or an access token from the
Seven Bridges single sign-on (TRUE
)?
projects
Projects object, for accessing projects resources on the platform.
files
Files object, for accessing files resources on the platform.
apps
Apps object, for accessing apps resources on the platform.
volumes
Volumes object, for accessing volumes resources on the platform.
tasks
Tasks object, for accessing volumes resources on the platform.
imports
Storage imports object, for accessing volume imports resources on the platform.
exports
Storage exports object, for accessing volume exports resources on the platform.
invoices
Invoices object, for accessing invoice resources on the platform.
billing_groups
Billing_groups object, for accessing billing groups resources on the platform.
new()
Create a new Seven Bridges API Authentication object. All methods can be accessed through this object.
Auth$new( from = c("direct", "env", "file"), platform = NA, url = NA, token = NA, sysenv_url = NA, sysenv_token = NA, config_file = NA, profile_name = NA, fs = NA, authorization = FALSE )
from
Authentication method. Could be:
"direct"
- pass the credential information to the arguments
directly,
"env"
- read from pre-set system environment variables, or
"file"
- read configurations from a credentials file.
Default is "direct"
.
platform
The platform to use.
If platform
and url
are both not specified,
the default is "aws-us"
(Seven Bridges Platform - US).
Other possible values include:
"aws-eu"
- Seven Bridges Platform - EU,
"cgc"
- Cancer Genomics Cloud,
"ali-cn"
- Seven Bridges Platform - China,
"cavatica"
- Cavatica, and
"f4c"
- BioData Catalyst Powered by Seven Bridges.
url
Base URL for API. Please only use this when you
want to specify a platform that is not in the platform
list
above, and also leaving platform
unspecified.
token
API authentication token or access_token
for
Seven Bridges single sign-on. Authentication token uniquely identifies
you on the Seven Bridges Platform and has all your data access,
app management and task execution permissions.
Read more about its usage
here.
sysenv_url
Name of the system environment variable storing
the API base URL. By default: "SB_API_ENDPOINT"
.
sysenv_token
Name of the system environment variable storing
the auth token. By default: "SB_AUTH_TOKEN"
.
config_file
Location of the user configuration file.
By default: "~/.sevenbridges/credentials"
.
profile_name
Profile name in the user configuration file.
The default value is "default"
.
fs
FS (FileSystem) object, for mount and unmount file system.
authorization
Is the token
an API
authentication token (FALSE
) or an access token from the
Seven Bridges single sign-on (TRUE
)?
Auth
class object.
\dontrun{ # Multiple ways to create Auth object # Using authentication token a <- Auth$new( token = "<your_token>", platform = "aws-us" ) # Authenticate using environment variables a <- Auth$new(from = "env") # Authenticate using file configuration a <- Auth$new(from = "file") }
get_token()
Returns the authentication token read from system environment variable.
Auth$get_token()
An API authentication token in form of a string.
\dontrun{ # Authenticate using authentication token a <- Auth$new( token = "<your_token>", platform = "aws-us" ) # Get that same token a$get_token() }
api()
This method returns all API paths and
pass arguments to core api()
function.
Auth$api( ..., limit = getOption("sevenbridges2")$limit, offset = getOption("sevenbridges2")$offset, fields = "_all" )
...
Other arguments passed to core api()
function, like path
,
query
parameters or full url
to some resource.
limit
The maximum number of collection items to return for a
single request. Minimum value is 1
. The maximum value is 100
and the
default value is 50
.
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.
fields
Selector specifying a subset of fields to include in the
response. This parameter enables you to specify the fields you want to
be returned when listing resources (e.g. all your projects) or
getting details of a specific resource (e.g. a given project).
For example, fields="id,name,size"
to return the fields
id, name and size for files. Default value is set to
_all
, so all fields are always returned for each resource.
More details please check
general API documentation.
\dontrun{ # Authenticate using authentication token a <- Auth$new( token = "<your_token>", platform = "aws-us" ) # Create API request using request parameters directly a$api(params) }
user()
Get details about the authenticated user.
Auth$user(username = NULL)
username
The username of a user for whom you want to get basic account information. If not provided, information about the currently authenticated user will be returned.
User
class object.
\dontrun{ # Authenticate using authentication token a <- Auth$new( token = "<your_token>", platform = "aws-us" ) # Get information about the currently authenticated user a$user() }
rate_limit()
Get information about current rate limit.
This call returns information about your current rate limit. This is the
number of API calls you can make in one hour. This call also returns
information about your current instance limit.
Auth$rate_limit()
\dontrun{ # Authenticate using authentication token a <- Auth$new( token = "<your_token>", platform = "aws-us" ) # Get current rate limit a$rate_limit() }
upload()
This method allows you to upload a single file from your local computer to the Platform.
Auth$upload( path, project = NULL, parent = NULL, filename = NULL, overwrite = FALSE, part_size = getOption("sevenbridges2")$RECOMMENDED_PART_SIZE, init = FALSE )
path
File path on local disk.
project
Project
object or its ID. Project should not be used
together with parent. If parent is used, the call will upload the file
to the specified Platform folder, within the project to which the
folder belongs. If project is used, the call will upload the file to
the root of the project's files.
parent
Parent folder object (of File
class) or its ID.
Should not be used together with project. If parent is used, the call
will upload the file to the
specified Platform folder, within the project to which the folder
belongs. If project is used, the call will upload the file to the root
of the project's files.
filename
Optional new file name. By default the uploaded file will
have the same name as the original file provided with the path
parameter. If its name will not change, omit this key.
overwrite
In case there is already a file with the same name in
the selected platform project or folder, this option allows you to
control whether that file will be overwritten or not.
If overwrite is set to TRUE
and a file already exists under the name
specified in the request, the existing file will be deleted and a new
one created in its place.
part_size
The preferred size for upload parts in bytes. If omitted or set to a value that is incompatible with the cloud storage provider, a default value will be used.
init
If TRUE
, the method will initialize and return the Upload
object and stop. If FALSE
, the method will return the Upload object
and start the upload process immediately.
\dontrun{ # Authenticate using authentication token a <- Auth$new( token = "<your_token>", platform = "aws-us" ) # Create upload job and set destination project upload_job <- a$upload( path = "/path/to/your/file.txt", project = destination_project, overwrite = TRUE, init = TRUE ) }
list_ongoing_uploads()
This method returns the list of all ongoing uploads.
Auth$list_ongoing_uploads()
\dontrun{ # Authenticate using authentication token a <- Auth$new( token = "<your_token>", platform = "aws-us" ) # List ongoing uploads a$list_ongoing_uploads() }
upload_abort()
This call aborts an ongoing multipart upload.
Auth$upload_abort(upload_id)
upload_id
Upload object or ID of the upload process that you want to abort.
\dontrun{ # Authenticate using authentication token a <- Auth$new( token = "<your_token>", platform = "aws-us" ) # Abort upload a$abort_upload(upload_id = "<id_of_the_upload_process>") }
send_feedback()
Send feedback to Seven Bridges.
Send feedback on ideas, thoughts, and problems via the sevenbridges2 API
package with three available types: idea
, thought
, and problem
.
You can send one feedback item per minute.
Auth$send_feedback( text, type = c("idea", "thought", "problem"), referrer = NULL )
text
Specifies the content for the feedback i.e. feedback text.
type
Specifies the type of feedback. The following are available:
idea
, thought
and problem
.
referrer
The name of the person submitting the feedback.
\dontrun{ # Authenticate using authentication token a <- Auth$new( token = "<your_token>", platform = "aws-us" ) # Send feedback a$send_feedback( "This is a test for sending feedback via API.", type = "thought" ) }
clone()
The objects of this class are cloneable with this method.
Auth$clone(deep = FALSE)
deep
Whether to make a deep clone.
## ------------------------------------------------ ## Method `Auth$new` ## ------------------------------------------------ ## Not run: # Multiple ways to create Auth object # Using authentication token a <- Auth$new( token = "<your_token>", platform = "aws-us" ) # Authenticate using environment variables a <- Auth$new(from = "env") # Authenticate using file configuration a <- Auth$new(from = "file") ## End(Not run) ## ------------------------------------------------ ## Method `Auth$get_token` ## ------------------------------------------------ ## Not run: # Authenticate using authentication token a <- Auth$new( token = "<your_token>", platform = "aws-us" ) # Get that same token a$get_token() ## End(Not run) ## ------------------------------------------------ ## Method `Auth$api` ## ------------------------------------------------ ## Not run: # Authenticate using authentication token a <- Auth$new( token = "<your_token>", platform = "aws-us" ) # Create API request using request parameters directly a$api(params) ## End(Not run) ## ------------------------------------------------ ## Method `Auth$user` ## ------------------------------------------------ ## Not run: # Authenticate using authentication token a <- Auth$new( token = "<your_token>", platform = "aws-us" ) # Get information about the currently authenticated user a$user() ## End(Not run) ## ------------------------------------------------ ## Method `Auth$rate_limit` ## ------------------------------------------------ ## Not run: # Authenticate using authentication token a <- Auth$new( token = "<your_token>", platform = "aws-us" ) # Get current rate limit a$rate_limit() ## End(Not run) ## ------------------------------------------------ ## Method `Auth$upload` ## ------------------------------------------------ ## Not run: # Authenticate using authentication token a <- Auth$new( token = "<your_token>", platform = "aws-us" ) # Create upload job and set destination project upload_job <- a$upload( path = "/path/to/your/file.txt", project = destination_project, overwrite = TRUE, init = TRUE ) ## End(Not run) ## ------------------------------------------------ ## Method `Auth$list_ongoing_uploads` ## ------------------------------------------------ ## Not run: # Authenticate using authentication token a <- Auth$new( token = "<your_token>", platform = "aws-us" ) # List ongoing uploads a$list_ongoing_uploads() ## End(Not run) ## ------------------------------------------------ ## Method `Auth$upload_abort` ## ------------------------------------------------ ## Not run: # Authenticate using authentication token a <- Auth$new( token = "<your_token>", platform = "aws-us" ) # Abort upload a$abort_upload(upload_id = "<id_of_the_upload_process>") ## End(Not run) ## ------------------------------------------------ ## Method `Auth$send_feedback` ## ------------------------------------------------ ## Not run: # Authenticate using authentication token a <- Auth$new( token = "<your_token>", platform = "aws-us" ) # Send feedback a$send_feedback( "This is a test for sending feedback via API.", type = "thought" ) ## End(Not run)
## ------------------------------------------------ ## Method `Auth$new` ## ------------------------------------------------ ## Not run: # Multiple ways to create Auth object # Using authentication token a <- Auth$new( token = "<your_token>", platform = "aws-us" ) # Authenticate using environment variables a <- Auth$new(from = "env") # Authenticate using file configuration a <- Auth$new(from = "file") ## End(Not run) ## ------------------------------------------------ ## Method `Auth$get_token` ## ------------------------------------------------ ## Not run: # Authenticate using authentication token a <- Auth$new( token = "<your_token>", platform = "aws-us" ) # Get that same token a$get_token() ## End(Not run) ## ------------------------------------------------ ## Method `Auth$api` ## ------------------------------------------------ ## Not run: # Authenticate using authentication token a <- Auth$new( token = "<your_token>", platform = "aws-us" ) # Create API request using request parameters directly a$api(params) ## End(Not run) ## ------------------------------------------------ ## Method `Auth$user` ## ------------------------------------------------ ## Not run: # Authenticate using authentication token a <- Auth$new( token = "<your_token>", platform = "aws-us" ) # Get information about the currently authenticated user a$user() ## End(Not run) ## ------------------------------------------------ ## Method `Auth$rate_limit` ## ------------------------------------------------ ## Not run: # Authenticate using authentication token a <- Auth$new( token = "<your_token>", platform = "aws-us" ) # Get current rate limit a$rate_limit() ## End(Not run) ## ------------------------------------------------ ## Method `Auth$upload` ## ------------------------------------------------ ## Not run: # Authenticate using authentication token a <- Auth$new( token = "<your_token>", platform = "aws-us" ) # Create upload job and set destination project upload_job <- a$upload( path = "/path/to/your/file.txt", project = destination_project, overwrite = TRUE, init = TRUE ) ## End(Not run) ## ------------------------------------------------ ## Method `Auth$list_ongoing_uploads` ## ------------------------------------------------ ## Not run: # Authenticate using authentication token a <- Auth$new( token = "<your_token>", platform = "aws-us" ) # List ongoing uploads a$list_ongoing_uploads() ## End(Not run) ## ------------------------------------------------ ## Method `Auth$upload_abort` ## ------------------------------------------------ ## Not run: # Authenticate using authentication token a <- Auth$new( token = "<your_token>", platform = "aws-us" ) # Abort upload a$abort_upload(upload_id = "<id_of_the_upload_process>") ## End(Not run) ## ------------------------------------------------ ## Method `Auth$send_feedback` ## ------------------------------------------------ ## Not run: # Authenticate using authentication token a <- Auth$new( token = "<your_token>", platform = "aws-us" ) # Send feedback a$send_feedback( "This is a test for sending feedback via API.", type = "thought" ) ## End(Not run)
R6 Class representing a central resource for managing billing groups.
This is main object for Billing
sevenbridges2::Item
-> Billing
URL
List of URL endpoints for this resource.
id
Billing group identifier.
owner
Username of the user that owns the billing group.
name
Billing group name.
type
Billing group type
pending
Billing group approval status.
disabled
Indicator of whether the billing group is disabled.
balance
Billing group balance.
new()
Create a new Billing object.
Billing$new(res = NA, ...)
res
Response containing Billing object information.
...
Other response arguments.
print()
Print billing group information as a bullet list.
Billing$print()
\dontrun{ # x is API response when billing group is requested billing_object <- Billing$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Print billing group billing_object$print() }
reload()
Reload Billing group object.
Billing$reload(...)
...
Other arguments that can be passed to core api()
function
like 'limit', 'offset', 'fields', etc.
Billing
object.
\dontrun{ # x is API response when billing group is requested billing_object <- Billing$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Reload billing group billing_object$reload() }
analysis_breakdown()
Method for getting a analysis breakdown for a billing group.
Billing$analysis_breakdown( date_from = NULL, date_to = NULL, invoice = NULL, fields = NULL, limit = getOption("sevenbridges2")$limit, offset = getOption("sevenbridges2")$offset, ... )
date_from
A string representing the starting date for retrieving transactions analysis in the following format: mm-dd-yyyy.
date_to
A string representing the ending date for retrieving transactions analysis in the following format: mm-dd-yyyy.
invoice
A string representing invoice ID or Invoice object to show a breakdown for the specific invoice. If omitted, the current spending breakdown is returned.
fields
Selector specifying a subset of fields to include in the response.
limit
The maximum number of collection items to return
for a single request. Minimum value is 1
.
The maximum value is 100
and the default value is 50
.
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.
\dontrun{ # x is API response when billing group is requested billing_object <- Billing$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Get analysis breakdown billing_object$analysis_breakdown() }
storage_breakdown()
Method for getting a storage breakdown for a billing group.
Billing$storage_breakdown( date_from = NULL, date_to = NULL, invoice = NULL, fields = NULL, limit = getOption("sevenbridges2")$limit, offset = getOption("sevenbridges2")$offset, ... )
date_from
A string representing the starting date for retrieving storage analysis in the following format: mm-dd-yyyy.
date_to
A string representing the ending date for retrieving storage analysis in the following format: mm-dd-yyyy.
invoice
A string representing invoice ID or Invoice object to show a breakdown for the specific invoice. If omitted, the current spending breakdown is returned.
fields
Selector specifying a subset of fields to include in the response.
limit
The maximum number of collection items to return
for a single request. Minimum value is 1
.
The maximum value is 100
and the default value is 50
.
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.
\dontrun{ # x is API response when billing group is requested billing_object <- Billing$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Get storage breakdown billing_object$storage_breakdown() }
egress_breakdown()
Method for getting a egress breakdown for a billing group.
Billing$egress_breakdown( date_from = NULL, date_to = NULL, invoice = NULL, fields = NULL, limit = getOption("sevenbridges2")$limit, offset = getOption("sevenbridges2")$offset, ... )
date_from
A string representing the starting date for retrieving egress analysis in the following format: mm-dd-yyyy.
date_to
A string representing the ending date for retrieving egress analysis in the following format: mm-dd-yyyy.
invoice
A string representing invoice ID or Invoice object to show a breakdown for the specific invoice. If omitted, the current spending breakdown is returned.
fields
Selector specifying a subset of fields to include in the response.
limit
The maximum number of collection items to return
for a single request. Minimum value is 1
.
The maximum value is 100
and the default value is 50
.
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.
\dontrun{ # x is API response when billing group is requested billing_object <- Billing$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Get egress breakdown billing_object$egress_breakdown() }
clone()
The objects of this class are cloneable with this method.
Billing$clone(deep = FALSE)
deep
Whether to make a deep clone.
## ------------------------------------------------ ## Method `Billing$print` ## ------------------------------------------------ ## Not run: # x is API response when billing group is requested billing_object <- Billing$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Print billing group billing_object$print() ## End(Not run) ## ------------------------------------------------ ## Method `Billing$reload` ## ------------------------------------------------ ## Not run: # x is API response when billing group is requested billing_object <- Billing$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Reload billing group billing_object$reload() ## End(Not run) ## ------------------------------------------------ ## Method `Billing$analysis_breakdown` ## ------------------------------------------------ ## Not run: # x is API response when billing group is requested billing_object <- Billing$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Get analysis breakdown billing_object$analysis_breakdown() ## End(Not run) ## ------------------------------------------------ ## Method `Billing$storage_breakdown` ## ------------------------------------------------ ## Not run: # x is API response when billing group is requested billing_object <- Billing$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Get storage breakdown billing_object$storage_breakdown() ## End(Not run) ## ------------------------------------------------ ## Method `Billing$egress_breakdown` ## ------------------------------------------------ ## Not run: # x is API response when billing group is requested billing_object <- Billing$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Get egress breakdown billing_object$egress_breakdown() ## End(Not run)
## ------------------------------------------------ ## Method `Billing$print` ## ------------------------------------------------ ## Not run: # x is API response when billing group is requested billing_object <- Billing$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Print billing group billing_object$print() ## End(Not run) ## ------------------------------------------------ ## Method `Billing$reload` ## ------------------------------------------------ ## Not run: # x is API response when billing group is requested billing_object <- Billing$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Reload billing group billing_object$reload() ## End(Not run) ## ------------------------------------------------ ## Method `Billing$analysis_breakdown` ## ------------------------------------------------ ## Not run: # x is API response when billing group is requested billing_object <- Billing$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Get analysis breakdown billing_object$analysis_breakdown() ## End(Not run) ## ------------------------------------------------ ## Method `Billing$storage_breakdown` ## ------------------------------------------------ ## Not run: # x is API response when billing group is requested billing_object <- Billing$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Get storage breakdown billing_object$storage_breakdown() ## End(Not run) ## ------------------------------------------------ ## Method `Billing$egress_breakdown` ## ------------------------------------------------ ## Not run: # x is API response when billing group is requested billing_object <- Billing$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Get egress breakdown billing_object$egress_breakdown() ## End(Not run)
R6 Class representing billing groups resource endpoints.
sevenbridges2::Resource
-> Billing_groups
URL
List of URL endpoints for this resource.
new()
Create a new Billing_groups object.
Billing_groups$new(...)
...
Other response arguments.
query()
List all your billing groups, including groups that are pending or have been disabled.
Billing_groups$query( limit = getOption("sevenbridges2")$limit, offset = getOption("sevenbridges2")$offset, ... )
limit
The maximum number of collection items to return
for a single request. Minimum value is 1
.
The maximum value is 100
and the default value is 50
.
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 query parameters, 'fields', etc.
Collection
of Billing
groups.
\dontrun{ billing_groups_object <- Billing_groups$new( auth = auth ) # List all your billing groups billing_groups_object$query() }
get()
Retrieve a single billing group, specified by its id.
To find the billing_group
, use the call Billing_groups$query()
to list all your billing groups. The information returned
includes the billing group owner, the total balance, and the status of
the billing group (pending or confirmed).
Billing_groups$get(id, ...)
id
The ID of the billing group you are querying.
...
Other arguments that can be passed to core api()
function
like 'fields', etc.
Billing
object.
\dontrun{ billing_groups_object <- Billing_groups$new( auth = auth ) # Get single billing group billing_groups_object$get(id = id) }
clone()
The objects of this class are cloneable with this method.
Billing_groups$clone(deep = FALSE)
deep
Whether to make a deep clone.
## ------------------------------------------------ ## Method `Billing_groups$query` ## ------------------------------------------------ ## Not run: billing_groups_object <- Billing_groups$new( auth = auth ) # List all your billing groups billing_groups_object$query() ## End(Not run) ## ------------------------------------------------ ## Method `Billing_groups$get` ## ------------------------------------------------ ## Not run: billing_groups_object <- Billing_groups$new( auth = auth ) # Get single billing group billing_groups_object$get(id = id) ## End(Not run)
## ------------------------------------------------ ## Method `Billing_groups$query` ## ------------------------------------------------ ## Not run: billing_groups_object <- Billing_groups$new( auth = auth ) # List all your billing groups billing_groups_object$query() ## End(Not run) ## ------------------------------------------------ ## Method `Billing_groups$get` ## ------------------------------------------------ ## Not run: billing_groups_object <- Billing_groups$new( auth = auth ) # Get single billing group billing_groups_object$get(id = id) ## End(Not run)
R6 Class representing a resource for managing collections. Wrapper for Seven Bridges pageable resources. Among the actual collection items it contains information regarding the total number of entries available on the server and resource API request URL (href).
href
API request URL.
items
Items returned in API response.
links
List of links (hrefs) for next and/or previous page resources.
total
Total number of items available on the server.
response
Raw API response.
auth
Seven Bridges Authentication object.
new()
Create a new Collection object.
Collection$new( href = NA, items = NA, links = NA, total = NA, response = NA, auth = NA )
href
API request URL.
items
Items returned in API response.
links
List of links (hrefs) for next and/or previous page resources.
total
Total number of items available on the server.
response
Raw API response.
auth
Seven Bridges Authentication object.
print()
Print method for Collection class.
Collection$print(n = 10)
n
Number of items to print in console.
\dontrun{ # x is API response when collection object is requested collection_object <- Collection$new( href = x$href, items = x$items, links = x$links, total = x$total, auth = auth, response = attr(x, "response") ) # Print collection object collection_object$print() }
next_page()
Return next page of results.
Collection$next_page(...)
...
Other arguments that can be passed to core api()
function
like 'advanced_access', 'fields', etc.
\dontrun{ # x is API response when collection object is requested collection_object <- Collection$new( href = x$href, items = x$items, links = x$links, total = x$total, auth = auth, response = attr(x, "response") ) # Get next page of collection results collection_object$next_page() }
prev_page()
Return previous page of results.
Collection$prev_page(...)
...
Other arguments that can be passed to core api()
function
like 'advanced_access', 'fields', etc.
\dontrun{ # x is API response when collection object is requested collection_object <- Collection$new( href = x$href, items = x$items, links = x$links, total = x$total, auth = auth, response = attr(x, "response") ) # Get previous page of collection results collection_object$prev_page() }
all()
Fetches all available items by iterating through all pages. Please be aware of the API rate limit for your request.
Collection$all(...)
...
Other arguments that can be passed to core api()
function
like 'advanced_access', 'fields', etc.
\dontrun{ # x is API response when collection object is requested collection_object <- Collection$new( href = x$href, items = x$items, links = x$links, total = x$total, auth = auth, response = attr(x, "response") ) # Get all results of collection collection_object$all() }
clone()
The objects of this class are cloneable with this method.
Collection$clone(deep = FALSE)
deep
Whether to make a deep clone.
## ------------------------------------------------ ## Method `Collection$print` ## ------------------------------------------------ ## Not run: # x is API response when collection object is requested collection_object <- Collection$new( href = x$href, items = x$items, links = x$links, total = x$total, auth = auth, response = attr(x, "response") ) # Print collection object collection_object$print() ## End(Not run) ## ------------------------------------------------ ## Method `Collection$next_page` ## ------------------------------------------------ ## Not run: # x is API response when collection object is requested collection_object <- Collection$new( href = x$href, items = x$items, links = x$links, total = x$total, auth = auth, response = attr(x, "response") ) # Get next page of collection results collection_object$next_page() ## End(Not run) ## ------------------------------------------------ ## Method `Collection$prev_page` ## ------------------------------------------------ ## Not run: # x is API response when collection object is requested collection_object <- Collection$new( href = x$href, items = x$items, links = x$links, total = x$total, auth = auth, response = attr(x, "response") ) # Get previous page of collection results collection_object$prev_page() ## End(Not run) ## ------------------------------------------------ ## Method `Collection$all` ## ------------------------------------------------ ## Not run: # x is API response when collection object is requested collection_object <- Collection$new( href = x$href, items = x$items, links = x$links, total = x$total, auth = auth, response = attr(x, "response") ) # Get all results of collection collection_object$all() ## End(Not run)
## ------------------------------------------------ ## Method `Collection$print` ## ------------------------------------------------ ## Not run: # x is API response when collection object is requested collection_object <- Collection$new( href = x$href, items = x$items, links = x$links, total = x$total, auth = auth, response = attr(x, "response") ) # Print collection object collection_object$print() ## End(Not run) ## ------------------------------------------------ ## Method `Collection$next_page` ## ------------------------------------------------ ## Not run: # x is API response when collection object is requested collection_object <- Collection$new( href = x$href, items = x$items, links = x$links, total = x$total, auth = auth, response = attr(x, "response") ) # Get next page of collection results collection_object$next_page() ## End(Not run) ## ------------------------------------------------ ## Method `Collection$prev_page` ## ------------------------------------------------ ## Not run: # x is API response when collection object is requested collection_object <- Collection$new( href = x$href, items = x$items, links = x$links, total = x$total, auth = auth, response = attr(x, "response") ) # Get previous page of collection results collection_object$prev_page() ## End(Not run) ## ------------------------------------------------ ## Method `Collection$all` ## ------------------------------------------------ ## Not run: # x is API response when collection object is requested collection_object <- Collection$new( href = x$href, items = x$items, links = x$links, total = x$total, auth = auth, response = attr(x, "response") ) # Get all results of collection collection_object$all() ## End(Not run)
R6 Class representing a resource for managing volume export jobs.
sevenbridges2::Item
-> Export
URL
List of URL endpoints for this resource.
id
Export job string identifier.
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.
source
List containing source file id that is being exported to the volume.
destination
List containing destination volume id and location (file name) on the volume where the file is being exported.
overwrite
Whether the exported file name was overwritten or not, if another one with the same name had already existed on the volume.
started_on
Time when the export job started.
finished_on
Time when the export job ended.
properties
List of volume properties set.
error
In case of error in the export job, standard API error is returned here.
result
File object that was exported.
new()
Create a new Export object.
Export$new(res = NA, ...)
res
Response containing Export job information.
...
Other response arguments.
print()
Print method for Export class.
Export$print()
\dontrun{ # x is API response when export is requested export_object <- Export$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Print export object export_object$print() }
reload()
Reload Export object information.
Export$reload(...)
...
Other arguments that can be passed to core api()
function
like 'fields', etc.
Export
object.
\dontrun{ # x is API response when export is requested export_object <- Export$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Reload export object export_object$reload() }
clone()
The objects of this class are cloneable with this method.
Export$clone(deep = FALSE)
deep
Whether to make a deep clone.
## ------------------------------------------------ ## Method `Export$print` ## ------------------------------------------------ ## Not run: # x is API response when export is requested export_object <- Export$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Print export object export_object$print() ## End(Not run) ## ------------------------------------------------ ## Method `Export$reload` ## ------------------------------------------------ ## Not run: # x is API response when export is requested export_object <- Export$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Reload export object export_object$reload() ## End(Not run)
## ------------------------------------------------ ## Method `Export$print` ## ------------------------------------------------ ## Not run: # x is API response when export is requested export_object <- Export$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Print export object export_object$print() ## End(Not run) ## ------------------------------------------------ ## Method `Export$reload` ## ------------------------------------------------ ## Not run: # x is API response when export is requested export_object <- Export$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Reload export object export_object$reload() ## End(Not run)
R6 Class representing storage exports resource endpoints.
sevenbridges2::Resource
-> Exports
URL
List of URL endpoints for this resource.
new()
Create a new Exports object.
Exports$new(...)
...
Other response arguments.
query()
This call lists export jobs initiated by particular user. Note that when you export a file from a project on the Platform into a volume, you write to your cloud storage bucket.
Exports$query( volume = NULL, state = NULL, limit = getOption("sevenbridges2")$limit, offset = getOption("sevenbridges2")$offset, ... )
volume
Volume id or Volume object. List all exports into this particular volume. Optional.
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 is 100
and the default value is 50
.
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.
Collection
of Export
objects.
\dontrun{ exports_object <- Exports$new( auth = auth ) # List all your running or failed export jobs on the volume exports_object$query(volume = volume, state = c("RUNNING", "FAILED")) }
get()
This call will return the details of an export job.
Exports$get(id, ...)
id
The export job identifier (id).
...
Other arguments that can be passed to core api()
function
like 'fields', etc.
Export
object.
\dontrun{ exports_object <- Exports$new( auth = auth ) # Get export job by ID exports_object$get(id = id) }
submit_export()
This call lets you queue a job to export a file from a
project on the Platform into a volume. The file selected for export must
not be a public file or an alias. Aliases are objects stored in your
cloud storage bucket which have been made available on the Platform.
The volume you are exporting to must be configured for
read-write access. To do this, set the access_mode
parameter to
RW
when creating or modifying a volume.
Essentially, the call writes to your cloud storage bucket via the
volume. If this call is successful, the original project file will
become an alias to the newly exported object on the volume.
The source file will be deleted from the Platform and, if no more
copies of this file exist, it will no longer count towards your total
storage price on the Platform.
In summary, once you export a file from the Platform to a volume, it is
no longer part of the storage on the Platform and cannot be exported
again.
Read more about this operation in our documentation
here.
If you want to export multiple files, the recommended way is to do it in bulk considering the API rate limit (learn more). Bulk operations will be implemented in next releases.
Exports$submit_export( source_file, destination_volume, destination_location, overwrite = FALSE, copy_only = FALSE, properties = NULL, ... )
source_file
File id or File object you want to export to the volume.
destination_volume
Volume id or Volume object you want to export files into.
destination_location
Volume-specific location to which the file will be exported. This location should be recognizable to the underlying cloud service as a valid key or path to a new file. Please note that if this volume has been configured with a prefix parameter, the value of prefix will be prepended to location before attempting to create the file on the volume.
If you would like to export the file into some folder on the volume,
please add folder name as prefix before file name in form
<folder-name>/<file-name>
.
overwrite
Set to TRUE
if you want to overwrite the item
if another one with the same name already exists at the destination.
copy_only
If TRUE
, file will be copied to a volume but
source file will remain on the Platform.
properties
Named list of additional volume properties, like:
sse_algorithm
- S3 server-side encryption to use when
exporting to this bucket. Supported values:
AES256
(SSE-S3 encryption), aws:kms
, null
(no server-side encryption). Default: AES256
.
sse_aws_kms_key_id
: Applies to type: s3
.
If AWS KMS encryption is used, this should be set to the required
KMS key. If not set and aws:kms
is set as sse_algorithm
,
default KMS key is used.
aws_canned_acl
: S3 canned ACL to apply on the object
on during export. Supported values: any one of
S3 canned ACLs;
null
(do not apply canned ACLs). Default: null
.
...
Other arguments that can be passed to core api()
function
like 'fields', etc.
Export
object.
\dontrun{ exports_object <- Exports$new( auth = auth ) # Submit export job exp_job1 <- exports_object$submit_export( source_file = test_file, destination_volume = vol1, destination_location = "new_volume_file.txt" ) }
delete()
Deleting export jobs is not possible.
Exports$delete()
bulk_get()
This call returns the details of a bulk export job. When you export files from a project on the Platform into a volume, you write to your cloud storage bucket. This call obtains the details of that job.
Exports$bulk_get(exports)
exports
The list of the export job IDs as returned by the call
to start a bulk export job or list of Export
objects.
Collection
with list of Export
objects.
\dontrun{ exports_object <- Exports$new( auth = auth, ) # List export jobs exports_object$bulk_get( exports = list("export-job-id-1", "export-job-id-2") ) }
bulk_submit_export()
Bulk export files from your project on the Seven Bridges
Platform into your volume. One call can contain up to 100 items.
Files selected for export must not be public files or aliases.
Aliases are objects stored in your cloud storage bucket which have
been made available on the Platform. The volume you are exporting to
must be configured for read-write access. To do this, set the
access_mode
parameter to RW when creating or modifying a volume.
Essentially, the call writes to your cloud storage bucket via the volume. If this call is successful, the original project files will become aliases to the newly exported objects on the volume. Source files will be deleted from the Platform and, if no more copies of the files exist, they will no longer count towards your total storage price on the Platform. In summary, once you export files from the Platform to a volume, they are no longer part of the storage on the Platform and cannot be exported again.
Learn more about using the Volumes API for Amazon S3 and for Google Cloud Storage.
Exports$bulk_submit_export(items, copy_only = FALSE)
items
Nested list of elements containing information about each file to be exported. For each element, users must provide:
source_file
- File ID or File object you want to export to
the volume,
destination_volume
- Volume ID or Volume object you want to
export files into.
destination_location
- Volume-specific location to which
the file will be exported. This location should be recognizable
to the underlying cloud service as a valid key or path to a
new file. Please note that if this volume has been configured
with a prefix
parameter, the value of prefix
will be
prepended to the location before attempting to create the file on
the volume.
If you would like to export the file into a folder on
the volume, please add folder name as a prefix before the file
name in the <folder-name>/<file-name>
form.
overwrite
- Set to TRUE
if you want to overwrite the
item with the same name if it already exists at the
destination.
properties
- Named list of additional volume properties,
like:
sse_algorithm
- S3 server-side encryption to use when
exporting to this bucket. Supported values:
AES256
(SSE-S3 encryption), aws:kms
, null
(no server-side encryption). Default: AES256
.
sse_aws_kms_key_id
: Applies to type: s3
.
If AWS KMS encryption is used, this should be set to the
required KMS key. If not set and aws:kms
is set as
sse_algorithm
, default KMS key is used.
aws_canned_acl
: S3 canned ACL to apply on the object
during export. Supported values: any one of
S3 canned ACLs;
null
(do not apply canned ACLs). Default: null
.
Example of the list:
items <- list( list( source_file = "test_file-id", destination_volume = "volume-id", destination_location = "new_volume_file.txt" ), list( source_file = "test_file_obj", destination_volume = "test_volume_obj", destination_location = "/volume_folder/exported_file.txt", overwrite = TRUE ), list( source_file = "project_file_3_id", destination_volume = "volume-id", destination_location = "project_file_3.txt", properties = list( sse_algorithm = "AES256" ) ) )
Read more on how to export files from your project to a volume or a volume folder.
Utility function prepare_items_for_bulk_export
can help
you prepare the items
parameter for the bulk_submit_export()
method.
copy_only
If set to true, the files will be copied to a volume but the source files will remain on the Platform.
Collection
with list of Export
objects.
\dontrun{ exports_object <- Exports$new( auth = auth ) # Submit new bulk export into a volume exports_object$bulk_submit_export(items = list( list( source_file = "test_file-id", destination_volume = "volume-id", destination_location = "new_volume_file.txt" ), list( source_file = test_file_obj, destination_volume = test_volume_obj, destination_location = "/volume_folder/exported_file.txt", overwrite = TRUE ), list( source_file = "project_file_3_id", destination_volume = "volume-id", destination_location = "project_file_3.txt", properties = list( sse_algorithm = "AES256" ) ) ), copy_only = TRUE ) }
clone()
The objects of this class are cloneable with this method.
Exports$clone(deep = FALSE)
deep
Whether to make a deep clone.
## ------------------------------------------------ ## Method `Exports$query` ## ------------------------------------------------ ## Not run: exports_object <- Exports$new( auth = auth ) # List all your running or failed export jobs on the volume exports_object$query(volume = volume, state = c("RUNNING", "FAILED")) ## End(Not run) ## ------------------------------------------------ ## Method `Exports$get` ## ------------------------------------------------ ## Not run: exports_object <- Exports$new( auth = auth ) # Get export job by ID exports_object$get(id = id) ## End(Not run) ## ------------------------------------------------ ## Method `Exports$submit_export` ## ------------------------------------------------ ## Not run: exports_object <- Exports$new( auth = auth ) # Submit export job exp_job1 <- exports_object$submit_export( source_file = test_file, destination_volume = vol1, destination_location = "new_volume_file.txt" ) ## End(Not run) ## ------------------------------------------------ ## Method `Exports$bulk_get` ## ------------------------------------------------ ## Not run: exports_object <- Exports$new( auth = auth, ) # List export jobs exports_object$bulk_get( exports = list("export-job-id-1", "export-job-id-2") ) ## End(Not run) ## ------------------------------------------------ ## Method `Exports$bulk_submit_export` ## ------------------------------------------------ ## Not run: exports_object <- Exports$new( auth = auth ) # Submit new bulk export into a volume exports_object$bulk_submit_export(items = list( list( source_file = "test_file-id", destination_volume = "volume-id", destination_location = "new_volume_file.txt" ), list( source_file = test_file_obj, destination_volume = test_volume_obj, destination_location = "/volume_folder/exported_file.txt", overwrite = TRUE ), list( source_file = "project_file_3_id", destination_volume = "volume-id", destination_location = "project_file_3.txt", properties = list( sse_algorithm = "AES256" ) ) ), copy_only = TRUE ) ## End(Not run)
## ------------------------------------------------ ## Method `Exports$query` ## ------------------------------------------------ ## Not run: exports_object <- Exports$new( auth = auth ) # List all your running or failed export jobs on the volume exports_object$query(volume = volume, state = c("RUNNING", "FAILED")) ## End(Not run) ## ------------------------------------------------ ## Method `Exports$get` ## ------------------------------------------------ ## Not run: exports_object <- Exports$new( auth = auth ) # Get export job by ID exports_object$get(id = id) ## End(Not run) ## ------------------------------------------------ ## Method `Exports$submit_export` ## ------------------------------------------------ ## Not run: exports_object <- Exports$new( auth = auth ) # Submit export job exp_job1 <- exports_object$submit_export( source_file = test_file, destination_volume = vol1, destination_location = "new_volume_file.txt" ) ## End(Not run) ## ------------------------------------------------ ## Method `Exports$bulk_get` ## ------------------------------------------------ ## Not run: exports_object <- Exports$new( auth = auth, ) # List export jobs exports_object$bulk_get( exports = list("export-job-id-1", "export-job-id-2") ) ## End(Not run) ## ------------------------------------------------ ## Method `Exports$bulk_submit_export` ## ------------------------------------------------ ## Not run: exports_object <- Exports$new( auth = auth ) # Submit new bulk export into a volume exports_object$bulk_submit_export(items = list( list( source_file = "test_file-id", destination_volume = "volume-id", destination_location = "new_volume_file.txt" ), list( source_file = test_file_obj, destination_volume = test_volume_obj, destination_location = "/volume_folder/exported_file.txt", overwrite = TRUE ), list( source_file = "project_file_3_id", destination_volume = "volume-id", destination_location = "project_file_3.txt", properties = list( sse_algorithm = "AES256" ) ) ), copy_only = TRUE ) ## End(Not run)
R6 Class representing a resource for managing files and folders.
sevenbridges2::Item
-> File
URL
List of URL endpoints for this resource.
id
File ID.
name
File name.
size
File size.
project
Project ID if any, where file/folder is located.
created_on
Date file/folder was created on.
modified_on
Date file/folder was modified on.
storage
File/folder's storage type.
origin
Task ID if file/folder is produced by some task execution.
tags
List of tags associated with the file.
metadata
List for metadata associated with the file.
url
File download URL.
parent
Parent folder ID.
type
This can be of type file
or folder
.
secondary_files
Secondary files linked to the file if exist.
new()
Create a new File object.
File$new(res = NA, ...)
res
Response containing File object information.
...
Other response arguments.
print()
Print method for File class.
File$print()
\dontrun{ # x is API response when file is requested file_object <- File$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Print file object file_object$print() }
detailed_print()
Detailed print method for File class.
File$detailed_print()
The call returns the file's name, its tags, and all of its metadata. Apart from regular file fields there are some additional fields:
storage
field denotes the type of storage for the file
which can be either PLATFORM or VOLUME depending on where the file is
stored.
origin
field denotes the task that produced the file, if it
was created by a task on the Seven Bridges Platform.
metadata
field lists the metadata fields and values for the
file.
tags
field lists the tags for the file. Learn more about
tagging your files
on the Platform.
\dontrun{ # x is API response when file is requested file_object <- File$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Detailed print of file object file_object$detailed_print() }
reload()
Reload File object information.
File$reload(...)
...
Other arguments that can be passed to core api()
function
like 'fields', etc.
File
object.
\dontrun{ # x is API response when file is requested file_object <- File$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Reload file object file_object$reload() }
update()
Updates the name, the full set metadata, and tags for a specified file. .
File$update(name = NULL, metadata = NULL, tags = NULL, ...)
name
The new name of the file.
metadata
The metadata fields and their values that you want to update. This is a named list of key-value pairs. The keys and values are strings.
tags
The tags you want to update, represented as unnamed list of values to add as tags.
...
Other arguments that can be passed to core api()
function
like 'limit', 'offset', 'fields', etc.
Updated File
object.
\dontrun{ # x is API response when file is requested file_object <- File$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Update file object file_object$update(name = "new_name") }
add_tag()
This method allows you to tag files on the Platform.
You can tag your files on the Platform with keywords to make it easier
to identify and organize files you’ve imported from public datasets
or copied between projects.
More details on how to use this call can be found
here.
File$add_tag(tags, overwrite = FALSE, ...)
tags
The tags you want to update, represented as unnamed list of values to add as tags.
overwrite
Set to TRUE
if you want to overwrite existing tags.
Default: FALSE
.
...
Additional parameters that can be passed to the method.
\dontrun{ # x is API response when file is requested file_object <- File$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Add new tag to file object file_object$add_tag(tags = c("new_tag")) }
copy_to()
This call copies the specified file to a new project.
Files retain their metadata when copied, but may be assigned new names
in their target project. To make this call, you should have
copy permission
within the project you are copying from.
Note: If you want to copy
multiple files, the recommended way is to do it in bulk considering the
API rate limit
(learn more).
You can do that using Auth$copy_files()
operation.
File$copy_to(project, name = NULL, ...)
project
The ID of the project or a Project object where you want to copy the file to.
name
The new name the file will have in the target project. If its name will not change, omit this key.
...
Other arguments that can be passed to core api()
function
like 'fields', etc.
Copied File
object.
\dontrun{ # x is API response when file is requested file_object <- File$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Copy file object to project file_object$copy_to(project = project) }
get_download_url()
This method returns a URL that you can use to download the specified file.
File$get_download_url(...)
...
Other arguments that can be passed to core api()
function
like 'fields', etc.
\dontrun{ # x is API response when file is requested file_object <- File$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Get download url for file object file_object$get_download_url() }
get_metadata()
This call returns the metadata values for the specified file.
File$get_metadata(...)
...
Other arguments that can be passed to core api()
function
like 'fields', etc.
\dontrun{ # x is API response when file is requested file_object <- File$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Get metadata for file object file_object$get_metadata() }
set_metadata()
This call changes the metadata values for the specified
file.
More details about how to modify metadata, you can find in the
API documentation.
File$set_metadata(metadata_fields, overwrite = FALSE, ...)
metadata_fields
Enter a list of key-value pairs of metadata fields and metadata values.
overwrite
Set to TRUE
if you want to overwrite existing tags.
Default: FALSE
.
...
Other arguments that can be passed to core api()
function
like 'fields', etc.
\dontrun{ # x is API response when file is requested file_object <- File$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Set metadata for file object file_object$set_metadata(metadata_fields = list("field_1" = "value_1")) }
move_to_folder()
This call moves a file from one folder to another. Moving of files is only allowed within the same project.
File$move_to_folder(parent, name = NULL)
parent
The ID of target folder or a File object which must
be of type FOLDER
.
name
Specify a new name for a file in case you want to rename it. If you want to use the same name, omit this key.
Moved File
object.
\dontrun{ # x is API response when file is requested file_object <- File$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Move file object to a project file_object$move_to_folder(parent = "parent-folder-id") }
list_contents()
List folder contents.
File$list_contents( limit = getOption("sevenbridges2")$limit, offset = getOption("sevenbridges2")$offset, ... )
limit
The maximum number of collection items to return
for a single request. Minimum value is 1
.
The maximum value is 100
and the default value is 50
.
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.
Collection
of File
objects.
\dontrun{ # x is API response when file is requested file_object <- File$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # List folder's content file_object$list_contents() }
delete()
Delete method for File objects.
File$delete()
\dontrun{ # x is API response when file is requested file_object <- File$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Delete file object file_object$delete() }
download()
Download method for File objects. It allows download a
platform file to your local computer. To specify the destination for
your download, you should provide the path to the destination directory
as directory_path
parameter.
File$download( directory_path, filename = self$name, method = "curl", retry_count = getOption("sevenbridges2")$default_retry_count, retry_timeout = getOption("sevenbridges2")$default_retry_timeout )
directory_path
Path to the destination directory of a new file.
filename
Full name for the new file, including its extension. By default, the name field of File object will be used.
method
Method to be used for downloading files. By default, this
parameter is set to curl
.
retry_count
Number of retries if error occurs during download.
retry_timeout
Number of seconds between two retries.
\dontrun{ # x is API response when file is requested file_object <- File$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Download file object file_object$download(directory_path = ".") }
submit_export()
This call lets you queue a job to export this file from a
project on the Platform into a volume. The file selected for export must
not be a public file or an alias. Aliases are objects stored in your
cloud storage bucket which have been made available on the Platform.
The volume you are exporting to must be configured for read-write
access. To do this, set the access_mode
parameter to RW
when
creating or modifying a volume.
Essentially, the call writes to your cloud storage bucket via the
volume. If this call is successful, the original project file will
become an alias to the newly exported object on the volume. The source
file will be deleted from the Platform and, if no more copies of this
file exist, it will no longer count towards your total storage price
on the Platform.
In summary, once you export a file from the Platform to a volume,
it is no longer part of the storage on the Platform and
cannot be exported again.
Read more about this operation in our documentation
here.
If you want to export multiple files, the recommended way is to do it
in bulk considering the API rate limit
(learn more)
(bulk operations will be implemented in next releases).
File$submit_export( destination_volume, destination_location, overwrite = FALSE, copy_only = FALSE, properties = NULL, ... )
destination_volume
Volume id or Volume object you want to export files into. Required.
destination_location
Volume-specific location to which the file will be exported. This location should be recognizable to the underlying cloud service as a valid key or path to a new file. Please note that if this volume has been configured with a prefix parameter, the value of prefix will be prepended to location before attempting to create the file on the volume.
If you would like to export the file into some folder on the volume,
please add folder name as prefix before file name in form
<folder-name>/<file-name>
.
overwrite
Set to TRUE
of you want to overwrite the item that
already exists at the destination. Default: FALSE
.
copy_only
If TRUE
, file will be copied to a volume but
source file will remain on the Platform.
properties
Named list of additional volume properties, like:
sse_algorithm
- S3 server-side encryption to use when
exporting to this bucket. Supported values:
AES256
(SSE-S3 encryption), aws:kms
, null
(no server-side encryption). Default: AES256
.
sse_aws_kms_key_id
: Applies to type: s3
.
If AWS KMS encryption is used, this should be set to the required
KMS key. If not set and aws:kms
is set as sse_algorithm
,
default KMS key is used.
aws_canned_acl
: S3 canned ACL to apply on the object
on during export. Supported values: any one of
S3 canned ACLs;
null
(do not apply canned ACLs). Default: null
.
...
Other arguments that can be passed to core api()
function
like 'fields', etc.
Export
object.
\dontrun{ # x is API response when file is requested file_object <- File$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Export file object to a volume file_object$submit_export( destination_volume = volume, destination_location = location ) }
clone()
The objects of this class are cloneable with this method.
File$clone(deep = FALSE)
deep
Whether to make a deep clone.
## ------------------------------------------------ ## Method `File$print` ## ------------------------------------------------ ## Not run: # x is API response when file is requested file_object <- File$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Print file object file_object$print() ## End(Not run) ## ------------------------------------------------ ## Method `File$detailed_print` ## ------------------------------------------------ ## Not run: # x is API response when file is requested file_object <- File$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Detailed print of file object file_object$detailed_print() ## End(Not run) ## ------------------------------------------------ ## Method `File$reload` ## ------------------------------------------------ ## Not run: # x is API response when file is requested file_object <- File$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Reload file object file_object$reload() ## End(Not run) ## ------------------------------------------------ ## Method `File$update` ## ------------------------------------------------ ## Not run: # x is API response when file is requested file_object <- File$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Update file object file_object$update(name = "new_name") ## End(Not run) ## ------------------------------------------------ ## Method `File$add_tag` ## ------------------------------------------------ ## Not run: # x is API response when file is requested file_object <- File$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Add new tag to file object file_object$add_tag(tags = c("new_tag")) ## End(Not run) ## ------------------------------------------------ ## Method `File$copy_to` ## ------------------------------------------------ ## Not run: # x is API response when file is requested file_object <- File$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Copy file object to project file_object$copy_to(project = project) ## End(Not run) ## ------------------------------------------------ ## Method `File$get_download_url` ## ------------------------------------------------ ## Not run: # x is API response when file is requested file_object <- File$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Get download url for file object file_object$get_download_url() ## End(Not run) ## ------------------------------------------------ ## Method `File$get_metadata` ## ------------------------------------------------ ## Not run: # x is API response when file is requested file_object <- File$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Get metadata for file object file_object$get_metadata() ## End(Not run) ## ------------------------------------------------ ## Method `File$set_metadata` ## ------------------------------------------------ ## Not run: # x is API response when file is requested file_object <- File$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Set metadata for file object file_object$set_metadata(metadata_fields = list("field_1" = "value_1")) ## End(Not run) ## ------------------------------------------------ ## Method `File$move_to_folder` ## ------------------------------------------------ ## Not run: # x is API response when file is requested file_object <- File$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Move file object to a project file_object$move_to_folder(parent = "parent-folder-id") ## End(Not run) ## ------------------------------------------------ ## Method `File$list_contents` ## ------------------------------------------------ ## Not run: # x is API response when file is requested file_object <- File$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # List folder's content file_object$list_contents() ## End(Not run) ## ------------------------------------------------ ## Method `File$delete` ## ------------------------------------------------ ## Not run: # x is API response when file is requested file_object <- File$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Delete file object file_object$delete() ## End(Not run) ## ------------------------------------------------ ## Method `File$download` ## ------------------------------------------------ ## Not run: # x is API response when file is requested file_object <- File$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Download file object file_object$download(directory_path = ".") ## End(Not run) ## ------------------------------------------------ ## Method `File$submit_export` ## ------------------------------------------------ ## Not run: # x is API response when file is requested file_object <- File$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Export file object to a volume file_object$submit_export( destination_volume = volume, destination_location = location ) ## End(Not run)
## ------------------------------------------------ ## Method `File$print` ## ------------------------------------------------ ## Not run: # x is API response when file is requested file_object <- File$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Print file object file_object$print() ## End(Not run) ## ------------------------------------------------ ## Method `File$detailed_print` ## ------------------------------------------------ ## Not run: # x is API response when file is requested file_object <- File$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Detailed print of file object file_object$detailed_print() ## End(Not run) ## ------------------------------------------------ ## Method `File$reload` ## ------------------------------------------------ ## Not run: # x is API response when file is requested file_object <- File$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Reload file object file_object$reload() ## End(Not run) ## ------------------------------------------------ ## Method `File$update` ## ------------------------------------------------ ## Not run: # x is API response when file is requested file_object <- File$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Update file object file_object$update(name = "new_name") ## End(Not run) ## ------------------------------------------------ ## Method `File$add_tag` ## ------------------------------------------------ ## Not run: # x is API response when file is requested file_object <- File$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Add new tag to file object file_object$add_tag(tags = c("new_tag")) ## End(Not run) ## ------------------------------------------------ ## Method `File$copy_to` ## ------------------------------------------------ ## Not run: # x is API response when file is requested file_object <- File$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Copy file object to project file_object$copy_to(project = project) ## End(Not run) ## ------------------------------------------------ ## Method `File$get_download_url` ## ------------------------------------------------ ## Not run: # x is API response when file is requested file_object <- File$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Get download url for file object file_object$get_download_url() ## End(Not run) ## ------------------------------------------------ ## Method `File$get_metadata` ## ------------------------------------------------ ## Not run: # x is API response when file is requested file_object <- File$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Get metadata for file object file_object$get_metadata() ## End(Not run) ## ------------------------------------------------ ## Method `File$set_metadata` ## ------------------------------------------------ ## Not run: # x is API response when file is requested file_object <- File$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Set metadata for file object file_object$set_metadata(metadata_fields = list("field_1" = "value_1")) ## End(Not run) ## ------------------------------------------------ ## Method `File$move_to_folder` ## ------------------------------------------------ ## Not run: # x is API response when file is requested file_object <- File$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Move file object to a project file_object$move_to_folder(parent = "parent-folder-id") ## End(Not run) ## ------------------------------------------------ ## Method `File$list_contents` ## ------------------------------------------------ ## Not run: # x is API response when file is requested file_object <- File$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # List folder's content file_object$list_contents() ## End(Not run) ## ------------------------------------------------ ## Method `File$delete` ## ------------------------------------------------ ## Not run: # x is API response when file is requested file_object <- File$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Delete file object file_object$delete() ## End(Not run) ## ------------------------------------------------ ## Method `File$download` ## ------------------------------------------------ ## Not run: # x is API response when file is requested file_object <- File$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Download file object file_object$download(directory_path = ".") ## End(Not run) ## ------------------------------------------------ ## Method `File$submit_export` ## ------------------------------------------------ ## Not run: # x is API response when file is requested file_object <- File$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Export file object to a volume file_object$submit_export( destination_volume = volume, destination_location = location ) ## End(Not run)
R6 Class representing Files resource.
sevenbridges2::Resource
-> Files
URL
List of URL endpoints for this resource.
new()
Create new Files resource object.
Files$new(...)
...
Other response arguments.
query()
This call returns a list of files and subdirectories in a
specified project or directory within a project, with specified
properties that you can access. The project or directory whose contents
you want to list is specified as a query parameter in the call. Further
properties to filter by can also be specified as query parameters.
Note that this call lists both files and subdirectories in the
specified project or directory within a project, but not the contents
of the subdirectories.
To list the contents of a subdirectory, make a new call
and specify the subdirectory ID as the parent
parameter.
More information you can find in our
API documentation.
Files$query( project = NULL, parent = NULL, name = NULL, metadata = NULL, origin = NULL, tag = NULL, limit = getOption("sevenbridges2")$limit, offset = getOption("sevenbridges2")$offset, ... )
project
Project identifier (ID) as string or a Project object. Project should not be used together with parent. If parent is used, the call will list the content of the specified folder, within the project to which the folder belongs. If project is used, the call will list the content at the root of the project's files.
parent
The parent folder identifier as string or a File object
which must be of type FOLDER
.
Should not be used together with project.
If parent is used, the call will list the content of the specified
folder, within the project to which the folder belongs.
If project is used, the call will list the content at the root of
the project's files.
name
Name of the file. List files with this name. Note that the name must be an exact complete string for the results to match. Multiple names can be represented as a vector.
metadata
List file with this metadata field values. List only files that have the specified value in metadata field. Different metadata fields are represented as a named list. You can also define multiple instances of the same metadata field.
origin
Task object. List only files produced by task.
tag
Filters the files based on the specified tag(s). Each tag must be an exact, complete match, for the results to match. Tags may include spaces. Multiple tags should be provided as a vector of strings. The method will return files that have any of the specified tags.
limit
The maximum number of collection items to return
for a single request. Minimum value is 1
.
The maximum value is 100
and the default value is 50
.
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
as 'fields', etc.
Collection
of File
objects.
\dontrun{ files_object <- Files$new(auth = auth) # Query files in a project files_object$query(project = project) }
get()
This call returns a single File object with its details. The call returns the file's name, its tags, and all of its metadata. Files are specified by their IDs, which you can obtain by making the API call to list all files in a project.
Files$get(id, ...)
id
The file ID.
...
Other arguments that can be passed to core api()
function
as 'fields', etc.
File
object.
\dontrun{ files_object <- Files$new(auth = auth) # Get file using id files_object$get(id = id) }
delete()
This call removes a file from the Seven Bridges Platform.
Files are specified by their IDs, which you can obtain by using
Files$query()
to list files or by getting a single file
using Files$get()
.
Files$delete(file, ...)
file
File
object or file ID.
...
Other arguments that can be passed to core api()
function
as 'fields', etc.
\dontrun{ files_object <- Files$new(auth = auth) # Delete a file files_object$delete(file = file) }
copy()
Copy file/files to the specified project. This call allows
you to copy files between projects. Unlike the call to copy a file
between projects, this call lets you batch the copy operation and copy
a list of files at a time.
More information you may find
here.
Files$copy(files, destination_project)
files
The list of files' IDs or list of File object to copy.
destination_project
Project object or project ID. where you want to copy files into.
\dontrun{ files_object <- Files$new(auth = auth) # Copy files to a project files_object$copy( file = file, destination_project = project ) }
create_folder()
A method for creating a new folder. It allows you to create
a new folder on the Platform within the root folder of a specified
project or the provided parent folder. Remember that you should provide
either the destination project (as the project
parameter) or the
destination folder (as the parent
parameter), not both.
More information you may find
here.
Files$create_folder(name, parent = NULL, project = NULL)
name
The name of the folder you are about to create.
parent
The ID of the parent destination folder or a File
object which must be of type FOLDER
.
project
The ID of the destination project, or a Project object.
\dontrun{ files_object <- Files$new(auth = auth) # Create folder in a project files_object$create_folder( name = name, project = project ) }
bulk_delete()
This method facilitates bulk file deletion. It accepts
either a list of File
objects or a list containing
files' IDs.
Files$bulk_delete(files)
files
Either a list of File
objects or a list
of strings (IDs) representing the files you intend to delete.
None. The function only displays the IDs of the deleted files in the console.
\dontrun{ # Delete two files by providing their IDs a$files$bulk_delete(files = list("file_1_ID", "file_2_ID")) } \dontrun{ # Delete two files by providing a list of File objects a$files$bulk_delete(files = list(File_Object_1, File_Object_2)) }
bulk_get()
This call returns the details of multiple specified files, including file names and file metadata. The maximum number of files you can retrieve the details for per call is 100.
Files$bulk_get(files)
files
A list of File
objects or list of strings
(IDs) of the files you are querying for details.
Collection
(list of File
objects).
\dontrun{ # Get details of multiple files a$files$bulk_get( files = list("file_1_ID", "file_2_ID") ) }
bulk_update()
A method that sets new information for specified files, replacing all existing information and erasing omitted parameters.
Files$bulk_update(files)
files
List of File
objects.
For each of the specified files, the call sets a new name
,
new tags
, and metadata
.
When editing fields in the File
objects you wish to
update, keep the following in mind:
The name
field should be a string representing the new name of
the file.
The metadata
field should be a named list of key-value pairs.
The keys and values should be strings.
The tags
field should be an unnamed list of values.
The maximum number of files you can update the details for per call is 100.
Collection
(list of File
objects).
\dontrun{ # Update details of multiple files a$files$bulk_update( files = list(File_Object_1, File_Object_2) ) }
bulk_edit()
This method modifies the existing information for specified files or adds new information while preserving omitted parameters.
Files$bulk_edit(files)
files
List of File
objects.
For each of the specified files, the call edits its name
,
tags
, and metadata
.
When editing fields in the File
objects you wish to
update, keep the following in mind:
The name
field should be a string representing the new name of
the file.
The metadata
field should be a named list of key-value pairs.
The keys and values should be strings.
The tags
field should be an unnamed list of values.
The maximum number of files you can update the details for per call is 100.
Collection
(list of File
objects).
\dontrun{ # Edit details of multiple files a$files$bulk_edit( files = list(File_Object_1, File_Object_2) ) }
async_bulk_copy()
This call lets you perform a bulk copy of files and folders. Any underlying folder structure will be preserved. You can copy:
to a folder within the same project,
to another project,
to a folder in another project.
Files$async_bulk_copy(items)
items
Nested list of elements containing information about each file/folder to be copied. For each element, you must provide:
file
- The ID of the file or folder you are copying.
Copying the project root folder is not allowed.
Use the API call for listing all files to obtain the ID.
parent
- The ID of the folder you are copying files to.
It should not be used together with project
. If project
is
used, the items will be imported to the root of the project
files. If parent
is used, the import will take place into the
specified folder, within the project to which the folder belongs.
project
- The project you are copying the file to.
It should not be used together with parent
. If parent
is
used, the import will take place into the specified folder,
within the project to which the folder belongs. If project
is
used, the items will be imported to the root of the project
files.
name
- Enter the new name for the file if you want to
rename it in the destination folder.
Example of the list:
items <- list( list( file = '<file-id-1>', parent = '<folder-id>' ), list( file = '<file-id-2>', project = '<project-id-1>', name = 'copied_file.txt' ), list( file = '<file-id-3>', parent = '<parent-id-2>', name = 'copied_file2.txt' ) )
Read more on how to perform async copy action on multiple files.
AsyncJob
object.
\dontrun{ # Copy multiple files a$files$async_bulk_copy( items = list( list( file = '<file-id-1>', parent = '<folder-id>' ), list( file = '<file-id-2>', project = '<project-id-1>', name = 'copied_file.txt' ), list( file = '<file-id-3>', parent = '<parent-id-2>', name = 'copied_file2.txt' ) ) ) }
async_bulk_delete()
This call lets you perform an asynchronous bulk deletion of files or folders. Deleting folders which aren't empty is allowed.
Files$async_bulk_delete(items)
items
List of File objects (both file
or folder
type) or list
of IDs of files/folders you want to delete.
Read more on how to perform async delete action on multiple files.
AsyncJob
object.
\dontrun{ # Delete multiple files a$files$async_bulk_delete( items = list(file_obj1, file_obj2, "<folder-id-string>", "<file-id>") ) }
async_bulk_move()
This call lets you perform a bulk move operation of files and folders. You can move:
to a root project folder,
to a subfolder within the same project or a different project.
Files$async_bulk_move(items)
items
Nested list of elements containing information about each file/folder to be moved. For each element, you must provide:
file
- The ID of the file or folder you are moving. Use the
API call for listing all files or folders to obtain the ID.
parent
- The ID of the folder you are moving the files to,
which should not be used along with project
. If project
is
used, the items will be imported to the root of the project files.
If parent
is used, the import will take place into the
specified folder, within the project to which the folder belongs.
project
- The project you are moving the files to. It
should not be used together with parent
. If parent
is used,
the import will take place into the specified folder, within the
project to which the folder belongs. If project
is used, the
items will be imported to the root of the project files.
name
- Enter the new name for the file or folder if you
want to rename at the destination.
Example of the list:
items <- list( list( file = '<file-id-1>', parent = '<folder-id>' ), list( file = '<file-id-2>', project = '<project-id-1>', name = 'moved_file.txt' ), list( file = '<file-id-3>', parent = '<parent-id-2>', name = 'moved_file2.txt' ) )
Read more on how to perform async move action on multiple files.
Rules for moving files and folders:
The file ID is preserved after the move.
The folder ID is changed after the move.
The destination must be an existing folder.
If the target folder contains a folder with the same name, the contents of both folders will be merged.
If a file with the same name already exists, the source file will be automatically renamed (by adding a numeric prefix).
You need to have WRITE permissions for both source and destination folders.
AsyncJob
object.
\dontrun{ # Move multiple files a$files$async_bulk_move( items = list( list( file = '<file-id-1>', parent = '<folder-id>' ), list( file = '<file-id-2>', project = '<project-id-1>', name = 'moved_file.txt' ), list( file = '<file-id-3>', parent = '<parent-id-2>', name = 'moved_file2.txt' ) ) ) }
async_get_copy_job()
This call retrieves the details of an asynchronous bulk copy job. This information will be available for up to a month after the job has been completed.
Files$async_get_copy_job(job_id)
job_id
The ID of the copy job you are querying. This ID can be found within the API response for the call for copying files. The function also accepts an AsyncJob object and extracts the ID.
AsyncJob
object.
\dontrun{ # Get details of an async copy job a$files$async_get_copy_job(job_id = "job-id") }
async_get_delete_job()
This call retrieves the details of an asynchronous bulk deletion job. This information will be available for up to a month after the job has been completed.
Files$async_get_delete_job(job_id)
job_id
The ID of the delete job you are querying. This ID can be found within the API response for the call for deleting files. The function also accepts an AsyncJob object and extracts the ID.
AsyncJob
object.
\dontrun{ # Get details of an async delete job a$files$async_get_delete_job(job_id = "job-id") }
async_get_move_job()
This call retrieves the details of an asynchronous bulk move job. This information will be available for up to a month after the job has been completed.
Files$async_get_move_job(job_id)
job_id
The ID of the move job you are querying. This ID can be found within the API response for the call for moving files. The function also accepts an AsyncJob object and extracts the ID.
An AsyncJob
object containing details of the move
job.
\dontrun{ # Get details of an async move job a$files$async_get_move_job(job_id = "job-id") }
async_list_file_jobs()
This call retrieves the details for all asynchronous bulk jobs you have started. This information will be available for up to a month after the job has been completed.
Files$async_list_file_jobs( limit = getOption("sevenbridges2")$limit, offset = getOption("sevenbridges2")$offset )
limit
The maximum number of collection items to return
for a single request. Minimum value is 1
.
The maximum value is 100
and the default value is 50
.
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.
A Collection
object containing a list of
AsyncJob
objects.
\dontrun{ # Get details of the first 5 async jobs a$files$async_list_file_jobs(limit = 5) }
clone()
The objects of this class are cloneable with this method.
Files$clone(deep = FALSE)
deep
Whether to make a deep clone.
## ------------------------------------------------ ## Method `Files$query` ## ------------------------------------------------ ## Not run: files_object <- Files$new(auth = auth) # Query files in a project files_object$query(project = project) ## End(Not run) ## ------------------------------------------------ ## Method `Files$get` ## ------------------------------------------------ ## Not run: files_object <- Files$new(auth = auth) # Get file using id files_object$get(id = id) ## End(Not run) ## ------------------------------------------------ ## Method `Files$delete` ## ------------------------------------------------ ## Not run: files_object <- Files$new(auth = auth) # Delete a file files_object$delete(file = file) ## End(Not run) ## ------------------------------------------------ ## Method `Files$copy` ## ------------------------------------------------ ## Not run: files_object <- Files$new(auth = auth) # Copy files to a project files_object$copy( file = file, destination_project = project ) ## End(Not run) ## ------------------------------------------------ ## Method `Files$create_folder` ## ------------------------------------------------ ## Not run: files_object <- Files$new(auth = auth) # Create folder in a project files_object$create_folder( name = name, project = project ) ## End(Not run) ## ------------------------------------------------ ## Method `Files$bulk_delete` ## ------------------------------------------------ ## Not run: # Delete two files by providing their IDs a$files$bulk_delete(files = list("file_1_ID", "file_2_ID")) ## End(Not run) ## Not run: # Delete two files by providing a list of File objects a$files$bulk_delete(files = list(File_Object_1, File_Object_2)) ## End(Not run) ## ------------------------------------------------ ## Method `Files$bulk_get` ## ------------------------------------------------ ## Not run: # Get details of multiple files a$files$bulk_get( files = list("file_1_ID", "file_2_ID") ) ## End(Not run) ## ------------------------------------------------ ## Method `Files$bulk_update` ## ------------------------------------------------ ## Not run: # Update details of multiple files a$files$bulk_update( files = list(File_Object_1, File_Object_2) ) ## End(Not run) ## ------------------------------------------------ ## Method `Files$bulk_edit` ## ------------------------------------------------ ## Not run: # Edit details of multiple files a$files$bulk_edit( files = list(File_Object_1, File_Object_2) ) ## End(Not run) ## ------------------------------------------------ ## Method `Files$async_bulk_copy` ## ------------------------------------------------ ## Not run: # Copy multiple files a$files$async_bulk_copy( items = list( list( file = '<file-id-1>', parent = '<folder-id>' ), list( file = '<file-id-2>', project = '<project-id-1>', name = 'copied_file.txt' ), list( file = '<file-id-3>', parent = '<parent-id-2>', name = 'copied_file2.txt' ) ) ) ## End(Not run) ## ------------------------------------------------ ## Method `Files$async_bulk_delete` ## ------------------------------------------------ ## Not run: # Delete multiple files a$files$async_bulk_delete( items = list(file_obj1, file_obj2, "<folder-id-string>", "<file-id>") ) ## End(Not run) ## ------------------------------------------------ ## Method `Files$async_bulk_move` ## ------------------------------------------------ ## Not run: # Move multiple files a$files$async_bulk_move( items = list( list( file = '<file-id-1>', parent = '<folder-id>' ), list( file = '<file-id-2>', project = '<project-id-1>', name = 'moved_file.txt' ), list( file = '<file-id-3>', parent = '<parent-id-2>', name = 'moved_file2.txt' ) ) ) ## End(Not run) ## ------------------------------------------------ ## Method `Files$async_get_copy_job` ## ------------------------------------------------ ## Not run: # Get details of an async copy job a$files$async_get_copy_job(job_id = "job-id") ## End(Not run) ## ------------------------------------------------ ## Method `Files$async_get_delete_job` ## ------------------------------------------------ ## Not run: # Get details of an async delete job a$files$async_get_delete_job(job_id = "job-id") ## End(Not run) ## ------------------------------------------------ ## Method `Files$async_get_move_job` ## ------------------------------------------------ ## Not run: # Get details of an async move job a$files$async_get_move_job(job_id = "job-id") ## End(Not run) ## ------------------------------------------------ ## Method `Files$async_list_file_jobs` ## ------------------------------------------------ ## Not run: # Get details of the first 5 async jobs a$files$async_list_file_jobs(limit = 5) ## End(Not run)
## ------------------------------------------------ ## Method `Files$query` ## ------------------------------------------------ ## Not run: files_object <- Files$new(auth = auth) # Query files in a project files_object$query(project = project) ## End(Not run) ## ------------------------------------------------ ## Method `Files$get` ## ------------------------------------------------ ## Not run: files_object <- Files$new(auth = auth) # Get file using id files_object$get(id = id) ## End(Not run) ## ------------------------------------------------ ## Method `Files$delete` ## ------------------------------------------------ ## Not run: files_object <- Files$new(auth = auth) # Delete a file files_object$delete(file = file) ## End(Not run) ## ------------------------------------------------ ## Method `Files$copy` ## ------------------------------------------------ ## Not run: files_object <- Files$new(auth = auth) # Copy files to a project files_object$copy( file = file, destination_project = project ) ## End(Not run) ## ------------------------------------------------ ## Method `Files$create_folder` ## ------------------------------------------------ ## Not run: files_object <- Files$new(auth = auth) # Create folder in a project files_object$create_folder( name = name, project = project ) ## End(Not run) ## ------------------------------------------------ ## Method `Files$bulk_delete` ## ------------------------------------------------ ## Not run: # Delete two files by providing their IDs a$files$bulk_delete(files = list("file_1_ID", "file_2_ID")) ## End(Not run) ## Not run: # Delete two files by providing a list of File objects a$files$bulk_delete(files = list(File_Object_1, File_Object_2)) ## End(Not run) ## ------------------------------------------------ ## Method `Files$bulk_get` ## ------------------------------------------------ ## Not run: # Get details of multiple files a$files$bulk_get( files = list("file_1_ID", "file_2_ID") ) ## End(Not run) ## ------------------------------------------------ ## Method `Files$bulk_update` ## ------------------------------------------------ ## Not run: # Update details of multiple files a$files$bulk_update( files = list(File_Object_1, File_Object_2) ) ## End(Not run) ## ------------------------------------------------ ## Method `Files$bulk_edit` ## ------------------------------------------------ ## Not run: # Edit details of multiple files a$files$bulk_edit( files = list(File_Object_1, File_Object_2) ) ## End(Not run) ## ------------------------------------------------ ## Method `Files$async_bulk_copy` ## ------------------------------------------------ ## Not run: # Copy multiple files a$files$async_bulk_copy( items = list( list( file = '<file-id-1>', parent = '<folder-id>' ), list( file = '<file-id-2>', project = '<project-id-1>', name = 'copied_file.txt' ), list( file = '<file-id-3>', parent = '<parent-id-2>', name = 'copied_file2.txt' ) ) ) ## End(Not run) ## ------------------------------------------------ ## Method `Files$async_bulk_delete` ## ------------------------------------------------ ## Not run: # Delete multiple files a$files$async_bulk_delete( items = list(file_obj1, file_obj2, "<folder-id-string>", "<file-id>") ) ## End(Not run) ## ------------------------------------------------ ## Method `Files$async_bulk_move` ## ------------------------------------------------ ## Not run: # Move multiple files a$files$async_bulk_move( items = list( list( file = '<file-id-1>', parent = '<folder-id>' ), list( file = '<file-id-2>', project = '<project-id-1>', name = 'moved_file.txt' ), list( file = '<file-id-3>', parent = '<parent-id-2>', name = 'moved_file2.txt' ) ) ) ## End(Not run) ## ------------------------------------------------ ## Method `Files$async_get_copy_job` ## ------------------------------------------------ ## Not run: # Get details of an async copy job a$files$async_get_copy_job(job_id = "job-id") ## End(Not run) ## ------------------------------------------------ ## Method `Files$async_get_delete_job` ## ------------------------------------------------ ## Not run: # Get details of an async delete job a$files$async_get_delete_job(job_id = "job-id") ## End(Not run) ## ------------------------------------------------ ## Method `Files$async_get_move_job` ## ------------------------------------------------ ## Not run: # Get details of an async move job a$files$async_get_move_job(job_id = "job-id") ## End(Not run) ## ------------------------------------------------ ## Method `Files$async_list_file_jobs` ## ------------------------------------------------ ## Not run: # Get details of the first 5 async jobs a$files$async_list_file_jobs(limit = 5) ## End(Not run)
R6 Class representing a resource for managing volume import jobs.
sevenbridges2::Item
-> Import
URL
List of URL endpoints for this resource.
id
Import job string identifier.
state
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.
overwrite
Whether the imported file/folder name was overwritten or not, if another one with the same name had already existed.
autorename
Whether the imported file/folder name was automatically renamed (by prefixing its name with an underscore and number) if another one with the same name had already existed.
preserve_folder_structure
Whether the imported folder structure was preserved or not.
source
List containing source volume id and source location of the file/folder is being imported to the platform.
destination
List containing destination project id or parent directory id where the file/folder is being imported, together with its name.
started_on
Time when the import job started.
finished_on
Time when the import job ended.
error
In case of error in the import job, standard API error is returned here.
result
File object that was imported.
new()
Create a new Import object.
Import$new(res = NA, ...)
res
Response containing Import object information.
...
Other response arguments.
print()
Print method for Import class.
Import$print()
\dontrun{ # x is API response when import is requested import_object <- Import$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Print import object import_object$print() }
reload()
Reload Import object information.
Import$reload(...)
...
Other arguments that can be passed to core api()
function
like 'fields', etc.
Import
object.
\dontrun{ # x is API response when import is requested import_object <- Import$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Reload import object import_object$reload() }
clone()
The objects of this class are cloneable with this method.
Import$clone(deep = FALSE)
deep
Whether to make a deep clone.
## ------------------------------------------------ ## Method `Import$print` ## ------------------------------------------------ ## Not run: # x is API response when import is requested import_object <- Import$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Print import object import_object$print() ## End(Not run) ## ------------------------------------------------ ## Method `Import$reload` ## ------------------------------------------------ ## Not run: # x is API response when import is requested import_object <- Import$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Reload import object import_object$reload() ## End(Not run)
## ------------------------------------------------ ## Method `Import$print` ## ------------------------------------------------ ## Not run: # x is API response when import is requested import_object <- Import$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Print import object import_object$print() ## End(Not run) ## ------------------------------------------------ ## Method `Import$reload` ## ------------------------------------------------ ## Not run: # x is API response when import is requested import_object <- Import$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Reload import object import_object$reload() ## End(Not run)
R6 Class representing storage imports resource endpoints.
sevenbridges2::Resource
-> Imports
URL
List of URL endpoints for this resource.
new()
Create a new Imports object.
Imports$new(...)
...
Other response arguments.
query()
This call lists import jobs initiated by particular user. Note that when you import a file from your volume on your cloud storage provider (Amazon Web Services or Google Cloud Storage), you are creating an alias on the Platform which points to the file in your cloud storage bucket. Aliases appear as files on the Platform and can be copied, executed, and modified as such. They refer back to the respective file on the given volume.
Imports$query( volume = NULL, project = NULL, state = NULL, limit = getOption("sevenbridges2")$limit, offset = getOption("sevenbridges2")$offset, ... )
volume
Volume id or Volume object. List all imports from this particular volume. Optional.
project
Project id or Project object. List all volume imports to this particular project. Optional.
state
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 is 100
and the default value is 50
.
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.
Collection
of Import
objects.
\dontrun{ imports_object <- Imports$new( auth = auth ) # List import job imports_object$query() }
get()
This call will return the details of an import job.
Imports$get(id, ...)
id
The import job identifier (id).
...
Other arguments that can be passed to core api()
function
like 'fields', etc.
Import
object.
\dontrun{ imports_object <- Imports$new( auth = auth ) # List import job imports_object$get(id = id) }
submit_import()
This call lets you queue a job to import a file or folder
from a volume into a project on the Platform.
Essentially, you are importing an item from your cloud storage provider
(Amazon Web Services, Google Cloud Storage, Azure or Ali Cloud) via the
volume onto the Platform.
If successful, an alias will be created on the Platform. Aliases appear
on the Platform and can be copied, executed, and modified as such.
They refer back to the respective item on the given volume.
If you want to import multiple files, the recommended way is to do it in bulk considering the API rate limit (learn more). Bulk operations will be implemented in next releases.
Imports$submit_import( source_volume, source_location, destination_project = NULL, destination_parent = NULL, name = NULL, overwrite = FALSE, autorename = FALSE, preserve_folder_structure = NULL, ... )
source_volume
Volume id or Volume object you want to import files or folders from.
source_location
File location name or folder prefix name on the volume you would like to import into some project/folder on the Platform.
destination_project
Destination project id or Project
object. Not required, but either destination_project
or destination_parent
directory must be
provided.
destination_parent
Folder id or File object
(with type = 'FOLDER'
). Not required, but either destination_project
or destination_parent
directory must be provided.
name
The name of the alias to create. This name should be unique
to the project.
If the name is already in use in the project, you should
use the overwrite
query parameter in this call to force any item with
that name to be deleted before the alias is created.
If name is omitted, the alias name will default to the last segment of
the complete location (including the prefix) on the volume.
Segments are considered to be separated with forward slashes /
.
Allowed characters in file names are all alphanumeric and special
characters except forward slash /
, while folder names can contain
alphanumeric and special characters _
, -
and .
.
overwrite
Set to TRUE
if you want to overwrite the item if
another one with the same name already exists at the destination.
Bear in mind that if used with folders import, the folder's content
(files with the same name) will be overwritten, not the whole folder.
autorename
Set to TRUE
if you want to automatically rename the
item (by prefixing its name with an underscore and number) if another
one with the same name already exists at the destination.
Bear in mind that if used with folders import, the folder content will
be renamed, not the whole folder.
preserve_folder_structure
Set to TRUE
if you want to keep the
exact source folder structure. The default value is TRUE
if the item
being imported is a folder. Should not be used if you are importing a
file. Bear in mind that if you use preserve_folder_structure = FALSE
,
that the response will be the parent folder object containing imported
files alongside with other files if they exist.
...
Other arguments that can be passed to core api()
function
like 'fields', etc.
Import
object.
\dontrun{ imports_object <- Imports$new( auth = auth ) # Submit new import into a project imports_object$submit_import( source_location = volume_file_object, destination_project = test_project_object, autorename = TRUE ) }
delete()
Deleting import jobs is not possible.
Imports$delete()
bulk_get()
This call returns the details of a bulk import job. Note that when you import files from your volume on a cloud storage provider (Amazon Web Services or Google Cloud Storage), you create an alias on the Platform which points to the files in your cloud storage bucket. Aliases appear as files on the Platform and can be copied, executed, and modified.
Imports$bulk_get(imports)
imports
The list of the import job IDs as returned by the call
to start a bulk import job or list of Import
objects.
Collection
with list of Import
objects.
\dontrun{ imports_object <- Imports$new( auth = auth ) # List import job imports_object$bulk_get( imports = list("import-job-id-1", "import-job-id-2") ) }
bulk_submit_import()
This call lets you perform a bulk import of files from your volume (either Amazon Web Services or Google Cloud Storage) into your project on the Platform.
You can use this call to either import files to a specific folder or a project but you can also use it to import a folder and its files into another destination folder while preserving folder structure. One call can contain up to 100 items. Learn more about using the Volumes API for Amazon S3 and for Google Cloud Storage.
Imports$bulk_submit_import(items)
items
Nested list of elements containing information about each file/folder to be imported. For each element, users must provide:
source_volume
- Volume object or its ID to import
files/folders from,
source_location
- Volume-specific location pointing to the
file or folder to import.
This location should be recognizable to the underlying cloud
service as a valid key or path to the item. If the item being
imported is a folder, its path should end with a /
.
Please note that if this volume was configured with a prefix
parameter when it was created, the value of prefix will be
prepended to the location before attempting to locate the item on
the volume.
destination_project
- Project object or ID to import
files/folders into. Should not be used together with
destination_parent. If project is used, the items will be imported
to the root of the project's files.
destination_parent
- File object of type 'folder' or its ID
to import files/folders into. Should not be used together with
destination_project. If parent is used, the import will take
place into the specified folder, within the project to which the
folder belongs.
name
- The name of the alias to create.
This name should be unique to the project. If the name is already
in use in the project, you should use the autorename
parameter
in this call to automatically rename the item (by prefixing its
name with an underscore and number).
If name is omitted, the alias name will default to the last
segment of the complete location (including the prefix) on the
volume. Segments are considered to be separated with forward
slashes ('/').
autorename
- Whether to automatically rename the item
(by prefixing its name with an underscore and number) if another
one with the same name already exists at the destination.
preserve_folder_structure
- Whether to keep the exact source
folder structure. The default value is TRUE if the item being
imported is a folder. Should not be used if you are importing a
file.
Example of the list:
items <- list( list( source_volume = 'rfranklin/my-volume', source_location = 'chimeras.html.gz', destination_project = 'rfranklin/my-project' ), list( source_volume = 'rfranklin/my-volume', source_location = 'my-folder/', destination_project = 'rfranklin/my-project', autorename = TRUE, preserve_folder_structure = TRUE ), list( source_volume = 'rfranklin/my-volume', source_location = 'my-volume-folder/', destination_parent = '567890abc1e5339df0414123', name = 'new-folder-name', autorename = TRUE, preserve_folder_structure = TRUE ) )
Read more on how to import folders from your volume into a project or a project folder.
Utility function prepare_items_for_bulk_import
can help you prepare the items
parameter based on the provided
list of VolumeFile
or VolumePrefix
objects.
Collection
with list of Import
objects.
\dontrun{ imports_object <- Imports$new( auth = auth ) # Submit new import into a project imports_object$bulk_submit_import(items = list( list( source_volume = "rfranklin/my-volume", source_location = "my-file.txt", destination_project = test_project_object, autorename = TRUE ), list( source_volume = "rfranklin/my-volume", source_location = "my-folder/", destination_parent = "parent-folder-id", autorename = FALSE, preserve_folder_structure = TRUE ) ) ) }
clone()
The objects of this class are cloneable with this method.
Imports$clone(deep = FALSE)
deep
Whether to make a deep clone.
## ------------------------------------------------ ## Method `Imports$query` ## ------------------------------------------------ ## Not run: imports_object <- Imports$new( auth = auth ) # List import job imports_object$query() ## End(Not run) ## ------------------------------------------------ ## Method `Imports$get` ## ------------------------------------------------ ## Not run: imports_object <- Imports$new( auth = auth ) # List import job imports_object$get(id = id) ## End(Not run) ## ------------------------------------------------ ## Method `Imports$submit_import` ## ------------------------------------------------ ## Not run: imports_object <- Imports$new( auth = auth ) # Submit new import into a project imports_object$submit_import( source_location = volume_file_object, destination_project = test_project_object, autorename = TRUE ) ## End(Not run) ## ------------------------------------------------ ## Method `Imports$bulk_get` ## ------------------------------------------------ ## Not run: imports_object <- Imports$new( auth = auth ) # List import job imports_object$bulk_get( imports = list("import-job-id-1", "import-job-id-2") ) ## End(Not run) ## ------------------------------------------------ ## Method `Imports$bulk_submit_import` ## ------------------------------------------------ ## Not run: imports_object <- Imports$new( auth = auth ) # Submit new import into a project imports_object$bulk_submit_import(items = list( list( source_volume = "rfranklin/my-volume", source_location = "my-file.txt", destination_project = test_project_object, autorename = TRUE ), list( source_volume = "rfranklin/my-volume", source_location = "my-folder/", destination_parent = "parent-folder-id", autorename = FALSE, preserve_folder_structure = TRUE ) ) ) ## End(Not run)
## ------------------------------------------------ ## Method `Imports$query` ## ------------------------------------------------ ## Not run: imports_object <- Imports$new( auth = auth ) # List import job imports_object$query() ## End(Not run) ## ------------------------------------------------ ## Method `Imports$get` ## ------------------------------------------------ ## Not run: imports_object <- Imports$new( auth = auth ) # List import job imports_object$get(id = id) ## End(Not run) ## ------------------------------------------------ ## Method `Imports$submit_import` ## ------------------------------------------------ ## Not run: imports_object <- Imports$new( auth = auth ) # Submit new import into a project imports_object$submit_import( source_location = volume_file_object, destination_project = test_project_object, autorename = TRUE ) ## End(Not run) ## ------------------------------------------------ ## Method `Imports$bulk_get` ## ------------------------------------------------ ## Not run: imports_object <- Imports$new( auth = auth ) # List import job imports_object$bulk_get( imports = list("import-job-id-1", "import-job-id-2") ) ## End(Not run) ## ------------------------------------------------ ## Method `Imports$bulk_submit_import` ## ------------------------------------------------ ## Not run: imports_object <- Imports$new( auth = auth ) # Submit new import into a project imports_object$bulk_submit_import(items = list( list( source_volume = "rfranklin/my-volume", source_location = "my-file.txt", destination_project = test_project_object, autorename = TRUE ), list( source_volume = "rfranklin/my-volume", source_location = "my-folder/", destination_parent = "parent-folder-id", autorename = FALSE, preserve_folder_structure = TRUE ) ) ) ## End(Not run)
R6 Class representing invoice information.
This object contains information about a selected invoice, including the costs for analysis and storage, and the invoice period.
sevenbridges2::Item
-> Invoice
URL
List of URL endpoints for this resource.
id
Invoice identifier.
pending
Invoice approval status.
approval_date
Invoice approval date.
invoice_period
Invoicing period (from-to).
analysis_costs
Costs of your analysis.
storage_costs
Storage costs.
total
Total costs.
new()
Create new Invoice object.
Invoice$new(res = NA, ...)
res
Response containing Invoice object information.
...
Other response arguments.
print()
Print invoice information as a bullet list.
Invoice$print()
\dontrun{ # x is API response when invoice is requested invoice_object <- Invoice$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Print invoice object invoice_object$print() }
reload()
Reload Invoice.
Invoice$reload(...)
...
Other arguments that can be passed to core api()
function
like 'fields', etc.
Invoice
object.
\dontrun{ # x is API response when invoice is requested invoice_object <- Invoice$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Reload invoice object invoice_object$reload() }
clone()
The objects of this class are cloneable with this method.
Invoice$clone(deep = FALSE)
deep
Whether to make a deep clone.
## ------------------------------------------------ ## Method `Invoice$print` ## ------------------------------------------------ ## Not run: # x is API response when invoice is requested invoice_object <- Invoice$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Print invoice object invoice_object$print() ## End(Not run) ## ------------------------------------------------ ## Method `Invoice$reload` ## ------------------------------------------------ ## Not run: # x is API response when invoice is requested invoice_object <- Invoice$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Reload invoice object invoice_object$reload() ## End(Not run)
## ------------------------------------------------ ## Method `Invoice$print` ## ------------------------------------------------ ## Not run: # x is API response when invoice is requested invoice_object <- Invoice$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Print invoice object invoice_object$print() ## End(Not run) ## ------------------------------------------------ ## Method `Invoice$reload` ## ------------------------------------------------ ## Not run: # x is API response when invoice is requested invoice_object <- Invoice$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Reload invoice object invoice_object$reload() ## End(Not run)
R6 Class representing invoice resource endpoints
sevenbridges2::Resource
-> Invoices
URL
List of URL endpoints for this resource.
new()
Create a new Invoices object.
Invoices$new(...)
...
Other response arguments.
query()
The call returns information about all your available
invoices, unless you use the billing_group
query parameter to specify
the ID of a particular billing group, in which case it will return the
invoice incurred by that billing group only.
Invoices$query( billing_group = NULL, limit = getOption("sevenbridges2")$limit, offset = getOption("sevenbridges2")$offset, ... )
billing_group
ID of a billing group or billing group object you want to list invoices for. Optional.
limit
The maximum number of collection items to return
for a single request. Minimum value is 1
.
The maximum value is 100
and the default value is 50
.
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 query parameters or 'fields', etc.
Collection
of Invoice
objects.
\dontrun{ invoices_object <- Invoices$new( auth = auth ) # List all your invoices invoices_object$query(billing_group = billing_group) }
get()
This call retrieves information about a selected invoice,
including the costs for analysis and storage, and the invoice period.
Use the call to list invoices to retrieve the invoice_id
s for a
specified billing group.
Invoices$get(id, ...)
id
The ID of the invoice you are querying.
...
Other arguments that can be passed to core api()
function
like 'fields', etc.
Invoice
object.
\dontrun{ invoices_object <- Invoices$new( auth = auth ) # Get single invoice by id invoices_object$get(id = id) }
clone()
The objects of this class are cloneable with this method.
Invoices$clone(deep = FALSE)
deep
Whether to make a deep clone.
## ------------------------------------------------ ## Method `Invoices$query` ## ------------------------------------------------ ## Not run: invoices_object <- Invoices$new( auth = auth ) # List all your invoices invoices_object$query(billing_group = billing_group) ## End(Not run) ## ------------------------------------------------ ## Method `Invoices$get` ## ------------------------------------------------ ## Not run: invoices_object <- Invoices$new( auth = auth ) # Get single invoice by id invoices_object$get(id = id) ## End(Not run)
## ------------------------------------------------ ## Method `Invoices$query` ## ------------------------------------------------ ## Not run: invoices_object <- Invoices$new( auth = auth ) # List all your invoices invoices_object$query(billing_group = billing_group) ## End(Not run) ## ------------------------------------------------ ## Method `Invoices$get` ## ------------------------------------------------ ## Not run: invoices_object <- Invoices$new( auth = auth ) # Get single invoice by id invoices_object$get(id = id) ## End(Not run)
Base class for describing objects: Project, Task, App, File, etc.
response
Raw response from the request.
href
Item's API request URL.
auth
Seven Bridges Authentication object.
new()
Create a new Item object.
Item$new(href = NA, response = NA, auth = NA)
href
Item's API request URL.
response
Raw API response.
auth
Seven Bridges Authentication object.
reload()
Reload the Item (resource).
Item$reload(cls, ...)
cls
Item class object.
...
Other arguments that can be passed to core api()
function
like 'limit', 'offset', 'fields', etc.
clone()
The objects of this class are cloneable with this method.
Item$clone(deep = FALSE)
deep
Whether to make a deep clone.
R6 Class representing a resource for managing project members.
sevenbridges2::Item
-> Member
id
Member's id.
username
Member's username.
email
Member's email.
type
Member's type.
permissions
Member's permissions.
new()
Create a new Member object.
Member$new(res = NA, ...)
res
Response containing Member object information.
...
Other response arguments.
print()
Print method for Member class.
Member$print()
\dontrun{ # x is API response when member is requested member_object <- Member$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Print member object member_object$print() }
reload()
Reload Member object information.
Member$reload()
\dontrun{ # x is API response when member is requested member_object <- Member$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Reload member object member_object$reload() }
clone()
The objects of this class are cloneable with this method.
Member$clone(deep = FALSE)
deep
Whether to make a deep clone.
## ------------------------------------------------ ## Method `Member$print` ## ------------------------------------------------ ## Not run: # x is API response when member is requested member_object <- Member$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Print member object member_object$print() ## End(Not run) ## ------------------------------------------------ ## Method `Member$reload` ## ------------------------------------------------ ## Not run: # x is API response when member is requested member_object <- Member$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Reload member object member_object$reload() ## End(Not run)
## ------------------------------------------------ ## Method `Member$print` ## ------------------------------------------------ ## Not run: # x is API response when member is requested member_object <- Member$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Print member object member_object$print() ## End(Not run) ## ------------------------------------------------ ## Method `Member$reload` ## ------------------------------------------------ ## Not run: # x is API response when member is requested member_object <- Member$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Reload member object member_object$reload() ## End(Not run)
R6 Class representing a resource for managing parts of the files' uploads.
URL
List of URL endpoints for this resource.
part_number
Part number.
part_size
Part size.
url
The URL to which to make the HTTP part upload request.
expires
ISO 8601 combined date and time representation in Coordinated Universal Time (UTC) by when the HTTP part upload request should be made.
headers
A map of headers and values that should be set when making the HTTP part upload request.
success_codes
A list of status codes returned by the HTTP part upload request that should be recognized as success. A successful part upload request should be reported back to the API in a call to report an uploaded file part by passing the information collected from the report object.
report
Report object.
etag
ETag received after starting a part upload.
auth
Authentication object.
response
Response object.
new()
Create a new Part object.
Part$new( part_number = NA, part_size = NA, url = NA, expires = NA, headers = NA, success_codes = NA, report = NA, etag = NA, auth = NA )
part_number
Part number.
part_size
Part size.
url
The URL to which to make the HTTP part upload request.
expires
Combined date and time representation in UTC by when the HTTP part upload request should be made.
headers
A map of headers and values that should be set when making the HTTP part upload request.
success_codes
A list of status codes returned by the HTTP part upload request that should be recognized as success.
report
Report object.
etag
ETag received after starting a part upload.
auth
Seven Bridges Authentication object.
print()
Print method for Part class.
Part$print()
\dontrun{ upload_part_object <- Part$new( part_number = part_number, part_size = part_size, auth = auth ) # Print upload part information upload_part_object$print() }
upload_info_part()
Get upload part info.
Part$upload_info_part(upload_id)
upload_id
Upload object or ID of the upload process that part. belongs to.
\dontrun{ upload_part_object <- Part$new( part_number = part_number, part_size = part_size, auth = auth ) # Get upload part status information upload_part_object$upload_info_part(upload_id = upload_id) }
upload_complete_part()
Report an uploaded part.
Part$upload_complete_part(upload_id)
upload_id
Upload object or ID of the upload process that part belongs to.
\dontrun{ upload_part_object <- Part$new( part_number = part_number, part_size = part_size, auth = auth ) # Report an uploaded part upload_part_object$upload_complete_part(upload_id = upload_id) }
clone()
The objects of this class are cloneable with this method.
Part$clone(deep = FALSE)
deep
Whether to make a deep clone.
## ------------------------------------------------ ## Method `Part$print` ## ------------------------------------------------ ## Not run: upload_part_object <- Part$new( part_number = part_number, part_size = part_size, auth = auth ) # Print upload part information upload_part_object$print() ## End(Not run) ## ------------------------------------------------ ## Method `Part$upload_info_part` ## ------------------------------------------------ ## Not run: upload_part_object <- Part$new( part_number = part_number, part_size = part_size, auth = auth ) # Get upload part status information upload_part_object$upload_info_part(upload_id = upload_id) ## End(Not run) ## ------------------------------------------------ ## Method `Part$upload_complete_part` ## ------------------------------------------------ ## Not run: upload_part_object <- Part$new( part_number = part_number, part_size = part_size, auth = auth ) # Report an uploaded part upload_part_object$upload_complete_part(upload_id = upload_id) ## End(Not run)
## ------------------------------------------------ ## Method `Part$print` ## ------------------------------------------------ ## Not run: upload_part_object <- Part$new( part_number = part_number, part_size = part_size, auth = auth ) # Print upload part information upload_part_object$print() ## End(Not run) ## ------------------------------------------------ ## Method `Part$upload_info_part` ## ------------------------------------------------ ## Not run: upload_part_object <- Part$new( part_number = part_number, part_size = part_size, auth = auth ) # Get upload part status information upload_part_object$upload_info_part(upload_id = upload_id) ## End(Not run) ## ------------------------------------------------ ## Method `Part$upload_complete_part` ## ------------------------------------------------ ## Not run: upload_part_object <- Part$new( part_number = part_number, part_size = part_size, auth = auth ) # Report an uploaded part upload_part_object$upload_complete_part(upload_id = upload_id) ## End(Not run)
R6 Class representing member's permissions.
sevenbridges2::Item
-> Permission
write
Write permission.
read
Read permission.
copy
Copy permission.
execute
Execute permission.
admin
Admin permission.
new()
Create a new Permission object.
Permission$new( read = TRUE, copy = FALSE, write = FALSE, execute = FALSE, admin = FALSE, ... )
read
User can view file names, metadata, and workflows.
They cannot view file contents. All members of a project have read
permissions by default. Even if you try setting read permissions to
FALSE
, they will still default to TRUE
copy
User can view file content, copy, and download files from a
project. Set value to TRUE
to assign the user copy permission.
Set to FALSE
to remove copy permission.
write
User can add, modify, and remove files and workflows in a
project. Set value to TRUE
to assign the user write permission.
Set to FALSE
to remove write permission.
execute
User can execute workflows and abort tasks in a project.
Set value to TRUE
to assign the user execute permission.
Set to FALSE
to remove execute permission.
admin
User can modify another user's permissions on a project,
add or remove people from the project and manage funding sources.
They also have all of the above permissions. Set value to TRUE
to
assign the user admin permission. Set to FALSE
to remove admin
permission.
...
Other response arguments.
print()
Print method for Permission class.
Permission$print()
\dontrun{ # x is API response when permission is requested permission_object <- Permission$new( write = x$write, read = x$read, copy = x$copy, execute = x$execute, admin = x$admin, href = x$href, auth = auth, response = attr(x, "response") ) # Print permission object permission_object$print() }
reload()
Reload Permission object information.
Permission$reload()
\dontrun{ # x is API response when permission is requested permission_object <- Permission$new( write = x$write, read = x$read, copy = x$copy, execute = x$execute, admin = x$admin, href = x$href, auth = auth, response = attr(x, "response") ) # Reload permission object permission_object$reload() }
clone()
The objects of this class are cloneable with this method.
Permission$clone(deep = FALSE)
deep
Whether to make a deep clone.
## ------------------------------------------------ ## Method `Permission$print` ## ------------------------------------------------ ## Not run: # x is API response when permission is requested permission_object <- Permission$new( write = x$write, read = x$read, copy = x$copy, execute = x$execute, admin = x$admin, href = x$href, auth = auth, response = attr(x, "response") ) # Print permission object permission_object$print() ## End(Not run) ## ------------------------------------------------ ## Method `Permission$reload` ## ------------------------------------------------ ## Not run: # x is API response when permission is requested permission_object <- Permission$new( write = x$write, read = x$read, copy = x$copy, execute = x$execute, admin = x$admin, href = x$href, auth = auth, response = attr(x, "response") ) # Reload permission object permission_object$reload() ## End(Not run)
## ------------------------------------------------ ## Method `Permission$print` ## ------------------------------------------------ ## Not run: # x is API response when permission is requested permission_object <- Permission$new( write = x$write, read = x$read, copy = x$copy, execute = x$execute, admin = x$admin, href = x$href, auth = auth, response = attr(x, "response") ) # Print permission object permission_object$print() ## End(Not run) ## ------------------------------------------------ ## Method `Permission$reload` ## ------------------------------------------------ ## Not run: # x is API response when permission is requested permission_object <- Permission$new( write = x$write, read = x$read, copy = x$copy, execute = x$execute, admin = x$admin, href = x$href, auth = auth, response = attr(x, "response") ) # Reload permission object permission_object$reload() ## End(Not run)
Utility function to prepare the items
parameter, a list of
elements containing information about each file to be exported using the
bulk_submit_export()
method.
prepare_items_for_bulk_export( files, destination_volume, destination_location_prefix = NULL, overwrite = TRUE, properties = NULL )
prepare_items_for_bulk_export( files, destination_volume, destination_location_prefix = NULL, overwrite = TRUE, properties = NULL )
files |
A list of |
destination_volume |
Either a |
destination_location_prefix |
Character. If the volume has been
configured with a prefix parameter, If you would like to export the file into a folder on the volume,
please add folder name as the prefix before the file name in the
Keep in mind that the same prefix will be added to all items (files) in the resulting list. |
overwrite |
Logical. If this is set to Keep in mind that the same overwrite option will be applied to all items (files) in the resulting list. |
properties |
Named list of additional volume properties, like:
Keep in mind that the same properties will be applied to all items (files) in the resulting list. |
Based on the provided list of File
objects or
file IDs, this function allows you to set the following fields for each
item:
source_file
destination_volume
destination_location
overwrite
properties
However, keep in mind that there are certain constraints:
The same destination_volume
applies to all items in the
. resulting list.
The same applies to overwrite
and properties
parameters.
By default, the destination_location
field is populated with
the source file name. Upon retrieval of the list of items for bulk
export, you can manually update the destination_location
field
for each element of the list as needed. Additionally, you have the
flexibility to manually modify any other fields in the list if
required.
List of body params items for for staring an export job.
## Not run: # Example 1: Prepare 3 items for bulk export action file_object_1 <- a$files$get(id = "file_1_ID") file_object_2 <- a$files$get(id = "file_2_ID") file_object_3 <- a$files$get(id = "file_3_ID") files_to_export <- list(file_object_1, file_object_2, file_object_3) prepare_items_for_bulk_export(files_to_export, destination_volume = "aws_example_volume" ) ## End(Not run) ## Not run: # Example 2: Prepare 3 items for bulk export action into some folder # on the volume - use folder name as prefix before file names file_object_1 <- a$files$get(id = "file_1_ID") file_object_2 <- a$files$get(id = "file_2_ID") file_object_3 <- a$files$get(id = "file_3_ID") files_to_export <- list(file_object_1, file_object_2, file_object_3) prepare_items_for_bulk_export(files_to_export, destination_volume = "aws_example_volume", destination_location_prefix = "example_folder/" ) ## End(Not run)
## Not run: # Example 1: Prepare 3 items for bulk export action file_object_1 <- a$files$get(id = "file_1_ID") file_object_2 <- a$files$get(id = "file_2_ID") file_object_3 <- a$files$get(id = "file_3_ID") files_to_export <- list(file_object_1, file_object_2, file_object_3) prepare_items_for_bulk_export(files_to_export, destination_volume = "aws_example_volume" ) ## End(Not run) ## Not run: # Example 2: Prepare 3 items for bulk export action into some folder # on the volume - use folder name as prefix before file names file_object_1 <- a$files$get(id = "file_1_ID") file_object_2 <- a$files$get(id = "file_2_ID") file_object_3 <- a$files$get(id = "file_3_ID") files_to_export <- list(file_object_1, file_object_2, file_object_3) prepare_items_for_bulk_export(files_to_export, destination_volume = "aws_example_volume", destination_location_prefix = "example_folder/" ) ## End(Not run)
Utility function to prepare the items
parameter, a list of
elements containing information about each file or folder to be imported
using the bulk_submit_import()
method.
prepare_items_for_bulk_import( volume_items, destination_project = NULL, destination_parent = NULL, autorename = FALSE, preserve_folder_structure = TRUE )
prepare_items_for_bulk_import( volume_items, destination_project = NULL, destination_parent = NULL, autorename = FALSE, preserve_folder_structure = TRUE )
volume_items |
A list of |
destination_project |
Destination project ID or |
destination_parent |
Folder ID or |
autorename |
Logical indicating whether to autorename conflicting
files (default is |
preserve_folder_structure |
Logical indicating whether to preserve
folder structure. Set to |
Based on the provided list of VolumeFile
or
VolumePrefix
objects, this function allows you to set the
following fields for each item:
source_volume
source_location
destination_project
or destination_parent
autorename
preserve_folder_structure
However, keep in mind that there are certain constraints:
The same destination_project
/destination_parent
selection
applies to all items in the resulting list.
The same applies to autorename
and preserve_folder_structure
parameters.
This function doesn't allow specification of the name
of
aliases to create. This is something that should be specified per
item, therefore it cannot be applied to the entire list. However, once
you have the output of the prepare_items_for_bulk_import
function
you can manually add the name
field to certain items if necessary.
A list of elements containing information about each file/folder to be imported.
Imports
, VolumeFile
,
VolumePrefix
## Not run: # Example 1: Prepare 2 items for bulk import action - provide destination # project volume_obj_1 <- a$volumes$get volume_obj_2 <- a$volumes$get volumes_to_import <- list(volume_obj_1, volume_obj_2) destination_project <- a$projects$get(id = "project_id") prepare_items_for_bulk_import( volume_items = volumes_to_import, destination_project = destination_project ) ## End(Not run) ## Not run: # Example 2: Prepare 2 items for bulk import action - provide destination # parent volume_obj_1 <- a$volumes$get volume_obj_2 <- a$volumes$get volumes_to_import <- list(volume_obj_1, volume_obj_2) destination_parent <- a$files$get(id = "folder_id") prepare_items_for_bulk_import( volume_items = volumes_to_import, destination_parent = destination_parent ) ## End(Not run)
## Not run: # Example 1: Prepare 2 items for bulk import action - provide destination # project volume_obj_1 <- a$volumes$get volume_obj_2 <- a$volumes$get volumes_to_import <- list(volume_obj_1, volume_obj_2) destination_project <- a$projects$get(id = "project_id") prepare_items_for_bulk_import( volume_items = volumes_to_import, destination_project = destination_project ) ## End(Not run) ## Not run: # Example 2: Prepare 2 items for bulk import action - provide destination # parent volume_obj_1 <- a$volumes$get volume_obj_2 <- a$volumes$get volumes_to_import <- list(volume_obj_1, volume_obj_2) destination_parent <- a$files$get(id = "folder_id") prepare_items_for_bulk_import( volume_items = volumes_to_import, destination_parent = destination_parent ) ## End(Not run)
R6 Class representing a central resource for managing projects.
sevenbridges2::Item
-> Project
URL
List of URL endpoints for this resource.
id
Project identifier. It consists of project owner's username or
if you are using Enterprise, then the Division name and project's
short name in form of <owner_username>/<project-short-name>
or
<division-name>/<project-short-name>
.
name
Project's name.
billing_group
The ID of the billing group for the project.
description
Project's description.
type
Project's type. All projects have type v2.
tags
The list of project tags.
settings
A list which contains detailed project settings. The following fields are part of the settings object:
locked
- If set TRUE
, the project is locked down.
Locking down a project prevents any Seven Bridges team member from
viewing any information about the task.
use_interruptible_instances
- Defines the use of
spot instances.
If not included in the request, spot instances are enabled by
default.
use_memoization
- Set to FALSE
by default. If set to TRUE
memoization
is enabled.
use_elastic_disk
- If set to TRUE
Elastic disk is
enabled.
intermediate_files
(list) - Contains the following subfields:
retention
- Specifies that intermediate files should be
retained for a limited amount of time.
The value is always LIMITED
.
duration
- Specifies intermediate files retention period
in hours. The minimum value is 1
. The maximum value is 120
and the default value is 24
.
root_folder
ID for of the project's root folder.
created_by
Username of the person who created the project.
created_on
Date and time of project creation.
modified_on
Date and time describing when the project was last modified.
permissions
An object containing the information about user's permissions within the project.
category
Project's category. By default projects are PRIVATE
.
new()
Create a new Project object.
Project$new(res = NA, ...)
res
Response containing Project object information.
...
Other response arguments.
print()
Basic print method for Project class.
Project$print()
\dontrun{ # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Print project object project_object$print() }
detailed_print()
Detailed print method for Project class.
Project$detailed_print()
This method allows users to print all the fields from the Project object more descriptively.
\dontrun{ # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Print project object in detail project_object$detailed_print() }
reload()
Reload Project object information.
Project$reload(...)
...
Other arguments that can be passed to core api()
function
like 'fields', etc.
\dontrun{ # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Reload project object project_object$reload() }
update()
Method that allows you to edit an already existing project.
As a project Admin you can use it to change the name
, settings
,
tags
or billing group
of the project.
Users with write permissions in the project can change the project
description
.
Project$update( name = NULL, description = NULL, billing_group = NULL, settings = NULL, tags = NULL, ... )
name
New name of the project you are updating.
description
New description of the project you are updating.
billing_group
Billing object or ID of a particular billing group you want to set to the project.
settings
Contains detailed project settings as explained in previous methods. Check our API documentation.
tags
The list of project tags you want to update.
...
Other arguments that can be passed to core api()
function
like 'limit', 'offset', 'fields', etc.
\dontrun{ # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Change project object name project_object$update(name = name) }
delete()
Method that allows you to delete project from a platform.
It can only be successfully made if you have admin status for the
project.
Please be careful when using this method and note that calling it will
permanently delete the project from the platform.
Project$delete()
\dontrun{ # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Delete project object project_object$delete() }
list_members()
Method for listing all the project members.
Project$list_members( limit = getOption("sevenbridges2")$limit, offset = getOption("sevenbridges2")$offset, ... )
limit
The maximum number of collection items to return
for a single request. Minimum value is 1
.
The maximum value is 100
and the default value is 50
.
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.
Collection
of Member
objects.
\dontrun{ # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # List members in a project project_object$list_members() }
add_member()
Method for adding new members to a specified project. The call can only be successfully made by a user who has admin permissions in the project.
Project$add_member( user = NULL, email = NULL, permissions = list(read = TRUE, copy = FALSE, write = FALSE, execute = FALSE, admin = FALSE) )
user
The Seven Bridges Platform username of the person you want to add to the project or object of class Member containing user's username.
email
The email address of the person you want to add to the project. This has to be the email address that the person used when registering for an account on the Seven Bridges Platform.
permissions
List of permissions that will be associated with the
project's member. It can contain fields: read
, copy
, write
,
execute
and admin
with logical fields - TRUE
if certain permission
is allowed to the user, or FALSE
if it's not.
Requests to add a project member must include the key permissions.
However, if you do not include a value for some permission, it will be
set to FALSE
by default. The exception to this rule is the read
permission, which is the default permission on a project. It enables a
user to read project data, including file names, but access file
contents.
Example:
permissions = list( read = TRUE, copy = TRUE, write = FALSE, execute = FALSE, admin = FALSE )
Member
object.
\dontrun{ # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Add member to a project project_object$add_member( user = "<username_of_a_user_you_want_to_add>", permissions = list(write = TRUE, execute = TRUE) ) }
remove_member()
A method for removing members from the project. It can only be successfully run by a user who has admin privileges in the project.
Project$remove_member(user)
user
The Seven Bridges Platform username of the person you want to remove from the project or object of class Member containing user's username.
\dontrun{ # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Remove member from a project project_object$remove_member(user = user) }
get_member()
This method returns the information about the member of the specified project.
Project$get_member(user, ...)
user
The Seven Bridges Platform username of the project member 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.
Member
object.
\dontrun{ # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Get member from a project project_object$get_member(user = user) }
modify_member_permissions()
This method can be used to edit a user's permissions in a specified project. It can only be successfully made by a user who has admin permissions in the project.
Project$modify_member_permissions( user = NULL, permissions = list(read = TRUE, copy = FALSE, write = FALSE, execute = FALSE, admin = FALSE) )
user
The Seven Bridges Platform username of the person you want to modify permissions on the volume for or object of class Member containing user's username.
permissions
List of permissions that will be associated with the
project's member. It can contain fields: read
, copy
, write
,
execute
and admin
with logical fields - TRUE
if certain permission
is allowed to the user, or FALSE
if it's not.
Requests to add a project member must include the key permissions.
However, if you do not include a value for some permission, it will be
set to FALSE
by default. The exception to this rule is the read
permission, which is the default permission on a project. It enables a
user to read project data, including file names, but access file
contents.
Example:
permissions = list(read = TRUE, copy = TRUE)
Permission
object.
\dontrun{ # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Modify member permissions in a project project_object$modify_member_permissions( user = user, permission = list(read = TRUE, copy = FALSE) ) }
list_files()
List all project's files and folders.
Project$list_files( limit = getOption("sevenbridges2")$limit, offset = getOption("sevenbridges2")$offset, ... )
limit
The maximum number of collection items to return
for a single request. Minimum value is 1
.
The maximum value is 100
and the default value is 50
.
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.
Collection
of File
objects.
\dontrun{ # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # List files in a project project_object$list_files() }
create_folder()
Create a new folder under the project's root directory. Every project on the Seven Bridges Platform is represented by a root folder which contains all the files associated with a particular project. You can create first level folders within this root folder by using this function.
Project$create_folder(name)
name
Folder name.
File
object of type 'FOLDER'.
\dontrun{ # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # List files in a project project_object$create_folder(name = "new_folder") }
get_root_folder()
Get project's root folder object
Project$get_root_folder()
File
object of type 'FOLDER'.
\dontrun{ # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Get root folder in a project project_object$get_root_folder() }
list_apps()
This call lists all apps in project.
Project$list_apps( query_terms = NULL, id = NULL, limit = getOption("sevenbridges2")$limit, offset = getOption("sevenbridges2")$offset, ... )
query_terms
A list of search terms used to filter apps based on
their details. Each term is case-insensitive and can relate to the
app's name, label, toolkit, toolkit version, category, tagline, or
description.
You can provide a single term (e.g., list("Compressor")
) or multiple
terms (e.g., list("Expression", "Abundance")
) to search for apps
that match all the specified terms. If a term matches any part of the
app's details, the app will be included in the results.
Search terms can also include phrases
(e.g., list("Abundance estimates input")
), which will search for
exact matches within app descriptions or other fields.
id
Use this parameter to query Project's apps based on their ID.
limit
The maximum number of collection items to return
for a single request. Minimum value is 1
.
The maximum value is 100
and the default value is 50
.
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 other query parameters or 'fields', etc.
Collection
of App
objects.
\dontrun{ # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # List apps in a project project_object$list_apps(query_terms = query_term) }
create_app()
This call creates app in project.
Project$create_app( raw = NULL, from_path = NULL, name, raw_format = c("JSON", "YAML") )
raw
The body of the request should be a CWL app description saved
as a JSON
or YAML
file. For a template of this description, try
making the call to get raw CWL for an app about an app already in one
of your projects. Shouldn't be used together with from_path
parameter.
from_path
File containing CWL app description. Shouldn't be used together with raw parameter.
name
A short name for the app (without any non-alphanumeric characters or spaces).
raw_format
The type of format used (JSON
or YAML
).
App
object.
\dontrun{ # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Create app in a project project_object$create_app(raw = raw) }
list_tasks()
This call lists all tasks from project you can access.
Read more about how to use query parameters properly
here.
Project$list_tasks( status = NULL, parent = NULL, created_from = NULL, created_to = NULL, started_from = NULL, started_to = NULL, ended_from = NULL, ended_to = NULL, order_by = c("created_time", "start_time", "name", "end_time", "created_by"), order = c("asc", "desc"), origin_id = NULL, limit = getOption("sevenbridges2")$limit, offset = getOption("sevenbridges2")$offset, ... )
status
You can filter the returned tasks by their status. Set the value of status to one of the following values:
QUEUED
DRAFT
RUNNING
COMPLETED
ABORTED
FAILED.
parent
Provide task ID or task object of the parent task to return all child tasks from that parent. A parent task is a task that specifies the criteria by which to batch its inputs into a series of further sub-tasks, called child tasks. See the documentation on batching tasks for more details on how to run tasks in batches.
created_from
Enter the starting date string for querying tasks created on the specified date and onwards.
created_to
Enter the ending date string for querying tasks
created until the specified date. You can use it in combination with
created_from
to specify a time interval.
started_from
Enter the starting date string for querying tasks started on the specified date and onwards.
started_to
Enter the ending date string for querying tasks started until the specified date.
ended_from
Enter the starting date string for querying tasks that ended on a specified date.
ended_to
Enter the ending date string for querying tasks that ended until a specified date.
order_by
Order returned results by the specified field.
Allowed values: created_time
, start_time
, name
, end_time
and
created_by
.
Sort can be done only by one column. The default
value is created_time
.
order
Sort results in ascending or descending order by
specifying asc
or desc
, respectively. Only taken into account if
order_by
is explicitly specified. The default value is asc
.
origin_id
Enter an automation run ID to list all tasks created from the specified automation run.
limit
The maximum number of collection items to return
for a single request. Minimum value is 1
.
The maximum value is 100
and the default value is 50
.
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.
Collection
of Task
objects.
\dontrun{ # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # List tasks in a project project_object$list_tasks() }
list_imports()
This call lists imports initiated by particular user into this destination project.
Project$list_imports( volume = NULL, state = NULL, limit = getOption("sevenbridges2")$limit, offset = getOption("sevenbridges2")$offset, ... )
volume
Volume id or Volume object. List all imports from particular volume. Optional.
state
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 is 100
and the default value is 50
.
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.
Collection
of Import
objects.
\dontrun{ # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # List import jobs in a project project_object$list_imports() }
create_task()
This call creates a new task. You can create either a single task or a batch task by using the app's default batching, override batching, or disable batching completely. A parent task is a task that specifies criteria by which to batch its inputs into a series of further sub-tasks, called child tasks. the documentation on batching tasks for more details on batching criteria.
Project$create_task( app, revision = NULL, name = NULL, description = NULL, execution_settings = NULL, inputs = NULL, output_location = NULL, batch = NULL, batch_input = NULL, batch_by = NULL, use_interruptible_instances = NULL, action = NULL, ... )
app
The ID of an app or an App object you want to run.
Recall that apps are specified by their projects, in the form
<project_id>/<app_name>
.
revision
The app revision (version) number.
name
The name of the task.
description
An optional description of the task.
execution_settings
Named list with detailed task execution parameters. Detailed task execution parameters:
instance_type
: Possible value is the specific instance type,
e.g. "instance_type" = "c4.2xlarge;ebs-gp2;2000"
;
max_parallel_instances
: Maximum number of instances
running at the same time. Takes any integer value equal to or
greater than 1, e.g. "max_parallel_instances" = 2.
;
use_memoization
: Set to FALSE
by default. Set to TRUE
to enable
memoization;
use_elastic_disk
: Set to TRUE
to enable
Elastic Disk.
Here is an example:
execution_settings <- list( "instance_type" = "c4.2xlarge;ebs-gp2;2000", "max_parallel_instances" = 2, "use_memoization" = TRUE, "use_elastic_disk" = TRUE )
inputs
List of objects. See the section on specifying task inputs for information on creating task input objects. Here is an example with various input types:
inputs <- list( "input_file"= "<file_id/file_object>", "input_directory" = "<folder_id/folder_object>", "input_array_string" = list("<string_elem_1>", "<string_elem_2>"), "input_boolean" = TRUE, "input_double" = 54.6, "input_enum" = "enum_1", "input_float" = 11.2, "input_integer" = "asdf", "input_long" = 4212, "input_string" = "test_string", "input_record" = list( "input_record_field_file" = "<file_id/file_object>", "input_record_field_integer" = 42 ) )
output_location
The output location list allows you to define the exact location where your task outputs will be stored. The location can either be defined for the entire project using the main_location parameter, or individually per each output node, by setting the nodes_override parameter to true and defining individual output node locations within nodes_location. See below for more details.
main_location
- Defines the output location for all
output nodes in the task. Can be a string path within the project in
which the task is created, for example
/Analysis/<task_id>_<task_name>/
or a path on an attached volume, such as
volumes://volume_name/<project_id>/html
.
Parts of the path enclosed in angle brackets <> are tokens that are
dynamically replaced with corresponding values during task
execution.
main_location_alias
: The string location (path) in the
project that will point to the actual location where the outputs are
stored. Used if main_location is defined as a volume path (starting
with volumes://), to provide an easy way of accessing output data
directly from project files.
nodes_override
: Enables defining of output locations
for output nodes individually through nodes_location (see below).
Set to TRUE
to be able to define individual locations per output
node. Default: FALSE
.
Even if nodes_override is set to TRUE
, it is not necessary to
define output locations for each of the output nodes individually.
Data from those output nodes that don't have their locations
explicitly defined through nodes_location is either placed in
main_location (if defined) or at the project files root if a main
output location is not defined for the task.
nodes_location
: List of output paths for individual
task output nodes in the following format for each output node: <output-node-id> = list(
"output_location" = "<output-path>",
"output_location_alias" = "<alias-path>"
)
Example:
b64html = list( "output_location" = "volumes://outputs/tasks/mar-19", "output_location_alias" = "/rfranklin/tasks/picard" )
In the example above, b64html is the ID of the output node for which you want to define the output location, while the parameters are defined as follows:
output_location
- Can be a path within the project in which
the task is created, for example
/Analysis/<task_id>_<task_name>/
or a path on an attached volume, such as
volumes://volume_name/<project_id>/html
. Also accepts tokens.
output_location_alias
- The location (path) in the project
that will point to the exact location where the output is stored.
Used if output_location is defined as a volume path
(starting with volumes://).
batch
This is set to FALSE
by default. Set to TRUE
to
create a batch task and specify the batch_input
and batch-by
criteria as described below.
batch_input
The ID of the input on which you wish to batch. You would typically batch on the input consisting of a list of files. If this parameter is omitted, the default batching criteria defined for the app will be used.
batch_by
Batching criteria in form of list. For example:
batch_by = list( type = "CRITERIA", criteria = list("metadata.condition") )
use_interruptible_instances
This field can be TRUE
or FALSE
.
Set this field to TRUE
to allow the use of
spot instances.
action
If set to run
, the task will be run immediately upon
creation.
...
Other arguments that can be passed to core api()
function
like 'fields', etc.
Task
object.
\dontrun{ # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Create a task in a project project_object$create_task(app = app) }
clone()
The objects of this class are cloneable with this method.
Project$clone(deep = FALSE)
deep
Whether to make a deep clone.
## ------------------------------------------------ ## Method `Project$print` ## ------------------------------------------------ ## Not run: # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Print project object project_object$print() ## End(Not run) ## ------------------------------------------------ ## Method `Project$detailed_print` ## ------------------------------------------------ ## Not run: # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Print project object in detail project_object$detailed_print() ## End(Not run) ## ------------------------------------------------ ## Method `Project$reload` ## ------------------------------------------------ ## Not run: # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Reload project object project_object$reload() ## End(Not run) ## ------------------------------------------------ ## Method `Project$update` ## ------------------------------------------------ ## Not run: # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Change project object name project_object$update(name = name) ## End(Not run) ## ------------------------------------------------ ## Method `Project$delete` ## ------------------------------------------------ ## Not run: # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Delete project object project_object$delete() ## End(Not run) ## ------------------------------------------------ ## Method `Project$list_members` ## ------------------------------------------------ ## Not run: # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # List members in a project project_object$list_members() ## End(Not run) ## ------------------------------------------------ ## Method `Project$add_member` ## ------------------------------------------------ ## Not run: # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Add member to a project project_object$add_member( user = "<username_of_a_user_you_want_to_add>", permissions = list(write = TRUE, execute = TRUE) ) ## End(Not run) ## ------------------------------------------------ ## Method `Project$remove_member` ## ------------------------------------------------ ## Not run: # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Remove member from a project project_object$remove_member(user = user) ## End(Not run) ## ------------------------------------------------ ## Method `Project$get_member` ## ------------------------------------------------ ## Not run: # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Get member from a project project_object$get_member(user = user) ## End(Not run) ## ------------------------------------------------ ## Method `Project$modify_member_permissions` ## ------------------------------------------------ ## Not run: # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Modify member permissions in a project project_object$modify_member_permissions( user = user, permission = list(read = TRUE, copy = FALSE) ) ## End(Not run) ## ------------------------------------------------ ## Method `Project$list_files` ## ------------------------------------------------ ## Not run: # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # List files in a project project_object$list_files() ## End(Not run) ## ------------------------------------------------ ## Method `Project$create_folder` ## ------------------------------------------------ ## Not run: # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # List files in a project project_object$create_folder(name = "new_folder") ## End(Not run) ## ------------------------------------------------ ## Method `Project$get_root_folder` ## ------------------------------------------------ ## Not run: # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Get root folder in a project project_object$get_root_folder() ## End(Not run) ## ------------------------------------------------ ## Method `Project$list_apps` ## ------------------------------------------------ ## Not run: # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # List apps in a project project_object$list_apps(query_terms = query_term) ## End(Not run) ## ------------------------------------------------ ## Method `Project$create_app` ## ------------------------------------------------ ## Not run: # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Create app in a project project_object$create_app(raw = raw) ## End(Not run) ## ------------------------------------------------ ## Method `Project$list_tasks` ## ------------------------------------------------ ## Not run: # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # List tasks in a project project_object$list_tasks() ## End(Not run) ## ------------------------------------------------ ## Method `Project$list_imports` ## ------------------------------------------------ ## Not run: # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # List import jobs in a project project_object$list_imports() ## End(Not run) ## ------------------------------------------------ ## Method `Project$create_task` ## ------------------------------------------------ ## Not run: # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Create a task in a project project_object$create_task(app = app) ## End(Not run)
## ------------------------------------------------ ## Method `Project$print` ## ------------------------------------------------ ## Not run: # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Print project object project_object$print() ## End(Not run) ## ------------------------------------------------ ## Method `Project$detailed_print` ## ------------------------------------------------ ## Not run: # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Print project object in detail project_object$detailed_print() ## End(Not run) ## ------------------------------------------------ ## Method `Project$reload` ## ------------------------------------------------ ## Not run: # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Reload project object project_object$reload() ## End(Not run) ## ------------------------------------------------ ## Method `Project$update` ## ------------------------------------------------ ## Not run: # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Change project object name project_object$update(name = name) ## End(Not run) ## ------------------------------------------------ ## Method `Project$delete` ## ------------------------------------------------ ## Not run: # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Delete project object project_object$delete() ## End(Not run) ## ------------------------------------------------ ## Method `Project$list_members` ## ------------------------------------------------ ## Not run: # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # List members in a project project_object$list_members() ## End(Not run) ## ------------------------------------------------ ## Method `Project$add_member` ## ------------------------------------------------ ## Not run: # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Add member to a project project_object$add_member( user = "<username_of_a_user_you_want_to_add>", permissions = list(write = TRUE, execute = TRUE) ) ## End(Not run) ## ------------------------------------------------ ## Method `Project$remove_member` ## ------------------------------------------------ ## Not run: # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Remove member from a project project_object$remove_member(user = user) ## End(Not run) ## ------------------------------------------------ ## Method `Project$get_member` ## ------------------------------------------------ ## Not run: # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Get member from a project project_object$get_member(user = user) ## End(Not run) ## ------------------------------------------------ ## Method `Project$modify_member_permissions` ## ------------------------------------------------ ## Not run: # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Modify member permissions in a project project_object$modify_member_permissions( user = user, permission = list(read = TRUE, copy = FALSE) ) ## End(Not run) ## ------------------------------------------------ ## Method `Project$list_files` ## ------------------------------------------------ ## Not run: # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # List files in a project project_object$list_files() ## End(Not run) ## ------------------------------------------------ ## Method `Project$create_folder` ## ------------------------------------------------ ## Not run: # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # List files in a project project_object$create_folder(name = "new_folder") ## End(Not run) ## ------------------------------------------------ ## Method `Project$get_root_folder` ## ------------------------------------------------ ## Not run: # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Get root folder in a project project_object$get_root_folder() ## End(Not run) ## ------------------------------------------------ ## Method `Project$list_apps` ## ------------------------------------------------ ## Not run: # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # List apps in a project project_object$list_apps(query_terms = query_term) ## End(Not run) ## ------------------------------------------------ ## Method `Project$create_app` ## ------------------------------------------------ ## Not run: # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Create app in a project project_object$create_app(raw = raw) ## End(Not run) ## ------------------------------------------------ ## Method `Project$list_tasks` ## ------------------------------------------------ ## Not run: # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # List tasks in a project project_object$list_tasks() ## End(Not run) ## ------------------------------------------------ ## Method `Project$list_imports` ## ------------------------------------------------ ## Not run: # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # List import jobs in a project project_object$list_imports() ## End(Not run) ## ------------------------------------------------ ## Method `Project$create_task` ## ------------------------------------------------ ## Not run: # x is API response when project is requested project_object <- Project$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Create a task in a project project_object$create_task(app = app) ## End(Not run)
R6 Class representing Projects resource.
sevenbridges2::Resource
-> Projects
URL
List of URL endpoints for this resource.
new()
Create new Projects resource object.
Projects$new(...)
...
Other response arguments.
query()
A method to list all projects available to particular user.
If the username is not provided, all projects available to the
currently authenticated user will be listed.
Otherwise, projects will be listed for the user whose username
is provided.
Please keep in mind that this way you will only be able to list
projects you are a member of.
More details on how to query projects, you can find in our
documentation.
Projects$query( name = NULL, owner = NULL, tags = NULL, limit = getOption("sevenbridges2")$limit, offset = getOption("sevenbridges2")$offset, ... )
name
Project's name.
owner
The username of the owner whose projects you want to query.
tags
A list of project tags used to filter the query results. Each tag should be provided as a string within the list, and tags may include spaces. For example, both "my_tag_1" and "tag with spaces" are valid tag values. The method will return only projects that have all the specified tags.
limit
The maximum number of collection items to return
for a single request. Minimum value is 1
.
The maximum value is 100
and the default value is 50
.
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 other query parameters or 'fields', etc.
Collection
of Project
objects.
\dontrun{ projects_object <- Projects$new(auth = auth) # Query projects projects_object$query(name = name) }
get()
This call creates Project object containing the details of a specified project.
Projects$get(id, ...)
id
Project ID. It consists of project owner's username or
if you are using Enterprise, then the Division name and project's
short name in form of <owner_username>/<project-short-name>
or
<division-name>/<project-short-name>
.
...
Other arguments that can be passed to core api()
function
like 'fields', etc.
Project
object.
\dontrun{ projects_object <- Projects$new(auth = auth) # Get project by id projects_object$get(id = id) }
delete()
Method that allows you to delete project from a platform.
It can only be successfully made if you have admin status for the
project.
Projects are specified by their IDs, which you can obtain by
using Projects$query()
to list projects or by getting a
single project using Projects$get()
.
Please be careful when using this method and note that calling it will
permanently delete the project from the platform.
Projects$delete(project, ...)
project
Project
object or project ID.
...
Other arguments that can be passed to core api()
function
as 'fields', etc.
\dontrun{ projects_object <- Projects$new(auth = auth) # Delete a project projects_object$delete(project = project) }
create()
A method for creating a new project.
Projects$create( name, billing_group = NULL, description = name, tags = NULL, locked = FALSE, controlled = FALSE, location = NULL, use_interruptible_instances = TRUE, use_memoization = FALSE, use_elastic_disk = FALSE, intermediate_files = list(retention = "LIMITED", duration = 24), ... )
name
The name of the project you are creating.
billing_group
The Billing object or ID of the billing group for the project.
description
Description of the project.
tags
The list of project tags.
locked
Set this field to TRUE
to lock down a project.
Locking down a project prevents any Seven Bridges team member from
viewing any information about the task.
controlled
Set this field to TRUE
to define this project as
controlled i.e. one which will contain controlled data. Set FALSE
to
define the project as open i.e. one which will contain open data.
location
Specify the location for this project:
aws:us-east-1
or aws:us-west-2
.
use_interruptible_instances
Defines the use of spot instances.
use_memoization
Set to FALSE
by default. Set to TRUE
to enable
memoization.
use_elastic_disk
Set to TRUE
to enable
Elastic disk.
intermediate_files
A list defining the retention period for intermediate files. Expected elements:
retention
- Specifies that intermediate files should be
retained for a limited amount of time.
The value is always LIMITED
.
duration
- Specifies intermediate files retention period in
hours. The minimum value is 1
. The maximum value is 120
and the
default value is 24
.
...
Other arguments that can be passed to core api()
function
like 'fields', etc.
Project
object.
\dontrun{ projects_object <- Projects$new(auth = auth) # Create a project projects_object$create( name = name, billing_group = billing_group, description = description ) }
clone()
The objects of this class are cloneable with this method.
Projects$clone(deep = FALSE)
deep
Whether to make a deep clone.
## ------------------------------------------------ ## Method `Projects$query` ## ------------------------------------------------ ## Not run: projects_object <- Projects$new(auth = auth) # Query projects projects_object$query(name = name) ## End(Not run) ## ------------------------------------------------ ## Method `Projects$get` ## ------------------------------------------------ ## Not run: projects_object <- Projects$new(auth = auth) # Get project by id projects_object$get(id = id) ## End(Not run) ## ------------------------------------------------ ## Method `Projects$delete` ## ------------------------------------------------ ## Not run: projects_object <- Projects$new(auth = auth) # Delete a project projects_object$delete(project = project) ## End(Not run) ## ------------------------------------------------ ## Method `Projects$create` ## ------------------------------------------------ ## Not run: projects_object <- Projects$new(auth = auth) # Create a project projects_object$create( name = name, billing_group = billing_group, description = description ) ## End(Not run)
## ------------------------------------------------ ## Method `Projects$query` ## ------------------------------------------------ ## Not run: projects_object <- Projects$new(auth = auth) # Query projects projects_object$query(name = name) ## End(Not run) ## ------------------------------------------------ ## Method `Projects$get` ## ------------------------------------------------ ## Not run: projects_object <- Projects$new(auth = auth) # Get project by id projects_object$get(id = id) ## End(Not run) ## ------------------------------------------------ ## Method `Projects$delete` ## ------------------------------------------------ ## Not run: projects_object <- Projects$new(auth = auth) # Delete a project projects_object$delete(project = project) ## End(Not run) ## ------------------------------------------------ ## Method `Projects$create` ## ------------------------------------------------ ## Not run: projects_object <- Projects$new(auth = auth) # Create a project projects_object$create( name = name, billing_group = billing_group, description = description ) ## End(Not run)
Rate object containing information about user's rate limit.
This is main object for Rate Limit.
sevenbridges2::Item
-> Rate
rate
A list containing the information about user's current rate limit. It consists of the following fields:
limit
Indicates how many requests can be made in five
minutes.
remaining
Indicates how many requests remain.
reset
Indicates the time when the request rate limit will
be reset.
instance
A list containing the information about user's current instance limit. It consists of the following fields:
limit
Indicates the total number of instances available
to the user. For the first few months, instance limits are
unlimited. This is indicated by a special limit of -1.
Correspondingly, the remaining value is high.
remaining
Indicates the number of the instances that are
available at the moment. For the first few months, instance limits
are unlimited. This is indicated by a high remaining value.
Correspondingly, the limit is set to a special value of -1.
new()
Create a new Rate limit object.
Rate$new(res = NA, ...)
res
Response containing Rate limit object info.
...
Other response arguments.
print()
Print rate limit information as a bullet list.
Rate$print()
clone()
The objects of this class are cloneable with this method.
Rate$clone(deep = FALSE)
deep
Whether to make a deep clone.
Base class for describing a resource.
This is a base class for describing a resource on the platform: Projects, Tasks, Volumes, Files, Apps etc.
auth
Seven Bridges Authentication object.
URL
List of URL endpoints for this resource.
new()
Create a new Resource object.
Resource$new(auth = NA)
auth
Seven Bridges Authentication object.
query()
Generic query implementation that is used by the resources.
Resource$query(...)
...
Parameters that will be passed to core api()
function.
get()
Generic get implementation that fetches single resource from the server.
Resource$get(cls, id, ...)
cls
Resource class object.
id
Object id.
...
Other arguments that can be passed to core api()
function
like 'fields', etc.
delete()
Generic implementation that deletes the resource from the server.
Resource$delete(id, ...)
id
Object id.
...
Other arguments that can be passed to core api()
function.
cls
Resource class object.
clone()
The objects of this class are cloneable with this method.
Resource$clone(deep = FALSE)
deep
Whether to make a deep clone.
R6 Class representing a resource for managing tasks.
sevenbridges2::Item
-> Task
URL
List of URL endpoints for this resource.
id
The ID of the task.
name
The name of the task.
status
Task status (different from execution_status). Allowed values:
QUEUED
DRAFT
RUNNING
COMPLETED
ABORTED
FAILED
description
An optional description of a task.
project
Identifier of the project that the task is located in.
app
The identifier of the app that was used for the task.
created_by
Username of the task creator.
executed_by
Username of the task executor.
created_on
The time in form of string when the task was created.
start_time
Task start time in form of string.
end_time
Task end time in form of string .
origin
Id of the entity that created the task, e.g. automation run, if task was created by an automation run.
use_interruptable_instances
This field can be TRUE
or
FALSE
. Set this field to TRUE
to allow the use of spot instances.
batch
TRUE
for batch tasks, FALSE
for regular and child
tasks (batch this task; if FALSE
, will not create a batch task).
batch_by
Batching criteria (list).
batch_group
Batch group for a batch task (list). Represents the group that is assigned to the child task from the batching criteria that was used when the task was started.
batch_input
Input identifier on to which to apply batching.
batch_parent
Parent task ID for a batch child. (batch task which is the parent of this task).
execution_settings
Execution settings list for the task.
execution_status
Task execution status list - info about current execution status.
errors
Validations errors list stored as a high-level errors array property in the API response.
warnings
Validation warnings list from API response.
price
Task cost (list) - contains amount and currency.
inputs
List of inputs that were submitted to the task.
outputs
List of generated outputs from the task.
output_location
List of locations where task outputs will be stored.
new()
Create new Task object.
Task$new(res = NA, ...)
res
Response containing Task object information.
...
Other response arguments.
print()
Print method for Task class.
Task$print()
\dontrun{ # x is API response when task is requested task_object <- Task$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Print task object task_object$print() }
reload()
Reload Task object information.
Task$reload(...)
...
Other arguments that can be passed to core api()
function
like 'fields', etc.
Task
object.
\dontrun{ # x is API response when task is requested task_object <- Task$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Reload task object task_object$reload() }
run()
This call runs (executes) the task. Only tasks whose status
is DRAFT
can be run.
Task$run( batch = NULL, use_interruptible_instances = NULL, in_place = TRUE, ... )
batch
Set this to FALSE
to disable the default batching
for this task. Running a batch task is a recommended way to run multiple
tasks considering the API rate limit
(learn more).
use_interruptible_instances
This field can be TRUE
or
FALSE
. Set this field to TRUE
to allow the use of
spot instances.
in_place
Default TRUE
. Should the new object of
Task class be returned or the current to be reinitialized.
...
Other arguments that can be passed to core api()
function
like 'fields', etc.
Task
object.
\dontrun{ # x is API response when task is requested task_object <- Task$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Run task task_object$run() }
abort()
This call aborts the specified task. Only tasks whose
status is RUNNING
or QUEUED
may be aborted.
Task$abort(in_place = TRUE, ...)
in_place
Default TRUE
. Should the new object of
Task class be returned or the current to be reinitialized.
...
Other arguments that can be passed to core api()
function
like 'fields', etc.
Task
object.
\dontrun{ # x is API response when task is requested task_object <- Task$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) . # Run task task_object$run() # Then abort task task_object$abort() }
clone_task()
This call clones the specified task. Once cloned, the task
can either be in DRAFT
mode or immediately ran, by setting the run
parameter to TRUE
.
Task$clone_task(run = FALSE, ...)
run
Set this to TRUE
in order to create a draft task
and execute it immediately. Default: FALSE
.
...
Other arguments that can be passed to core api()
function
like 'fields', etc.
Task
object.
\dontrun{ # x is API response when task is requested task_object <- Task$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Clone task object task_object$clone_task() }
get_execution_details()
This call returns execution details of the specified task. The task is referred to by its ID, which you can obtain by making the call to list all tasks you can access. The call breaks down the information into the task's distinct jobs. A job is a single subprocess carried out in a task. The information returned by this call is broadly similar to that which can be found in the task stats and logs provided on the Platform. The task execution details include the following information:
The name of the command line job that executed
The start time of the job
End time of the job (if it completed)
The status of the job (DONE
, FAILED
, or RUNNING
)
Information on the computational instance that the job was run on, including the provider ID, the type of instance used and the cloud service provider
A link that can be used to download the standard error logs for the job.
SHA hash of the Docker image ('checksum').
Task$get_execution_details(...)
...
Other arguments that can be passed to core api()
function
like 'fields', etc.
List of execution details.
\dontrun{ # x is API response when task is requested task_object <- Task$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Get task execution details task_object$get_execution_details() }
list_batch_children()
This call retrieves batch child tasks for this task if its a batch task.
Task$list_batch_children( status = NULL, project = NULL, created_from = NULL, created_to = NULL, started_from = NULL, started_to = NULL, ended_from = NULL, ended_to = NULL, order_by = NULL, order = NULL, origin_id = NULL, limit = getOption("sevenbridges2")$limit, offset = getOption("sevenbridges2")$offset, ... )
status
You can filter the returned tasks by their status. Set the value of status to one of the following values:
QUEUED
DRAFT
RUNNING
COMPLETED
ABORTED
FAILED.
project
Provide the project ID or Project object you wish to list the tasks from.
created_from
Enter the starting date string for querying tasks created on the specified date and onwards.
created_to
Enter the ending date string for querying tasks
created until the specified date. You can use it in combination with
created_from
to specify a time interval.
started_from
Enter the starting date string for querying tasks started on the specified date and onwards.
started_to
Enter the ending date string for querying tasks started until the specified date.
ended_from
Enter the starting date string for querying tasks that ended on a specified date.
ended_to
Enter the ending date string for querying tasks that ended until a specified date.
order_by
Order returned results by the specified field.
Allowed values: created_time
, start_time
, name
, end_time
and
created_by
.
Sort can be done only by one column. The default
value is created_time
.
order
Sort results in ascending or descending order by
specifying asc
or desc
, respectively. Only taken into account if
order_by
is explicitly specified. The default value is asc
.
origin_id
Enter an automation run ID to list all tasks created from the specified automation run.
limit
The maximum number of collection items to return
for a single request. Minimum value is 1
.
The maximum value is 100
and the default value is 50
.
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.
Collection
of Task
objects.
\dontrun{ # x is API response when task is requested task_object <- Task$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # List batch children of a task task_object$list_batch_children() }
delete()
This call deletes the specified task. The task is referred to by its ID, which you can obtain by making the call to list all tasks you can access.
Task$delete(...)
...
Other arguments that can be passed to core api()
function
like 'fields', etc.
\dontrun{ # x is API response when task is requested task_object <- Task$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Delete task task_object$delete() }
rerun()
This call reruns (executes) the specified task.
Task$rerun(...)
...
Other arguments that can be passed to core api()
function
like 'fields', etc.
Task
object.
\dontrun{ # x is API response when task is requested task_object <- Task$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Rerun task task_object$rerun() }
update()
Change the details of the specified task, including its
name, description, and inputs. Note that you can only modify tasks with
a task status of DRAFT
. Tasks which are RUNNING
, QUEUED
,
ABORTED
, COMPLETED
or FAILED
cannot be modified in order to
enable the reproducibility of analyses which have been queued for
execution or has initiated executing.
There are two things to note if you are editing a batch task:
1
If you want to change the input on which to batch and
the batch criteria, you need to specify the batch_input and batch_by
parameters together in the same function call.
2
If you want to disable batching on a task, set batch to
false. Or, you can also set the parameters batch_input and batch_by
to NULL.
Task$update( name = NULL, description = NULL, execution_settings = NULL, inputs = NULL, output_location = NULL, batch = NULL, batch_input = NULL, batch_by = NULL, ... )
name
The name of the task.
description
An optional description of the task.
execution_settings
Named list with detailed task execution parameters. Detailed task execution parameters:
instance_type
: Possible value is the specific instance type,
e.g. "instance_type" = "c4.2xlarge;ebs-gp2;2000"
;
max_parallel_instances
: Maximum number of instances
running at the same time. Takes any integer value equal to or
greater than 1, e.g. "max_parallel_instances" = 2.
;
use_memoization
: Set to FALSE
by default. Set to TRUE
to enable
memoization;
use_elastic_disk
: Set to TRUE
to enable
Elastic Disk.
Here is an example:
execution_settings <- list( "instance_type" = "c4.2xlarge;ebs-gp2;2000", "max_parallel_instances" = 2, "use_memoization" = TRUE, "use_elastic_disk" = TRUE )
inputs
List of objects. See the section on specifying task inputs for information on creating task input objects. Here is an example with various input types:
inputs <- list( "input_file"= "<file_id/file_object>", "input_directory" = "<folder_id/folder_object>", "input_array_string" = list("<string_elem_1>", "<string_elem_2>"), "input_boolean" = TRUE, "input_double" = 54.6, "input_enum" = "enum_1", "input_float" = 11.2, "input_integer" = "asdf", "input_long" = 4212, "input_string" = "test_string", "input_record" = list( "input_record_field_file" = "<file_id/file_object>", "input_record_field_integer" = 42 ) )
output_location
The output location list allows you to define the exact location where your task outputs will be stored. The location can either be defined for the entire project using the main_location parameter, or individually per each output node, by setting the nodes_override parameter to true and defining individual output node locations within nodes_location. See below for more details.
main_location
- Defines the output location for all
output nodes in the task. Can be a string path within the project in
which the task is created, for example /Analysis/<task_id>_<task_name>/
or a path on an attached volume, such as volumes://volume_name/<project_id>/html
.
Parts of the path enclosed in angle brackets <> are tokens that are
dynamically replaced with corresponding values during task
execution.
main_location_alias
: The string location (path) in the
project that will point to the actual location where the outputs are
stored. Used if main_location is defined as a volume path (starting
with volumes://), to provide an easy way of accessing output data
directly from project files.
nodes_override
: Enables defining of output locations
for output nodes individually through nodes_location (see below).
Set to TRUE
to be able to define individual locations per output
node. Default: FALSE
.
Even if nodes_override is set to TRUE
, it is not necessary to
define output locations for each of the output nodes individually.
Data from those output nodes that don't have their locations
explicitly defined through nodes_location is either placed in
main_location (if defined) or at the project files root if a main
output location is not defined for the task.
nodes_location
: List of output paths for individual
task output nodes in the following format for each output node:<output-node-id> = list(
"output_location" = "<output-path>",
"output_location_alias" = "<alias-path>"
)
Example:
b64html = list( "output_location" = "volumes://outputs/tasks/mar-19", "output_location_alias" = "/rfranklin/tasks/picard" )
In the example above, b64html is the ID of the output node for which you want to define the output location, while the parameters are defined as follows:
output_location
- Can be a path within the project in which
the task is created, for example
/Analysis/<task_id>_<task_name>/
or a path on an attached volume, such as
volumes://volume_name/<project_id>/html
. Also accepts tokens.
output_location_alias
- The location (path) in the project
that will point to the exact location where the output is stored.
Used if output_location is defined as a volume path
(starting with volumes://).
batch
This is set to FALSE
by default. Set to TRUE
to
create a batch task and specify the batch_input
and batch-by
criteria as described below.
batch_input
The ID of the input on which you wish to batch. You would typically batch on the input consisting of a list of files. If this parameter is omitted, the default batching criteria defined for the app will be used.
batch_by
Batching criteria in form of list. For example:
batch_by = list( type = "CRITERIA", criteria = list("metadata.condition") )
...
Other arguments that can be passed to core api()
function
like 'fields', etc.
Task
object.
\dontrun{ # x is API response when task is requested task_object <- Task$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Update task task_object$update(name = new_name) }
clone()
The objects of this class are cloneable with this method.
Task$clone(deep = FALSE)
deep
Whether to make a deep clone.
## ------------------------------------------------ ## Method `Task$print` ## ------------------------------------------------ ## Not run: # x is API response when task is requested task_object <- Task$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Print task object task_object$print() ## End(Not run) ## ------------------------------------------------ ## Method `Task$reload` ## ------------------------------------------------ ## Not run: # x is API response when task is requested task_object <- Task$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Reload task object task_object$reload() ## End(Not run) ## ------------------------------------------------ ## Method `Task$run` ## ------------------------------------------------ ## Not run: # x is API response when task is requested task_object <- Task$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Run task task_object$run() ## End(Not run) ## ------------------------------------------------ ## Method `Task$abort` ## ------------------------------------------------ ## Not run: # x is API response when task is requested task_object <- Task$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) . # Run task task_object$run() # Then abort task task_object$abort() ## End(Not run) ## ------------------------------------------------ ## Method `Task$clone_task` ## ------------------------------------------------ ## Not run: # x is API response when task is requested task_object <- Task$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Clone task object task_object$clone_task() ## End(Not run) ## ------------------------------------------------ ## Method `Task$get_execution_details` ## ------------------------------------------------ ## Not run: # x is API response when task is requested task_object <- Task$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Get task execution details task_object$get_execution_details() ## End(Not run) ## ------------------------------------------------ ## Method `Task$list_batch_children` ## ------------------------------------------------ ## Not run: # x is API response when task is requested task_object <- Task$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # List batch children of a task task_object$list_batch_children() ## End(Not run) ## ------------------------------------------------ ## Method `Task$delete` ## ------------------------------------------------ ## Not run: # x is API response when task is requested task_object <- Task$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Delete task task_object$delete() ## End(Not run) ## ------------------------------------------------ ## Method `Task$rerun` ## ------------------------------------------------ ## Not run: # x is API response when task is requested task_object <- Task$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Rerun task task_object$rerun() ## End(Not run) ## ------------------------------------------------ ## Method `Task$update` ## ------------------------------------------------ ## Not run: # x is API response when task is requested task_object <- Task$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Update task task_object$update(name = new_name) ## End(Not run)
## ------------------------------------------------ ## Method `Task$print` ## ------------------------------------------------ ## Not run: # x is API response when task is requested task_object <- Task$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Print task object task_object$print() ## End(Not run) ## ------------------------------------------------ ## Method `Task$reload` ## ------------------------------------------------ ## Not run: # x is API response when task is requested task_object <- Task$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Reload task object task_object$reload() ## End(Not run) ## ------------------------------------------------ ## Method `Task$run` ## ------------------------------------------------ ## Not run: # x is API response when task is requested task_object <- Task$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Run task task_object$run() ## End(Not run) ## ------------------------------------------------ ## Method `Task$abort` ## ------------------------------------------------ ## Not run: # x is API response when task is requested task_object <- Task$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) . # Run task task_object$run() # Then abort task task_object$abort() ## End(Not run) ## ------------------------------------------------ ## Method `Task$clone_task` ## ------------------------------------------------ ## Not run: # x is API response when task is requested task_object <- Task$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Clone task object task_object$clone_task() ## End(Not run) ## ------------------------------------------------ ## Method `Task$get_execution_details` ## ------------------------------------------------ ## Not run: # x is API response when task is requested task_object <- Task$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Get task execution details task_object$get_execution_details() ## End(Not run) ## ------------------------------------------------ ## Method `Task$list_batch_children` ## ------------------------------------------------ ## Not run: # x is API response when task is requested task_object <- Task$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # List batch children of a task task_object$list_batch_children() ## End(Not run) ## ------------------------------------------------ ## Method `Task$delete` ## ------------------------------------------------ ## Not run: # x is API response when task is requested task_object <- Task$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Delete task task_object$delete() ## End(Not run) ## ------------------------------------------------ ## Method `Task$rerun` ## ------------------------------------------------ ## Not run: # x is API response when task is requested task_object <- Task$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Rerun task task_object$rerun() ## End(Not run) ## ------------------------------------------------ ## Method `Task$update` ## ------------------------------------------------ ## Not run: # x is API response when task is requested task_object <- Task$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Update task task_object$update(name = new_name) ## End(Not run)
R6 Class representing tasks resource endpoints.
sevenbridges2::Resource
-> Tasks
URL
List of URL endpoints for this resource.
new()
Create new Tasks resource object.
Tasks$new(...)
...
Other response arguments.
query()
This call lists all tasks you can access.
Read more about how to use query parameters properly
here.
Tasks$query( status = NULL, parent = NULL, project = NULL, created_from = NULL, created_to = NULL, started_from = NULL, started_to = NULL, ended_from = NULL, ended_to = NULL, order_by = c("created_time", "start_time", "name", "end_time", "created_by"), order = c("asc", "desc"), origin_id = NULL, limit = getOption("sevenbridges2")$limit, offset = getOption("sevenbridges2")$offset, ... )
status
You can filter the returned tasks by their status.
Set the value of status to one of the following values: QUEUED
,
DRAFT
, RUNNING
, COMPLETED
, ABORTED
, FAILED
.
parent
Provide task ID or Task object of the parent task to return all child tasks from that parent. A parent task is a task that specifies criteria by which to batch its inputs into a series of further sub-tasks, called child tasks. See the documentation on batching tasks for more details on how to run tasks in batches.
project
Provide the project ID or Project object you wish to list the tasks from.
created_from
Enter the starting date string for querying tasks created on the specified date and onwards.
created_to
Enter the ending date string for querying tasks
created until the specified date. You can use it in combination with
created_from
to specify a time interval.
started_from
Enter the starting date string for querying tasks started on the specified date and onwards.
started_to
Enter the ending date string for querying tasks started until the specified date.
ended_from
Enter the starting date string for querying tasks that ended on a specified date.
ended_to
Enter the ending date string for querying tasks that ended until a specified date.
order_by
Order returned results by the specified field.
Allowed values: created_time
, start_time
, name
, end_time
and
created_by
.
Sort can be done only by one column. The default
value is created_time
.
order
Sort results in ascending or descending order by
specifying asc
or desc
, respectively. Only taken into account if
order_by
is explicitly specified. The default value is asc
.
origin_id
Enter an automation run ID to list all tasks created from the specified automation run.
limit
The maximum number of collection items to return
for a single request. Minimum value is 1
.
The maximum value is 100
and the default value is 50
.
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.
Collection
of Task
objects.
get()
This call returns details of the specified task. The task is referred to by its ID, which you can obtain by making the call to list all tasks you can access. The task details include its creator, its start and end time, the number of jobs completed in it, and its input and output files. You can also see the status of the task.
Tasks$get(id, ...)
id
The ID of the task you are querying.
...
Other arguments that can be passed to core api()
function
like 'fields', etc.
Task
object.
delete()
This call deletes a task from the Seven Bridges Platform.
Tasks are specified by their IDs, which you can obtain by using
Tasks$query()
to list tasks or by getting a single task
using Tasks$get()
.
Tasks$delete(task, ...)
task
Task
object or task ID.
...
Other arguments that can be passed to core api()
function
as 'fields', etc.
create()
This call creates a new task. You can create either a single task or a batch task by using the app's default batching, override batching, or disable batching completely. A parent task is a task that specifies criteria by which to batch its inputs into a series of further sub-tasks, called child tasks. the documentation on batching tasks for more details on batching criteria.
Tasks$create( project, app, revision = NULL, name = NULL, description = NULL, execution_settings = NULL, inputs = NULL, output_location = NULL, batch = NULL, batch_input = NULL, batch_by = NULL, use_interruptible_instances = NULL, action = NULL, ... )
project
The ID of a project or a Project object where you want to create the task in.
app
The ID of an app or an App object you want to run.
Recall that apps are specified by their projects, in the form
<project_id>/<app_name>
.
revision
The app revision (version) number.
name
The name of the task.
description
An optional description of the task.
execution_settings
Named list with detailed task execution parameters. Detailed task execution parameters:
instance_type
: Possible value is the specific instance type,
e.g. "instance_type" = "c4.2xlarge;ebs-gp2;2000"
;
max_parallel_instances
: Maximum number of instances
running at the same time. Takes any integer value equal to or
greater than 1, e.g. "max_parallel_instances" = 2.
;
use_memoization
: Set to FALSE
by default. Set to TRUE
to enable
memoization;
use_elastic_disk
: Set to TRUE
to enable
Elastic Disk.
Here is an example:
execution_settings <- list( "instance_type" = "c4.2xlarge;ebs-gp2;2000", "max_parallel_instances" = 2, "use_memoization" = TRUE, "use_elastic_disk" = TRUE )
inputs
List of objects. See the section on specifying task inputs for information on creating task input objects. Here is an example with various input types:
inputs <- list( "input_file"= "<file_id/file_object>", "input_directory" = "<folder_id/folder_object>", "input_array_string" = list("<string_elem_1>", "<string_elem_2>"), "input_boolean" = TRUE, "input_double" = 54.6, "input_enum" = "enum_1", "input_float" = 11.2, "input_integer" = "asdf", "input_long" = 4212, "input_string" = "test_string", "input_record" = list( "input_record_field_file" = "<file_id/file_object>", "input_record_field_integer" = 42 ) )
output_location
The output location list allows you to define the exact location where your task outputs will be stored. The location can either be defined for the entire project using the main_location parameter, or individually per each output node, by setting the nodes_override parameter to true and defining individual output node locations within nodes_location. See below for more details.
main_location
- Defines the output location for all
output nodes in the task. Can be a string path within the project in
which the task is created, for example /Analysis/<task_id>_<task_name>/
or a path on an attached volume, such as volumes://volume_name/<project_id>/html
.
Parts of the path enclosed in angle brackets <> are tokens that are
dynamically replaced with corresponding values during task
execution.
main_location_alias
: The string location (path) in the
project that will point to the actual location where the outputs are
stored. Used if main_location is defined as a volume path (starting
with volumes://), to provide an easy way of accessing output data
directly from project files.
nodes_override
: Enables defining of output locations
for output nodes individually through nodes_location (see below).
Set to TRUE
to be able to define individual locations per output
node. Default: FALSE
.
Even if nodes_override is set to TRUE
, it is not necessary to
define output locations for each of the output nodes individually.
Data from those output nodes that don't have their locations
explicitly defined through nodes_location is either placed in
main_location (if defined) or at the project files root if a main
output location is not defined for the task.
nodes_location
: List of output paths for individual
task output nodes in the following format for each output node:<output-node-id> = list(
"output_location" = "<output-path>",
"output_location_alias" = "<alias-path>"
)
Example:
b64html = list( "output_location" = "volumes://outputs/tasks/mar-19", "output_location_alias" = "/rfranklin/tasks/picard" )
In the example above, b64html is the ID of the output node for which you want to define the output location, while the parameters are defined as follows:
output_location
- Can be a path within the project in which
the task is created, for example
/Analysis/<task_id>_<task_name>/
or a path on an attached volume, such as
volumes://volume_name/<project_id>/html
. Also accepts tokens.
output_location_alias
- The location (path) in the project
that will point to the exact location where the output is stored.
Used if output_location is defined as a volume path
(starting with volumes://).
batch
This is set to FALSE
by default. Set to TRUE
to
create a batch task and specify the batch_input
and batch-by
criteria as described below.
batch_input
The ID of the input on which you wish to batch. You would typically batch on the input consisting of a list of files. If this parameter is omitted, the default batching criteria defined for the app will be used.
batch_by
Batching criteria in form of list. For example:
batch_by = list( type = "CRITERIA", criteria = list("metadata.condition") )
use_interruptible_instances
This field can be TRUE
or FALSE
.
Set this field to TRUE
to allow the use of
spot instances.
action
If set to run
, the task will be run immediately upon
creation.
...
Other arguments that can be passed to core api()
function
like 'fields', etc.
Task
object.
bulk_get()
This call returns statistics for all specified tasks.
Tasks$bulk_get(tasks)
tasks
A list of Task
objects or list of strings
(IDs) of the tasks you are requesting the statistics for.
Collection
(list of Task
objects).
\dontrun{ # Get details of multiple tasks a$tasks$bulk_get( tasks = list("task_1_ID", "task_2_ID") ) }
clone()
The objects of this class are cloneable with this method.
Tasks$clone(deep = FALSE)
deep
Whether to make a deep clone.
## ------------------------------------------------ ## Method `Tasks$bulk_get` ## ------------------------------------------------ ## Not run: # Get details of multiple tasks a$tasks$bulk_get( tasks = list("task_1_ID", "task_2_ID") ) ## End(Not run)
## ------------------------------------------------ ## Method `Tasks$bulk_get` ## ------------------------------------------------ ## Not run: # Get details of multiple tasks a$tasks$bulk_get( tasks = list("task_1_ID", "task_2_ID") ) ## End(Not run)
R6 Class representing a resource for managing files' uploads.
URL
List of URL endpoints for this resource.
upload_id
Upload ID received after upload initialization.
path
Relative or absolute path to the file on the local disc.
project
Project's identifier (character).
parent
The ID of the folder to which the item is being uploaded. Should not be used together with 'project'.
filename
File name. By default it will be the same as the name of the file you want to upload. However, it can be changed to new name.
overwrite
If TRUE
will overwrite file on the server.
file_size
File size.
part_size
Size of part in bytes.
part_length
Number of parts to upload.
parts
List of parts to be uploaded (class Part
).
initialized
If TRUE
, upload has been initialized.
auth
Authentication object.
new()
Create a new Upload object.
Upload$new( path = NA, project = NA, parent = NA, filename = NA, overwrite = FALSE, file_size = NA, part_size = getOption("sevenbridges2")$RECOMMENDED_PART_SIZE, initialized = FALSE, auth = NA )
path
Path to the file on the local disc.
project
Project's identifier (character).
parent
The ID of the folder to which the item is being uploaded.
filename
New file name. Optional.
overwrite
If true will overwrite file on the server.
file_size
File size.
part_size
Size of a single part in bytes.
initialized
If TRUE
, upload has been initialized.
auth
Seven Bridges Authentication object.
print()
Print method for Upload class.
Upload$print()
\dontrun{ upload_object <- Upload$new( path = "path/to/my/file.txt", project = project_object, auth = auth ) # Print upload object information upload_object$print(name = name) }
init()
Initialize new multipart file upload.
Upload$init()
\dontrun{ upload_object <- Upload$new( path = "path/to/my/file.txt", project = project_object, auth = auth ) # Initialize multipart file upload object upload_object$init() }
info()
Get the details of an active multipart upload.
Upload$info(list_parts = FALSE)
list_parts
If TRUE
, also return a list of parts
that have been reported as completed for this multipart upload.
Please bear in mind that the output could be heavy for printing if
there are lot of parts.
\dontrun{ upload_object <- Upload$new( path = "path/to/my/file.txt", project = project_object, auth = auth ) # Get upload job status information upload_object$info() }
start()
Start the file upload
Upload$start()
File
object.
\dontrun{ upload_object <- Upload$new( path = "path/to/my/file.txt", project = project_object, auth = auth ) # Initialize multipart file upload object upload_object$init() # Start upload process upload_object$start() }
abort()
Abort the multipart upload This call aborts an ongoing upload.
Upload$abort()
\dontrun{ upload_object <- Upload$new( path = "path/to/my/file.txt", project = project_object, auth = auth ) # Abort upload process upload_object$abort() }
clone()
The objects of this class are cloneable with this method.
Upload$clone(deep = FALSE)
deep
Whether to make a deep clone.
## ------------------------------------------------ ## Method `Upload$print` ## ------------------------------------------------ ## Not run: upload_object <- Upload$new( path = "path/to/my/file.txt", project = project_object, auth = auth ) # Print upload object information upload_object$print(name = name) ## End(Not run) ## ------------------------------------------------ ## Method `Upload$init` ## ------------------------------------------------ ## Not run: upload_object <- Upload$new( path = "path/to/my/file.txt", project = project_object, auth = auth ) # Initialize multipart file upload object upload_object$init() ## End(Not run) ## ------------------------------------------------ ## Method `Upload$info` ## ------------------------------------------------ ## Not run: upload_object <- Upload$new( path = "path/to/my/file.txt", project = project_object, auth = auth ) # Get upload job status information upload_object$info() ## End(Not run) ## ------------------------------------------------ ## Method `Upload$start` ## ------------------------------------------------ ## Not run: upload_object <- Upload$new( path = "path/to/my/file.txt", project = project_object, auth = auth ) # Initialize multipart file upload object upload_object$init() # Start upload process upload_object$start() ## End(Not run) ## ------------------------------------------------ ## Method `Upload$abort` ## ------------------------------------------------ ## Not run: upload_object <- Upload$new( path = "path/to/my/file.txt", project = project_object, auth = auth ) # Abort upload process upload_object$abort() ## End(Not run)
## ------------------------------------------------ ## Method `Upload$print` ## ------------------------------------------------ ## Not run: upload_object <- Upload$new( path = "path/to/my/file.txt", project = project_object, auth = auth ) # Print upload object information upload_object$print(name = name) ## End(Not run) ## ------------------------------------------------ ## Method `Upload$init` ## ------------------------------------------------ ## Not run: upload_object <- Upload$new( path = "path/to/my/file.txt", project = project_object, auth = auth ) # Initialize multipart file upload object upload_object$init() ## End(Not run) ## ------------------------------------------------ ## Method `Upload$info` ## ------------------------------------------------ ## Not run: upload_object <- Upload$new( path = "path/to/my/file.txt", project = project_object, auth = auth ) # Get upload job status information upload_object$info() ## End(Not run) ## ------------------------------------------------ ## Method `Upload$start` ## ------------------------------------------------ ## Not run: upload_object <- Upload$new( path = "path/to/my/file.txt", project = project_object, auth = auth ) # Initialize multipart file upload object upload_object$init() # Start upload process upload_object$start() ## End(Not run) ## ------------------------------------------------ ## Method `Upload$abort` ## ------------------------------------------------ ## Not run: upload_object <- Upload$new( path = "path/to/my/file.txt", project = project_object, auth = auth ) # Abort upload process upload_object$abort() ## End(Not run)
User object containing user information.
This is main object for Users.
sevenbridges2::Item
-> User
URL
List of URL endpoints for this resource.
username
User name.
email
User's email address.
first_name
User's first name.
last_name
User's last name.
affiliation
The company or the institute the user is affiliated with.
phone
User's phone number.
address
User's residential address.
city
User's city of residence.
state
User's state of residence.
country
User's country of residence.
zip_code
Zip code for the user's residence.
role
User's role.
tags
Platform tags associated with the user.
new()
Create a new User object.
User$new(res = NA, ...)
res
Response containing User object information.
...
Other response arguments.
print()
Print user information as bullet list.
User$print()
reload()
Reload User object information.
User$reload(...)
...
Other arguments that can be passed to core api()
function
like 'fields', etc.
User
object.
clone()
The objects of this class are cloneable with this method.
User$clone(deep = FALSE)
deep
Whether to make a deep clone.
R6 Class representing a resource for managing volumes.
sevenbridges2::Item
-> Volume
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
.
new()
Create a new Volume object.
Volume$new(res = NA, ...)
res
Response containing Volume object info.
...
Other response arguments.
print()
Print method for Volume class.
Volume$print()
\dontrun{ # 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() }
reload()
Reload Volume object information.
Volume$reload(...)
...
Other arguments that can be passed to core api()
function
like 'fields', etc.
Volume
object.
\dontrun{ # 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() }
update()
Update a volume. This function updates the details of a specific volume.
Volume$update(description = NULL, access_mode = NULL, service = NULL)
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.
Volume
object.
\dontrun{ # 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) }
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.
Volume$deactivate(...)
...
Other query parameters or arguments that can be passed to
core api()
function like 'force'.
Use it within query parameter, like query = list(force = TRUE)
.
\dontrun{ # 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()
Reactivate volume.
This function reactivates the previously deactivated volume by updating
the active
field of the volume to TRUE
.
Volume$reactivate(...)
...
Other query parameters or arguments that can be passed to
core api()
function like 'force'.
Use it within query parameter, like query = list(force = TRUE)
.
Volume
object.
\dontrun{ # 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() }
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.
Volume$delete()
\dontrun{ # 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() }
list_contents()
List volume contents. This call lists the contents of a specific volume.
Volume$list_contents( prefix = NULL, limit = getOption("sevenbridges2")$limit, link = NULL, continuation_token = NULL, ... )
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 is 100
and the default value is 50
.
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
.
VolumeContentCollection
object containing
list of VolumeFile
and VolumePrefix
objects.
\dontrun{ # 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() }
get_file()
Get volume file information. This function returns the specific Volume File.
Volume$get_file(location = NULL, link = NULL, ...)
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.
VolumeFile
object.
\dontrun{ # 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) }
list_members()
List members of a volume. This function returns the members of a specific volume.
Volume$list_members( limit = getOption("sevenbridges2")$limit, offset = getOption("sevenbridges2")$offset, ... )
limit
The maximum number of collection items to return
for a single request. Minimum value is 1
.
The maximum value is 100
and the default value is 50
.
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.
Collection
containing Member
objects.
\dontrun{ # 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() }
add_member()
Add member to a volume. This function adds members to the specified volume.
Volume$add_member( user, permissions = list(read = TRUE, copy = FALSE, write = FALSE, admin = FALSE) )
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)
Member
object.
\dontrun{ # 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) ) }
remove_member()
Remove member from a volume. This function removes members from the specified volume.
Volume$remove_member(user)
user
The Seven Bridges Platform username of the person you want to remove from the volume or object of class Member containing user's username.
\dontrun{ # 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) }
get_member()
Get member's details. This function returns member's information.
Volume$get_member(user, ...)
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.
Member
object.
\dontrun{ # 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) }
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.
Volume$modify_member_permissions( user, permissions = list(read = TRUE, copy = FALSE, write = FALSE, admin = FALSE) )
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)
Permission
object.
\dontrun{ # 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) ) }
list_imports()
This call lists import jobs initiated by particular user from this volume.
Volume$list_imports( project = NULL, state = NULL, limit = getOption("sevenbridges2")$limit, offset = getOption("sevenbridges2")$offset, ... )
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 is 100
and the default value is 50
.
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.
Collection
containing list of
Import
job objects.
\dontrun{ # 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") ) }
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.
Volume$list_exports( state = NULL, limit = getOption("sevenbridges2")$limit, offset = getOption("sevenbridges2")$offset, ... )
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 is 100
and the default value is 50
.
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.
Collection
containing list of
Export
job objects.
\dontrun{ # 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")) }
clone()
The objects of this class are cloneable with this method.
Volume$clone(deep = FALSE)
deep
Whether to make a deep clone.
## ------------------------------------------------ ## Method `Volume$print` ## ------------------------------------------------ ## Not run: # 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() ## End(Not run) ## ------------------------------------------------ ## Method `Volume$reload` ## ------------------------------------------------ ## Not run: # 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() ## End(Not run) ## ------------------------------------------------ ## Method `Volume$update` ## ------------------------------------------------ ## Not run: # 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) ## End(Not run) ## ------------------------------------------------ ## Method `Volume$deactivate` ## ------------------------------------------------ ## Not run: # 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() ## End(Not run) ## ------------------------------------------------ ## Method `Volume$reactivate` ## ------------------------------------------------ ## Not run: # 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() ## End(Not run) ## ------------------------------------------------ ## Method `Volume$delete` ## ------------------------------------------------ ## Not run: # 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() ## End(Not run) ## ------------------------------------------------ ## Method `Volume$list_contents` ## ------------------------------------------------ ## Not run: # 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() ## End(Not run) ## ------------------------------------------------ ## Method `Volume$get_file` ## ------------------------------------------------ ## Not run: # 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) ## End(Not run) ## ------------------------------------------------ ## Method `Volume$list_members` ## ------------------------------------------------ ## Not run: # 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() ## End(Not run) ## ------------------------------------------------ ## Method `Volume$add_member` ## ------------------------------------------------ ## Not run: # 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) ) ## End(Not run) ## ------------------------------------------------ ## Method `Volume$remove_member` ## ------------------------------------------------ ## Not run: # 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) ## End(Not run) ## ------------------------------------------------ ## Method `Volume$get_member` ## ------------------------------------------------ ## Not run: # 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) ## End(Not run) ## ------------------------------------------------ ## Method `Volume$modify_member_permissions` ## ------------------------------------------------ ## Not run: # 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) ) ## End(Not run) ## ------------------------------------------------ ## Method `Volume$list_imports` ## ------------------------------------------------ ## Not run: # 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") ) ## End(Not run) ## ------------------------------------------------ ## Method `Volume$list_exports` ## ------------------------------------------------ ## Not run: # 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")) ## End(Not run)
## ------------------------------------------------ ## Method `Volume$print` ## ------------------------------------------------ ## Not run: # 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() ## End(Not run) ## ------------------------------------------------ ## Method `Volume$reload` ## ------------------------------------------------ ## Not run: # 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() ## End(Not run) ## ------------------------------------------------ ## Method `Volume$update` ## ------------------------------------------------ ## Not run: # 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) ## End(Not run) ## ------------------------------------------------ ## Method `Volume$deactivate` ## ------------------------------------------------ ## Not run: # 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() ## End(Not run) ## ------------------------------------------------ ## Method `Volume$reactivate` ## ------------------------------------------------ ## Not run: # 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() ## End(Not run) ## ------------------------------------------------ ## Method `Volume$delete` ## ------------------------------------------------ ## Not run: # 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() ## End(Not run) ## ------------------------------------------------ ## Method `Volume$list_contents` ## ------------------------------------------------ ## Not run: # 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() ## End(Not run) ## ------------------------------------------------ ## Method `Volume$get_file` ## ------------------------------------------------ ## Not run: # 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) ## End(Not run) ## ------------------------------------------------ ## Method `Volume$list_members` ## ------------------------------------------------ ## Not run: # 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() ## End(Not run) ## ------------------------------------------------ ## Method `Volume$add_member` ## ------------------------------------------------ ## Not run: # 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) ) ## End(Not run) ## ------------------------------------------------ ## Method `Volume$remove_member` ## ------------------------------------------------ ## Not run: # 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) ## End(Not run) ## ------------------------------------------------ ## Method `Volume$get_member` ## ------------------------------------------------ ## Not run: # 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) ## End(Not run) ## ------------------------------------------------ ## Method `Volume$modify_member_permissions` ## ------------------------------------------------ ## Not run: # 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) ) ## End(Not run) ## ------------------------------------------------ ## Method `Volume$list_imports` ## ------------------------------------------------ ## Not run: # 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") ) ## End(Not run) ## ------------------------------------------------ ## Method `Volume$list_exports` ## ------------------------------------------------ ## Not run: # 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")) ## End(Not run)
R6 Class representing a resource for managing volume content collections.
sevenbridges2::Collection
-> VolumeContentCollection
prefixes
Prefixes on the volume, returned in API response.
new()
Create new VolumeContentCollection object.
VolumeContentCollection$new(res = NA, ...)
res
Response containing VolumeContentCollection object fields.
...
Other response arguments.
print()
Print method for VolumeContentCollection class.
VolumeContentCollection$print(n = 10)
n
Number of items to print in console.
\dontrun{ # x is API response when volume content collection is requested vol_con_col_object <- VolumeContentCollection$new( res = x, href = x$href, links = x$links, auth = auth, response = attr(x, "response") ) # Print volume content collection object vol_con_col_object$print() }
next_page()
Return next page of results.
VolumeContentCollection$next_page(...)
...
Other arguments or query parameters that can be passed to
core api()
function like 'advance_access', 'fields' etc.
\dontrun{ # x is API response when volume content collection is requested vol_con_col_object <- VolumeContentCollection$new( res = x, href = x$href, links = x$links, auth = auth, response = attr(x, "response") ) # Get next page of results vol_con_col_object$next_page() }
prev_page()
Return previous page of results.
VolumeContentCollection$prev_page()
\dontrun{ # x is API response when volume content collection is requested vol_con_col_object <- VolumeContentCollection$new( res = x, href = x$href, links = x$links, auth = auth, response = attr(x, "response") ) # Get previous page of results vol_con_col_object$prev_page() }
all()
Fetches all available items.
VolumeContentCollection$all(...)
...
Other arguments or query parameters that can be passed to
core api()
function like 'advance_access', 'fields' etc.
\dontrun{ # x is API response when volume content collection is requested vol_con_col_object <- VolumeContentCollection$new( res = x, href = x$href, links = x$links, auth = auth, response = attr(x, "response") ) # Get all results vol_con_col_object$all() }
clone()
The objects of this class are cloneable with this method.
VolumeContentCollection$clone(deep = FALSE)
deep
Whether to make a deep clone.
## ------------------------------------------------ ## Method `VolumeContentCollection$print` ## ------------------------------------------------ ## Not run: # x is API response when volume content collection is requested vol_con_col_object <- VolumeContentCollection$new( res = x, href = x$href, links = x$links, auth = auth, response = attr(x, "response") ) # Print volume content collection object vol_con_col_object$print() ## End(Not run) ## ------------------------------------------------ ## Method `VolumeContentCollection$next_page` ## ------------------------------------------------ ## Not run: # x is API response when volume content collection is requested vol_con_col_object <- VolumeContentCollection$new( res = x, href = x$href, links = x$links, auth = auth, response = attr(x, "response") ) # Get next page of results vol_con_col_object$next_page() ## End(Not run) ## ------------------------------------------------ ## Method `VolumeContentCollection$prev_page` ## ------------------------------------------------ ## Not run: # x is API response when volume content collection is requested vol_con_col_object <- VolumeContentCollection$new( res = x, href = x$href, links = x$links, auth = auth, response = attr(x, "response") ) # Get previous page of results vol_con_col_object$prev_page() ## End(Not run) ## ------------------------------------------------ ## Method `VolumeContentCollection$all` ## ------------------------------------------------ ## Not run: # x is API response when volume content collection is requested vol_con_col_object <- VolumeContentCollection$new( res = x, href = x$href, links = x$links, auth = auth, response = attr(x, "response") ) # Get all results vol_con_col_object$all() ## End(Not run)
## ------------------------------------------------ ## Method `VolumeContentCollection$print` ## ------------------------------------------------ ## Not run: # x is API response when volume content collection is requested vol_con_col_object <- VolumeContentCollection$new( res = x, href = x$href, links = x$links, auth = auth, response = attr(x, "response") ) # Print volume content collection object vol_con_col_object$print() ## End(Not run) ## ------------------------------------------------ ## Method `VolumeContentCollection$next_page` ## ------------------------------------------------ ## Not run: # x is API response when volume content collection is requested vol_con_col_object <- VolumeContentCollection$new( res = x, href = x$href, links = x$links, auth = auth, response = attr(x, "response") ) # Get next page of results vol_con_col_object$next_page() ## End(Not run) ## ------------------------------------------------ ## Method `VolumeContentCollection$prev_page` ## ------------------------------------------------ ## Not run: # x is API response when volume content collection is requested vol_con_col_object <- VolumeContentCollection$new( res = x, href = x$href, links = x$links, auth = auth, response = attr(x, "response") ) # Get previous page of results vol_con_col_object$prev_page() ## End(Not run) ## ------------------------------------------------ ## Method `VolumeContentCollection$all` ## ------------------------------------------------ ## Not run: # x is API response when volume content collection is requested vol_con_col_object <- VolumeContentCollection$new( res = x, href = x$href, links = x$links, auth = auth, response = attr(x, "response") ) # Get all results vol_con_col_object$all() ## End(Not run)
R6 Class representing a resource for managing VolumeFile objects.
sevenbridges2::Item
-> VolumeFile
URL
List of URL endpoints for this resource.
location
File location on the volume.
type
Type of storage (cloud provider). Can be one of:
s3
, gcs
, azure
, OSS
.
volume
Volume id.
metadata
File's metadata if exists.
new()
Create a new VolumeFile object.
VolumeFile$new(res = NA, ...)
res
Response containing VolumeFile object info.
...
Other response arguments.
print()
Print method for VolumeFile class.
VolumeFile$print()
\dontrun{ # x is API response when volume file is requested volume_file_object <- VolumeFile$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Print volume file object volume_file_object$print() }
reload()
Reload VolumeFile object information.
VolumeFile$reload(...)
...
Other arguments that can be passed to core api()
function
like 'fields', etc.
VolumeFile
object.
\dontrun{ # x is API response when volume file is requested volume_file_object <- VolumeFile$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Reload volume file object volume_file_object$reload() }
import()
This call lets you queue a job to import this file or folder
from a volume into a project on the Platform.
Essentially, you are importing an item from your cloud storage provider
(Amazon Web Services, Google Cloud Storage, Azure or Ali Cloud) via the
volume onto the Platform.
If successful, an alias will be created on the Platform. Aliases appear
on the Platform and can be copied, executed, and modified as such.
They refer back to the respective item on the given volume.
VolumeFile$import( destination_project = NULL, destination_parent = NULL, name = NULL, overwrite = FALSE, autorename = FALSE, ... )
destination_project
String destination project id or Project
object. Not required, but either destination_project
or
destination_parent
directory must be provided.
destination_parent
String folder id or File object
(with type = 'FOLDER'
). Not required, but either destination_project
or destination_parent
directory must be provided.
name
The name of the alias to create. This name should be unique
to the project.
If the name is already in use in the project, you should
use the overwrite
query parameter in this call to force any item with
that name to be deleted before the alias is created.
If name is omitted, the alias name will default to the last segment of
the complete location (including the prefix) on the volume.
Segments are considered to be separated with forward slashes /. Allowed characters in file names are all alphanumeric and special characters except forward slash /, while folder names can contain alphanumeric and special characters _, - and ..
overwrite
Set to TRUE
if you want to overwrite the item if
another one with the same name already exists at the destination.
Bear in mind that if used with folders import, the folder's content
(files with the same name) will be overwritten, not the whole folder.
autorename
Set to TRUE
if you want to automatically rename the
item (by prefixing its name with an underscore and number) if another
one with the same name already exists at the destination.
Bear in mind that if used with folders import, the folder content will
be renamed, not the whole folder.
...
Other arguments that can be passed to core api()
function
like 'fields', etc.
Import
object.
\dontrun{ # x is API response when volume file is requested volume_file_object <- VolumeFile$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Import volume file object volume_file_object$import(destination_project = destination_project) }
clone()
The objects of this class are cloneable with this method.
VolumeFile$clone(deep = FALSE)
deep
Whether to make a deep clone.
## ------------------------------------------------ ## Method `VolumeFile$print` ## ------------------------------------------------ ## Not run: # x is API response when volume file is requested volume_file_object <- VolumeFile$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Print volume file object volume_file_object$print() ## End(Not run) ## ------------------------------------------------ ## Method `VolumeFile$reload` ## ------------------------------------------------ ## Not run: # x is API response when volume file is requested volume_file_object <- VolumeFile$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Reload volume file object volume_file_object$reload() ## End(Not run) ## ------------------------------------------------ ## Method `VolumeFile$import` ## ------------------------------------------------ ## Not run: # x is API response when volume file is requested volume_file_object <- VolumeFile$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Import volume file object volume_file_object$import(destination_project = destination_project) ## End(Not run)
## ------------------------------------------------ ## Method `VolumeFile$print` ## ------------------------------------------------ ## Not run: # x is API response when volume file is requested volume_file_object <- VolumeFile$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Print volume file object volume_file_object$print() ## End(Not run) ## ------------------------------------------------ ## Method `VolumeFile$reload` ## ------------------------------------------------ ## Not run: # x is API response when volume file is requested volume_file_object <- VolumeFile$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Reload volume file object volume_file_object$reload() ## End(Not run) ## ------------------------------------------------ ## Method `VolumeFile$import` ## ------------------------------------------------ ## Not run: # x is API response when volume file is requested volume_file_object <- VolumeFile$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Import volume file object volume_file_object$import(destination_project = destination_project) ## End(Not run)
R6 Class representing a resource for managing VolumePrefix objects.
sevenbridges2::Item
-> VolumePrefix
URL
List of URL endpoints for this resource.
prefix
File/prefix name on the volume.
volume
Volume id.
new()
Create a new VolumePrefix object.
VolumePrefix$new(res = NA, ...)
res
Response containing VolumePrefix object info.
...
Other response arguments.
print()
Print method for VolumePrefix class.
VolumePrefix$print()
\dontrun{ # x is API response when volume prefix is requested volume_prefix_object <- VolumePrefix$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Print volume prefix object volume_prefix_object$print() }
reload()
Reload VolumePrefix object information.
VolumePrefix$reload()
\dontrun{ # x is API response when volume prefix is requested volume_prefix_object <- VolumePrefix$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Reload volume prefix object volume_prefix_object$reload() }
list_contents()
List volume folder contents. This call lists the contents of a specific volume folder.
VolumePrefix$list_contents( limit = getOption("sevenbridges2")$limit, continuation_token = NULL, ... )
limit
The maximum number of collection items to return
for a single request. Minimum value is 1
.
The maximum value is 100
and the default value is 50
.
This is a pagination-specific attribute.
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
.
VolumeContentCollection
object containing list of
VolumeFile
and VolumePrefix
objects.
\dontrun{ # x is API response when volume prefix is requested volume_prefix_object <- VolumePrefix$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # List volume prefix object contents volume_prefix_object$list_contents() }
import()
This call lets you queue a job to import this file or folder
from a volume into a project on the Platform.
Essentially, you are importing an item from your cloud storage provider
(Amazon Web Services, Google Cloud Storage, Azure or Ali Cloud) via the
volume onto the Platform.
If successful, an alias will be created on the Platform. Aliases appear
on the Platform and can be copied, executed, and modified as such.
They refer back to the respective item on the given volume.
VolumePrefix$import( destination_project = NULL, destination_parent = NULL, name = NULL, overwrite = FALSE, autorename = FALSE, preserve_folder_structure = NULL, ... )
destination_project
String destination project id or Project
object. Not required, but either destination_project
or
destination_parent
directory must be provided.
destination_parent
String folder id or File object
(with type = 'FOLDER'
). Not required, but either destination_project
or destination_parent
directory must be provided.
name
The name of the alias to create. This name should be unique
to the project.
If the name is already in use in the project, you should
use the overwrite
query parameter in this call to force any item with
that name to be deleted before the alias is created.
If name is omitted, the alias name will default to the last segment of
the complete location (including the prefix) on the volume.
Segments are considered to be separated with forward slashes /. Allowed characters in file names are all alphanumeric and special characters except forward slash /, while folder names can contain alphanumeric and special characters _, - and ..
overwrite
Set to TRUE
if you want to overwrite the item if
another one with the same name already exists at the destination.
Bear in mind that if used with folders import, the folder's content
(files with the same name) will be overwritten, not the whole folder.
autorename
Set to TRUE
if you want to automatically rename the
item (by prefixing its name with an underscore and number) if another
one with the same name already exists at the destination.
Bear in mind that if used with folders import, the folder content will
be renamed, not the whole folder.
preserve_folder_structure
Set to TRUE
if you want to keep the
exact source folder structure. The default value is TRUE
if the item
being imported is a folder. Should not be used if you are importing a
file. Bear in mind that if you use preserve_folder_structure = FALSE
,
that the response will be the parent folder object containing imported
files alongside with other files if they exist.
...
Other arguments that can be passed to core api()
function
like 'fields', etc.
Import
object.
\dontrun{ # x is API response when volume prefix is requested volume_prefix_object <- VolumePrefix$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # List volume prefix object contents volume_prefix_object$import(destination_project = destination_project) }
clone()
The objects of this class are cloneable with this method.
VolumePrefix$clone(deep = FALSE)
deep
Whether to make a deep clone.
## ------------------------------------------------ ## Method `VolumePrefix$print` ## ------------------------------------------------ ## Not run: # x is API response when volume prefix is requested volume_prefix_object <- VolumePrefix$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Print volume prefix object volume_prefix_object$print() ## End(Not run) ## ------------------------------------------------ ## Method `VolumePrefix$reload` ## ------------------------------------------------ ## Not run: # x is API response when volume prefix is requested volume_prefix_object <- VolumePrefix$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Reload volume prefix object volume_prefix_object$reload() ## End(Not run) ## ------------------------------------------------ ## Method `VolumePrefix$list_contents` ## ------------------------------------------------ ## Not run: # x is API response when volume prefix is requested volume_prefix_object <- VolumePrefix$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # List volume prefix object contents volume_prefix_object$list_contents() ## End(Not run) ## ------------------------------------------------ ## Method `VolumePrefix$import` ## ------------------------------------------------ ## Not run: # x is API response when volume prefix is requested volume_prefix_object <- VolumePrefix$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # List volume prefix object contents volume_prefix_object$import(destination_project = destination_project) ## End(Not run)
## ------------------------------------------------ ## Method `VolumePrefix$print` ## ------------------------------------------------ ## Not run: # x is API response when volume prefix is requested volume_prefix_object <- VolumePrefix$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Print volume prefix object volume_prefix_object$print() ## End(Not run) ## ------------------------------------------------ ## Method `VolumePrefix$reload` ## ------------------------------------------------ ## Not run: # x is API response when volume prefix is requested volume_prefix_object <- VolumePrefix$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # Reload volume prefix object volume_prefix_object$reload() ## End(Not run) ## ------------------------------------------------ ## Method `VolumePrefix$list_contents` ## ------------------------------------------------ ## Not run: # x is API response when volume prefix is requested volume_prefix_object <- VolumePrefix$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # List volume prefix object contents volume_prefix_object$list_contents() ## End(Not run) ## ------------------------------------------------ ## Method `VolumePrefix$import` ## ------------------------------------------------ ## Not run: # x is API response when volume prefix is requested volume_prefix_object <- VolumePrefix$new( res = x, href = x$href, auth = auth, response = attr(x, "response") ) # List volume prefix object contents volume_prefix_object$import(destination_project = destination_project) ## End(Not run)
R6 Class representing volumes resource endpoints.
sevenbridges2::Resource
-> Volumes
URL
List of URL endpoints for this resource.
new()
Create a new Volumes object.
Volumes$new(...)
...
Other response arguments.
query()
This call lists all the volumes you've registered.
Volumes$query(...)
...
Other arguments that can be passed to core api()
function
like 'limit', 'offset', 'fields', etc.
Collection
of Volume
objects.
\dontrun{ volumes_object <- Volumes$new(auth = auth) # Query volumes volumes_object$query() }
get()
This call returns details of the specified volume. The volume is referred to by its ID, which you can obtain by making the call to list all the volumes you've registered.
Volumes$get(id)
id
The Volume ID consists of volume owner's name (for enterprise
users) and volume name in form {volume_owner}/{volume_name}
,
or division name (if user belongs to some division) and volume
name in form {division}/{volume_name}
. You can also get the Volume ID
for a volume by making the call to list all volumes you've registered.
Volume
object.
\dontrun{ volumes_object <- Volumes$new(auth = auth) # Get volumes volumes_object$get(id = id) }
delete()
This call deletes a volume you've created to refer to storage on Amazon Web Services or Google Cloud Storage. 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.
Volumes are specified by their IDs, which you can obtain by using
Volumes$query()
to list files or by getting a single file
using Volumes$get()
.
Volumes$delete(volume, ...)
volume
Volume
object or volume ID.
...
Other arguments that can be passed to core api()
function
as 'fields', etc.
\dontrun{ volumes_object <- Volumes$new(auth = auth) # Get volumes volumes_object$delete(volume = volume) }
create_s3_using_iam_user()
Create new volume to connect to your s3 bucket on AWS cloud.
Volumes authorize the Platform to access and query objects on a
specified cloud storage (Amazon Web Services, Google Cloud Storage,
Azure or Ali cloud) on your behalf. This function uses
IAM User credentials to connect to your s3 bucket.
Read more about volume creation in our API documentation.
Volumes$create_s3_using_iam_user( name = NULL, access_mode = "RW", description = NULL, prefix = NULL, bucket = NULL, endpoint = "s3.amazonaws.com", access_key_id = NULL, secret_access_key = NULL, properties = list(sse_algorithm = "AES256"), from_path = NULL )
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.
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"
.
description
An optional description of this volume.
prefix
A service-specific string prefix to append to all objects created in this volume. If the service supports folders, and this prefix includes them, the API will attempt to create any missing folders when it outputs a file.
bucket
The name of the AWS S3 bucket you wish to register
as a volume.
Required if from_path
parameter is not provided.
endpoint
AWS API endpoint to use when accessing this
bucket. Default: s3.amazonaws.com
.
access_key_id
AWS access key ID in form of string of the IAM user
shared with Seven Bridges to access this bucket.
Required if from_path
parameter is not provided.
secret_access_key
AWS secret access key in form of string of the
IAM user shared with Seven Bridges to access this bucket.
Required if from_path
parameter is not provided.
properties
Named list containing the properties of a specific service. These values set the defaults for operations performed with this volume. Individual operations can override these defaults by providing a custom properties object. For AWS S3, there are:
sse_algorithm
- S3 server-side encryption to use when
exporting to this bucket. Supported values:
AES256
(SSE-S3 encryption), aws:kms
, null
(no server-side encryption). Default: AES256
.
sse_aws_kms_key_id
: Applies to type: s3
.
If AWS KMS encryption is used, this should be set to the required
KMS key. If not set and aws:kms
is set as sse_algorithm
,
default KMS key is used.
aws_canned_acl
: S3 canned ACL to apply on the object
on during export. Supported values: any one of
S3 canned ACLs;
null
(do not apply canned ACLs). Default: null
.
from_path
Path to JSON configuration file containing all required information for registering a volume. If provided, it will overwrite all previous parameters set.
Volume
object.
\dontrun{ volumes_object <- Volumes$new(auth = auth) # Create new AWS Volume (IAM User) aws_iam_user_volume <- volumes_object$create_s3_using_iam_user( name = "my_new_aws_user_volume", bucket = "<bucket-name>", description = "AWS IAM User Vol", access_key_id = "<access-key>", secret_access_key = "<secret-access-key>" ) }
create_s3_using_iam_role()
Create new volume to connect to your s3 bucket on AWS cloud.
Volumes authorize the Platform to access and query objects on a
specified cloud storage (Amazon Web Services, Google Cloud Storage,
Azure or Ali cloud) on your behalf. This function uses
IAM Role credentials to connect to your s3 bucket.
In order to use these credentials, user must have specific user tag
enabled by Support team.
Read more about volume creation in our API documentation.
Volumes$create_s3_using_iam_role( name = NULL, access_mode = "RW", description = NULL, prefix = NULL, bucket = NULL, endpoint = "s3.amazonaws.com", role_arn = NULL, external_id = NULL, properties = list(sse_algorithm = "AES256"), from_path = NULL )
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.
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"
.
description
An optional description of this volume.
prefix
A service-specific string prefix to append to all objects created in this volume. If the service supports folders, and this prefix includes them, the API will attempt to create any missing folders when it outputs a file.
bucket
The name of the AWS S3 bucket you wish to register
as a volume.
Required if from_path
parameter is not provided.
endpoint
AWS API endpoint to use when accessing this
bucket. Default: s3.amazonaws.com
.
role_arn
The ARN (Amazon Resource Name) of your role that
is used to connect your S3 bucket.
Required if from_path
parameter is not provided.
external_id
Optional information that you can use in an
IAM role trust policy to designate who can assume the role.
Must be provided if it is configured in your role trust policy on AWS.
Required if from_path
parameter is not provided.
properties
Named list containing the properties of a specific service. These values set the defaults for operations performed with this volume. Individual operations can override these defaults by providing a custom properties object. For AWS S3, there are:
sse_algorithm
- S3 server-side encryption to use when
exporting to this bucket. Supported values:
AES256
(SSE-S3 encryption), aws:kms
, null
(no server-side encryption). Default: AES256
.
sse_aws_kms_key_id
: Applies to type: s3
.
If AWS KMS encryption is used, this should be set to the required
KMS key. If not set and aws:kms
is set as sse_algorithm
,
default KMS key is used.
aws_canned_acl
: S3 canned ACL to apply on the object
on during export. Supported values: any one of
S3 canned ACLs;
null
(do not apply canned ACLs). Default: null
.
from_path
Path to JSON configuration file containing all required information for registering a volume. If provided, it will overwrite all previous parameters set.
Volume
object.
\dontrun{ volumes_object <- Volumes$new(auth = auth) # Create new AWS Volume (IAM Role) aws_iam_role_volume <- volumes_object$create_s3_using_iam_role( name = "my_new_aws_user_volume", bucket = "<bucket-name>", description = "AWS IAM Role Vol", role_arn = "<role-arn-key>", external_id = "<external-id>" ) }
create_google_using_iam_user()
Create new volume to connect to your bucket on GCS.
Volumes authorize the Platform to access and query objects on a
specified cloud storage (Amazon Web Services, Google Cloud Storage,
Azure or Ali cloud) on your behalf. This function uses
IAM User credentials to connect with your GCS bucket.
Read more about volume creations in our
API documentation.
Volumes$create_google_using_iam_user( name = NULL, access_mode = "RW", description = NULL, prefix = NULL, bucket = NULL, root_url = "https://www.googleapis.com", client_email = NULL, private_key = NULL, properties = NULL, from_path = NULL )
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.
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"
.
description
An optional description of this volume.
prefix
A service-specific string prefix to append to all objects created in this volume. If the service supports folders, and this prefix includes them, the API will attempt to create any missing folders when it outputs a file.
bucket
The name of the GCS bucket you wish to register
as a volume. Required if from_path
parameter is not provided.
root_url
Google Cloud Storage API endpoint for accessing
this bucket.
Default: https://www.googleapis.com
.
client_email
The client email address for the Google Cloud
service account to use for operations on this bucket. This can be found
in the JSON containing your service account credentials.
Required if from_path
parameter is not provided.
private_key
Google Cloud Platform private key.
Required if from_path
parameter is not provided.
properties
Named list containing the properties of a specific service. These values set the defaults for operations performed with this volume. Individual operations can override these defaults by providing a custom properties object.
from_path
Path to JSON configuration file containing all required information for registering a volume. If provided, it will overwrite all previous parameters set.
Volume
object.
\dontrun{ volumes_object <- Volumes$new(auth = auth) # Create Google cloud volume using IAM User authentication type gc_iam_user_volume <- volumes_object$create_google_using_iam_user( name = "my_new_gc_user_volume", access_mode = "RW", bucket = "<bucket-name>", description = "GC IAM User volume", client_email = "<client_email>", private_key = "<private_key-string>" ) }
create_google_using_iam_role()
Create new volume to connect to your bucket on GCS.
Volumes authorize the Platform to access and query objects on a
specified cloud storage (Amazon Web Services, Google Cloud Storage,
Azure or Ali cloud) on your behalf. This function uses
IAM Role credentials to connect to your GCS bucket.
In order to use these credentials, user must have specific user tag
enabled by Support team.
Read more about volume creations in our
API documentation.
Volumes$create_google_using_iam_role( name = NULL, access_mode = "RW", description = NULL, prefix = NULL, bucket = NULL, root_url = "https://www.googleapis.com", configuration = NULL, properties = NULL, from_path = NULL )
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.
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"
.
description
An optional description of this volume.
prefix
A service-specific string prefix to append to all objects created in this volume. If the service supports folders, and this prefix includes them, the API will attempt to create any missing folders when it outputs a file.
bucket
The name of the GCS bucket you wish to register
as a volume. Required if from_path
parameter is not provided.
root_url
Google Cloud Storage API endpoint for accessing
this bucket.
Default: https://www.googleapis.com
.
configuration
Connection configuration parameters in JSON format downloaded from the Google Cloud Console once prerequisites have been set up. Could be provided as a named list, or as path to the downloaded JSON file.
properties
Named list containing the properties of a specific service. These values set the defaults for operations performed with this volume. Individual operations can override these defaults by providing a custom properties object.
from_path
Path to JSON configuration file containing all required information for registering a volume. If provided, it will overwrite all previous parameters set.
Volume
object.
\dontrun{ volumes_object <- Volumes$new(auth = auth) # Create Google cloud volume using IAM User authentication type gc_iam_role_volume <- volumes_object$create_google_using_iam_role( name = "my_new_gc_role_volume", access_mode = "RO", bucket = "<bucket-name>", description = "GC IAM Role volume", configuration = list( type = "<type-name>", audience = "<audience-link>", subject_token_type = "<subject_token_type>", service_account_impersonation_url = "<service_account_impersonation_url>", token_url = "<token_url>", credential_source = list( environment_id = "<environment_id>", region_url = "<region_url>", url = "<url>", regional_cred_verification_url = "<regional_cred_verification_url>" ) ) ) }
create_azure()
This call creates a new volume by attaching a Microsoft Azure storage container to the Platform.
Volumes$create_azure( name = NULL, description = NULL, endpoint = NULL, storage_account = NULL, container = NULL, prefix = NULL, tenant_id = NULL, client_id = NULL, client_secret = NULL, resource_id = NULL, from_path = NULL )
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
An optional description of this volume.
endpoint
Specify a Microsoft Azure endpoint, only if you
are using an endpoint that is different from the default one
https://(serviceaccount).blob.core.windows.net
. To make a non-default
endpoint work with the Platform, please first make sure it is supported
by Seven Bridges.
storage_account
The name of the storage account that holds the container you want to attach as a volume.
container
The name of the container that you want to attach as a Volume.
prefix
A service-specific string prefix to append to all objects created in this volume. If the service supports folders, and this prefix includes them, the API will attempt to create any missing folders when it outputs a file.
tenant_id
Directory (tenant) ID of the application you created on the Azure Portal for the purpose of attaching your storage container.
client_id
Application (client) ID of the application you created on the Azure Portal for the purpose of attaching your storage container.
client_secret
Value of the client secret you created on the Azure Portal for the purpose of attaching your storage container.
resource_id
Resource ID of the Azure storage account. To get it, go to the Azure Portal, open the storage account's Overview page and click JSON View.
from_path
JSON configuration file containing all required information for registering a volume.
Volume
object.
\dontrun{ volumes_object <- Volumes$new(auth = auth) # Create Azure volume azure_volume <- volumes_object$create_azure( name = "my_new_azure_volume", description = "Azure volume", endpoint = "<endpoint>", container = "<bucket-name", storage_account = "<storage_account-name>", tenant_id = "<tenant_id>", client_id = "<client_id>", client_secret = "<client_secret>", resource_id = "<resource_id>" ) }
create_ali_oss()
Create new volume to connect to your bucket on ALI (OSS) platform.
Volumes$create_ali_oss( name = NULL, description = NULL, endpoint = NULL, bucket = NULL, prefix = NULL, access_key_id = NULL, secret_access_key = NULL, properties = NULL, from_path = NULL )
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
An optional description of this volume.
endpoint
Specify an Ali Cloud endpoint.
bucket
The name of the ALI(OSS) bucket you wish to register
as a volume. Required if from_path
parameter is not provided.
prefix
A service-specific string prefix to append to all objects created in this volume. If the service supports folders, and this prefix includes them, the API will attempt to create any missing folders when it outputs a file.
access_key_id
ALI(OSS) access key ID of the user shared
with Seven Bridges to access this bucket.
Required if from_path
parameter is not provided.
secret_access_key
ALI(OSS) secret access key of the user
shared with Seven Bridges to access this bucket.
Required if from_path
parameter is not provided.
properties
Named list containing the properties of a specific service. These values set the defaults for operations performed with this volume. Individual operations can override these defaults by providing a custom properties object.
from_path
JSON configuration file containing all required information for registering a volume.
Volume
object.
\dontrun{ volumes_object <- Volumes$new(auth = auth) # Create Ali cloud volume ali_volume <- volumes_object$create_ali_oss( name = "my_new_azure_volume", description = "Ali volume", endpoint = "<endpoint>", bucket = "<bucket-name", access_key_id = "<access_key_id>", secret_access_key = "<secret_access_key>" ) }
clone()
The objects of this class are cloneable with this method.
Volumes$clone(deep = FALSE)
deep
Whether to make a deep clone.
## ------------------------------------------------ ## Method `Volumes$query` ## ------------------------------------------------ ## Not run: volumes_object <- Volumes$new(auth = auth) # Query volumes volumes_object$query() ## End(Not run) ## ------------------------------------------------ ## Method `Volumes$get` ## ------------------------------------------------ ## Not run: volumes_object <- Volumes$new(auth = auth) # Get volumes volumes_object$get(id = id) ## End(Not run) ## ------------------------------------------------ ## Method `Volumes$delete` ## ------------------------------------------------ ## Not run: volumes_object <- Volumes$new(auth = auth) # Get volumes volumes_object$delete(volume = volume) ## End(Not run) ## ------------------------------------------------ ## Method `Volumes$create_s3_using_iam_user` ## ------------------------------------------------ ## Not run: volumes_object <- Volumes$new(auth = auth) # Create new AWS Volume (IAM User) aws_iam_user_volume <- volumes_object$create_s3_using_iam_user( name = "my_new_aws_user_volume", bucket = "<bucket-name>", description = "AWS IAM User Vol", access_key_id = "<access-key>", secret_access_key = "<secret-access-key>" ) ## End(Not run) ## ------------------------------------------------ ## Method `Volumes$create_s3_using_iam_role` ## ------------------------------------------------ ## Not run: volumes_object <- Volumes$new(auth = auth) # Create new AWS Volume (IAM Role) aws_iam_role_volume <- volumes_object$create_s3_using_iam_role( name = "my_new_aws_user_volume", bucket = "<bucket-name>", description = "AWS IAM Role Vol", role_arn = "<role-arn-key>", external_id = "<external-id>" ) ## End(Not run) ## ------------------------------------------------ ## Method `Volumes$create_google_using_iam_user` ## ------------------------------------------------ ## Not run: volumes_object <- Volumes$new(auth = auth) # Create Google cloud volume using IAM User authentication type gc_iam_user_volume <- volumes_object$create_google_using_iam_user( name = "my_new_gc_user_volume", access_mode = "RW", bucket = "<bucket-name>", description = "GC IAM User volume", client_email = "<client_email>", private_key = "<private_key-string>" ) ## End(Not run) ## ------------------------------------------------ ## Method `Volumes$create_google_using_iam_role` ## ------------------------------------------------ ## Not run: volumes_object <- Volumes$new(auth = auth) # Create Google cloud volume using IAM User authentication type gc_iam_role_volume <- volumes_object$create_google_using_iam_role( name = "my_new_gc_role_volume", access_mode = "RO", bucket = "<bucket-name>", description = "GC IAM Role volume", configuration = list( type = "<type-name>", audience = "<audience-link>", subject_token_type = "<subject_token_type>", service_account_impersonation_url = "<service_account_impersonation_url>", token_url = "<token_url>", credential_source = list( environment_id = "<environment_id>", region_url = "<region_url>", url = "<url>", regional_cred_verification_url = "<regional_cred_verification_url>" ) ) ) ## End(Not run) ## ------------------------------------------------ ## Method `Volumes$create_azure` ## ------------------------------------------------ ## Not run: volumes_object <- Volumes$new(auth = auth) # Create Azure volume azure_volume <- volumes_object$create_azure( name = "my_new_azure_volume", description = "Azure volume", endpoint = "<endpoint>", container = "<bucket-name", storage_account = "<storage_account-name>", tenant_id = "<tenant_id>", client_id = "<client_id>", client_secret = "<client_secret>", resource_id = "<resource_id>" ) ## End(Not run) ## ------------------------------------------------ ## Method `Volumes$create_ali_oss` ## ------------------------------------------------ ## Not run: volumes_object <- Volumes$new(auth = auth) # Create Ali cloud volume ali_volume <- volumes_object$create_ali_oss( name = "my_new_azure_volume", description = "Ali volume", endpoint = "<endpoint>", bucket = "<bucket-name", access_key_id = "<access_key_id>", secret_access_key = "<secret_access_key>" ) ## End(Not run)
## ------------------------------------------------ ## Method `Volumes$query` ## ------------------------------------------------ ## Not run: volumes_object <- Volumes$new(auth = auth) # Query volumes volumes_object$query() ## End(Not run) ## ------------------------------------------------ ## Method `Volumes$get` ## ------------------------------------------------ ## Not run: volumes_object <- Volumes$new(auth = auth) # Get volumes volumes_object$get(id = id) ## End(Not run) ## ------------------------------------------------ ## Method `Volumes$delete` ## ------------------------------------------------ ## Not run: volumes_object <- Volumes$new(auth = auth) # Get volumes volumes_object$delete(volume = volume) ## End(Not run) ## ------------------------------------------------ ## Method `Volumes$create_s3_using_iam_user` ## ------------------------------------------------ ## Not run: volumes_object <- Volumes$new(auth = auth) # Create new AWS Volume (IAM User) aws_iam_user_volume <- volumes_object$create_s3_using_iam_user( name = "my_new_aws_user_volume", bucket = "<bucket-name>", description = "AWS IAM User Vol", access_key_id = "<access-key>", secret_access_key = "<secret-access-key>" ) ## End(Not run) ## ------------------------------------------------ ## Method `Volumes$create_s3_using_iam_role` ## ------------------------------------------------ ## Not run: volumes_object <- Volumes$new(auth = auth) # Create new AWS Volume (IAM Role) aws_iam_role_volume <- volumes_object$create_s3_using_iam_role( name = "my_new_aws_user_volume", bucket = "<bucket-name>", description = "AWS IAM Role Vol", role_arn = "<role-arn-key>", external_id = "<external-id>" ) ## End(Not run) ## ------------------------------------------------ ## Method `Volumes$create_google_using_iam_user` ## ------------------------------------------------ ## Not run: volumes_object <- Volumes$new(auth = auth) # Create Google cloud volume using IAM User authentication type gc_iam_user_volume <- volumes_object$create_google_using_iam_user( name = "my_new_gc_user_volume", access_mode = "RW", bucket = "<bucket-name>", description = "GC IAM User volume", client_email = "<client_email>", private_key = "<private_key-string>" ) ## End(Not run) ## ------------------------------------------------ ## Method `Volumes$create_google_using_iam_role` ## ------------------------------------------------ ## Not run: volumes_object <- Volumes$new(auth = auth) # Create Google cloud volume using IAM User authentication type gc_iam_role_volume <- volumes_object$create_google_using_iam_role( name = "my_new_gc_role_volume", access_mode = "RO", bucket = "<bucket-name>", description = "GC IAM Role volume", configuration = list( type = "<type-name>", audience = "<audience-link>", subject_token_type = "<subject_token_type>", service_account_impersonation_url = "<service_account_impersonation_url>", token_url = "<token_url>", credential_source = list( environment_id = "<environment_id>", region_url = "<region_url>", url = "<url>", regional_cred_verification_url = "<regional_cred_verification_url>" ) ) ) ## End(Not run) ## ------------------------------------------------ ## Method `Volumes$create_azure` ## ------------------------------------------------ ## Not run: volumes_object <- Volumes$new(auth = auth) # Create Azure volume azure_volume <- volumes_object$create_azure( name = "my_new_azure_volume", description = "Azure volume", endpoint = "<endpoint>", container = "<bucket-name", storage_account = "<storage_account-name>", tenant_id = "<tenant_id>", client_id = "<client_id>", client_secret = "<client_secret>", resource_id = "<resource_id>" ) ## End(Not run) ## ------------------------------------------------ ## Method `Volumes$create_ali_oss` ## ------------------------------------------------ ## Not run: volumes_object <- Volumes$new(auth = auth) # Create Ali cloud volume ali_volume <- volumes_object$create_ali_oss( name = "my_new_azure_volume", description = "Ali volume", endpoint = "<endpoint>", bucket = "<bucket-name", access_key_id = "<access_key_id>", secret_access_key = "<secret_access_key>" ) ## End(Not run)