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

api.mpa1000.edid:get_binary (parameters) Download EDID of an HDMI Sink as binary.
api.mpa1000.edid:get_json (parameters) Get EDID of an HDMI Sink as JSON.
api.mpa1000.infoframe:get_audio (parameters) Get Audio InfoFrame.
api.mpa1000.infoframe:get_video (parameters) Get AVI InfoFrame.
api.mpa1000.logs:delete_csv (parameters) Clear logs.
api.mpa1000.logs:get_csv (parameters) Download logs as CSV.
api.mpa1000.logs:get_json (parameters) Get logs as JSON.
api.mpa1000.statistics:get_cpu_usage (parameters) Get CPU usage history.
api.mpa1000.statistics:get_temperature (parameters) Get temperature history.
api.mpa1000:delete_config (parameters) Reset configuration.
api.mpa1000:get_config (parameters) Get configuration.
api.mpa1000:get_status (parameters) Get status.
api.mpa1000:get_system_info (parameters) Get system information.
api.mpa1000:patch_config (parameters, payload) Edit configuration.
api.mpa1000:reboot (parameters, payload) Reboot the device.
api.nmos_wrappers.multicast:receive_stream (parameters, payload) Receive multicast stream.
api.nmos_wrappers.multicast:transmit_stream (parameters, payload) Transmit multicast stream.
api.nmos_wrappers.unicast:connect_endpoints (parameters, payload) (Dis-)connect unicast NMOS endpoints.
api.nmos_wrappers:get_endpoints_list (parameters) Get NMOS endpoints.
api.nmos_wrappers:get_nmos_device_id (parameters) Get Device ID.
api.web_gui:login (parameters, payload) Log in.
api.web_gui:password (parameters, payload) Change password.

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
  1. result.error: (table)
  2. result.error.code: (number/integer) Code of the error.
  3. result.error.detail: (string) Any information useful for further debug.
  4. result.error.type: (string) Status information.
  5. Example:
    {
       error = { code = 404, type = "Not found" };
     }

Or

    table (status 501) Device type is Encoder
  1. result.error: (table)
  2. result.error.code: (number/integer) Code of the error.
  3. result.error.detail: (string) Any information useful for further debug.
  4. result.error.type: (string) Status information.
  5. 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
  1. result.cea_ext_timings: (array)
  2. result.detailed_timings: (array)
  3. 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"}.
  4. result.established_timings: (array)
  5. result.gamma: (number) Display gamma (range 1.00-3.54).
  6. result.manufacture_week: (number/integer)
  7. result.manufacture_year: (number/integer)
  8. result.manufacturer: (string)
  9. result.screen_size: (table)
  10. result.screen_size.height: (number/integer) Vertical screen size, in centimetres.
  11. result.screen_size.width: (number/integer) Horizontal screen size, in centimetres.
  12. result.standard_timings: (array)
  13. result.version: (string) Possible values: {"1.3","1.4"}.
  14. 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
  1. result.error: (table)
  2. result.error.code: (number/integer) Code of the error.
  3. result.error.detail: (string) Any information useful for further debug.
  4. result.error.type: (string) Status information.
  5. Example:
    {
       error = { code = 404, type = "Not found" };
     }

Or

    table (status 501) Device type is Encoder
  1. result.error: (table)
  2. result.error.code: (number/integer) Code of the error.
  3. result.error.detail: (string) Any information useful for further debug.
  4. result.error.type: (string) Status information.
  5. 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
  1. result.channel_allocation: (table) Mapping between channel numbers and speaker positions.
  2. result.channel_allocation.1: (string) Possible values: {"FL"}.
  3. result.channel_allocation.2: (string) Possible values: {"FR"}.
  4. result.channel_allocation.3: (string) Possible values: {"LFE"}.
  5. result.channel_allocation.4: (string) Possible values: {"FC"}.
  6. result.channel_allocation.5: (string) Possible values: {"RC","RL"}.
  7. result.channel_allocation.6: (string) Possible values: {"RR"}.
  8. result.channel_allocation.7: (string) Possible values: {"FLC","RLC","RC","FCH","FLH","FLW"}.
  9. result.channel_allocation.8: (string) Possible values: {"FRC","RRC","TC","FRH","FRW","FCH"}.
  10. result.channel_count: (number/integer) Maximum: 8.
  11. 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"}.
  12. result.downmix_inhibit: (boolean) The key is present only if downmixing is prohibited. Possible values: {true}.
  13. result.level_shift_value: (number/integer) Minimum: 0. Maximum: 15.
  14. result.lfe_playback_level: (number/integer) Low-frequency effect playback level. Possible values: {0,10}.
  15. result.sample_frequency: (number) Sample frequency in kHz. Possible values: {32,44.100000000000001,48,88.200000000000003,96,176.40000000000001,192}.
  16. result.sample_size: (number/integer) Sample size in bits. Possible values: {16,20,24}.
  17. result.version: (number/integer) Audio Infoframe version.
  18. 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.
  1. result.error: (table)
  2. result.error.code: (number/integer) Code of the error.
  3. result.error.detail: (string) Any information useful for further debug.
  4. result.error.type: (string) Status information.
  5. Example:
    {
       error = { code = 404, type = "Not found" };
     }

