R6 Class representing a central resource for managing projects.
Super class
sevenbridges2::Item
-> Project
Public fields
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 setTRUE
, 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 toFALSE
by default. If set toTRUE
memoization is enabled.use_elastic_disk
- If set toTRUE
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 alwaysLIMITED
.duration
- Specifies intermediate files retention period in hours. The minimum value is1
. The maximum value is120
and the default value is24
.
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
.
Methods
Method print()
Basic print method for Project class.
Method detailed_print()
Detailed print method for Project class.
Method reload()
Reload Project object information.
Arguments
...
Other arguments that can be passed to core
api()
function like 'fields', etc.
Method 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
.
Usage
Project$update(
name = NULL,
description = NULL,
billing_group = NULL,
settings = NULL,
tags = NULL,
...
)
Arguments
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.
Method 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.
Method list_members()
Method for listing all the project members.
Arguments
limit
The maximum number of collection items to return for a single request. Minimum value is
1
. The maximum value is100
and the default value is50
. This is a pagination-specific attribute.offset
The zero-based starting index in the entire collection of the first item to return. The default value is
0
. This is a pagination-specific attribute....
Other arguments that can be passed to core
api()
function like 'fields', etc.
Returns
Collection
of Member
objects.
Method 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.
Usage
Project$add_member(
user = NULL,
email = NULL,
permissions = list(read = TRUE, copy = FALSE, write = FALSE, execute = FALSE, admin =
FALSE)
)
Arguments
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
andadmin
with logical fields -TRUE
if certain permission is allowed to the user, orFALSE
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 toFALSE
by default. The exception to this rule is theread
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 )
Returns
Member
object.
Examples
\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)
)
}
Method 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.
Method get_member()
This method returns the information about the member of the specified project.
Arguments
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.
Returns
Member
object.
Method 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.
Usage
Project$modify_member_permissions(
user = NULL,
permissions = list(read = TRUE, copy = FALSE, write = FALSE, execute = FALSE, admin =
FALSE)
)
Arguments
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
andadmin
with logical fields -TRUE
if certain permission is allowed to the user, orFALSE
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 toFALSE
by default. The exception to this rule is theread
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)
Returns
Permission
object.
Examples
\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)
)
}
Method list_files()
List all project's files and folders.
Arguments
limit
The maximum number of collection items to return for a single request. Minimum value is
1
. The maximum value is100
and the default value is50
. This is a pagination-specific attribute.offset
The zero-based starting index in the entire collection of the first item to return. The default value is
0
. This is a pagination-specific attribute....
Other arguments that can be passed to core
api()
function like 'fields', etc.
Returns
Collection
of File
objects.
Method 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.
Returns
File
object of type 'FOLDER'.
Method list_apps()
This call lists all apps in project.
Arguments
query_terms
Enter one or more search terms to query Project's apps.
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 is100
and the default value is50
. This is a pagination-specific attribute.offset
The zero-based starting index in the entire collection of the first item to return. The default value is
0
. This is a pagination-specific attribute....
Other arguments that can be passed to core
api()
function like other query parameters or 'fields', etc.
Returns
Collection
of App
objects.
Method create_app()
This call creates app in project.
Usage
Project$create_app(
raw = NULL,
from_path = NULL,
name,
raw_format = c("JSON", "YAML")
)
Arguments
raw
The body of the request should be a CWL app description saved as a
JSON
orYAML
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 withfrom_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
orYAML
).
Returns
App
object.
Method list_tasks()
This call lists all tasks from project you can access.
Read more about how to use query parameters properly
here.
Usage
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,
...
)
Arguments
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
andcreated_by
.
Sort can be done only by one column. The default value iscreated_time
.order
Sort results in ascending or descending order by specifying
asc
ordesc
, respectively. Only taken into account iforder_by
is explicitly specified. The default value isasc
.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 is100
and the default value is50
. This is a pagination-specific attribute.offset
The zero-based starting index in the entire collection of the first item to return. The default value is
0
. This is a pagination-specific attribute....
Other arguments that can be passed to core
api()
function like 'fields', etc.
Returns
Collection
of Task
objects.
Method list_imports()
This call lists imports initiated by particular user into this destination project.
Arguments
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 is100
and the default value is50
. This is a pagination-specific attribute.offset
The zero-based starting index in the entire collection of the first item to return. The default value is
0
. This is a pagination-specific attribute....
Other arguments that can be passed to core
api()
function like 'fields', etc.
Returns
Collection
of Import
objects.
Method 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.
Usage
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,
...
)
Arguments
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 toFALSE
by default. Set toTRUE
to enable memoization;use_elastic_disk
: Set toTRUE
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 asvolumes://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 toTRUE
to be able to define individual locations per output node. Default:FALSE
. Even if nodes_override is set toTRUE
, 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 asvolumes://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 toTRUE
to create a batch task and specify thebatch_input
andbatch-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:
use_interruptible_instances
This field can be
TRUE
orFALSE
. Set this field toTRUE
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.
Returns
Task
object.
Examples
## ------------------------------------------------
## Method `Project$print`
## ------------------------------------------------
if (FALSE) {
# 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()
}
## ------------------------------------------------
## Method `Project$detailed_print`
## ------------------------------------------------
if (FALSE) {
# 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()
}
## ------------------------------------------------
## Method `Project$reload`
## ------------------------------------------------
if (FALSE) {
# 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()
}
## ------------------------------------------------
## Method `Project$update`
## ------------------------------------------------
if (FALSE) {
# 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)
}
## ------------------------------------------------
## Method `Project$delete`
## ------------------------------------------------
if (FALSE) {
# 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()
}
## ------------------------------------------------
## Method `Project$list_members`
## ------------------------------------------------
if (FALSE) {
# 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()
}
## ------------------------------------------------
## Method `Project$add_member`
## ------------------------------------------------
if (FALSE) {
# 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)
)
}
## ------------------------------------------------
## Method `Project$remove_member`
## ------------------------------------------------
if (FALSE) {
# 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)
}
## ------------------------------------------------
## Method `Project$get_member`
## ------------------------------------------------
if (FALSE) {
# 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)
}
## ------------------------------------------------
## Method `Project$modify_member_permissions`
## ------------------------------------------------
if (FALSE) {
# 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)
)
}
## ------------------------------------------------
## Method `Project$list_files`
## ------------------------------------------------
if (FALSE) {
# 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()
}
## ------------------------------------------------
## Method `Project$create_folder`
## ------------------------------------------------
if (FALSE) {
# 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")
}
## ------------------------------------------------
## Method `Project$get_root_folder`
## ------------------------------------------------
if (FALSE) {
# 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()
}
## ------------------------------------------------
## Method `Project$list_apps`
## ------------------------------------------------
if (FALSE) {
# 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)
}
## ------------------------------------------------
## Method `Project$create_app`
## ------------------------------------------------
if (FALSE) {
# 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)
}
## ------------------------------------------------
## Method `Project$list_tasks`
## ------------------------------------------------
if (FALSE) {
# 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()
}
## ------------------------------------------------
## Method `Project$list_imports`
## ------------------------------------------------
if (FALSE) {
# 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()
}
## ------------------------------------------------
## Method `Project$create_task`
## ------------------------------------------------
if (FALSE) {
# 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)
}