| Projects {sevenbridges2} | R Documentation |
R6 Class representing a projects endpoints.
Description
R6 Class representing Projects resource.
Super class
sevenbridges2::Resource -> Projects
Public fields
URLList of URL endpoints for this resource.
Methods
Public 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
nameProject's name.
ownerThe username of the owner whose projects you want to query.
tagsThe list of project tags.
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 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
idProject 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
projectProjectobject 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
nameThe name of the project you are creating.
billing_groupThe Billing object or ID of the billing group for the project.
descriptionDescription of the project.
tagsThe list of project tags.
lockedSet this field to
TRUEto lock down a project. Locking down a project prevents any Seven Bridges team member from viewing any information about the task.controlledSet this field to
TRUEto define this project as controlled i.e. one which will contain controlled data. SetFALSEto define the project as open i.e. one which will contain open data.locationSpecify the location for this project:
aws:us-east-1oraws:us-west-2.use_interruptible_instancesDefines the use of spot instances.
use_memoizationSet to
FALSEby default. Set toTRUEto enable memoization.use_elastic_diskSet to
TRUEto enable Elastic disk.intermediate_filesA 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 alwaysLIMITED. -
duration- Specifies intermediate files retention period in hours. The minimum value is1. The maximum value is120and the default value is24.
-
...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
deepWhether to make a deep clone.
Examples
## ------------------------------------------------
## 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)