Or

    table (status 501) Device type is Decoder
  1. result.error: (table)
  2. result.error.code: (number/integer) Code of the error.
  3. result.error.detail: (string) Any information useful for further debug.
  4. result.error.type: (string) Status information.
  5. 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
  1. 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"}.
  2. result.bottom_bar: (number/integer) Line number of Start of Bottom Bar.
  3. result.colorimetry: (string) Possible values: {"ITU-R BT.601","ITU-R BT.709","YCC601","YCC709","sYCC601","Adobe YCC601","Adobe RGB"}.
  4. result.colorspace: (string) Possible values: {"RGB","YUV422","YUV444","YUV420"}.
  5. result.content_type: (string) Possible values: {"Graphics","Photo","Cinema","Game"}.
  6. result.left_bar: (number/integer) Line number of End of Left Bar.
  7. result.non_uniform_picture_scaling: (string) Possible values: {"Horizontal","Vertical","Vertical and Horizontal"}.
  8. result.pic_aspect_ratio: (string) Possible values: {"4:3","16:9"}.
  9. result.pixel_repetition: (number/integer) Pixel Repetition factor (how many times pixels are sent). Minimum: 1. Maximum: 10.
  10. result.rgb_quantization_range: (string) Possible values: {"Default","Limited","Full"}.
  11. result.right_bar: (number/integer) Line number of Start of Right Bar.
  12. result.scan_info: (string) Possible values: {"Overscan","Underscan"}.
  13. result.top_bar: (number/integer) Line number of End of Top Bar.
  14. result.version: (number/integer) AVI Infoframe version.
  15. result.vic: (number/integer) Video Format Identification code.
  16. result.ycc_quantization_range: (string) Possible values: {"Limited","Full"}.
  17. 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.
  1. result.error: (table)
  2. result.error.code: (number/integer) Code of the error.
  3. result.error.detail: (string) Any information useful for further debug.
  4. result.error.type: (string) Status information.
  5. Example:
    {
       error = { code = 404, type = "Not found" };
     }

Or

    table (status 501) Device type is Decoder
  1. result.error: (table)
  2. result.error.code: (number/integer) Code of the error.
  3. result.error.detail: (string) Any information useful for further debug.
  4. result.error.type: (string) Status information.
  5. 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
  1. result.error: (table)
  2. result.error.code: (number/integer) Code of the error.
  3. result.error.detail: (string) Any information useful for further debug.
  4. result.error.type: (string) Status information.
  5. 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
  1. result.error: (table)
  2. result.error.code: (number/integer) Code of the error.
  3. result.error.detail: (string) Any information useful for further debug.
  4. result.error.type: (string) Status information.
  5. 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
  1. result.error: (table)
  2. result.error.code: (number/integer) Code of the error.
  3. result.error.detail: (string) Any information useful for further debug.
  4. result.error.type: (string) Status information.
  5. Example:
    {
       error = { code = 400, detail = "The reason of the error", type = "Bad request" };
     }

