Create a volume (Microsoft Azure)
Navigation
- Microsoft Azure volumes
- Attach a Microsoft Azure volume:
- Via the visual interface
- Via the API:
- Create a volume (Microsoft Azure)
- Get details of a volume (Microsoft Azure)
- Update a volume (Microsoft Azure)
This call creates a new volume by attaching a Microsoft Azure storage container to the Platform.
Request
https://api.sb.biodatacatalyst.nhlbi.nih.gov/v2/storage/volumes
Example request
POST /v2/storage/volumes HTTP/1.1
Host: api.sb.biodatacatalyst.nhlbi.nih.gov
X-SBG-Auth-Token: 3210a98c1db9304ea9d9273156740f74
Content-Type: application/json
curl --data '@create-volume.json' -X POST -H "X-SBG-Auth-Token: 3210a98c1db9304ea9d9273156740f74" -H "Content-Type: application/json" 'https://api.sb.biodatacatalyst.nhlbi.nih.gov/v2/storage/volumes'
Header Fields
Name | Description |
---|---|
X-SBG-Auth-Token required | Your Platform 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.
Key | Data type | Description |
---|---|---|
name required | String | The name of the volume. It must be unique from all other volumes for this user. |
access_mode | String | Specifies the access mode for the volume. Azure volumes are available only in read-only (RO ) mode. |
description | String | An optional description of this volume. |
service required | Object | This 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
service
objectKey | Data type | Description |
---|---|---|
type | String | Use azure for Microsoft Azure. |
endpoint | String | Specify 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 Platform, please first make sure it is supported by Seven Bridges. |
storage_account | String | The name of the storage account that holds the container you want to attach as a volume. |
container | String | The name of the container that you want to attach as a volume. |
prefix default: "" | String | A 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. |
credentials | Object | Contains the Microsoft Azure credentials that are necessary in order to attach your storage container: - tenant_id - client_id - client_secret |
tenant_id required | String | Directory (tenant) ID of the application you created on the Azure Portal for the purpose of attaching your storage container. |
client_id required | String | Application (client) ID of the application you created on the Azure Portal for the purpose of attaching your storage container. |
client_secret required | String | Value of the client secret you created on the Azure Portal for the purpose of attaching your storage container. |
properties | Object | Contains the following properties of specific service: - resource_id |
resource_id required | String | Resource 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": "f3e3f554-276d-5c2c-b87e-e3fe12d782fe",
"client_secret": "Ab0.7M4edTRsrp9.v7lqJ-8~fte0qun.cT"
},
"properties": {
"resource_id": "/subscriptions/e1bfa7ce-123a-575d-789c-5bc70e98f986/resourceGroups/test/providers/Microsoft.Storage/storageAccounts/myazurestorage"
}
}
}
Response
See a list of Platform-specific response codes that may be contained in the body of the response.
Example response body
{
"href": "https://api.sb.biodatacatalyst.nhlbi.nih.gov/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-123a-575d-789c-5bc70e98f986/resourceGroups/test/providers/Microsoft.Storage/storageAccounts/myazurestorage"
}
},
"created_on": "2021-05-18T15:22:03Z",
"modified_on": "2021-05-18T15:22:03Z",
"active": true
}