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 |
Successful response
JSON
|
401 |
Authorization token is not provided or is invalid. Obtaining a token |
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
}'
$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);