Or

    table (status 404) Log file wasn't found
  1. result.error: (table)
  2. result.error.code: (number/integer) Code of the error.
  3. result.error.detail: (string) Any information useful for further debug.
  4. result.error.type: (string) Status information.
  5. 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
  1. result.general: (table)
  2. result.general.device_name: (string) Assigned device name.
  3. result.general.kvm_enabled: (boolean) Turn kvm option on/off. Possible values: {true,false}.
  4. result.media: (table)
  5. 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.
  6. result.media.framerate: (string) Frame rate of the video stream (applicable only for Encoders). Possible values: {"HDMI EDID","30","60"}.
  7. result.media.kvm_port: (number/integer) UDP port for KVM stream purposes.
  8. result.media.multicast_audio_port: (number/integer) UDP port of the multicast audio stream (applicable only for Encoders).
  9. result.media.multicast_ip: (string/ipv4) IP address of the multicast group (applicable only for Encoders).
  10. result.media.multicast_video_port: (number/integer) UDP port of the multicast video stream (applicable only for Encoders).
  11. result.media.stream_delivery: (string) Indicates whether delivered stream is multicast or unicast. Possible values: {"unicast","multicast"}.
  12. result.media.unicast_audio_port: (number/integer) UDP port of the unicast audio stream (applicable only for Encoders).
  13. result.media.unicast_video_port: (number/integer) UDP port of the unicast video stream (applicable only for Encoders).
  14. 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.
  15. result.media.video_resolution: (string) Resolution of the video stream (applicable only for Encoders). Possible values: {"HDMI EDID","1080p","2160p"}.
  16. result.network: (table)
  17. result.network.dhcp: (boolean) Indicates whether DHCP is enabled. Possible values: {true,false}.
  18. result.network.dns_server_ip: (string/ipv4) IP address of DNS server in the network.
  19. result.network.gateway: (string/ipv4) IP address of gateway.
  20. result.network.ip: (string/ipv4) IP address of the device.
  21. result.network.subnet: (string/ipv4) Subnet mask.
  22. result.webserver: (table)
  23. result.webserver.port: (number/integer) Port number of an application.
  24. 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
  1. result.error: (table)
  2. result.error.code: (number/integer) Code of the error.
  3. result.error.detail: (string) Any information useful for further debug.
  4. result.error.type: (string) Status information.
  5. Example:
    {
       error = { code = 404, type = "Not found" };
     }

