The Block Service is responsible for managing block storage devices. It provides functionalities to provision, deprovision, format, mount, unmount, and manage block storage devices. Additionally, it supports replica management, snapshot operations, and integration with Longhorn for block storage orchestration.
Provisions a new block storage device.
- Endpoint:
POST /v1/storage/blocks/provision
- Params:
name
(string): Name of the block.size
(number): Size of the block in GB.node
(string): Node to create the block.replicas
(number): Number of replicas.
- Returns: The created block object.
Deprovisions an existing block storage device.
- Endpoint:
DELETE /v1/storage/blocks/:id/deprovision
- Params:
id
(string): ID of the block.
- Returns: The ID of the deleted block.
Formats a block storage device.
- Endpoint:
POST /v1/storage/blocks/:id/format
- Params:
id
(string): ID of the block.force
(boolean, optional): Force format.
- Returns: The updated block object.
Mounts a block storage device.
- Endpoint:
POST /v1/storage/blocks/:id/mount
- Params:
id
(string): ID of the block.force
(boolean, optional): Force mount.
- Returns: The updated block object.
Unmounts a block storage device.
- Endpoint:
POST /v1/storage/blocks/:id/unmount
- Params:
id
(string): ID of the block.force
(boolean, optional): Force unmount.
- Returns: The updated block object.
Retrieves the usage of a block storage device.
- Endpoint:
GET /v1/storage/blocks/:id/usage
- Params:
id
(string): ID of the block.
- Returns: The block usage.
Trims a block storage device.
- Endpoint:
POST /v1/storage/blocks/:id/trim
- Params:
id
(string): ID of the block.
- Returns: The block object.
Checks the state of the pods associated with a block storage device.
- Endpoint:
GET /v1/storage/blocks/:id/check-pods
- Params:
id
(string): ID of the block.
- Returns: The block object.
Balances the number of replicas of a block storage device.
- Endpoint:
POST /v1/storage/blocks/:id/balance
- Params:
id
(string): ID of the block.
- Returns: The block object.
Lists replicas of a block storage device.
- Endpoint:
GET /v1/storage/blocks/:id/replicas
- Params:
id
(string): ID of the block.
- Returns: Array of replicas.
Creates a new replica for a block storage device.
- Endpoint:
POST /v1/storage/blocks/:id/replicas/create
- Params:
id
(string): ID of the block.disk
(string): Disk ID.
- Returns: The updated block object.
Removes a replica from a block storage device.
- Endpoint:
POST /v1/storage/blocks/:id/replicas/:replica/remove
- Params:
id
(string): ID of the block.replica
(string): Replica ID.
- Returns: The updated block object.
Adds a replica to a block storage device.
- Endpoint:
POST /v1/storage/blocks/:id/replicas/add
- Params:
id
(string): ID of the block.replica
(string): Replica ID.restore
(boolean, optional): Restore flag.fastSync
(boolean, optional): Fast sync flag.fileSyncHttpClientTimeout
(number, optional): File sync HTTP client timeout.
- Returns: The result from the command.
Removes a replica from the frontend controller.
- Endpoint:
DELETE /v1/storage/blocks/:id/replicas/:replica
- Params:
id
(string): ID of the block.replica
(string): Replica ID.force
(boolean, optional): Force flag.
- Returns: The result from the command.
Gets the rebuild status of a replica of a block storage device.
- Endpoint:
GET /v1/storage/blocks/:id/replicas/:replica/rebuild-status
- Params:
id
(string): ID of the block.replica
(string): Replica ID.
- Returns: The result from the command.
Verifies the rebuild status of a replica of a block storage device.
- Endpoint:
POST /v1/storage/blocks/:id/replicas/:replica/verify-rebuild
- Params:
id
(string): ID of the block.replica
(string): Replica ID.
- Returns: The result from the command.
Creates a snapshot of a volume.
- Endpoint:
POST /v1/storage/blocks/:id/snapshots/create
- Params:
id
(string): ID of the block.
- Returns: The block object.
Reverts a volume to a specific snapshot.
- Endpoint:
POST /v1/storage/blocks/:id/snapshots/revert
- Params:
id
(string): ID of the block.snapshotName
(string): Name of the snapshot.
- Returns: The block object.
Lists snapshots of a volume.
- Endpoint:
GET /v1/storage/blocks/:id/snapshots/list
- Params:
id
(string): ID of the block.
- Returns: Array of snapshot objects.
Removes a snapshot of a volume.
- Endpoint:
POST /v1/storage/blocks/:id/snapshots/remove
- Params:
id
(string): ID of the block.snapshotName
(string): Name of the snapshot.
- Returns: The block object.
Purges snapshots of a volume.
- Endpoint:
POST /v1/storage/blocks/:id/snapshots/purge
- Params:
id
(string): ID of the block.skipInProgress
(boolean, optional): Skip in-progress flag.
- Returns: The block object.
Gets the status of the purge operation of snapshots of a volume.
- Endpoint:
GET /v1/storage/blocks/:id/snapshots/purge-status
- Params:
id
(string): ID of the block.
- Returns: The block object.
Gets information about a snapshot of a volume.
- Endpoint:
GET /v1/storage/blocks/:id/snapshots/info
- Params:
id
(string): ID of the block.
- Returns: Snapshot object.
Clones a snapshot of a volume.
- Endpoint:
POST /v1/storage/blocks/:id/snapshots/clone
- Params:
id
(string): ID of the block.snapshotName
(string): Name of the snapshot.fromControllerAddress
(string): Address of the engine controller of the source volume.fromVolumeName
(string): Name of the source volume.fromControllerInstanceName
(string): Name of the engine controller instance of the source volume.
- Returns: The block object.
Gets the status of the clone operation of a snapshot of a volume.
- Endpoint:
GET /v1/storage/blocks/:id/snapshots/clone-status
- Params:
id
(string): ID of the block.snapshotName
(string): Name of the snapshot.
- Returns: The block object.
Starts the hash calculation of a snapshot of a volume.
- Endpoint:
POST /v1/storage/blocks/:id/snapshots/hash
- Params:
id
(string): ID of the block.snapshotName
(string): Name of the snapshot.
- Returns: The block object.
Cancels the hash calculation of a snapshot of a volume.
- Endpoint:
POST /v1/storage/blocks/:id/snapshots/hash-cancel
- Params:
id
(string): ID of the block.snapshotName
(string): Name of the snapshot.
- Returns: The block object.
Gets the status of the hash calculation of a snapshot of a volume.
- Endpoint:
GET /v1/storage/blocks/:id/snapshots/hash-status
- Params:
id
(string): ID of the block.snapshotName
(string): Name of the snapshot.
- Returns: The block object.