Create a volume (Microsoft Azure)

📘

Navigation

This call creates a new volume by attaching a Microsoft Azure storage container to the CGC.

Request

https://cgc-api.sbgenomics.com/v2/storage/volumes

Example request

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

Header Fields

NameDescription
X-SBG-Auth-Token
required
Your CGC 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 typeDescription
name
required
StringThe name of the volume. It must be unique from all other volumes for this user.
access_modeStringSpecifies the access mode for the volume. Azure volumes are available only in read-only (RO) mode.
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 typeDescription
typeStringUse azure for Microsoft Azure.
endpointStringSpecify a Microsoft Azure endpoint, only if you are using an endpoint that is different from the default one https://(serviceaccount).blob.core.windows.net. To make a non-default endpoint work with the CGC, please first make sure it is supported by Seven Bridges.
storage_accountStringThe name of the storage account that holds the container you want to attach as a volume.
containerStringThe name of the container that you want to attach as a volume.
prefix
default: ""
StringA 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.
credentialsObjectContains the Microsoft Azure credentials that are necessary in order to attach your storage container:
- tenant_id
- client_id
- client_secret
tenant_id
required
StringDirectory (tenant) ID of the application you created on the Azure Portal for the purpose of attaching your storage container.
client_id
required
StringApplication (client) ID of the application you created on the Azure Portal for the purpose of attaching your storage container.
client_secret
required
StringValue of the client secret you created on the Azure Portal for the purpose of attaching your storage container.
propertiesObjectContains the following properties of specific service:
-resource_id
resource_id
required
StringResource ID of the Azure storage account. To get it, go to the Azure Portal, open the storage account's Overview page and click JSON View.

Example request body

{
	"name": "samples",
	"description": "Volume containing raw samples",
	"access_mode": "RO",
	"service": {
		"type": "azure",
		"endpoint": "https://myazurestorage.blob.core.windows.net/",
		"storage_account": "myazurestorage",
		"container": "raw-samples",
		"credentials": {
			"tenant_id": "a32789b5-123e-45d6-78c9-b8faeb12de9c",
			"client_id": "c90b4699-bd66-53af-bd1a-a933d80629a4",
			"client_secret": "Jm0.7M5edJEvle9.v6pqJ-9~fte1qen.vT"
		},
		"properties": {
      "resource_id": "/subscriptions/ea078c48-f73b-5460-a43b-4a1ab89e7f15/resourceGroups/test/providers/Microsoft.Storage/storageAccounts/myazurestorage"
    }
	}
}

Response

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

Example response body

{
    "href": "https://cgc-api.sbgenomics.com/v2/storage/volumes/rfranklin/samples",
    "id": "rfranklin/samples",
    "name": "samples",
    "description": "Volume containing raw samples",
    "access_mode": "RO",
    "service": {
        "type": "AZURE",
        "bucket": "myazurestorage.raw-samples",
        "prefix": "",
        "endpoint": "https://myazurestorage.blob.core.windows.net/",
        "storage_account": "myazurestorage",
        "container": "raw-samples",
        "credentials": {
            "tenant_id": "a32789b5-123e-45d6-78c9-b8faeb12de9c",
            "client_id": "f3e3f554-276d-5c2c-b87e-e3fe12d782fe"
        },
        "properties": {
            "resource_id": "/subscriptions/e1bfa7ce-da8d-575d-b8ce-5bc70e98f986/resourceGroups/test/providers/Microsoft.Storage/storageAccounts/myazurestorage"
        }
    },
    "created_on": "2021-05-18T15:22:03Z",
    "modified_on": "2021-05-18T15:22:03Z",
    "active": true
}