Deactivate a volume

This call deactivates a volume. Note that this request is based off of the PATCH request to update a volume.

Once deactivated, you cannot import from, export to, or browse within a volume. As such, the content of the files imported from this volume will no longer be accessible on the Platform. However, you can update the volume and manage members. Note that you cannot deactivate the volume if you have running imports or exports unless you force the operation using the query parameter force=true, as described below.

Note that to delete a volume, first you must deactivate it and delete all files which have been imported from the volume to the Platform.

If you want to reactivate the volume at a later time, make this call again with the key "active" set to "true" in the request body.

Request

https://api.sbgenomics.com/v2/storage/volumes/{volume_id}
https://eu-api.sbgenomics.com/v2/storage/volumes/{volume_id}

Example request

PATCH /v2/storage/volumes/rfranklin/output HTTP/1.1
Host: api.sbgenomics.com
X-SBG-Auth-Token: 3259c50e1ac5426ea8f1273259740f75
Content-Type: application/json
curl  --data '@patch-volume.json' -s -H "X-SBG-Auth-Token: 6282d5e2121d43e7900e9d52b15845e7" -H "Content-Type: application/json" -X PATCH "https://api.sbgenomics.com/storage/volumes/rfranklin/output"
from sevenbridges import Api

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

volume = api.volumes.get(id='rfranklin/output')

# set 'active' field to False
volume.active = False

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

print(volume.active)

Header Fields

Key

Description of value

X-SBG-Auth-Token
required

Your Seven Bridges Platform authentication token.

Content-type
required

application/json

Path parameters

Key

Description of value

volume-id

The volume that you want to update.

Query parameters

Key

Description of value

force

Set this to true to force-quit ongoing import or export operations on a volume you intend to deactivate

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

Data type of value

Description of value

active

String

Set this to false to deactivate the volume. Note that if there are ongoing import or export operations on the volume, you must force-quit the operations using the query parameter force=true.
To reactivate a volume, set this back to true again.

Example request body

{
    "active": false
}

Response

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

Response body

The response object contains information about the specified volume. The information is structured using the following key-value pairs:

Key

Data type of value

Description of value

active

Boolean

If a volume is deactivated, this field will be set to false

id

String

ID of this volume, containing owner/name

name

String

Name of the volume.

description

String

The description of this volume.

created_on

String

The date and time this volume was created.

modified_on

String

The date and time this volume was last modified.

Example response body

{
  "href": "https://api.sbgenomics.com/v2/storage/volumes/rfranklin/output",
  "id": "rfranklin/my-volume",
  "name": "my-volume",
  "access_mode": "RW",
  "service": {
    "type": "S3",
    "bucket": "my_bucket",
    "prefix": "input-files",
    "endpoint": "s3.amazonaws.com",
    "credentials": {
      "access_key_id": "AKIAJRC7TPMRMDKOFXGA"
    },
    "properties": {
      "sse_algorithm": "AES256"
    }
   },
  "created_on": "2017-05-09T16:19:10Z",
  "modified_on": "2017-05-24T09:27:41Z",
  "active": false
}