Edit a project

This call edits a project on the Seven Bridges Platform. 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.

Request

https://api.sbgenomics.com/v2/projects/{project_owner}/{project}
https://eu-api.sbgenomics.com/v2/projects/{project_owner}/{project}

🚧

PATCH

If your client does not support PATCH requests, you can use POST to send this request, along with the query parameter _method=PATCH:

i.e. https://api.sbgenomics.com/v2/projects/{project_owner}/{project}?_method=PATCH

👍

Referring to your project

Note that project_owner is always case-sensitive, and that project is not the project's name but its ID, or short name. For full details of identifying objects using the API, please see the API overview.

Example request

PATCH /v2/projects/rfranklin/my-project HTTP/1.1
Host: api.sbgenomics.com
X-SBG-Auth-Token: 3259c50e1ac5426ea8f1273259740f74
curl  --data '{"name": "New name for my project", "description": "Updated with the results of the latest experiments"}' -s -H "X-SBG-Auth-Token: 7942f56901534434a054dafc3813bc96" -H "content-type: application/json" -X PATCH "https://api.sbgenomics.com/v2/projects/rfranklin/my-project"
from sevenbridges import Api

api = Api(url='https://api.sbgenomics.com/v2',
          token='3259c50e1ac5426ea8f1273259740f74')

project = api.projects.get('rfranklin/my-project')

# change the attributes
project.name = 'my project'
project.description = 'Updated with the results of the latest experiments'
project.settings.locked = True
project.settings.use_interruptible_instances = False
project.settings.use_memoization = True
project.settings.intermediate_files = {
    'retention': 'LIMITED',
    'duration': 24
}
project.tags = ['tag1', 'tag2']

# send PATCH request to SB API
project.save()

print(project.description)

Request body

The request body should contain a set of key-value pairs. The keys, and the values they take, are described in the following table. Enter a key-value pair if you want to re-set the existing value for the project.

Note that although you may change the name of the project, this does not affect its short name, which is immutable.

Key

Datatype of value

Description of value

name

string

The name of the project you are editing.

billing_group

string

The ID of the billing group for the project.

List all billing groups to find your billing group ID.

settings

dictionary

This dictionary contains the following keys:

  • locked
  • use_interruptible_instances.
  • use_memoization
  • intermediate_files
  • use_elastic_disk

See the field below for details.

locked

Boolean

This field can be true or false.

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

use_interruptible_instances

Boolean

This field can be true or false to enable or disable the use of spot instances.

use_memoization

Boolean

Set to false by default. Set to true to enable memoization.

use_elastic_disk

Boolean

Enable or disable Elastic Disk.

intermediate_files

dictionary

Specifies intermediate files retention period.

To do this, specify a dictionary with the following format:

{ "retention": "LIMITED", 
   "duration": 24 }

The minimum value is 1 h. The maximum value is 120 h and the default value is 24 h.

description

string

A description of the project.

tags

array

The list of project tags.

Example request body

{
    "name": "my project",
    "description": "Updated with the results of the latest experiments",
    "settings": {
        "locked": true,
        "use_interruptible_instances": false,
        "use_memoization": true,
        "intermediate_files": {
          "retention":"LIMITED",
          "duration":24
        }
    },
    "tags": ["tag1", "tag2"]
}

Header Fields

Name

Description

X-SBG-Auth-Token
required

Your Seven Bridges Platform authentication token.

Path parameters

Name

Description

project

The short name of the project you are editing.

project_owner

The owner of the project you are editing.

Query parameters

Name

Data type

Description

fields

string

Selector specifying a subset of fields to include in the response.

Response

See a list of Seven Bridges Platform-specific response codes that may be contained in the body of the response.

Example response body

{
    "href": "https://api.sbgenomics.com/v2/projects/rfranklin/my-project",
    "id": "rfranklin/my-project",
    "name": "my project",
    "type": "v2",
    "description": "Updated with the results of the latest experiments",
    "tags": [
        "tag1", 
        "tag2"
    ],
    "settings": {
        "locked": true,
        "controlled": false,
        "location": "aws:us-east-1",
        "use_interruptible_instances": false,
        "use_memoization": true,
        "intermediate_files": {
            "duration": 24,
            "retention": "LIMITED"
        }
    },
    "permissions": {
        "write": true,
        "read": true,
        "copy": true,
        "execute": true,
        "admin": true
    },
    "root_folder": "595b8ca0e4b0a50d07cb58f9",
    "billing_group": "2791e8dc-4bb0-4314-9f3a-a8113e21e58c",
    "created_by": "rfranklin",
    "category": "PRIVATE",
    "created_on": "2017-07-04T12:40:00Z",
    "modified_on": "2019-05-20T12:49:34Z"
}