Skip to main content
Skip table of contents

Create a media server

Create a media server

When creating a server, there are fields that are specific to certain types of media servers.

For media_server_v2, these fields are: storages and token.

For flussonic, the field is: proxy.

The field has_cache is only for flussonic (it will be null for other media servers). It is not set via the API but receives data from the media server.

POST /api/admin/v1/servers

Method parameters

string type, server type


array storages, array of storages


string internal_domain, address for accessing the media server API


string external_domain, address for clients to receive streams, screenshots, and archives


int internal, internal port


int external, external port


int rtsp, RTSP port


string proxy, proxy address, only for flussonic. It allows downloading previews and archives only for platform users


string group_type, group


int streams_limit, limit of the number of streams


int bitrate_limit, limit of incoming traffic, in Kbps


string token, token for accessing the media server. Mandatory for servers with type media_server_v2


string schema, URL schema


bool is_stream_condition_management_enabled, whether to enable stream condition management functionality

200 OK

Successful response

JSON
{
    "id": 3,
    "type": "media_server_v2",
    "schema": "https",
    "internal_domain": "host-name-3.vms.local",
    "external_domain": "host-name-3.vms.local",
    "domain": "host-name-3.vms.local",
    "internal": "8080",
    "external": "8443",
    "rtsp": "5554",
    "traffic_in": 1960,
    "traffic_out": 0,
    "status": true,
    "is_enabled": true,
    "has_cache": false,
    "proxy": "host-name-3.vms.local",
    "created_at": "2022-12-06 20:20:50",
    "updated_at": "2022-12-26 14:19:43",
    "group_type": "all",
    "can_delete": false,
    "streams_limit": 100,
    "bitrate_limit": 1000000,
    "extra": {
        "io": {
            "read_rate": 0,
            "read_bytes": 0,
            "write_rate": 0,
            "write_bytes": 0
        },
        "cpu": {
            "total": 33,
            "usage": 3,
            "stime_sec": 3531,
            "utime_sec": 3531
        },
        "mem": {
            "rss": 89370624,
            "share": 9932800,
            "usage": 2443603968
        },
        "net": {
            "in_bitrate": 2006784,
            "out_bitrate": 0
        },
        "drives": {
            "/": {
                "fs": "ext4",
                "mount": "/",
                "inode_free": 1479423,
                "inode_total": 1605632,
                "capacity_free": 18977148928,
                "capacity_total": 25713446912
            },
            "/boot": {
                "fs": "ext4",
                "mount": "/boot",
                "inode_free": 65220,
                "inode_total": 65536,
                "capacity_free": 806346752,
                "capacity_total": 1020702720
            },
            "/storage": {
                "fs": "ext4",
                "mount": "/storage",
                "inode_free": 32767681,
                "inode_total": 32768000,
                "capacity_free": 518499958784,
                "capacity_total": 527298822144
            }
        },
        "server": {
            "ip4": "192.168.200.17",
            "name": "MS-21.03.3-lts-rc-3",
            "build": "caeb03b",
            "uptime": 247945,
            "startat": 1670595943,
            "version": "21.03.3",
            "hostname": "host-name-3.vms.local",
            "revision": "lts-rc-3",
            "timestamp": "20221129093237"
        },
        "cluster": {
            "id": "2",
            "node": "5",
            "enable": "true",
            "hostname": "host-name-3.vms.local"
        },
        "license": {
            "type": "enterprise",
            "issued": 4102433999
        },
        "streams": {
            "total": 18,
            "active": 2,
            "clients": 0
        },
        "storages": {
            "/storage": {
                "fs": "",
                "err": 0,
                "name": "default",
                "mount": "/storage",
                "inode_free": 32767681,
                "inode_total": 32768000,
                "capacity_free": 518499958784,
                "capacity_total": 527298822144
            }
        }
    },
    "storages": [
        {
            "id": 3,
            "server_id": 3,
            "path": "/storage",
            "usage": "1.669",
            "is_confirmed": 1,
            "can_delete": false,
            "created_at": "2022-12-06 20:20:50",
            "updated_at": "2022-12-12 14:18:08"
        }
    ],
    "cluster": {
        "id": 4,
        "name": "cluster 2",
        "type": "main_secondary",
        "internal": null,
        "external": null,
        "rtsp": null,
        "streams_limit": null,
        "bitrate_limit": null,
        "created_at": "2022-12-16 10:25:53",
        "updated_at": "2022-12-16 10:25:53",
        "pack": null
    },
    "is_editable": true,
    "is_stream_condition_management_enabled": false,
    "is_have_incorrect_cameras": true
}

401 Unauthorized

Authorization token is not provided or is invalid. Obtaining a token

cURL
BASH
curl -k --request POST \
	--url 'https://your-domain/api/admin/v1/servers' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '{
    "type": "string",
    "storages": [],
    "internal_domain": "string",
    "external_domain": "string",
    "internal": 0,
    "external": 0,
    "rtsp": 0,
    "proxy": "string",
    "group_type": "string",
    "streams_limit": 0,
    "bitrate_limit": 0,
    "token": "string",
    "schema": "string",
    "is_stream_condition_management_enabled": true
}'
PHP
PHP
$data = array (
  'type' => 'string',
  'storages' => 
  array (
  ),
  'internal_domain' => 'string',
  'external_domain' => 'string',
  'internal' => 0,
  'external' => 0,
  'rtsp' => 0,
  'proxy' => 'string',
  'group_type' => 'string',
  'streams_limit' => 0,
  'bitrate_limit' => 0,
  'token' => 'string',
  'schema' => 'string',
  'is_stream_condition_management_enabled' => true,
);
$context = stream_context_create([
	'ssl'=>['verify_peer' => false],
	'http' => [
		'method' => 'POST',
		'header' => "Content-Type: application/json\r
Accept: application/json",
		'content'=>json_encode($data)
	]
]);
$result = file_get_contents('https://your-domain/api/admin/v1/servers', false, $context);
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.