Skip to main content

Virtual Host

Get Virtual Host List

Request

GET /v1/vhosts
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

Authentication required

Header

WWW-Authenticate: Basic realm=”OvenMediaEngine”

Body

{
"message": "[HTTP] Authorization header is required to call API (401)",
"statusCode": 401
}

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.ovenmedialabs.com",
"prod.ovenmedialabs.com"
],
"tls": {
"certPath": "/etc/pki/ovenmedialabs.com/_ovenmedialabs_com.crt",
"chainCertPath": "/etc/pki/ovenmedialabs.com/_ovenmedialabs_com.ca-bundle",
"keyPath": "/etc/pki/ovenmedialabs.com/_ovenmedialabs_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.ovenmedialabs.com",
"redisServer": {
"auth": "!@#ovenmediaengine",
"host": "redis.server:6379"
}
}
},
{
"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.

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.ovenmedialabs.com",
"prod.ovenmedialabs.com"
],
"tls": {
"certPath": "/etc/pki/ovenmedialabs.com/_ovenmedialabs_com.crt",
"chainCertPath": "/etc/pki/ovenmedialabs.com/_ovenmedialabs_com.ca-bundle",
"keyPath": "/etc/pki/ovenmedialabs.com/_ovenmedialabs_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.ovenmedialabs.com",
"redisServer": {
"auth": "!@#ovenmediaengine",
"host": "redis.server:6379"
}
}
}
},
{
"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
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

Authentication required

Header

WWW-Authenticate: Basic realm=”OvenMediaEngine”

Body

{
"message": "[HTTP] Authorization header is required to call API (401)",
"statusCode": 401
}
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.ovenmedialabs.com",
"*"
],
"tls": {
"certPath": "/etc/pki/ovenmedialabs.com/_ovenmedialabs_com.crt",
"chainCertPath": "/etc/pki/ovenmedialabs.com/_ovenmedialabs_com.ca-bundle",
"keyPath": "/etc/pki/ovenmedialabs.com/_ovenmedialabs_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.ovenmedialabs.com",
"redisServer": {
"auth": "!@#ovenmediaengine",
"host": "redis.server:6379"
}
}
}

# statusCode
Same as HTTP Status Code
# message
A human-readable description of the response code
# response
Virtual host information
401 Unauthorized

Authentication required

Header

WWW-Authenticate: Basic realm=”OvenMediaEngine”

Body

{
"message": "[HTTP] Authorization header is required to call API (401)",
"statusCode": 401
}
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

The request has succeeded

Header

Content-Type: application/json

Body

{
"message": "OK",
"statusCode": 200
}

# statusCode
Same as HTTP Status Code
# message
A human-readable description of the response code
401 Unauthorized

Authentication required

Header

WWW-Authenticate: Basic realm=”OvenMediaEngine”

Body

{
"message": "[HTTP] Authorization header is required to call API (401)",
"statusCode": 401
}
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
}