Or

    table (status 409) Changes cannot be applied due to an active stream
  1. result.error: (table)
  2. result.error.code: (number/integer) Code of the error.
  3. result.error.detail: (string) Any information useful for further debug.
  4. result.error.type: (string) Status information.
  5. 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
  1. result.error: (table)
  2. result.error.code: (number/integer) Code of the error.
  3. result.error.detail: (string) Any information useful for further debug.
  4. result.error.type: (string) Status information.
  5. 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
  1. result.general: (table)
  2. result.general.device_name: (string) Assigned device name.
  3. result.general.kvm_enabled: (boolean) Turn kvm option on/off. Possible values: {true,false}.
  4. result.media: (table)
  5. 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.
  6. result.media.framerate: (string) Frame rate of the video stream (applicable only for Encoders). Possible values: {"HDMI EDID","30","60"}.
  7. result.media.kvm_port: (number/integer) UDP port for KVM stream purposes.
  8. result.media.multicast_audio_port: (number/integer) UDP port of the multicast audio stream (applicable only for Encoders).
  9. result.media.multicast_ip: (string/ipv4) IP address of the multicast group (applicable only for Encoders).
  10. result.media.multicast_video_port: (number/integer) UDP port of the multicast video stream (applicable only for Encoders).
  11. result.media.stream_delivery: (string) Indicates whether delivered stream is multicast or unicast. Possible values: {"unicast","multicast"}.
  12. result.media.unicast_audio_port: (number/integer) UDP port of the unicast audio stream (applicable only for Encoders).
  13. result.media.unicast_video_port: (number/integer) UDP port of the unicast video stream (applicable only for Encoders).
  14. 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.
  15. result.media.video_resolution: (string) Resolution of the video stream (applicable only for Encoders). Possible values: {"HDMI EDID","1080p","2160p"}.
  16. result.network: (table)
  17. result.network.dhcp: (boolean) Indicates whether DHCP is enabled. Possible values: {true,false}.
  18. result.network.dns_server_ip: (string/ipv4) IP address of DNS server in the network.
  19. result.network.gateway: (string/ipv4) IP address of gateway.
  20. result.network.ip: (string/ipv4) IP address of the device.
  21. result.network.subnet: (string/ipv4) Subnet mask.
  22. result.webserver: (table)
  23. result.webserver.port: (number/integer) Port number of an application.
  24. 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
  1. result.error: (table)
  2. result.error.code: (number/integer) Code of the error.
  3. result.error.detail: (string) Any information useful for further debug.
  4. result.error.type: (string) Status information.
  5. 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
  1. result.general: (table)
  2. result.general.device_name: (string) Assigned device name.
  3. result.general.device_type: (string) Device type. Possible values: {"Encoder","Decoder"}.
  4. result.general.kvm_enabled: (boolean) Turn kvm option on/off. Possible values: {true,false}.
  5. result.general.uptime: (number/integer) Time in secs, which the device has been working.
  6. result.hdmi: (table)
  7. result.hdmi.bandwidth: (number/integer) Amount of data that can be transferred per second.
  8. result.hdmi.bit_depth: (number/integer) The number of bits used to represent each pixel.
  9. result.hdmi.color_space: (string) Representation of a range of colors.
  10. result.hdmi.frame_rate: (number/integer) Number of frames per second.
  11. result.hdmi.h_pixels_active: (number/integer) Number of active horizontal pixels.
  12. result.hdmi.h_pixels_total: (number/integer) Total number of horizontal pixels.
  13. result.hdmi.interlaced: (boolean) Shows whether interlaced mode is on or off.
  14. result.hdmi.pixels_per_second: (number/integer) Number of pixels per second.
  15. result.hdmi.status: (boolean) HDMI port status.
  16. result.hdmi.v_pixels_active: (number/integer) Number of active vertical pixels.
  17. result.hdmi.v_pixels_total: (number/integer) Total number of vertical pixels.
  18. result.hdmi.version: (string) HDMI version of the connected HDMI device.
  19. result.media: (table)
  20. result.media.audio_stream_status: (string) Audio stream status. Possible values: {"STOPPED","STARTED","TRANSIENT_ERROR","STREAM_STARTING"}.
  21. 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.
  22. result.media.framerate: (string) Frame rate of the video stream (applicable only for Encoders). Possible values: {"HDMI EDID","30","60"}.
  23. result.media.kvm_port: (number/integer) UDP port for KVM stream purposes.
  24. result.media.locking_protocol: (string) Name of protocol using for media clock synchronization. Possible values: {"PTP","RCLP"}.
  25. result.media.multicast_audio_port: (number/integer) UDP port of the multicast audio stream (applicable only for Encoders).
  26. result.media.multicast_ip: (string/ipv4) IP address of the multicast group (applicable only for Encoders).
  27. result.media.multicast_video_port: (number/integer) UDP port of the multicast video stream (applicable only for Encoders).
  28. result.media.stream_delivery: (string) Indicates whether delivered stream is multicast or unicast. Possible values: {"unicast","multicast"}.
  29. result.media.subframe_latency_enabled: (boolean) Sub-frame latency status.
  30. result.media.unicast_audio_port: (number/integer) UDP port of the unicast audio stream (applicable only for Encoders).
  31. result.media.unicast_video_port: (number/integer) UDP port of the unicast video stream (applicable only for Encoders).
  32. 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.
  33. result.media.video_resolution: (string) Resolution of the video stream (applicable only for Encoders). Possible values: {"HDMI EDID","1080p","2160p"}.
  34. result.media.video_stream_status: (string) Video stream status. Possible values: {"STOPPED","STARTED","TRANSIENT_ERROR","STREAM_STARTING"}.
  35. result.network: (table)
  36. result.network.dhcp: (boolean) Indicates whether DHCP is enabled. Possible values: {true,false}.
  37. result.network.dns_server_ip: (string/ipv4) IP address of DNS server in the network.
  38. result.network.gateway: (string/ipv4) IP address of gateway.
  39. result.network.ip: (string/ipv4) IP address of the device.
  40. result.network.subnet: (string/ipv4) Subnet mask.
  41. result.webserver: (table)
  42. result.webserver.port: (number/integer) Port number of an application.
  43. 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
  1. result.active_partition: (string) Which partition is active now.
  2. result.backoffice_version: (string) Version of the backoffice service.
  3. result.hw_version: (string) Version of the hardware.
  4. result.libnmos_cpp_version: (string) Version of nmos-cpp library used in NMOS Node.
  5. result.linux_version: (string) Version of Linux on the device.
  6. result.low_level_api_version: (string) Version of the low level API.
  7. result.mac_address: (string) MAC address of the device.
  8. result.mint_version: (string) Version of the Macnica integration layer.
  9. result.module_revision: (string) Revision of the module.
  10. result.serial_number: (string) Serial Number of the device.
  11. result.system_image_version: (string) Integration version, defined by version in integration repo.
  12. 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
  1. result.general: (table)
  2. result.general.device_name: (string) Assigned device name.
  3. result.general.kvm_enabled: (boolean) Turn kvm option on/off. Possible values: {true,false}.
  4. result.media: (table)
  5. 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.
  6. result.media.framerate: (string) Frame rate of the video stream (applicable only for Encoders). Possible values: {"HDMI EDID","30","60"}.
  7. result.media.kvm_port: (number/integer) UDP port for KVM stream purposes.
  8. result.media.multicast_audio_port: (number/integer) UDP port of the multicast audio stream (applicable only for Encoders).
  9. result.media.multicast_ip: (string/ipv4) IP address of the multicast group (applicable only for Encoders).
  10. result.media.multicast_video_port: (number/integer) UDP port of the multicast video stream (applicable only for Encoders).
  11. result.media.stream_delivery: (string) Indicates whether delivered stream is multicast or unicast. Possible values: {"unicast","multicast"}.
  12. result.media.unicast_audio_port: (number/integer) UDP port of the unicast audio stream (applicable only for Encoders).
  13. result.media.unicast_video_port: (number/integer) UDP port of the unicast video stream (applicable only for Encoders).
  14. 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.
  15. result.media.video_resolution: (string) Resolution of the video stream (applicable only for Encoders). Possible values: {"HDMI EDID","1080p","2160p"}.
  16. result.network: (table)
  17. result.network.dhcp: (boolean) Indicates whether DHCP is enabled. Possible values: {true,false}.
  18. result.network.dns_server_ip: (string/ipv4) IP address of DNS server in the network.
  19. result.network.gateway: (string/ipv4) IP address of gateway.
  20. result.network.ip: (string/ipv4) IP address of the device.
  21. result.network.subnet: (string/ipv4) Subnet mask.
  22. result.webserver: (table)
  23. result.webserver.port: (number/integer) Port number of an application.
  24. 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
  1. result.error: (table)
  2. result.error.code: (number/integer) Code of the error.
  3. result.error.detail: (string) Any information useful for further debug.
  4. result.error.type: (string) Status information.
  5. Example:
    {
       error = { code = 400, detail = "The reason of the error", type = "Bad request" };
     }

