Developer_release_1.4.0
Class mint.rest.backoffice.api
MPA1000 HTTP API.
# Overview
MPA1000 HTTP API is hosted by an embedded web server and provides
access to device functionality via HTTP calls. It also has a WebSocket which notifies
a client about updates.
The API is divided into following parts:
* **/mpa1000** - general information about the device and its configuration
* **/nmos-wrappers** - NMOS-related functionality wrappers used for connection management
* **/web-gui** - temporary kludge for Web GUI sign-in system
* **/ws** - WebSocket for tracking updates
* **/app** - A REST bridge to Lua applications
# Error handling
This API extensively uses various HTTP codes to respond with an error. Each operation has
a list of possible errors, but 500 is considered as a general error which may be returned
as a result of any operation.
Functions
Methods
mint.rest.backoffice.api:oem_messages (parameters) | Get Lua apps web messages. |
Functions
Methods- api.mpa1000.edid:get_binary (parameters)
-
Download EDID of an HDMI Sink as binary.
Returns an EDID file retrieved from an HDMI Sink currently connected to the Decoder.
Parameters:
- parameters table Parameters
Returns:
-
mint.console_friendly_binary
(status 200) Successful operation
Or
-
table
(status 404) EDID binary wasn't found. Probably, there is no connected HDMI Sink
result.error
: (table)result.error.code
: (number/integer) Code of the error.result.error.detail
: (string) Any information useful for further debug.result.error.type
: (string) Status information.
Example:
{ error = { code = 404, type = "Not found" }; }
Or
-
table
(status 501) Device type is Encoder
result.error
: (table)result.error.code
: (number/integer) Code of the error.result.error.detail
: (string) Any information useful for further debug.result.error.type
: (string) Status information.
Example:
{ error = { code = 501, type = "Not implemented" }; }
Usage:
result = api.mpa1000.edid:get_binary()
- api.mpa1000.edid:get_json (parameters)
-
Get EDID of an HDMI Sink as JSON.
Returns EDID file content retrieved from an HDMI Sink currently connected to the Decoder.
Parameters:
- parameters table Parameters
Returns:
-
table
(status 200) Successful operation
result.cea_ext_timings
: (array)result.detailed_timings
: (array)result.display_type
: (string) Digital display type in terms of supported subsampling modes. Possible values:{"RGB 4:4:4","RGB 4:4:4 + YUV 4:4:4","RGB 4:4:4 + YUV 4:2:2","RGB 4:4:4 + YUV 4:4:4 + YUV 4:2:2"}
.result.established_timings
: (array)result.gamma
: (number) Display gamma (range 1.00-3.54).result.manufacture_week
: (number/integer)result.manufacture_year
: (number/integer)result.manufacturer
: (string)result.screen_size
: (table)result.screen_size.height
: (number/integer) Vertical screen size, in centimetres.result.screen_size.width
: (number/integer) Horizontal screen size, in centimetres.result.standard_timings
: (array)result.version
: (string) Possible values:{"1.3","1.4"}
.
Example:
{ cea_ext_timings = { { frame_rate = 60, height = 1080, width = 1920 }; { frame_rate = 60, height = 720, width = 1280 }; { frame_rate = 50, height = 1080, width = 1920 }; { frame_rate = 50, height = 720, width = 1280 }; { frame_rate = 60, height = 480, width = 720 }; { frame_rate = 50, height = 576, width = 720 }; }; detailed_timings = { { frame_rate = 60, height = 1080, width = 1920 }; { frame_rate = 60, height = 720, width = 1280 }; }; display_type = "RGB 4:4:4 + YUV 4:4:4"; established_timings = { { frame_rate = 70, height = 400, width = 720 }; { frame_rate = 60, height = 480, width = 640 }; { frame_rate = 67, height = 480, width = 640 }; { frame_rate = 72, height = 480, width = 640 }; { frame_rate = 75, height = 480, width = 640 }; { frame_rate = 56, height = 600, width = 800 }; { frame_rate = 60, height = 600, width = 800 }; { frame_rate = 72, height = 600, width = 800 }; { frame_rate = 75, height = 600, width = 800 }; { frame_rate = 75, height = 624, width = 832 }; { frame_rate = 60, height = 768, width = 1024 }; { frame_rate = 70, height = 768, width = 1024 }; { frame_rate = 75, height = 768, width = 1024 }; { frame_rate = 75, height = 1024, width = 1280 }; { frame_rate = 75, height = 870, width = 1152 }; }; gamma = 2.2; manufacture_week = 19; manufacture_year = 2018; manufacturer = "SAM Model b43"; screen_size = { height = 30, width = 53 }; standard_timings = { { frame_rate = 75, height = 864, width = 1152 }; { frame_rate = 60, height = 720, width = 1280 }; { frame_rate = 60, height = 800, width = 1280 }; { frame_rate = 60, height = 1024, width = 1280 }; { frame_rate = 60, height = 900, width = 1440 }; { frame_rate = 60, height = 900, width = 1600 }; { frame_rate = 60, height = 1050, width = 1680 }; }; version = "1.3"; }
Or
-
table
(status 404) EDID binary wasn't found. Probably, there is no connected HDMI Sink
result.error
: (table)result.error.code
: (number/integer) Code of the error.result.error.detail
: (string) Any information useful for further debug.result.error.type
: (string) Status information.
Example:
{ error = { code = 404, type = "Not found" }; }
Or
-
table
(status 501) Device type is Encoder
result.error
: (table)result.error.code
: (number/integer) Code of the error.result.error.detail
: (string) Any information useful for further debug.result.error.type
: (string) Status information.
Example:
{ error = { code = 501, type = "Not implemented" }; }
Usage:
result = api.mpa1000.edid:get_json()
- api.mpa1000.infoframe:get_audio (parameters)
-
Get Audio InfoFrame.
Get the last Audio InfoFrame received from an HDMI Source (Encoder only).
Parameters:
- parameters table Parameters
Returns:
-
table
(status 200) Successful operation
result.channel_allocation
: (table) Mapping between channel numbers and speaker positions.result.channel_allocation.1
: (string) Possible values:{"FL"}
.result.channel_allocation.2
: (string) Possible values:{"FR"}
.result.channel_allocation.3
: (string) Possible values:{"LFE"}
.result.channel_allocation.4
: (string) Possible values:{"FC"}
.result.channel_allocation.5
: (string) Possible values:{"RC","RL"}
.result.channel_allocation.6
: (string) Possible values:{"RR"}
.result.channel_allocation.7
: (string) Possible values:{"FLC","RLC","RC","FCH","FLH","FLW"}
.result.channel_allocation.8
: (string) Possible values:{"FRC","RRC","TC","FRH","FRW","FCH"}
.result.channel_count
: (number/integer) Maximum:8
.result.coding_type
: (string) Possible values:{"PCM","AC3","MPEG1","MP3","MPEG2","AAC","DTS","ATRAC","One-bit audio","Dolby Digital Plus","DTS HD","MAT","DST","WMA Pro"}
.result.downmix_inhibit
: (boolean) The key is present only if downmixing is prohibited. Possible values:{true}
.result.level_shift_value
: (number/integer) Minimum:0
. Maximum:15
.result.lfe_playback_level
: (number/integer) Low-frequency effect playback level. Possible values:{0,10}
.result.sample_frequency
: (number) Sample frequency in kHz. Possible values:{32,44.100000000000001,48,88.200000000000003,96,176.40000000000001,192}
.result.sample_size
: (number/integer) Sample size in bits. Possible values:{16,20,24}
.result.version
: (number/integer) Audio Infoframe version.
Example:
{ channel_allocation = { ["1"] = "FL", ["2"] = "FR", ["3"] = "LFE" }; channel_count = 3; coding_type = "PCM"; downmix_inhibit = true; level_shift_value = 0; lfe_playback_level = 0; sample_frequency = 32; sample_size = 16; version = 1; }
Or
-
table
(status 404) Audio InfoFrame wasn't found. Probably, there is no connected HDMI Source.
result.error
: (table)result.error.code
: (number/integer) Code of the error.result.error.detail
: (string) Any information useful for further debug.result.error.type
: (string) Status information.
Example:
{ error = { code = 404, type = "Not found" }; }
Or
-
table
(status 501) Device type is Decoder
result.error
: (table)result.error.code
: (number/integer) Code of the error.result.error.detail
: (string) Any information useful for further debug.result.error.type
: (string) Status information.
Example:
{ error = { code = 501, type = "Not implemented" }; }
Usage:
result = api.mpa1000.infoframe:get_audio()
- api.mpa1000.infoframe:get_video (parameters)
-
Get AVI InfoFrame.
Get the last AVI InfoFrame received from an HDMI Source (Encoder only).
Parameters:
- parameters table Parameters
Returns:
-
table
(status 200) Successful operation
result.active_aspect_ratio
: (string) Possible values:{"16:9 Top","14:9 Top","16:9 Center","Picture","4:3","16:9","14:9","4:3 SP 14:9","16:9 SP 14:9","16:9 SP 4:3"}
.result.bottom_bar
: (number/integer) Line number of Start of Bottom Bar.result.colorimetry
: (string) Possible values:{"ITU-R BT.601","ITU-R BT.709","YCC601","YCC709","sYCC601","Adobe YCC601","Adobe RGB"}
.result.colorspace
: (string) Possible values:{"RGB","YUV422","YUV444","YUV420"}
.result.content_type
: (string) Possible values:{"Graphics","Photo","Cinema","Game"}
.result.left_bar
: (number/integer) Line number of End of Left Bar.result.non_uniform_picture_scaling
: (string) Possible values:{"Horizontal","Vertical","Vertical and Horizontal"}
.result.pic_aspect_ratio
: (string) Possible values:{"4:3","16:9"}
.result.pixel_repetition
: (number/integer) Pixel Repetition factor (how many times pixels are sent). Minimum:1
. Maximum:10
.result.rgb_quantization_range
: (string) Possible values:{"Default","Limited","Full"}
.result.right_bar
: (number/integer) Line number of Start of Right Bar.result.scan_info
: (string) Possible values:{"Overscan","Underscan"}
.result.top_bar
: (number/integer) Line number of End of Top Bar.result.version
: (number/integer) AVI Infoframe version.result.vic
: (number/integer) Video Format Identification code.result.ycc_quantization_range
: (string) Possible values:{"Limited","Full"}
.
Example:
{ active_aspect_ratio = "16:9 Top"; bottom_bar = 485; colorimetry = "ITU-R BT.601"; colorspace = "RGB"; content_type = "Graphics"; left_bar = 20; non_uniform_picture_scaling = "Horizontal"; pic_aspect_ratio = "4:3"; pixel_repetition = 2; rgb_quantization_range = "Default"; right_bar = 730; scan_info = "Overscan"; top_bar = 15; version = 3; vic = 50; }
Or
-
table
(status 404) AVI InfoFrame wasn't found. Probably, there is no connected HDMI Source.
result.error
: (table)result.error.code
: (number/integer) Code of the error.result.error.detail
: (string) Any information useful for further debug.result.error.type
: (string) Status information.
Example:
{ error = { code = 404, type = "Not found" }; }
Or
-
table
(status 501) Device type is Decoder
result.error
: (table)result.error.code
: (number/integer) Code of the error.result.error.detail
: (string) Any information useful for further debug.result.error.type
: (string) Status information.
Example:
{ error = { code = 501, type = "Not implemented" }; }
Usage:
result = api.mpa1000.infoframe:get_video()
- api.mpa1000.logs:delete_csv (parameters)
-
Clear logs.
Clears the log file.
Parameters:
- parameters table Parameters
Returns:
-
table
(status 204) Successful operation
Example:
{ }
Or
-
table
(status 404) Log file wasn't found
result.error
: (table)result.error.code
: (number/integer) Code of the error.result.error.detail
: (string) Any information useful for further debug.result.error.type
: (string) Status information.
Example:
{ error = { code = 404, type = "Not found" }; }
Usage:
result = api.mpa1000.logs:delete_csv()
- api.mpa1000.logs:get_csv (parameters)
-
Download logs as CSV.
Returns the full log file in CSV format.
Parameters:
- parameters table Parameters
Returns:
-
string
(status 200) Successful operation
Or
-
table
(status 404) Log file wasn't found
result.error
: (table)result.error.code
: (number/integer) Code of the error.result.error.detail
: (string) Any information useful for further debug.result.error.type
: (string) Status information.
Example:
{ error = { code = 404, type = "Not found" }; }
Usage:
result = api.mpa1000.logs:get_csv()
- api.mpa1000.logs:get_json (parameters)
-
Get logs as JSON.
Filters last log messages of specified log level(s) and returns not more than the last 500 KB of the filtered logs in JSON format.
Parameters:
- parameters table Parameters
parameters.logLevel
: (array) List of log levels for filtering. Omitting this parameter is treated as including all the log leves to the response.
Returns:
-
table
(status 200) Successful operation
Example:
{ "[2021-04-16 03:06:16.008] [lua_sched] [debug] cron:1 forked to pid (cron call): 4459"; "[2021-04-16 03:06:16.014] [temperature_checker] [info] temperature: 14.0 (too hot threshold: 55.0 extremely hot threshold: 180.0 )"; "[2021-04-16 03:06:16.252] [mintd] [debug] [ LL API ]<0>i: [VIDEO STREAMING] status is now: 0\ [AUDIO STREAMING] status is now: 0"; "[2021-04-16 03:06:16.253] [mintd] [debug] [ LL API ]<0>i: [VIDEO STREAMING] status is now: 0\ [AUDIO STREAMING] status is now: 0"; "[2021-04-16 03:06:16.995] [mintd] [debug] [ XADC-Temp ]<3>i: RAW TEMP VALUE is: 2729 -Celsius: 62.6283 -Farenheit: 144.731"; "[2021-04-16 03:06:16.995] [mintd] [debug] [ XADC-Temp ]<3>i: RAW MAX TEMP VALUE is: 2757 -Celsius: 66.0734 -Farenheit: 150.932"; "[2021-04-16 03:06:16.995] [mintd] [debug] [ XADC-Temp ]<3>i: RAW MAX TEMP VALUE is: 2708 -Celsius: 60.0444 -Farenheit: 140.08"; "[2021-04-16 03:06:17.011] [lua_sched] [debug] cron:1 forked to pid (cron call): 4460"; "[2021-04-16 03:06:17.018] [temperature_checker] [info] temperature: 15.0 (too hot threshold: 55.0 extremely hot threshold: 180.0 )"; "[2021-04-16 03:06:17.254] [mintd] [debug] [ LL API ]<0>i: [VIDEO STREAMING] status is now: 0\ [AUDIO STREAMING] status is now: 0"; "[2021-04-16 03:06:17.255] [mintd] [debug] [ LL API ]<0>i: [VIDEO STREAMING] status is now: 0\ [AUDIO STREAMING] status is now: 0"; }
Or
-
table
(status 400) Something went wrong with the request
result.error
: (table)result.error.code
: (number/integer) Code of the error.result.error.detail
: (string) Any information useful for further debug.result.error.type
: (string) Status information.
Example:
{ error = { code = 400, detail = "The reason of the error", type = "Bad request" }; }
Or
-
table
(status 404) Log file wasn't found
result.error
: (table)result.error.code
: (number/integer) Code of the error.result.error.detail
: (string) Any information useful for further debug.result.error.type
: (string) Status information.
Example:
{ error = { code = 404, type = "Not found" }; }
Usage:
result = api.mpa1000.logs:get_json()
- api.mpa1000.statistics:get_cpu_usage (parameters)
-
Get CPU usage history.
Returns an array of CPU usage values from the moment the device was launched.
Parameters:
- parameters table Parameters
Returns:
-
table
(status 200) Successful operation
Example:
{ { cpu_usage = 100.0, time = 1602776285 }; { cpu_usage = 4.0, time = 1602776342 }; { cpu_usage = 3.5, time = 1602776399 }; { cpu_usage = 3.0303030014038, time = 1602776456 }; { cpu_usage = 4.8780488967896, time = 1602776513 }; { cpu_usage = 2.9850745201111, time = 1602776570 }; { cpu_usage = 3.4482758045197, time = 1602776627 }; { cpu_usage = 3.4653465747833, time = 1602776684 }; }
Usage:
result = api.mpa1000.statistics:get_cpu_usage()
- api.mpa1000.statistics:get_temperature (parameters)
-
Get temperature history.
Returns an array of chip temperature values from the moment the device was launched.
Parameters:
- parameters table Parameters
Returns:
-
table
(status 200) Successful operation
Example:
{ { temperature = 65.704284667969, time = 1602776284 }; { temperature = 65.704284667969, time = 1602776338 }; { temperature = 65.704284667969, time = 1602776392 }; { temperature = 65.827323913574, time = 1602776446 }; { temperature = 66.196449279785, time = 1602776500 }; { temperature = 66.442527770996, time = 1602776554 }; { temperature = 66.319488525391, time = 1602776608 }; }
Usage:
result = api.mpa1000.statistics:get_temperature()
- api.mpa1000:delete_config (parameters)
-
Reset configuration.
Resets the configuration to default values.
Parameters:
- parameters table Parameters
Returns:
-
table
(status 200) Successful operation
result.general
: (table)result.general.device_name
: (string) Assigned device name.result.general.kvm_enabled
: (boolean) Turn kvm option on/off. Possible values:{true,false}
.result.media
: (table)result.media.compression_rate
: (number) Bits per pixel value of compression rate for the current setting (applicable only for Encoders). Minimum:1
. Maximum:4
. Example:2.5
.result.media.framerate
: (string) Frame rate of the video stream (applicable only for Encoders). Possible values:{"HDMI EDID","30","60"}
.result.media.kvm_port
: (number/integer) UDP port for KVM stream purposes.result.media.multicast_audio_port
: (number/integer) UDP port of the multicast audio stream (applicable only for Encoders).result.media.multicast_ip
: (string/ipv4) IP address of the multicast group (applicable only for Encoders).result.media.multicast_video_port
: (number/integer) UDP port of the multicast video stream (applicable only for Encoders).result.media.stream_delivery
: (string) Indicates whether delivered stream is multicast or unicast. Possible values:{"unicast","multicast"}
.result.media.unicast_audio_port
: (number/integer) UDP port of the unicast audio stream (applicable only for Encoders).result.media.unicast_video_port
: (number/integer) UDP port of the unicast video stream (applicable only for Encoders).result.media.video_bit_rate_cap
: (number/integer) Maximum allowed bit rate for video, Mb/s (applicable only for Encoders). Minimum:100
. Maximum:850
. Example:800
.result.media.video_resolution
: (string) Resolution of the video stream (applicable only for Encoders). Possible values:{"HDMI EDID","1080p","2160p"}
.result.network
: (table)result.network.dhcp
: (boolean) Indicates whether DHCP is enabled. Possible values:{true,false}
.result.network.dns_server_ip
: (string/ipv4) IP address of DNS server in the network.result.network.gateway
: (string/ipv4) IP address of gateway.result.network.ip
: (string/ipv4) IP address of the device.result.network.subnet
: (string/ipv4) Subnet mask.result.webserver
: (table)result.webserver.port
: (number/integer) Port number of an application.
Example:
{ general = { device_name = "MPA1000 Encoder" }; media = { compression_rate = 2; framerate = "HDMI EDID"; multicast_audio_port = 45001; multicast_ip = "239.45.55.60"; multicast_video_port = 45000; stream_delivery = "unicast"; unicast_audio_port = 5801; unicast_video_port = 5800; video_bit_rate_cap = 800; video_resolution = "HDMI EDID"; }; network = { dhcp = false; dns_server_ip = "192.168.228.1"; gateway = "192.168.228.1"; ip = "192.168.228.40"; subnet = "255.255.255.0"; }; webserver = { port = 80 }; }
Or
-
table
(status 404) Configuration wasn't found
result.error
: (table)result.error.code
: (number/integer) Code of the error.result.error.detail
: (string) Any information useful for further debug.result.error.type
: (string) Status information.
Example:
{ error = { code = 404, type = "Not found" }; }
Or
-
table
(status 409) Changes cannot be applied due to an active stream
result.error
: (table)result.error.code
: (number/integer) Code of the error.result.error.detail
: (string) Any information useful for further debug.result.error.type
: (string) Status information.
Example:
{ error = { code = 409, detail = "The reason of the error", type = "Conflict" }; }
Or
-
table
(status 423) The device is being set up to have an active stream
result.error
: (table)result.error.code
: (number/integer) Code of the error.result.error.detail
: (string) Any information useful for further debug.result.error.type
: (string) Status information.
Example:
{ error = { code = 423, detail = "The reason of the error", type = "Locked" }; }
Usage:
result = api.mpa1000:delete_config()
- api.mpa1000:get_config (parameters)
-
Get configuration.
Returns current configuration of the device. This is the last saved settings, not the current device status.
Parameters:
- parameters table Parameters
Returns:
-
table
(status 200) Successful operation
result.general
: (table)result.general.device_name
: (string) Assigned device name.result.general.kvm_enabled
: (boolean) Turn kvm option on/off. Possible values:{true,false}
.result.media
: (table)result.media.compression_rate
: (number) Bits per pixel value of compression rate for the current setting (applicable only for Encoders). Minimum:1
. Maximum:4
. Example:2.5
.result.media.framerate
: (string) Frame rate of the video stream (applicable only for Encoders). Possible values:{"HDMI EDID","30","60"}
.result.media.kvm_port
: (number/integer) UDP port for KVM stream purposes.result.media.multicast_audio_port
: (number/integer) UDP port of the multicast audio stream (applicable only for Encoders).result.media.multicast_ip
: (string/ipv4) IP address of the multicast group (applicable only for Encoders).result.media.multicast_video_port
: (number/integer) UDP port of the multicast video stream (applicable only for Encoders).result.media.stream_delivery
: (string) Indicates whether delivered stream is multicast or unicast. Possible values:{"unicast","multicast"}
.result.media.unicast_audio_port
: (number/integer) UDP port of the unicast audio stream (applicable only for Encoders).result.media.unicast_video_port
: (number/integer) UDP port of the unicast video stream (applicable only for Encoders).result.media.video_bit_rate_cap
: (number/integer) Maximum allowed bit rate for video, Mb/s (applicable only for Encoders). Minimum:100
. Maximum:850
. Example:800
.result.media.video_resolution
: (string) Resolution of the video stream (applicable only for Encoders). Possible values:{"HDMI EDID","1080p","2160p"}
.result.network
: (table)result.network.dhcp
: (boolean) Indicates whether DHCP is enabled. Possible values:{true,false}
.result.network.dns_server_ip
: (string/ipv4) IP address of DNS server in the network.result.network.gateway
: (string/ipv4) IP address of gateway.result.network.ip
: (string/ipv4) IP address of the device.result.network.subnet
: (string/ipv4) Subnet mask.result.webserver
: (table)result.webserver.port
: (number/integer) Port number of an application.
Example:
{ general = { device_name = "Macnica MPA1000" }; media = { compression_rate = 2; framerate = "60"; multicast_audio_port = 45001; multicast_ip = "239.45.55.60"; multicast_video_port = 45000; stream_delivery = "unicast"; unicast_audio_port = 5801; unicast_video_port = 5800; video_bit_rate_cap = 800; video_resolution = "1080p"; }; network = { dhcp = true; dns_server_ip = "192.168.59.1"; gateway = "192.168.59.1"; ip = "192.168.59.89"; subnet = "255.255.255.0"; }; webserver = { port = 8080 }; }
Or
-
table
(status 404) Configuration wasn't found
result.error
: (table)result.error.code
: (number/integer) Code of the error.result.error.detail
: (string) Any information useful for further debug.result.error.type
: (string) Status information.
Example:
{ error = { code = 404, type = "Not found" }; }
Usage:
result = api.mpa1000:get_config()
- api.mpa1000:get_status (parameters)
-
Get status.
Returns the status of the device.
Parameters:
- parameters table Parameters
Returns:
-
table
(status 200) Successful operation
result.general
: (table)result.general.device_name
: (string) Assigned device name.result.general.device_type
: (string) Device type. Possible values:{"Encoder","Decoder"}
.result.general.kvm_enabled
: (boolean) Turn kvm option on/off. Possible values:{true,false}
.result.general.uptime
: (number/integer) Time in secs, which the device has been working.result.hdmi
: (table)result.hdmi.bandwidth
: (number/integer) Amount of data that can be transferred per second.result.hdmi.bit_depth
: (number/integer) The number of bits used to represent each pixel.result.hdmi.color_space
: (string) Representation of a range of colors.result.hdmi.frame_rate
: (number/integer) Number of frames per second.result.hdmi.h_pixels_active
: (number/integer) Number of active horizontal pixels.result.hdmi.h_pixels_total
: (number/integer) Total number of horizontal pixels.result.hdmi.interlaced
: (boolean) Shows whether interlaced mode is on or off.result.hdmi.pixels_per_second
: (number/integer) Number of pixels per second.result.hdmi.status
: (boolean) HDMI port status.result.hdmi.v_pixels_active
: (number/integer) Number of active vertical pixels.result.hdmi.v_pixels_total
: (number/integer) Total number of vertical pixels.result.hdmi.version
: (string) HDMI version of the connected HDMI device.result.media
: (table)result.media.audio_stream_status
: (string) Audio stream status. Possible values:{"STOPPED","STARTED","TRANSIENT_ERROR","STREAM_STARTING"}
.result.media.compression_rate
: (number) Bits per pixel value of compression rate for the current setting (applicable only for Encoders). Minimum:1
. Maximum:4
. Example:2.5
.result.media.framerate
: (string) Frame rate of the video stream (applicable only for Encoders). Possible values:{"HDMI EDID","30","60"}
.result.media.kvm_port
: (number/integer) UDP port for KVM stream purposes.result.media.locking_protocol
: (string) Name of protocol using for media clock synchronization. Possible values:{"PTP","RCLP"}
.result.media.multicast_audio_port
: (number/integer) UDP port of the multicast audio stream (applicable only for Encoders).result.media.multicast_ip
: (string/ipv4) IP address of the multicast group (applicable only for Encoders).result.media.multicast_video_port
: (number/integer) UDP port of the multicast video stream (applicable only for Encoders).result.media.stream_delivery
: (string) Indicates whether delivered stream is multicast or unicast. Possible values:{"unicast","multicast"}
.result.media.subframe_latency_enabled
: (boolean) Sub-frame latency status.result.media.unicast_audio_port
: (number/integer) UDP port of the unicast audio stream (applicable only for Encoders).result.media.unicast_video_port
: (number/integer) UDP port of the unicast video stream (applicable only for Encoders).result.media.video_bit_rate_cap
: (number/integer) Maximum allowed bit rate for video, Mb/s (applicable only for Encoders). Minimum:100
. Maximum:850
. Example:800
.result.media.video_resolution
: (string) Resolution of the video stream (applicable only for Encoders). Possible values:{"HDMI EDID","1080p","2160p"}
.result.media.video_stream_status
: (string) Video stream status. Possible values:{"STOPPED","STARTED","TRANSIENT_ERROR","STREAM_STARTING"}
.result.network
: (table)result.network.dhcp
: (boolean) Indicates whether DHCP is enabled. Possible values:{true,false}
.result.network.dns_server_ip
: (string/ipv4) IP address of DNS server in the network.result.network.gateway
: (string/ipv4) IP address of gateway.result.network.ip
: (string/ipv4) IP address of the device.result.network.subnet
: (string/ipv4) Subnet mask.result.webserver
: (table)result.webserver.port
: (number/integer) Port number of an application.
Example:
{ general = { device_name = "MPA1000 Encoder", device_type = "Encoder", uptime = 909810 }; hdmi = { status = false, version = "N/A" }; media = { audio_stream_status = "TRANSIENT_ERROR"; compression_rate = 2.5; framerate = "HDMI EDID"; locking_protocol = "PTP"; multicast_audio_port = 45001; multicast_ip = "239.45.55.60"; multicast_video_port = 45000; stream_delivery = "unicast"; subframe_latency_enabled = true; unicast_audio_port = 5801; unicast_video_port = 5800; video_bit_rate_cap = 800; video_resolution = "HDMI EDID"; video_stream_status = "TRANSIENT_ERROR"; }; network = { dhcp = false; dns_server_ip = "192.168.228.1"; gateway = "192.168.228.1"; ip = "192.168.228.40"; subnet = "255.255.255.0"; }; webserver = { port = 8080 }; }
Usage:
result = api.mpa1000:get_status()
- api.mpa1000:get_system_info (parameters)
-
Get system information.
Returns common information about the device.
Parameters:
- parameters table Parameters
Returns:
-
table
(status 200) Successful operation
result.active_partition
: (string) Which partition is active now.result.backoffice_version
: (string) Version of the backoffice service.result.hw_version
: (string) Version of the hardware.result.libnmos_cpp_version
: (string) Version of nmos-cpp library used in NMOS Node.result.linux_version
: (string) Version of Linux on the device.result.low_level_api_version
: (string) Version of the low level API.result.mac_address
: (string) MAC address of the device.result.mint_version
: (string) Version of the Macnica integration layer.result.module_revision
: (string) Revision of the module.result.serial_number
: (string) Serial Number of the device.result.system_image_version
: (string) Integration version, defined by version in integration repo.
Example:
{ active_partition = "mmcblk0p2"; backoffice_version = "0.17.4.1"; hw_version = "1.186"; libnmos_cpp_version = "887053d9dbf1eb22011557e6018c8225c3ed5d5c"; linux_version = "4.14.0"; low_level_api_version = "0.60.0"; mac_address = "70:b3:d5:e8:e1:11"; mint_version = "0.60.5"; module_revision = "rev-a"; serial_number = "MPA1000-0000100001"; system_image_version = "MVP_RC_0.4"; }
Usage:
result = api.mpa1000:get_system_info()
- api.mpa1000:patch_config (parameters, payload)
-
Edit configuration.
Patches specific parameters of the configuration. If requested parameters can be applied, the new values go to the configuration.
Parameters:
- parameters table Parameters
- payload table Describes configuration of the device
payload.general
: (table)payload.general.device_name
: (string) Assigned device name.payload.general.kvm_enabled
: (boolean) Turn kvm option on/off. Possible values:{true,false}
.payload.media
: (table)payload.media.compression_rate
: (number) Bits per pixel value of compression rate for the current setting (applicable only for Encoders). Minimum:1
. Maximum:4
. Example:2.5
.payload.media.framerate
: (string) Framerate of video stream. Possible values:{"HDMI EDID","30","60"}
.payload.media.kvm_port
: (any) UDP port for KVM stream purposes.payload.media.multicast_audio_port
: (any) UDP port of the multicast audio stream.payload.media.multicast_ip
: (string/ipv4) Multicast IP address.payload.media.multicast_video_port
: (any) UDP port of the multicast video stream.payload.media.stream_delivery
: (string) Indicates whether delivered stream is multicast or unicast. Possible values:{"unicast","multicast"}
.payload.media.unicast_audio_port
: (any) UDP port of the unicast audio stream.payload.media.unicast_video_port
: (any) UDP port of the unicast video stream.payload.media.video_bit_rate_cap
: (number/integer) Maximum allowed bit rate for video, Mb/s (applicable only for Encoders). Minimum:100
. Maximum:850
. Example:800
.payload.media.video_resolution
: (string) Resolution of video stream. Possible values:{"HDMI EDID","1080p","2160p"}
.payload.network
: (table)payload.network.dhcp
: (boolean) Indicates whether DHCP is enabled. Possible values:{true,false}
.payload.network.dns_server_ip
: (string/ipv4) IP address of DNS server in the network.payload.network.gateway
: (string/ipv4) IP address of gateway.payload.network.ip
: (string/ipv4) IP address of the device.payload.network.subnet
: (string/ipv4) Subnet mask.payload.webserver
: (table)payload.webserver.port
: (number/integer) Port number of an application.
Returns:
-
table
(status 200) Successful operation
result.general
: (table)result.general.device_name
: (string) Assigned device name.result.general.kvm_enabled
: (boolean) Turn kvm option on/off. Possible values:{true,false}
.result.media
: (table)result.media.compression_rate
: (number) Bits per pixel value of compression rate for the current setting (applicable only for Encoders). Minimum:1
. Maximum:4
. Example:2.5
.result.media.framerate
: (string) Frame rate of the video stream (applicable only for Encoders). Possible values:{"HDMI EDID","30","60"}
.result.media.kvm_port
: (number/integer) UDP port for KVM stream purposes.result.media.multicast_audio_port
: (number/integer) UDP port of the multicast audio stream (applicable only for Encoders).result.media.multicast_ip
: (string/ipv4) IP address of the multicast group (applicable only for Encoders).result.media.multicast_video_port
: (number/integer) UDP port of the multicast video stream (applicable only for Encoders).result.media.stream_delivery
: (string) Indicates whether delivered stream is multicast or unicast. Possible values:{"unicast","multicast"}
.result.media.unicast_audio_port
: (number/integer) UDP port of the unicast audio stream (applicable only for Encoders).result.media.unicast_video_port
: (number/integer) UDP port of the unicast video stream (applicable only for Encoders).result.media.video_bit_rate_cap
: (number/integer) Maximum allowed bit rate for video, Mb/s (applicable only for Encoders). Minimum:100
. Maximum:850
. Example:800
.result.media.video_resolution
: (string) Resolution of the video stream (applicable only for Encoders). Possible values:{"HDMI EDID","1080p","2160p"}
.result.network
: (table)result.network.dhcp
: (boolean) Indicates whether DHCP is enabled. Possible values:{true,false}
.result.network.dns_server_ip
: (string/ipv4) IP address of DNS server in the network.result.network.gateway
: (string/ipv4) IP address of gateway.result.network.ip
: (string/ipv4) IP address of the device.result.network.subnet
: (string/ipv4) Subnet mask.result.webserver
: (table)result.webserver.port
: (number/integer) Port number of an application.
Example:
{ general = { device_name = "Macnica MPA1000" }; media = { compression_rate = 2; framerate = "60"; multicast_audio_port = 45001; multicast_ip = "239.45.55.60"; multicast_video_port = 45000; stream_delivery = "unicast"; unicast_audio_port = 5801; unicast_video_port = 5800; video_bit_rate_cap = 800; video_resolution = "1080p"; }; network = { dhcp = true; dns_server_ip = "192.168.59.1"; gateway = "192.168.59.1"; ip = "192.168.59.89"; subnet = "255.255.255.0"; }; webserver = { port = 8080 }; }
Or
-
table
(status 400) Something went wrong with the request
result.error
: (table)result.error.code
: (number/integer) Code of the error.result.error.detail
: (string) Any information useful for further debug.result.error.type
: (string) Status information.
Example:
{ error = { code = 400, detail = "The reason of the error", type = "Bad request" }; }
Or
-
table
(status 404) Configuration wasn't found
result.error
: (table)result.error.code
: (number/integer) Code of the error.result.error.detail
: (string) Any information useful for further debug.result.error.type
: (string) Status information.
Example:
{ error = { code = 404, type = "Not found" }; }
Or
-
table
(status 409) Changes cannot be applied due to an active stream
result.error
: (table)result.error.code
: (number/integer) Code of the error.result.error.detail
: (string) Any information useful for further debug.result.error.type
: (string) Status information.
Example:
{ error = { code = 409, detail = "The reason of the error", type = "Conflict" }; }
Or
-
table
(status 423) The device is being set up to have an active stream
result.error
: (table)result.error.code
: (number/integer) Code of the error.result.error.detail
: (string) Any information useful for further debug.result.error.type
: (string) Status information.
Example:
{ error = { code = 423, detail = "The reason of the error", type = "Locked" }; }
Usage:
payload = { general = { device_name = "Macnica MPA1000" }; network = { ip = "192.168.59.11" }; } result = api.mpa1000:patch_config(payload)
- api.mpa1000:reboot (parameters, payload)
-
Reboot the device.
Performs a soft reboot after a specified delay.
Parameters:
- parameters table Parameters
- payload table
payload.delay
: (number/integer) Delay time before the reboot in seconds. Minimum:5
. Maximum:60
.
Returns:
-
table
(status 200) Successful operation
result.delay
: (number/integer) Delay time before the reboot in seconds. Minimum:5
. Maximum:60
.
Example:
{ delay = 10 }
Usage:
payload = { delay = 10 } result = api.mpa1000:reboot(payload)
- api.nmos_wrappers.multicast:receive_stream (parameters, payload)
-
Receive multicast stream.
Turns on/off receiving of a multicast media stream.
Parameters:
- parameters table Parameters
- payload table A set of parameters for start/stop a multicast stream receiving
payload.device_id
: (string) NMOS Device UUID of a desired Encoder.payload.enable
: (boolean) Boolean showing whether a connection should be enabled or disabled.payload.media_type
: (string) Media type (video/audio). Possible values:{"video","audio"}
.
Returns:
-
table
(status 200) Successful operation
result.device_id
: (string) NMOS Device UUID of a desired Encoder.result.enable
: (boolean) Boolean showing whether a connection should be enabled or disabled.result.media_type
: (string) Media type (video/audio). Possible values:{"video","audio"}
.
Example:
{ device_id = "8284ac9c-4076-4acf-b314-0b65cc503e07"; enable = true; media_type = "video"; }
Or
-
table
(status 400) Something went wrong with the request
result.error
: (table)result.error.code
: (number/integer) Code of the error.result.error.detail
: (string) Any information useful for further debug.result.error.type
: (string) Status information.
Example:
{ error = { code = 400, detail = "The reason of the error", type = "Bad request" }; }
Or
-
table
(status 409) Specified connection target is a Decoder, the device is already receiving stream, it is in the unicast mode or an Encoder
result.error
: (table)result.error.code
: (number/integer) Code of the error.result.error.detail
: (string) Any information useful for further debug.result.error.type
: (string) Status information.
Example:
{ error = { code = 409, detail = "The reason of the error", type = "Conflict" }; }
Or
-
table
(status 423) The device is being set up to have an active stream
result.error
: (table)result.error.code
: (number/integer) Code of the error.result.error.detail
: (string) Any information useful for further debug.result.error.type
: (string) Status information.
Example:
{ error = { code = 423, detail = "The reason of the error", type = "Locked" }; }
Usage:
payload = { device_id = "8284ac9c-4076-4acf-b314-0b65cc503e07"; enable = true; media_type = "video"; } result = api.nmos_wrappers.multicast:receive_stream(payload)
- api.nmos_wrappers.multicast:transmit_stream (parameters, payload)
-
Transmit multicast stream.
Turns on/off transmitting of a multicast media stream.
Parameters:
- parameters table Parameters
- payload table A set of parameters for start/stop of a multicast stream transmitting
payload.enable
: (boolean) Boolean showing whether a stream should be enabled or disabled.payload.media_type
: (string) Media type (video/audio). Possible values:{"video","audio"}
.
Returns:
-
table
(status 200) Successful operation
result.enable
: (boolean) Boolean showing whether a stream should be enabled or disabled.result.media_type
: (string) Media type (video/audio). Possible values:{"video","audio"}
.
Example:
{ enable = true, media_type = "video" }
Or
-
table
(status 400) Something went wrong with the request
result.error
: (table)result.error.code
: (number/integer) Code of the error.result.error.detail
: (string) Any information useful for further debug.result.error.type
: (string) Status information.
Example:
{ error = { code = 400, detail = "The reason of the error", type = "Bad request" }; }
Or
-
table
(status 409) The device is already transmitting stream, it is in the unicast mode or a Decoder
result.error
: (table)result.error.code
: (number/integer) Code of the error.result.error.detail
: (string) Any information useful for further debug.result.error.type
: (string) Status information.
Example:
{ error = { code = 409, detail = "The reason of the error", type = "Conflict" }; }
Or
-
table
(status 423) The device is being set up to have an active stream
result.error
: (table)result.error.code
: (number/integer) Code of the error.result.error.detail
: (string) Any information useful for further debug.result.error.type
: (string) Status information.
Example:
{ error = { code = 423, detail = "The reason of the error", type = "Locked" }; }
Usage:
payload = { enable = true, media_type = "video" } result = api.nmos_wrappers.multicast:transmit_stream(payload)
- api.nmos_wrappers.unicast:connect_endpoints (parameters, payload)
-
(Dis-)connect unicast NMOS endpoints.
Establishes or stops a unicast media stream.
Parameters:
- parameters table Parameters
- payload table A set of parameters for establishing/destroying a unicast stream
payload.device_id
: (string) NMOS Device UUID to connect with.payload.enable
: (boolean) Boolean showing whether a connection should be enabled or disabled.payload.media_type
: (string) Media type (video/audio). Possible values:{"video","audio"}
.
Returns:
-
table
(status 200) Successful operation
result.device_id
: (string) NMOS Device UUID to connect with.result.enable
: (boolean) Boolean showing whether a connection should be enabled or disabled.result.media_type
: (string) Media type (video/audio). Possible values:{"video","audio"}
.
Example:
{ device_id = "8284ac9c-4076-4acf-b314-0b65cc503e07"; enable = true; media_type = "video"; }
Or
-
table
(status 400) Something went wrong with the request
result.error
: (table)result.error.code
: (number/integer) Code of the error.result.error.detail
: (string) Any information useful for further debug.result.error.type
: (string) Status information.
Example:
{ error = { code = 400, detail = "The reason of the error", type = "Bad request" }; }
Or
-
table
(status 409) Specified connection target is already receiving/transmitting stream or the device is in the multicast mode
result.error
: (table)result.error.code
: (number/integer) Code of the error.result.error.detail
: (string) Any information useful for further debug.result.error.type
: (string) Status information.
Example:
{ error = { code = 409, detail = "The reason of the error", type = "Conflict" }; }
Or
-
table
(status 423) The device is being set up to have an active stream
result.error
: (table)result.error.code
: (number/integer) Code of the error.result.error.detail
: (string) Any information useful for further debug.result.error.type
: (string) Status information.
Example:
{ error = { code = 423, detail = "The reason of the error", type = "Locked" }; }
Usage:
payload = { device_id = "8284ac9c-4076-4acf-b314-0b65cc503e07"; enable = true; media_type = "video"; } result = api.nmos_wrappers.unicast:connect_endpoints(payload)
- api.nmos_wrappers:get_endpoints_list (parameters)
-
Get NMOS endpoints.
Returns a list of NMOS connection targets composed of Senders (in a case of Decoder) or Receivers (in a case of Encoder) which support the same media formats as MPA1000.
Parameters:
- parameters table Parameters
Returns:
-
table
(status 200) Successful operation
result.discovery_origin
: (string/uri) Origin of the list (Peer-to-Peer mode or a link to a Query API). Example:"http://192.168.1.30:8001"
.result.priority
: (number/integer) Query Service Priority.result.targets
: (array) NMOS connection targets (Devices with Senders or Receivers).
Example:
{ discovery_origin = "http://192.168.1.30:8001"; priority = 10; targets = { { audio_endpoint = { status = "incompatible", stream_delivery = "unicast" }; href = "http://192.168.1.34:8001"; id = "8284ac9c-4076-4acf-b314-0b65cc503e07"; ip_addr = "192.168.1.34"; name = "My Favorite Receiving Device"; video_endpoint = { status = "compatible_active", stream_delivery = "unicast" }; }; { audio_endpoint = { status = "compatible_inactive", stream_delivery = "multicast" }; href = "http://192.168.1.35:8001"; id = "44114da1-8a5a-4d42-8442-a02397a1948f"; ip_addr = "192.168.1.35"; name = "My Favorite Sending Device"; }; }; }
Usage:
result = api.nmos_wrappers:get_endpoints_list()
- api.nmos_wrappers:get_nmos_device_id (parameters)
-
Get Device ID.
Returns device ID of the board.
Parameters:
- parameters table Parameters
Returns:
-
table
(status 200) Successful operation
result.device_id
: (string)
Example:
{ device_id = "8474f274-bf6c-5b02-b324-b5ecbf4fcb8a" }
Or
-
table
(status 404) Appropriate NMOS Device wasn't found
result.error
: (table)result.error.code
: (number/integer) Code of the error.result.error.detail
: (string) Any information useful for further debug.result.error.type
: (string) Status information.
Example:
{ error = { code = 404, type = "Not found" }; }
Usage:
result = api.nmos_wrappers:get_nmos_device_id()
- api.web_gui:login (parameters, payload)
-
Log in.
Compare encrypted client password with encrypted server password.
Parameters:
- parameters table Parameters
- payload table Credentials to access Web GUI
payload.password
: (string) Encrypted client password.
Returns:
-
table
(status 200) Client password matches the server password.
Example:
{ }
Or
-
table
(status 400) Something wrong with login request or received JSON file.
result.error
: (table)result.error.code
: (number/integer) Code of the error.result.error.detail
: (string) Any information useful for further debug.result.error.type
: (string) Status information.
Example:
{ error = { code = 400, detail = "The reason of the error", type = "Bad request" }; }
Or
-
table
(status 401) Returned when client password does not match server password.
result.error
: (table)result.error.code
: (number/integer) Code of the error.result.error.detail
: (string) Any information useful for further debug.result.error.type
: (string) Status information.
Example:
{ error = { code = 401, type = "Unauthorized" }; }
Usage:
payload = { password = "3e1gsfvfdh764egvq23erfc0d" } result = api.web_gui:login(payload)
- api.web_gui:password (parameters, payload)
-
Change password.
Changes password if current client password matches current server password.
Parameters:
- parameters table Parameters
- payload table Parammeters requied to update current password
payload.current_password
: (string) Encrypted current client password.payload.new_password
: (string) Encrypted new password.
Returns:
-
table
(status 200) Successful operation
Example:
{ }
Or
-
table
(status 400) Something wrong with login request or received JSON file.
result.error
: (table)result.error.code
: (number/integer) Code of the error.result.error.detail
: (string) Any information useful for further debug.result.error.type
: (string) Status information.
Example:
{ error = { code = 400, detail = "The reason of the error", type = "Bad request" }; }
Or
-
table
(status 401) Wrong password
result.error
: (table)result.error.code
: (number/integer) Code of the error.result.error.detail
: (string) Any information useful for further debug.result.error.type
: (string) Status information.
Example:
{ error = { code = 401, type = "Unauthorized" }; }
Usage:
payload = { current_password = "3e1gsfvfdh764egvq23erfc0d"; new_password = "3dtrfghjk89iujhvascf7893hy"; } result = api.web_gui:password(payload)
Methods
- mint.rest.backoffice.api:oem_messages (parameters)
-
Get Lua apps web messages.
Return messages that was sent by Lua apps.?app_id=
[&id= ]:get Parameters:
- parameters table Parameters
parameters.app_id
: (any) Lua application ID.parameters.id
: (string) Last received message ID.
Returns:
-
table
(status 200) Successful operation
Example:
{ { app_id = "com.example.acme.demo_forms"; clear_messages = false; id = "1"; message_data = "Text from a Lua app"; message_type = "info"; }; }
Or
-
table
(status 400) Returned if query parameters are absent
result.error
: (table)result.error.code
: (number/integer) Code of the error.result.error.detail
: (string) Any information useful for further debug.result.error.type
: (string) Status information.
Usage:
result = api.oem_messages?app_id=<APP_ID>[&id=<START_MSG_ID>]:get()