Skip to contents

R6 Class representing Projects resource.

Super class

sevenbridges2::Resource -> Projects

Public fields

URL

List of URL endpoints for this resource.

Methods


Method new()

Create new Projects resource object.

Usage

Projects$new(...)

Arguments

...

Other response arguments.


Method 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.

Usage

Projects$query(
  name = NULL,
  owner = NULL,
  tags = NULL,
  limit = getOption("sevenbridges2")$limit,
  offset = getOption("sevenbridges2")$offset,
  ...
)

Arguments

name

Project's name.

owner

The username of the owner whose projects you want to query.

tags

The list of project 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.

Returns

Collection of Project objects.

Examples

\dontrun{
 projects_object <- Projects$new(auth = auth)

 # Query projects
 projects_object$query(name = name)
}


Method get()

This call creates Project object containing the details of a specified project.

Usage

Projects$get(id, ...)

Arguments

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.

Returns

Project object.

Examples

\dontrun{
 projects_object <- Projects$new(auth = auth)

 # Get project by id
 projects_object$get(id = id)
}


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.
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.

Usage

Projects$delete(project, ...)

Arguments

project

Project object or project ID.

...

Other arguments that can be passed to core api() function as 'fields', etc.

Examples

\dontrun{
 projects_object <- Projects$new(auth = auth)

 # Delete a project
 projects_object$delete(project = project)
}


Method create()

A method for creating a new project.

Usage

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),
  ...
)

Arguments

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.

Returns

Project object.

Examples

\dontrun{
 projects_object <- Projects$new(auth = auth)

 # Create a project
 projects_object$create(
                    name = name,
                    billing_group = billing_group,
                    description = description
                  )
}


Method clone()

The objects of this class are cloneable with this method.

Usage

Projects$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples


## ------------------------------------------------
## Method `Projects$query`
## ------------------------------------------------

if (FALSE) {
 projects_object <- Projects$new(auth = auth)

 # Query projects
 projects_object$query(name = name)
}


## ------------------------------------------------
## Method `Projects$get`
## ------------------------------------------------

if (FALSE) {
 projects_object <- Projects$new(auth = auth)

 # Get project by id
 projects_object$get(id = id)
}


## ------------------------------------------------
## Method `Projects$delete`
## ------------------------------------------------

if (FALSE) {
 projects_object <- Projects$new(auth = auth)

 # Delete a project
 projects_object$delete(project = project)
}


## ------------------------------------------------
## Method `Projects$create`
## ------------------------------------------------

if (FALSE) {
 projects_object <- Projects$new(auth = auth)

 # Create a project
 projects_object$create(
                    name = name,
                    billing_group = billing_group,
                    description = description
                  )
}