Storages API
A storage is a directory on the server where Alta records the archive of channels. A channel uses a storage with its storage field. Read more about the settings in Storage Management.
All requests of this page are available to the admin role only.
Storage Object
Section titled “Storage Object”{ "id": "archive", "duration": 48, "local": "/var/lib/alta/archive", "save_preview": true}- id: Storage ID. Only in the create request.
- duration: Archive duration in hours. Required.
- local: Absolute path to the archive directory on the server. Send it in every create and update request.
- save_preview (optional): Save MP4 preview clips for streams with H.264 and H.265 video.
Create a Storage
Section titled “Create a Storage”POST /api/ott/storageExample:
curl -sS -X POST -H "Authorization: Bearer $TOKEN" \ -H 'Content-Type: application/json' \ 'http://alta.example.com:8100/api/ott/storage' \ -d '{"id": "archive", "duration": 48, "local": "/var/lib/alta/archive", "save_preview": true}'Returns 204, or 409 if a storage with this ID exists.
Get a Storage
Section titled “Get a Storage”GET /api/ott/storage?id=<storage_id>Returns the storage object without the id field, or 404.
Update a Storage
Section titled “Update a Storage”PUT /api/ott/storage?id=<storage_id>Send the complete object.
- A new
durationorsave_previewapplies to the channels that use the storage immediately. - A new
localstops the channels of the storage, moves the storage to the new directory, and starts the channels again. Alta does not copy the old archive, and removes the archive of the channels from the old directory.
Returns 204, or 404.
Delete a Storage
Section titled “Delete a Storage”DELETE /api/ott/storage?id=<storage_id>Before you delete a storage, remove it from the channels with Update a Channel: send the channel without the storage field. A channel must not refer to a storage that does not exist.
Returns 204, or 404.
Storage Status
Section titled “Storage Status”GET /api/ott/storage/statusReturns the size of every storage and the archive of every channel variant. Use it to get the list of storage IDs and to find the channels that record.
Response:
{ "storages": { "archive": { "size": 52428800000 } }, "channels": { "news/main": { "storage": "archive", "size": 5242880000, "duration": 172800, "diskFull": 0 } }}- storages: Size of the archive in bytes for each storage.
- channels: Archive of each variant that records.
- storage: Storage ID.
- size: Size in bytes.
- duration: Recorded duration in seconds.
- diskFull:
1when the free disk space is below the threshold, otherwise0.
Disk Space Threshold
Section titled “Disk Space Threshold”PUT /api/ott/storagecommonsettingsSets the free disk space below which channels switch to circular recording. Read more in Storage Management.
curl -sS -X PUT -H "Authorization: Bearer $TOKEN" \ -H 'Content-Type: application/json' \ 'http://alta.example.com:8100/api/ott/storagecommonsettings' \ -d '{"disk_space_threshold_mb": 10240}'- disk_space_threshold_mb: Threshold in megabytes. Required.
Returns 204. For the free space of the disk read Status.