mediamtx/apidocs/openapi.yaml

568 lines
13 KiB
YAML
Raw Normal View History

2021-08-07 16:28:27 +00:00
openapi: 3.0.0
info:
version: 1.0.0
title: rtsp-simple-server API
2021-09-06 15:51:08 +00:00
description: API of rtsp-simple-server, a server and proxy that supports various protocols.
2021-08-07 16:28:27 +00:00
license:
name: MIT
url: https://opensource.org/licenses/MIT
servers:
2021-08-07 17:08:07 +00:00
- url: http://localhost:9997
2021-08-07 16:28:27 +00:00
components:
schemas:
Conf:
type: object
properties:
# general
logLevel:
type: string
logDestinations:
type: array
items:
type: string
logFile:
type: string
readTimeout:
type: string
2021-08-07 16:28:27 +00:00
writeTimeout:
type: string
2021-08-07 16:28:27 +00:00
readBufferCount:
type: integer
api:
type: boolean
apiAddress:
type: string
metrics:
type: boolean
metricsAddress:
type: string
pprof:
type: boolean
pprofAddress:
type: string
runOnConnect:
type: string
runOnConnectRestart:
type: boolean
# rtsp
rtspDisable:
type: boolean
protocols:
type: array
items:
type: string
encryption:
type: string
rtspAddress:
type: string
rtspsAddress:
type: string
rtpAddress:
type: string
rtcpAddress:
type: string
multicastIPRange:
type: string
multicastRTPPort:
type: integer
multicastRTCPPort:
type: integer
serverKey:
type: string
serverCert:
type: string
authMethods:
type: array
items:
type: string
readBufferSize:
type: integer
# rtmp
rtmpDisable:
type: boolean
rtmpAddress:
type: string
# hls
hlsDisable:
type: boolean
hlsAddress:
type: string
hlsAlwaysRemux:
type: boolean
hlsSegmentCount:
type: integer
hlsSegmentDuration:
type: string
2021-08-07 16:28:27 +00:00
hlsAllowOrigin:
type: string
paths:
type: object
additionalProperties:
$ref: '#/components/schemas/PathConf'
PathConf:
type: object
properties:
# source
source:
type: string
sourceProtocol:
type: string
sourceAnyPortEnable:
type: boolean
sourceFingerprint:
type: string
sourceOnDemand:
type: boolean
sourceOnDemandStartTimeout:
type: string
2021-08-07 16:28:27 +00:00
sourceOnDemandCloseAfter:
type: string
2021-08-07 16:28:27 +00:00
sourceRedirect:
type: string
disablePublisherOverride:
type: boolean
fallback:
type: string
# authentication
publishUser:
type: string
publishPass:
type: string
publishIPs:
type: array
items:
type: string
readUser:
type: string
readPass:
type: string
readIPs:
type: array
items:
type: string
# custom commands
runOnInit:
type: string
runOnInitRestart:
type: boolean
runOnDemand:
type: string
runOnDemandRestart:
type: boolean
runOnDemandStartTimeout:
type: string
2021-08-07 16:28:27 +00:00
runOnDemandCloseAfter:
type: string
2021-08-07 16:28:27 +00:00
runOnPublish:
type: string
runOnPublishRestart:
type: boolean
runOnRead:
type: string
runOnReadRestart:
type: boolean
Path:
type: object
properties:
confName:
type: string
conf:
$ref: '#/components/schemas/PathConf'
source:
oneOf:
2021-08-07 17:03:07 +00:00
- $ref: '#/components/schemas/PathSourceRTSPSession'
- $ref: '#/components/schemas/PathSourceRTSPSSession'
2021-08-07 17:03:07 +00:00
- $ref: '#/components/schemas/PathSourceRTMPConn'
2021-08-20 08:12:25 +00:00
- $ref: '#/components/schemas/PathSourceRTSPSource'
- $ref: '#/components/schemas/PathSourceRTMPSource'
2021-08-07 16:28:27 +00:00
sourceReady:
type: boolean
readers:
type: array
items:
oneOf:
2021-08-07 17:03:07 +00:00
- $ref: '#/components/schemas/PathReaderRTSPSession'
- $ref: '#/components/schemas/PathReaderRTSPSSession'
2021-08-07 17:03:07 +00:00
- $ref: '#/components/schemas/PathReaderRTMPConn'
- $ref: '#/components/schemas/PathReaderHLSMuxer'
PathSourceRTSPSession:
type: object
properties:
type:
type: string
2021-08-20 08:13:41 +00:00
enum: [rtspSession]
2021-08-07 17:03:07 +00:00
id:
type: string
PathSourceRTSPSSession:
type: object
properties:
type:
type: string
2021-08-20 08:13:41 +00:00
enum: [rtspsSession]
id:
type: string
2021-08-07 17:03:07 +00:00
PathSourceRTMPConn:
type: object
properties:
type:
type: string
2021-08-20 08:13:41 +00:00
enum: [rtmpConn]
2021-08-07 17:03:07 +00:00
id:
type: string
2021-08-20 08:12:25 +00:00
PathSourceRTSPSource:
type: object
properties:
type:
type: string
enum: [rtspSource]
PathSourceRTMPSource:
type: object
properties:
type:
type: string
enum: [rtmpSource]
2021-08-07 17:03:07 +00:00
PathReaderRTSPSession:
type: object
properties:
type:
type: string
2021-08-20 08:13:41 +00:00
enum: [rtspSession]
2021-08-07 17:03:07 +00:00
id:
type: string
PathReaderRTSPSSession:
type: object
properties:
type:
type: string
2021-08-20 08:13:41 +00:00
enum: [rtspsSession]
id:
type: string
2021-08-07 17:03:07 +00:00
PathReaderRTMPConn:
type: object
properties:
type:
type: string
2021-08-20 08:13:41 +00:00
enum: [rtmpConn]
2021-08-07 17:03:07 +00:00
id:
type: string
PathReaderHLSMuxer:
type: object
properties:
type:
type: string
2021-08-18 13:49:12 +00:00
enum: [hlsMuxer]
2021-08-07 16:28:27 +00:00
RTSPSession:
type: object
properties:
remoteAddr:
type: string
state:
type: string
enum: [idle, read, publish]
2021-08-07 16:28:27 +00:00
RTSPSSession:
type: object
properties:
remoteAddr:
type: string
state:
type: string
enum: [idle, read, publish]
2021-08-07 16:28:27 +00:00
RTMPConn:
type: object
properties:
remoteAddr:
type: string
state:
type: string
enum: [idle, read, publish]
2021-08-07 16:28:27 +00:00
PathsList:
type: object
properties:
items:
type: object
additionalProperties:
$ref: '#/components/schemas/Path'
RTSPSessionsList:
type: object
properties:
items:
type: object
additionalProperties:
$ref: '#/components/schemas/RTSPSession'
RTSPSSessionsList:
type: object
properties:
items:
type: object
additionalProperties:
$ref: '#/components/schemas/RTSPSSession'
RTMPConnsList:
type: object
properties:
items:
type: object
additionalProperties:
$ref: '#/components/schemas/RTMPConn'
2021-08-07 16:28:27 +00:00
paths:
2021-08-07 17:08:07 +00:00
/v1/config/get:
2021-08-07 16:28:27 +00:00
get:
operationId: configGet
summary: returns the configuration.
2021-08-07 16:28:27 +00:00
description: ''
responses:
'200':
description: the request was successful.
content:
application/json:
schema:
$ref: '#/components/schemas/Conf'
'500':
description: internal server error.
2021-08-07 17:08:07 +00:00
/v1/config/set:
2021-08-07 16:28:27 +00:00
post:
operationId: configSet
summary: changes the configuration.
2021-10-06 11:33:35 +00:00
description: all fields are optional. paths can't be edited with this request, use /v1/config/paths/{operation}/{name} to edit them.
2021-08-07 17:03:07 +00:00
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Conf'
2021-08-07 16:28:27 +00:00
responses:
'200':
description: the request was successful.
'400':
description: invalid request.
'500':
description: internal server error.
2021-08-07 17:08:07 +00:00
/v1/config/paths/add/{name}:
2021-08-07 16:28:27 +00:00
post:
operationId: configPathsAdd
summary: adds the configuration of a path.
2021-08-07 17:03:07 +00:00
description: all fields are optional.
2021-08-07 16:28:27 +00:00
parameters:
- name: name
in: path
required: true
description: the name of the path.
schema:
type: string
2021-08-07 17:03:07 +00:00
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PathConf'
2021-08-07 16:28:27 +00:00
responses:
'200':
description: the request was successful.
'400':
description: invalid request.
'500':
description: internal server error.
2021-08-07 17:08:07 +00:00
/v1/config/paths/edit/{name}:
2021-08-07 16:28:27 +00:00
post:
operationId: configPathsEdit
summary: changes the configuration of a path.
2021-08-07 17:03:07 +00:00
description: all fields are optional.
2021-08-07 16:28:27 +00:00
parameters:
- name: name
in: path
required: true
description: the name of the path.
schema:
type: string
2021-08-07 17:03:07 +00:00
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PathConf'
2021-08-07 16:28:27 +00:00
responses:
'200':
description: the request was successful.
'400':
description: invalid request.
'500':
description: internal server error.
2021-08-07 17:08:07 +00:00
/v1/config/paths/remove/{name}:
2021-08-07 16:28:27 +00:00
post:
operationId: configPathsRemove
summary: removes the configuration of a path.
description: ''
parameters:
- name: name
in: path
required: true
description: the name of the path.
schema:
type: string
responses:
'200':
description: the request was successful.
'400':
description: invalid request.
'500':
description: internal server error.
2021-08-07 17:08:07 +00:00
/v1/paths/list:
2021-08-07 16:28:27 +00:00
get:
operationId: pathsList
summary: returns all active paths.
description: ''
responses:
'200':
description: the request was successful.
content:
application/json:
schema:
$ref: '#/components/schemas/PathsList'
2021-08-07 16:28:27 +00:00
'400':
description: invalid request.
'500':
description: internal server error.
2021-08-07 17:08:07 +00:00
/v1/rtspsessions/list:
2021-08-07 16:28:27 +00:00
get:
operationId: rtspSessionsList
summary: returns all active RTSP sessions.
description: ''
responses:
'200':
description: the request was successful.
content:
application/json:
schema:
$ref: '#/components/schemas/RTSPSessionsList'
2021-08-07 16:28:27 +00:00
'400':
description: invalid request.
'500':
description: internal server error.
2021-08-07 17:08:07 +00:00
/v1/rtspsessions/kick/{id}:
2021-08-07 16:28:27 +00:00
post:
operationId: rtspSessionsKick
summary: kicks out a RTSP session from the server.
description: ''
parameters:
- name: id
in: path
required: true
description: the ID of the session.
schema:
type: string
responses:
'200':
description: the request was successful.
'400':
description: invalid request.
'500':
description: internal server error.
/v1/rtspssessions/list:
get:
operationId: rtspsSessionsList
summary: returns all active RTSPS sessions.
description: ''
responses:
'200':
description: the request was successful.
content:
application/json:
schema:
$ref: '#/components/schemas/RTSPSSessionsList'
'400':
description: invalid request.
'500':
description: internal server error.
/v1/rtspssessions/kick/{id}:
post:
operationId: rtspsSessionsKick
summary: kicks out a RTSPS session from the server.
description: ''
parameters:
- name: id
in: path
required: true
description: the ID of the session.
schema:
type: string
responses:
'200':
description: the request was successful.
'400':
description: invalid request.
'500':
description: internal server error.
2021-08-07 17:08:07 +00:00
/v1/rtmpconns/list:
2021-08-07 16:28:27 +00:00
get:
operationId: rtmpConnsList
summary: returns all active RTMP connections.
description: ''
responses:
'200':
description: the request was successful.
content:
application/json:
schema:
$ref: '#/components/schemas/RTMPConnsList'
2021-08-07 16:28:27 +00:00
'400':
description: invalid request.
'500':
description: internal server error.
2021-08-07 17:08:07 +00:00
/v1/rtmpconns/kick/{id}:
2021-08-07 16:28:27 +00:00
post:
operationId: rtmpConnsKick
summary: kicks out a RTMP connection from the server.
description: ''
parameters:
- name: id
in: path
required: true
description: the ID of the connection.
schema:
type: string
responses:
'200':
description: the request was successful.
'400':
description: invalid request.
'500':
description: internal server error.