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.
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 |
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/{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
}'
$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);