Create a new project

This call creates a new project.

Request

https://api.sbgenomics.com/v2/projects
https://eu-api.sbgenomics.com/v2/projects
from sevenbridges import Api

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

# send POST request to SB API
new_project = api.projects.create(
    name='My new project',
    description='This is my new project',
    billing_group='e291343d-032e9-43283-917a-898fba99dca0',
    settings={
        'locked': False,
        'controlled': False,
        'location': 'aws:us-west-2',
        'use_interruptible_instances': False,
        'use_memoization': True,
        'intermediate_files': {
            'retention': 'LIMITED',
            'duration': 24
        }
    }
)

print(new_project.name)

Example request

POST /v2/projects HTTP/1.1
Host: api.sbgenomics.com
X-SBG-Auth-Token: 3259c50e1ac5426ea8f1273259740f74
content-type: application/json
curl --data '{"name": "My New Project", "description": "A project for testing my apps", "billing_group": "1f0c2751-694c-4e98-b863-06b68f5a61ca"}' -s -H "X-SBG-Auth-Token: 7942f56901534434a054dafc3813bc96" -H "content-type: application/json" -X POST "https://api.sbgenomics.com/v2/projects"

Header Fields

Name

Description

X-SBG-Auth-Token
required

Your Seven Bridges Platform authentication token.

Query parameters

Name

Data type

Description

fields

string

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

Request body

In the body, you should enter a list of key-value pairs. The keys, and the values they take, are described in the following table.

Key

Datatype of value

Description of value

name
required

string

The name of the project you are creating.

description

string

A description of the project.

billing_group
required

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 two fields, locked and use_interruptible_instances - see below for further information.

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

controlled

boolean

This field can be true or false.

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

boolean

Use this field to specify the location for this project:

  • aws:us-east-1
  • aws:us-west-2

use_interruptible_instances

boolean

This field can be true or false. If not included in the request, spot instances are enabled by default.

use_memoization

boolean

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

use_elastic_disk

boolean

Set to true to enable 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.

👍

Project short names

Recall from the API Overview that projects are assigned short names. When you specify the given name of your project, in the request body, the short name will be automatically generated, using the process described in the API Overview.

Example request body

{
  "name": "My new project", 
  "description": "This is my new project", 
  "billing_group": "e291343d-032e9-43283-917a-898fba99dca0",
  "settings":{
    "locked": false, 
    "controlled": true, 
    "location": "aws:us-west-2", 
    "use_interruptible_instances": false, 
    "use_memoization": true, 
    "intermediate_files": {
       "retention":"LIMITED",
       "duration":24
     }
   }
}

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-new-project",
    "id": "rfranklin/my-new-project",
    "name": "My new project",
    "type": "v2",
    "description": "This is my new project",
    "tags": [],
    "category": "PRIVATE",
    "settings": {
        "locked": false,
        "controlled": true,
        "location": "aws:us-west-2",
        "use_interruptible_instances": false,
        "use_memoization": true,
        "intermediate_files": {
            "duration": 24,
            "retention": "LIMITED"
        }
    },
    "root_folder": "5d8cae1be4b0cbef3002f893",
    "billing_group": "e291343d-02e9-4283-915a-898fba99dca0"
}
Interpreting the response body

  • The response will include an empty list [] for the object tags. This is a legacy feature of the API, and should be ignored.
  • The field locked is set to true, which means you've created a locked project. Locking down a project prevents any Seven Bridges team member from viewing any information about the task.