Virtual Host
Get Virtual Host List
Request
GET /v1/vhosts
Header
Authorization: Basic {credentials}
# Authorization
Credentials for HTTP Basic Authentication created with <AccessToken>
Responses
200 Ok
The request has succeeded
Header
Content-Type: application/json
Body
{
"statusCode": 200,
"message": "OK",
"response": [
"default",
"service",
"poc"
]
}
# statusCode
Same as HTTP Status Code
# message
A human-readable description of the response code
# response
Json array containing a list of virtual host names
401 Unauthorized
Create Virtual Host
Request
POST /v1/vhosts
Header
Authorization: Basic {credentials}
# Authorization
Credentials for HTTP Basic Authentication created with <AccessToken>
Body
Configure virtual hosts to be created in Json array format.
[
{
"name": "vhost",
"host": {
"names": [
"ome-dev.ovenmedia.com",
"prod.ovenmedia.com"
],
"tls": {
"certPath": "/etc/pki/ovenmedia.com/_ovenmedia_com.crt",
"chainCertPath": "/etc/pki/ovenmedia.com/_ovenmedia_com.ca-bundle",
"keyPath": "/etc/pki/ovenmedia.com/_ovenmedia_com.key"
}
},
"signedPolicy": {
"enables": {
"providers": "rtmp,webrtc,srt",
"publishers": "webrtc,llhls"
},
"policyQueryKeyName": "policy",
"secretKey": "aKq#1kj",
"signatureQueryKeyName": "signature"
},
"admissionWebhooks": {
"controlServerUrl": "https://control.server/admission",
"enables": {
"providers": "rtmp,webrtc,srt",
"publishers": "webrtc,llhls"
},
"secretKey": "",
"timeout": 3000
},
"origins": {
"origin": [
{
"location": "/app/rtsp",
"pass": {
"scheme": "rtsp",
"urls": {
"url": [
"rtsp.server:8554/ca-01"
]
}
}
}
]
},
"originMapStore": {
"originHostName": "ome-dev.ovenmedia.com",
"redisServer": {
"auth": "!@#ovenmediaengine",
"host": "redis.server:6379"
}
},
"applications": [
{
"name": "*",
"type": "live",
"outputProfiles": {
"outputProfile": [
{
"name": "bypass",
"outputStreamName": "${OriginStreamName}",
"encodes": {
"videos": [
{
"name": "bypass_video",
"bypass": true
}
],
"audios": [
{
"name": "bypass_audio",
"bypass": true
}
]
}
}
]
},
"providers": {
"ovt": {}
},
"publishers": {
"llhls": {},
"webrtc": {}
}
}
]
},
{
"name": "vhost2",
"host": {
"names": [
"ovenmediaengine.com"
],
"tls": {
"certPath": "/etc/pki/ovenmediaengine.com/_ovenmediaengine_com.crt",
"chainCertPath": "/etc/pki/ovenmediaengine.com/_ovenmediaengine_com.ca-bundle",
"keyPath": "/etc/pki/ovenmediaengine.com/_ovenmediaengine_com.key"
}
}
}
]
# name (required)
The virtual host name. Cannot be duplicated.
# host (required)
## names (required)
The addresses(IP or Domain)of the host.
## tls (optional)
The certificate file path. Required if using TLS.
# signedPolicy (optional)
The SignedPolicy setting. Please refer to the manual for details.
# admissionWebhooks (optional)
The AdmissionWebhooks setting. Please refer to the manual for details.
# origins (optional)
The Origins setting. Please refer to the manual for details.
# originMapStore (optional)
The OriginMapStore setting. Please refer to the manual for details.
# applications (optional)
Applications to create together with the virtual host. Each entry has the same format as the body of POST /v1/vhosts/{vhost}/apps, but default values are not filled in here, so specify providers, publishers, and outputProfiles explicitly.
An entry named "*" is registered as the dynamic application template instead of an application, and the response returns it as dynamicApplicationTemplate. See the Origin-Edge Clustering chapter for details.
The template cannot be changed after the virtual host is created. Delete the virtual host and create it again to change the template.
Responses
200 Ok
The request has succeeded
Header
Content-Type: application/json
Body
It responds with Json array for each request.
[
{
"message": "OK",
"statusCode": 200,
"response": {
"name": "enterprise",
"host": {
"names": [
"ome-dev.ovenmedia.com",
"prod.ovenmedia.com"
],
"tls": {
"certPath": "/etc/pki/ovenmedia.com/_ovenmedia_com.crt",
"chainCertPath": "/etc/pki/ovenmedia.com/_ovenmedia_com.ca-bundle",
"keyPath": "/etc/pki/ovenmedia.com/_ovenmedia_com.key"
}
},
"signedPolicy": {
"enables": {
"providers": "rtmp,webrtc,srt",
"publishers": "webrtc,llhls"
},
"policyQueryKeyName": "policy",
"secretKey": "aKq#1kj",
"signatureQueryKeyName": "signature"
},
"admissionWebhooks": {
"controlServerUrl": "https://control.server/admission",
"enables": {
"providers": "rtmp,webrtc,srt",
"publishers": "webrtc,llhls"
},
"secretKey": "",
"timeout": 3000
},
"origins": {
"origin": [
{
"location": "/app/rtsp",
"pass": {
"scheme": "rtsp",
"urls": {
"url": [
"rtsp.server:8554/ca-01"
]
}
}
}
]
},
"originMapStore": {
"originHostName": "ome-dev.ovenmedia.com",
"redisServer": {
"auth": "!@#ovenmediaengine",
"host": "redis.server:6379"
}
},
"dynamicApplicationTemplate": {
"name": "*",
"type": "live",
"outputProfiles": {
"outputProfile": [
{
"name": "bypass",
"outputStreamName": "${OriginStreamName}",
"encodes": {
"videos": [
{
"name": "bypass_video",
"bypass": true
}
],
"audios": [
{
"name": "bypass_audio",
"bypass": true
}
]
}
}
]
},
"providers": {
"ovt": {}
},
"publishers": {
"llhls": {},
"webrtc": {}
}
}
}
},
{
"message": "OK",
"statusCode": 200,
"response": {
"name": "free",
"host": {
"names": [
"ovenmediaengine.com"
],
"tls": {
"certPath": "/etc/pki/ovenmediaengine.com/_ovenmediaengine_com.crt",
"chainCertPath": "/etc/pki/ovenmediaengine.com/_ovenmediaengine_com.ca-bundle",
"keyPath": "/etc/pki/ovenmediaengine.com/_ovenmediaengine_com.key"
}
}
}
}
]
# statusCode
Same as HTTP Status Code
# message
A human-readable description of the response code
# response
Created virtual host information. dynamicApplicationTemplate holds the dynamic application template ("*") when one is registered.
207 Multi-Status
There might be a mixture of responses.
Header
Content-Type: application/json
Body
It responds with Json array for each request.
[
{
"statusCode": 200,
"message": "OK",
"response": {
"name": "enterprise",
"host": {
"names": [
...
},
{
"statusCode": 409,
"message": "Conflict",
"response": {
...
}
}
}
# statusCode
Same as HTTP Status Code
# message
A human-readable description of the response code
# response
Virtual host information created when statusCode is 200
400 Bad Request
Invalid request. Body is not a Json array or does not have a required value
401 Unauthorized
409 Conflict
A virtual host with that name already exists
Get Virtual Host Information
Request
GET /v1/vhosts/{vhost}
Header
Authorization: Basic {credentials}
# Authorization
Credentials for HTTP Basic Authentication created with <AccessToken>
Responses
200 Ok
The request has succeeded
Header
Content-Type: application/json
Body
"message": "OK",
"statusCode": 200
"response": {
"name": "default",
"distribution": "ovenServer",
"host": {
"name": "default",
"distribution": "ovenServer",
"host": {
"names": [
"ome-dev.ovenmedia.com",
"*"
],
"tls": {
"certPath": "/etc/pki/ovenmedia.com/_ovenmedia_com.crt",
"chainCertPath": "/etc/pki/ovenmedia.com/_ovenmedia_com.ca-bundle",
"keyPath": "/etc/pki/ovenmedia.com/_ovenmedia_com.key"
}
},
"signedPolicy": {
"enables": {
"providers": "rtmp,webrtc,srt",
"publishers": "webrtc,llhls"
},
"policyQueryKeyName": "policy",
"secretKey": "aKq#1kj",
"signatureQueryKeyName": "signature"
},
"admissionWebhooks": {
"controlServerUrl": "https://control.server/admission",
"enables": {
"providers": "rtmp,webrtc,srt",
"publishers": "webrtc,llhls"
},
"secretKey": "",
"timeout": 3000
},
"origins": {
"origin": [
{
"location": "/app/rtsp",
"pass": {
"scheme": "rtsp",
"urls": {
"url": [
"rtsp.server:8554/ca-01"
]
}
}
}
]
},
"originMapStore": {
"originHostName": "ome-dev.ovenmedia.com",
"redisServer": {
"auth": "!@#ovenmediaengine",
"host": "redis.server:6379"
}
},
"dynamicApplicationTemplate": {
"name": "*",
"type": "live",
"outputProfiles": {
"outputProfile": [
{
"name": "bypass",
"outputStreamName": "${OriginStreamName}",
"encodes": {
"videos": [
{
"name": "bypass_video",
"bypass": true
}
],
"audios": [
{
"name": "bypass_audio",
"bypass": true
}
]
}
}
]
},
"providers": {
"ovt": {}
},
"publishers": {
"llhls": {},
"webrtc": {}
}
}
}
# statusCode
Same as HTTP Status Code
# message
A human-readable description of the response code
# response
Virtual host information. dynamicApplicationTemplate holds the dynamic application template ("*") when one is registered. Use GET /v1/vhosts/{vhost}/apps to list the applications.
401 Unauthorized
404 Not Found
The given vhost name could not be found.
Body
{
"message": "[HTTP] Could not find the virtual host: [default1] (404)",
"statusCode": 404
}
Delete Virtual Host
Request
DELETE /v1/vhosts/{vhost}
Header
Authorization: Basic {credentials}
# Authorization
Credentials for HTTP Basic Authentication created with <AccessToken>
Responses
200 Ok
401 Unauthorized
404 Not Found
The given vhost name could not be found.
Body
{
"message": "[HTTP] Could not find the virtual host: [default1] (404)",
"statusCode": 404
}
500 Internal Server Error
The request failed due to an error on the server. Check the server log for the reason of the error.
Body
{
"message": "[HTTP] Internal Server Error (500)",
"statusCode": 500
}