Skip to main content

Create a Storage Volume

Create a new storage volume.

/storage/volume/create

Authorization

You can find the AccessToken in the Request Header, or copy it from the web page(copy Auth Token). This token is generated each time you log in and will expire after one day.

You can also request the login api to get another token. See login api.

The AccessToken should be included in the request as a cookie. In the cURL example below, you can see how the token is passed using the -b flag:

-b 'AccessToken=your_token_here'

Note: Replace your_token_here with your actual AccessToken. The token is a JWT (JSON Web Token) that contains your authentication information and permissions.

Request Body

The request body contains the storage volume configuration.

FieldTypeRequiredDescription
namestringYesThe name of the storage volume
sizeGBnumberYesThe size of the storage volume in GB
regionstringYesThe ID of the region where the storage volume will be created
volumeTypestringYesThe type of storage volume (filesystem, highspeedstorage, etc.)

Example Request

{
"name": "example-volume",
"sizeGB": 200,
"region": "fce31a0c-xxxx-xxxx-xxxx-41caa1bdd251",
"volumeType": "filesystem"
}

cURL Example

curl 'https://hpc-ai.com/api/storage/volume/create' \
-H 'content-type: application/json' \
-b 'AccessToken=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOlsicGxhdGZvcm0uY29sb3NzYWxhaS5jb20iXSwiZXhwIjoxNzUxNjExOTE2LCJncm91cCI6WyJhZG1pbiJdLCJpYXQiOjE3NTE1MjU1MTYsImlzcyI6ImhwY2FpdGVjaC5jb20iLCJzdWIiOiIwOGY2ZjI2MS1hNzY2LTQ2M2UtOGJhNC04NWU2YWUzMmY0OTIifQ.hDEYrfq5zksB7ywx7scoNM-IJmyW88mYTtz435kamqoO8etsSPHy1yLe2L7WKAkUx_eJOISUauwTUX6Of8ys5gj8MP4BK6Ixh_saAWylRdF7IrFMDb16Yaxc2a91yAhK26IsiDCOoygSBYZ8tMHMUJkudkY2CqzSJvb3Z-kCqJfK8wlgY45Dgx6dTkVeYvA9bohnRQ6R4hI57HJo8fnav3VxkzEbYcs9UmLSNgfPYdC-mCURsSsPUaCTVEUxk9oJaHXmyH61uo7ZQKOHXNqsCHVgwFJPAm3YjPCx3n1jNYPGH-amnrLt0PQVpFa-PGWwjySrOVyjmjtlsMxxxxxx' \
--data-raw '{"name":"example-volume2","sizeGB":200,"region":"fce31a0c-xxxx-xxxx-xxxx-41caa1bdd251","volumeType":"filesystem"}'

Example Response

Success Response

{
"volume": {
"id": "da18c47c-xxxx-xxxx-xxxx-f5289ab0c8c3",
"volumeName": "example-volume",
"region": "fce31a0c-xxxx-xxxx-xxxx-41caa1bdd251",
"volumeType": "filesystem",
"sizeGB": 200,
"usageGB": 0,
"status": "Pending",
"username": "username"
}
}

Error Response

{
"message": "Volume already exists"
}