Or

    table (status 404) Configuration wasn't found
  1. result.error: (table)
  2. result.error.code: (number/integer) Code of the error.
  3. result.error.detail: (string) Any information useful for further debug.
  4. result.error.type: (string) Status information.
  5. Example:
    {
       error = { code = 404, type = "Not found" };
     }

Or

    table (status 409) Changes cannot be applied due to an active stream
  1. result.error: (table)
  2. result.error.code: (number/integer) Code of the error.
  3. result.error.detail: (string) Any information useful for further debug.
  4. result.error.type: (string) Status information.
  5. 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
  1. result.error: (table)
  2. result.error.code: (number/integer) Code of the error.
  3. result.error.detail: (string) Any information useful for further debug.
  4. result.error.type: (string) Status information.
  5. 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
  1. result.delay: (number/integer) Delay time before the reboot in seconds. Minimum: 5. Maximum: 60.
  2. 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
  1. result.device_id: (string) NMOS Device UUID of a desired Encoder.
  2. result.enable: (boolean) Boolean showing whether a connection should be enabled or disabled.
  3. result.media_type: (string) Media type (video/audio). Possible values: {"video","audio"}.
  4. Example:
    {
       device_id = "8284ac9c-4076-4acf-b314-0b65cc503e07";
       enable = true;
       media_type = "video";
     }

