R6 Class representing a central resource for managing projects.
Super class
sevenbridges2::Item -> Project
Public fields
URLList of URL endpoints for this resource.
idProject 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>.nameProject's name.
billing_groupThe ID of the billing group for the project.
descriptionProject's description.
typeProject's type. All projects have type v2.
tagsThe list of project tags.
settingsA 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 toFALSEby default. If set toTRUEmemoization is enabled.use_elastic_disk- If set toTRUEElastic 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 is120and the default value is24.
root_folderID of the project's root folder.
created_byUsername of the person who created the project.
created_onDate and time of project creation.
modified_onDate and time describing when the project was last modified.
permissionsAn object containing the information about user's permissions within the project.
categoryProject'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
nameNew name of the project you are updating.
descriptionNew description of the project you are updating.
billing_groupBilling object or ID of a particular billing group you want to set to the project.
settingsContains detailed project settings as explained in previous methods. Check our API documentation.
tagsThe 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 a project from the
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
limitThe maximum number of collection items to return for a single request. Minimum value is
1. The maximum value is100and the default value is50. This is a pagination-specific attribute.offsetThe 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
userThe Seven Bridges Platform username of the person you want to add to the project or object of class Member containing user's username.
emailThe 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.
permissionsList of permissions that will be associated with the project's member. It can contain fields:
read,copy,write,executeandadminwith logical fields -TRUEif certain permission is allowed to the user, orFALSEif 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 toFALSEby default. The exception to this rule is thereadpermission, 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
userThe 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
userThe 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.
permissionsList of permissions that will be associated with the project's member. It can contain fields:
read,copy,write,executeandadminwith logical fields -TRUEif certain permission is allowed to the user, orFALSEif 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 toFALSEby default. The exception to this rule is thereadpermission, 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
limitThe maximum number of collection items to return for a single request. Minimum value is
1. The maximum value is100and the default value is50. This is a pagination-specific attribute.offsetThe 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 the project.
Arguments
query_termsA 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.idUse this parameter to query Project's apps based on their ID.
limitThe maximum number of collection items to return for a single request. Minimum value is
1. The maximum value is100and the default value is50. This is a pagination-specific attribute.offsetThe 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
rawThe body of the request should be a CWL app description saved as a
JSONorYAMLfile. 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_pathparameter.from_pathFile containing CWL app description. Shouldn't be used together with raw parameter.
nameA short name for the app (without any non-alphanumeric characters or spaces).
raw_formatThe type of format used (
JSONorYAML).
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
statusYou 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.
parentProvide 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_fromEnter the starting date string for querying tasks created on the specified date and onwards.
created_toEnter the ending date string for querying tasks created until the specified date. You can use it in combination with
created_fromto specify a time interval.started_fromEnter the starting date string for querying tasks started on the specified date and onwards.
started_toEnter the ending date string for querying tasks started until the specified date.
ended_fromEnter the starting date string for querying tasks that ended on a specified date.
ended_toEnter the ending date string for querying tasks that ended until a specified date.
order_byOrder returned results by the specified field. Allowed values:
created_time,start_time,name,end_timeandcreated_by.
Sort can be done only by one column. The default value iscreated_time.orderSort results in ascending or descending order by specifying
ascordesc, respectively. Only taken into account iforder_byis explicitly specified. The default value isasc.origin_idEnter an automation run ID to list all tasks created from the specified automation run.
limitThe maximum number of collection items to return for a single request. Minimum value is
1. The maximum value is100and the default value is50. This is a pagination-specific attribute.offsetThe 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 a particular user into this destination project.
Arguments
volumeVolume id or Volume object. List all imports from particular volume. Optional.
stateThe 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")limitThe maximum number of collection items to return for a single request. Minimum value is
1. The maximum value is100and the default value is50. This is a pagination-specific attribute.offsetThe 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. See 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
appThe 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>.revisionThe app revision (version) number.
nameThe name of the task.
descriptionAn optional description of the task.
execution_settingsNamed 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 toFALSEby default. Set toTRUEto enable memoization;use_elastic_disk: Set toTRUEto 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 )inputsList 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_locationThe 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 toTRUEto 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://).
batchThis is set to
FALSEby default. Set toTRUEto create a batch task and specify thebatch_inputandbatch-bycriteria as described below.batch_inputThe 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_byBatching criteria in form of list. For example:
use_interruptible_instancesThis field can be
TRUEorFALSE. Set this field toTRUEto allow the use of spot instances.actionIf 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) { # \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()
} # }
## ------------------------------------------------
## Method `Project$detailed_print`
## ------------------------------------------------
if (FALSE) { # \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()
} # }
## ------------------------------------------------
## Method `Project$reload`
## ------------------------------------------------
if (FALSE) { # \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()
} # }
## ------------------------------------------------
## Method `Project$update`
## ------------------------------------------------
if (FALSE) { # \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)
} # }
## ------------------------------------------------
## Method `Project$delete`
## ------------------------------------------------
if (FALSE) { # \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()
} # }
## ------------------------------------------------
## Method `Project$list_members`
## ------------------------------------------------
if (FALSE) { # \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()
} # }
## ------------------------------------------------
## Method `Project$add_member`
## ------------------------------------------------
if (FALSE) { # \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 `Project$remove_member`
## ------------------------------------------------
if (FALSE) { # \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)
} # }
## ------------------------------------------------
## Method `Project$get_member`
## ------------------------------------------------
if (FALSE) { # \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)
} # }
## ------------------------------------------------
## Method `Project$modify_member_permissions`
## ------------------------------------------------
if (FALSE) { # \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 `Project$list_files`
## ------------------------------------------------
if (FALSE) { # \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()
} # }
## ------------------------------------------------
## Method `Project$create_folder`
## ------------------------------------------------
if (FALSE) { # \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")
} # }
## ------------------------------------------------
## Method `Project$get_root_folder`
## ------------------------------------------------
if (FALSE) { # \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()
} # }
## ------------------------------------------------
## Method `Project$list_apps`
## ------------------------------------------------
if (FALSE) { # \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)
} # }
## ------------------------------------------------
## Method `Project$create_app`
## ------------------------------------------------
if (FALSE) { # \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)
} # }
## ------------------------------------------------
## Method `Project$list_tasks`
## ------------------------------------------------
if (FALSE) { # \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()
} # }
## ------------------------------------------------
## Method `Project$list_imports`
## ------------------------------------------------
if (FALSE) { # \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()
} # }
## ------------------------------------------------
## Method `Project$create_task`
## ------------------------------------------------
if (FALSE) { # \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)
} # }