post https://cavatica-api.sbgenomics.com/v2
This call lets you perform a bulk import of files from your volume (either Amazon Web Services or Google Cloud Storage) into your project on the CAVATICA. One call can contain up to 100 items.
If successful, an alias will be created on the CAVATICA. Aliases appear as files on the CAVATICA and can be copied, executed, and modified as such. They refer back to the respective file on the given volume.
Learn more about using the Volumes API for Amazon S3 and for Google Cloud Storage.
Request
https://cavatica-api.sbgenomics.com/v2/bulk/storage/imports/create
Example request
POST v2/bulk/storage/imports/create
Host: cavatica-api.sbgenomics.com
X-SBG-Auth-Token: 3259c50e1ac5426ea8f1373259740f75
curl -X POST \
https://cavatica-api.sbgenomics.com/v2/bulk/storage/imports/create \
-H 'Content-Type: application/json' \
-H 'X-SBG-Auth-Token: b04aa2a2e98348a1a3a75ca677ea7fd7' \
-d '{
"items": [
{
"source": {
"volume": "rfranklin/input",
"location": "example_human_Illumina.pe_1.fastq"
},
"destination": {
"project": "rfranklin/my_project",
"name": "example_human_Illumina.pe_1.fastq"
},
"overwrite": true
},{
"source": {
"volume": "rfranklin/input",
"location": "example_human_Illumina.pe_2.fastq"
},
"destination": {
"project": "rfranklin/my_project",
"name": "example_human_Illumina.pe_2.fastq"
},
"overwrite": true
}
]
}
'
Header Fields
Name | Description |
---|---|
X-SBG-Auth-Token required | Your CAVATICA authentication token. |
Content-Type required | application/json |
Request body
For every item in the request body, you should enter the list of key-value pairs described in the table below. One API call can contain up to 100 items.
Key | Data type | Description |
---|---|---|
source required | object | This object should describe the source from which the file should be imported. |
volume required | string | Volume ID from which to import the file. |
location required | string | Volume-specific location pointing to the file to import. This location should be recognizable to the underlying cloud service as a valid key or path to the file. Please note that if this volume was configured with a prefix parameter when it was created, the prefix will be prepended to location before attempting to locate the file on the volume. |
destination required | object | This object should describe the CAVATICA destination for the imported file. |
project required | string | The project in which to create the alias. |
name | string | The name of the alias to create. This name should be unique to the project. If the name is already in use in the project, you should use the overwrite parameter in this call to force any file with that name to be deleted before the alias is created.If name is omitted, the alias name will default to the last segment of the complete location (including the prefix ) on the volume. Segments are considered to be separated with forward slashes ('/'). |
Example request body
{
"items": [
{
"source": {
"volume": "rfranklin/input",
"location": "example_human_Illumina.pe_1.fastq"
},
"destination": {
"project": "rfranklin/my_project",
"name": "example_human_Illumina.pe_1.fastq"
},
"overwrite": true
},{
"source": {
"volume": "rfranklin/input",
"location": "example_human_Illumina.pe_2.fastq"
},
"destination": {
"project": "rfranklin/my_project",
"name": "example_human_Illumina.pe_2.fastq"
},
"overwrite": true
}
]
}
Response
See a list of CAVATICA-specific response codes that may be contained in the body of the response.
Response body
Key | Data type | Description |
---|---|---|
id | string | ID of this import job. |
state | string | The state of this import job. Possible values are:PENDING : the import is queued;RUNNING : the import is running;COMPLETED : the import has completed successfully;FAILED : the import has failed. |
source | object | Import source, as passed when this job was started by the call to start an import job. |
destination | object | Import destination, as passed when this job was start an import job. |
result | object | File object that was imported. |
error | object | In case of error in the import job, standard API error is returned here. |
Example response body
{
"items": [
{
"resource": {
"href": "https://cavatica-api.sbgenomics.com/v2/storage/imports/wMtBbkNxJ7ldKtkZ3hC3eisVr3DtQcT3",
"id": "wMtBbkNxJ7ldKtkZ3hC3eisVr3DtQcT3",
"state": "PENDING",
"overwrite": true,
"source": {
"volume": "rfranklin/input",
"location": "example_human_Illumina.pe_1.fastq"
},
"destination": {
"project": "rfranklin/my_project",
"name": "example_human_Illumina.pe_1.fastq"
}
}
},
{
"resource": {
"href": "https://cavatica-api.sbgenomics.com/v2/storage/imports/0vXu4HQe7WqdTZg9iRcetk0UePQZ2I9I",
"id": "0vXu4HQe7WqdTZg9iRcetk0UePQZ2I9I",
"state": "PENDING",
"overwrite": true,
"source": {
"volume": "rfranklin/input",
"location": "example_human_Illumina.pe_2.fastq"
},
"destination": {
"project": "rfranklin/my_project",
"name": "example_human_Illumina.pe_2.fastq"
}
}
}
]
}