Or

    table (status 400) Something went wrong with the request
  1. result.error: (table)
  2. result.error.code: (number/integer) Code of the error.
  3. result.error.detail: (string) Any information useful for further debug.
  4. result.error.type: (string) Status information.
  5. 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
  1. result.error: (table)
  2. result.error.code: (number/integer) Code of the error.
  3. result.error.detail: (string) Any information useful for further debug.
  4. result.error.type: (string) Status information.
  5. 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
  1. result.error: (table)
  2. result.error.code: (number/integer) Code of the error.
  3. result.error.detail: (string) Any information useful for further debug.
  4. result.error.type: (string) Status information.
  5. 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
  1. result.enable: (boolean) Boolean showing whether a stream should be enabled or disabled.
  2. result.media_type: (string) Media type (video/audio). Possible values: {"video","audio"}.
  3. Example:
    { enable = true, media_type = "video" }

Or

    table (status 400) Something went wrong with the request
  1. result.error: (table)
  2. result.error.code: (number/integer) Code of the error.
  3. result.error.detail: (string) Any information useful for further debug.
  4. result.error.type: (string) Status information.
  5. 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
  1. result.error: (table)
  2. result.error.code: (number/integer) Code of the error.
  3. result.error.detail: (string) Any information useful for further debug.
  4. result.error.type: (string) Status information.
  5. 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
  1. result.error: (table)
  2. result.error.code: (number/integer) Code of the error.
  3. result.error.detail: (string) Any information useful for further debug.
  4. result.error.type: (string) Status information.
  5. 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
  1. result.device_id: (string) NMOS Device UUID to connect with.
  2. result.enable: (boolean) Boolean showing whether a connection should be enabled or disabled.
  3. result.media_type: (string) Media type (video/audio). Possible values: {"video","audio"}.
  4. Example:
    {
       device_id = "8284ac9c-4076-4acf-b314-0b65cc503e07";
       enable = true;
       media_type = "video";
     }

Or

    table (status 400) Something went wrong with the request
  1. result.error: (table)
  2. result.error.code: (number/integer) Code of the error.
  3. result.error.detail: (string) Any information useful for further debug.
  4. result.error.type: (string) Status information.
  5. 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
  1. result.error: (table)
  2. result.error.code: (number/integer) Code of the error.
  3. result.error.detail: (string) Any information useful for further debug.
  4. result.error.type: (string) Status information.
  5. 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
  1. result.error: (table)
  2. result.error.code: (number/integer) Code of the error.
  3. result.error.detail: (string) Any information useful for further debug.
  4. result.error.type: (string) Status information.
  5. 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
  1. 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".
  2. result.priority: (number/integer) Query Service Priority.
  3. result.targets: (array) NMOS connection targets (Devices with Senders or Receivers).
  4. 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
  1. result.device_id: (string)
  2. Example:
    { device_id = "8474f274-bf6c-5b02-b324-b5ecbf4fcb8a" }

Or

    table (status 404) Appropriate NMOS Device wasn't found
  1. result.error: (table)
  2. result.error.code: (number/integer) Code of the error.
  3. result.error.detail: (string) Any information useful for further debug.
  4. result.error.type: (string) Status information.
  5. 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.
  1. result.error: (table)
  2. result.error.code: (number/integer) Code of the error.
  3. result.error.detail: (string) Any information useful for further debug.
  4. result.error.type: (string) Status information.
  5. 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.
  1. result.error: (table)
  2. result.error.code: (number/integer) Code of the error.
  3. result.error.detail: (string) Any information useful for further debug.
  4. result.error.type: (string) Status information.
  5. 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.
  1. result.error: (table)
  2. result.error.code: (number/integer) Code of the error.
  3. result.error.detail: (string) Any information useful for further debug.
  4. result.error.type: (string) Status information.
  5. Example:
    {
       error = { code = 400, detail = "The reason of the error", type = "Bad request" };
     }

Or

    table (status 401) Wrong password
  1. result.error: (table)
  2. result.error.code: (number/integer) Code of the error.
  3. result.error.detail: (string) Any information useful for further debug.
  4. result.error.type: (string) Status information.
  5. 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
  1. result.error: (table)
  2. result.error.code: (number/integer) Code of the error.
  3. result.error.detail: (string) Any information useful for further debug.
  4. result.error.type: (string) Status information.

Usage:

    result = api.oem_messages?app_id=<APP_ID>[&id=<START_MSG_ID>]:get()
generated by LDoc 1.4.6 Last updated 1980-01-01 00:00:00