Create a mediаserver
Create a mediaserver
When creating a server, there are fields that are needed only for a certain type of media server. For media_server_v2 these are: storages
and token
{
"schema": "https",
"internal_domain": "host-name-3.vms.local",
"external_domain": "host-name-3.vms.local",
"internal": "8080",
"external": 8443,
"rtsp": "5554",
"type": "media_server_v2",
"proxy": "host-name-3.vms.local",
"group_type": "all",
"streams_limit": 100,
"bitrate_limit": 1000000,
"storages": [
"/storage"
],
"is_stream_condition_management_enabled": false,
"is_callback_enabled": false,
"onvif_events": "8887"
}
POST /api/admin/v1/servers |
Parameters
string
type, Server type
array
storages, Storage array
string
internal_domain, Address where the media server API will be accessed
string
external_domain, Address where clients will receive streams, screenshots and archives
int
internal, Internal port
int
external, External port
int
rtsp, Rtsp port
int
onvif_events, Port for proxying onvif events
string
proxy, Proxy address, only for flussonic, this is necessary so that only platform users can download the preview and archive
string
group_type, Group
int
streams_limit, Limit on the number of streams
int
bitrate_limit, Incoming traffic limit, Kbit/s
string
token, Token for accessing the media server.
string
schema, URL schema
bool
is_stream_condition_management_enabled, Do I need to enable the functionality?
bool
is_callback_enabled, Whether processing of callbacks from media servers is enabled.
200 |
Successful response
JSON
|
401 |
Authorization token not sent or not valid |
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,
"onvif_events": 0,
"proxy": "string",
"group_type": "string",
"streams_limit": 0,
"bitrate_limit": 0,
"token": "string",
"schema": "string",
"is_stream_condition_management_enabled": true,
"is_callback_enabled": true
}'
$data = array (
'type' => 'string',
'storages' =>
array (
),
'internal_domain' => 'string',
'external_domain' => 'string',
'internal' => 0,
'external' => 0,
'rtsp' => 0,
'onvif_events' => 0,
'proxy' => 'string',
'group_type' => 'string',
'streams_limit' => 0,
'bitrate_limit' => 0,
'token' => 'string',
'schema' => 'string',
'is_stream_condition_management_enabled' => true,
'is_callback_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);