Skip to main content
Skip table of contents

Media server update

Media server update

Media servers have fields that are specific to certain types of media servers.

For media_server_v2, these fields are: storages and token.

For flussonic, this 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. The token will only be changed if sent in the request.

CODE
If there are streams on the server, only the following fields can be changed:
is_enabled,
streams_limit,
bitrate_limit,
schema,
is_stream_condition_management_enabled,
is_need_to_enable_disabled_streams

If other fields are sent, they will be ignored.

PUT /api/admin/v1/servers/{server}

Method parameters

int server, unique identifier of the media server


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 internal, internal port


int external, external port


int rtsp, RTSP port


bool is_enabled, enable distribution


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


string group_type, group


int streams_limit, limit of the number of streams


int bitrate_limit, incoming traffic limit in Kbps


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


string schema, URL schema


bool is_stream_condition_management_enabled, whether to enable the functionality


bool is_need_to_enable_disabled_streams, whether to enable disabled streams associated with this media server.

It will be processed if is_stream_condition_management_enabled is changed from true to false and there are streams associated with the media server.

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/{server}' \
	--header 'Content-Type: application/json' \
	--header 'Accept: application/json' \
	--data '{
    "server": 0,
    "type": "string",
    "storages": [],
    "internal_domain": "string",
    "external_domain": "string",
    "internal": 0,
    "external": 0,
    "rtsp": 0,
    "is_enabled": true,
    "proxy": "string",
    "group_type": "string",
    "streams_limit": 0,
    "bitrate_limit": 0,
    "token": "string",
    "schema": "string",
    "is_stream_condition_management_enabled": true,
    "is_need_to_enable_disabled_streams": true
}'
PHP
PHP
$data = array (
  'server' => 0,
  'type' => 'string',
  'storages' => 
  array (
  ),
  'internal_domain' => 'string',
  'external_domain' => 'string',
  'internal' => 0,
  'external' => 0,
  'rtsp' => 0,
  'is_enabled' => true,
  'proxy' => 'string',
  'group_type' => 'string',
  'streams_limit' => 0,
  'bitrate_limit' => 0,
  'token' => 'string',
  'schema' => 'string',
  'is_stream_condition_management_enabled' => true,
  'is_need_to_enable_disabled_streams' => true,
);
$context = stream_context_create([
	'ssl'=>['verify_peer' => false],
	'http' => [
		'method' => 'PUT',
		'header' => "Content-Type: application/json\r
Accept: application/json",
		'content'=>json_encode($data)
	]
]);
$result = file_get_contents('https://your-domain/api/admin/v1/servers/{server}', false, $context);
JavaScript errors detected

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

If this problem persists, please contact our support.