Create a volume

This call creates a new volume. Currently, volumes may be created using three types of cloud storage repository:

  • Amazon Web Services' (AWS) S3 buckets
  • Google Cloud Storage (GCS) buckets
  • Other types of cloud storage, through an S3-compatible API (read-only). This cloud storage type requires an additional API layer that the storage employs, which must use the same "language" as the AWS S3 API.

šŸ“˜

If your are using a cloud storage provider other than Amazon Web Services S3 or Google Cloud Storage, please make sure you have met the following requirements:

  • There is an additional API layer implemented on your cloud storage, compatible with the AWS S3 API. This means that you need to use an additional service or software on top of your storage, that will emulate the behavior and interaction of AWS S3 storage.
  • You or your cloud storage administrator can provide S3-compatible storage endpoint and credentials that are required to connect the storage to CAVATICA. These should be available for creation or obtaining when you have met the previous prerequisite.
https://cavatica-api.sbgenomics.com/v2/storage/volumes

Request

Example request

POST /v2/storage/volumes HTTP/1.1
Host: cavatica-api.sbgenomics.com
X-SBG-Auth-Token: 3259c50e1ac5426ea8f1273259740f74
Content-Type: application/json
curl --data '@create-volume.json' -X POST -H "X-SBG-Auth-Token: ce7ae5ab85e946599298e88a3430fba0" -H "Content-Type: application/json" 'https://cavatica-api.sbgenomics.com/storage/volumes'

Header Fields

KeyDescription of value
X-SBG-Auth-Token
required
Your CAVATICA authentication token.
Content-type
required
application/json

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.

KeyData type of valueDescription of value
name
required
StringThe name of the volume. It must be unique from all other volumes for this user.

access_mode
StringSignifies whether this volume should be used for read-write ("RW") or read-only ("RO") operations.

The access mode is consulted independently of the credentials granted to Seven Bridges when the volume was created, so it is possible to use a read-write credentials to register both read-write and read-only volumes using it.

default: "RW"
descriptionStringAn optional description of this volume.
service
required
ObjectThis object should contain the information about the cloud service that this volume represents.

See the service object section below for an explanation of its structure.

The service object

KeyData type of valueDescription of value
typestringThe type of cloud service supported. Currently the only valid values are "s3" for Amazon Web Services or an S3-compatible endpoint and "gcs" for Google Cloud Storage.
prefixStringA service-specific prefix to prepend to all objects created in this volume. If the service supports folders, and this prefix includes them, the API will attempt to create any missing folders when it outputs a file.

default: ""
bucket

applies to type: s3 and gcs
required
StringThe name of the bucket you wish to register as a volume.
root_url

default: https://s3.amazonaws.com for s3, https://www.googleapis.com/ for gcs, or a custom endpoint if you are connecting cloud storage through an S3-compatible endpoint.
StringCloud provider API endpoint to use when accessing this bucket.

For a list of AWS-supported endpoints, see AWS Regions and Endpoints.
credentialsObjectContains credentials for the underlying cloud provider.

AWS IAM user, or S3-compatible endpoint:
access-key-id
secret_access-key


For Google Cloud Storage, these credentials are:

client_email
* private_key
access_key_id

applies to type: s3
required
StringAWS access key ID of the IAM user shared with Seven Bridges to access this bucket.
secret_access_key

applies to type: s3
required
StringAWS secret access key of the IAM user shared with Seven Bridges to access this bucket.
client_email

applies to type: gcs
required
StringGoogle Cloud Platform user email.
private_key

applies to type: gcs
required
StringGoogle Cloud Platform private key.
propertiesObjectContains properties of specific service.
sse_algorithm

applies to type: s3
StringUse default AES256 server-side encryption or AWS KMS encryption when writing to this bucket.

Can be:
AES256 (default)
aws:kms

default: AES256
sse_aws_kms_key_id

applies to type: s3
StringIf AWS KMS encryption is used, this should be set to the required KMS key. If not set and aws:kms is set as sse_algorithm, default KMS key is used.

Example request body

{
  "name": "my_s3_volume",
  "service": {
    "type": "s3",
    "bucket": "input_files",
    "prefix": "",
    "credentials": {
      "access_key_id": "AKIAIOSFODNN7EXAMPLE",
      "secret_access_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
    },
    "properties": {
      "sse_algorithm": "AES256"
    }
  },
  "access_mode": "RO"
}
{
  "name": "my_gcs_volume",
  "description": "New google volume",
  "service": {
    "type": "gcs",
    "bucket": "output_files",
    "prefix": "output",
    "credentials": {
      "client_email": "[email protected]",
      "private_key": "-----BEGIN RSA PRIVATE KEY-----\nEXAMPLEBAAKCAQEAsXj4E7svaB4szcOrAcraSbsGnNuTU1b/4llyspDa0lltZIKL\nfl5s3QoqbjUWqAZXkJexKus55g49ULD8BGKH2r4EF+XyKcpoon4uIFcbm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HJDt04hz0fXfTFc4yTZqnSpqQPZMQfw8LajK2gA+v/Gf2xYn7fcKGW/h0vj\nYB9u16hfirdcGZ+Ih3MR1mECgYEAnq1b1KJIirlYm8FYrVOGe4FxRF2/ngdA05Ck\nZYl9Vl8pZqvAL+MZ4hpyYvs9CzX1KClL38XdaZ2ftKJB2tjzDZYl9Vl8pZqvAL+MZ4hpyYrand0m1KClL38XdaZ2ftKJB2tjzDZYl9Vl8pZqvALJlQZYl9Vl8pZqvAL+MZ4hpyYvs9CzX1KClL38XdaZ2ftKJB2tjzDZYl9Vl8pZqvAL+CxZYl9Vl8pZqvAL+MZ4hpyYvs9CzX1KClL38XdaZ2ftKJB2tjzDZYl9Vl8pZqvAL+MjZYl9Vl8pZqvAL+MZ4hpyYvs9CzX1KClL38XdaZ2ftKJB2tjzDZYl9Vl8pZqvALSi0sVSXpA=\n-----END RSA PRIVATE KEY-----"
    }
  },
  "access_mode": "RW"
}

Response

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

Example response body

{
  "href": "https://cavatica-api.sbgenomics.com/v2/storage/volumes/rfranklin/my_volume",
  "id": "rfranklin/my_volume",
  "name": "my_volume",
  "access_mode": "RW",
  "service": {
    "type": "S3",
    "bucket": "output",
    "prefix": "",
    "endpoint": "s3.amazonaws.com",
    "credentials": {
      "access_key_id": "AKIAIOSFODNN7EXAMPLE"
    },
    "properties": {
      "sse_algorithm": "AES256"
    }
  },
  "created_on": "2016-06-30T08:14:02Z",
  "modified_on": "2016-06-30T08:14:02Z",
  "active": true
}

šŸ‘

Note that you cannot view volumes that you have created via the visual interface. However, you can see all your volumes by making the call to list volumes.

Language