Skip to main content

Filesystems

Filesystem Schema

  • id String - A unique identifier for each filesystem. This is automatically generated.
  • name String - The human-readable name for the filesystem.
  • description String - The human-readable description for the filesystem.
  • size BigInt (String) - The storage size of this filesystem given in GiB.
  • region String - The identifier for the region this filesystem exists in (eg. NORD-NO-KRS-1).
  • type String - The storage type of the filesystem. Possible values are vast.
  • status String - The filesystem status. Possible values are creating, created, deleting.
  • mount_endpoint_range Tuple[String, String] - The start and end IP of the mount endpoint range. Expressed as a array with two entries.
  • mount_base_path String - The base path on the server under which the mount point can be accessed.
  • created_at String - A time value given in ISO8601 combined date and time format that represents when the filesystem was created.
  • updated_at String - A time value given in ISO8601 combined date and time format that represents when the filesystem was updated.
Mounting the filesystem

To mount the filesystem inside a instance use the values of the mount_endpoint_range and mount_base_path fields to build the mount command.

First create a mount destination:

mkdir /mnt/nfs

Then, given the following values as example

{
...
"mount_endpoint_range": ["10.24.11.10", "10.24.11.48"],
"mount_base_path": "/7cd68eba-c74c-11ee-a2cf-57cd29ef9c84",
...
}

the mount command for nfs-client would be (install with apt-get install nfs-client):

# choose a random IP from the range 10.24.11.10 - 10.24.11.48 as the connection IP. In this case we chose 10.24.11.40 as an example.
mount -o proto=tcp,vers=3,nconnect=8 10.24.11.40:/REPLACE-BY-MOUNT-BASE-PATH-API-FIELD /mnt/nfs

and using vastnfs (available if the type is "vast", installation instructions here):

# choose a random IP from the range 10.24.11.10 - 10.24.11.48 as the connection IP. In this case we chose 10.24.11.40 as an example.
mount -o proto=tcp,vers=3,nconnect=16,spread_writes,spread_reads,remoteports=10.24.11.10-10.24.11.48 10.24.11.40:/REPLACE-BY-MOUNT-BASE-PATH-API-FIELD /mnt/nfs

Create a Filesystem

To create a new filesystem, send a request to:

POST /compute/v1/filesystems (HTTP 201 - Created)

The attribute values that must be set to successfully create a filesystem are:

Body parameters

  • name String Required - The human-readable name set for the filesystem.
  • description String Optional - The human-readable description set for the filesystem.
  • size BigInt Required - The storage size of this filesystem given in GiB (Min: 1GiB).
  • region String Required - The identifier for the region in which this filesystem should be created in, see Regions.
  • type String Optional - The storage type of this filesystem. Defaults to vast, see Filesystem Schema.
{
"name": "<filesystem name>",
"description": "<filesystem description>",
"size": 1000,
"region": "NORD-NO-KRS-1",
"type": "vast"
}

Response body

The filesystem will be created using the provided information. The response body will contain a JSON object with standard attributes for your new filesystem, see Filesystem Schema:

{
"filesystem": {
"id": "0580fb4c-de74-4b83-8bdb-1fd87d89f827",
"name": "<filesystem name>",
"description": "<filesystem description>",
"size": 1000,
"region": "NORD-NO-KRS-1",
"type": "vast",
"mount_endpoint_range": ["10.24.11.10", "10.24.11.48"],
"mount_base_path": "/7cd68eba-c74c-11ee-a2cf-57cd29ef9c84",
"status": "created",
"created_at": "2024-01-28T07:53:11.177Z",
"updated_at": "2024-01-28T07:53:11.177Z"
}
}

List Filesystems

Lists all filesystems of an account.

GET /compute/v1/filesystems (HTTP 200 - OK)

Query parameters

  • per_page Integer Optional - A positive integer lower than or equal to 100 to select the number of items to return (default: 50).
  • page Integer Optional - A positive integer to choose the page to return.

Response body

The response will be a JSON object with pagination details and a key called filesystems. This will be set to an array of filesystem objects, each of which will contain the filesystem object, see Filesystem Schema:

{
"filesystems": [
{
"id": "0580fb4c-de74-4b83-8bdb-1fd87d89f827",
"name": "<filesystem name>",
"description": "<filesystem description>",
"size": 1000,
"region": "NORD-NO-KRS-1",
"type": "vast",
"mount_endpoint_range": ["10.24.11.10", "10.24.11.48"],
"mount_base_path": "/7cd68eba-c74c-11ee-a2cf-57cd29ef9c84",
"status": "created",
"created_at": "2024-01-28T07:53:11.177Z",
"updated_at": "2024-01-28T07:53:11.177Z"
}
],
"total_count": 1,
"page": 1,
"per_page": 50
}

Get Filesystem

Get details of one filesystem with a given ID.

GET /compute/v1/filesystems/<filesystem_id> (HTTP 200 - OK)

Path parameters:

  • filesystem_id String - filesystem id

Response body

The response will be a JSON object that contains the filesystem attributes, see Filesystem Schema:

{
"filesystem": {
"id": "0580fb4c-de74-4b83-8bdb-1fd87d89f827",
"name": "<filesystem name>",
"description": "<filesystem description>",
"size": 1000,
"region": "NORD-NO-KRS-1",
"type": "vast",
"mount_endpoint_range": ["10.24.11.10", "10.24.11.48"],
"mount_base_path": "/7cd68eba-c74c-11ee-a2cf-57cd29ef9c84",
"status": "created",
"created_at": "2024-01-28T07:53:11.177Z",
"updated_at": "2024-01-28T07:53:11.177Z"
}
}

Delete a Filesystem

Delete a filesystem with the given ID

DELETE /compute/v1/filesystems/<filesystem_id>  (HTTP 204 - No content)

Path parameters:

  • filesystem_id String - filesystem id

Examples (cURL)

# Create a new filesystem
curl -H "Authorization: Bearer $TOKEN" \
-X POST "https://api.genesiscloud.com/compute/v1/filesystems" \
-H "Content-Type: application/json" \
--data-raw '{
"name": "name",
"size": 1000,
"region": "NORD-NO-KRS-1",
"type": "vast"
}'
# List all filesystems
curl -H "Authorization: Bearer $TOKEN" \
"https://api.genesiscloud.com/compute/v1/filesystems"
# Get a filesystem by id
curl -H "Authorization: Bearer $TOKEN" \
"https://api.genesiscloud.com/compute/v1/filesystems/<filesystem_id>"
# Delete a filesystem by id
curl -H "Authorization: Bearer $TOKEN" \
-X DELETE "https://api.genesiscloud.com/compute/v1/filesystems/<filesystem_id>"