Difference between revisions of "Myth Service"

From MythTV Official Wiki
Jump to: navigation, search
(Intro)
(Add GetSetting/GetSettingList)
(4 intermediate revisions by 2 users not shown)
Line 13: Line 13:
 
|-  
 
|-  
 
| style="background:silver" |AddStorageGroupDir
 
| style="background:silver" |AddStorageGroupDir
| style="background:silver" align="center" | Yes
 
| style="background:silver" | TBD
 
|-
 
| BackupDatabase
 
| align="center"  | Yes
 
| TBD
 
|-
 
| style="background:silver" |ChangePassword
 
 
| style="background:silver" align="center" | Yes
 
| style="background:silver" align="center" | Yes
 
| style="background:silver" | TBD
 
| style="background:silver" | TBD
Line 35: Line 27:
 
| align="center"  | Yes
 
| align="center"  | Yes
 
| TBD
 
| TBD
|-  
+
|-
| style="background:silver" |GetConnectionInfo
+
| style="background:silver" |GetBackendInfo
| style="background:silver" align="center" | No
+
| style="background:silver" align="center" | No (new in 0.28)
 +
| style="background:silver" | Get basic information about the backend's configuration.
 +
|-
 +
| GetConnectionInfo
 +
| align="center" | No
 +
| | TBD
 +
|-
 +
| style="background:silver" |ChangePassword
 +
| style="background:silver" align="center" | Yes
 
| style="background:silver" | TBD
 
| style="background:silver" | TBD
|-  
+
|-
 
| GetHostName
 
| GetHostName
 
| align="center"  | No
 
| align="center"  | No
Line 45: Line 45:
 
|-  
 
|-  
 
| style="background:silver" |GetHosts
 
| style="background:silver" |GetHosts
| style="background:silver" align="center" | Yes
+
| style="background:silver" align="center" | No
 
| style="background:silver" | TBD
 
| style="background:silver" | TBD
 
|-  
 
|-  
Line 58: Line 58:
 
| GetSettings
 
| GetSettings
 
| align="center"  | No
 
| align="center"  | No
| TBD
+
| Used prior to 0.28
 
|-  
 
|-  
 +
| GetSetting
 +
| align="center"  | No
 +
| Gets an individual setting in 0.28+
 +
|-
 +
| GetSettingList
 +
| align="center"  | No
 +
| Gets a list of settings in 0.28+
 +
|-
 
| style="background:silver" |GetStorageGroupDirs
 
| style="background:silver" |GetStorageGroupDirs
 
| style="background:silver" align="center" | No
 
| style="background:silver" align="center" | No
Line 65: Line 73:
 
|-  
 
|-  
 
| GetTimeZone
 
| GetTimeZone
| align="center"  | Yes
+
| align="center"  | No
 
| TBD
 
| TBD
 
|-  
 
|-  
Line 97: Line 105:
 
|-  
 
|-  
 
| SendMessage
 
| SendMessage
| align="center"  | No
+
| align="center"  | No (0.28+ Yes)
 
| Send a message to one or more frontends, which will appear as a popup message on the screen.
 
| Send a message to one or more frontends, which will appear as a popup message on the screen.
 
|-  
 
|-  
 
| style="background:silver" |SendNotification
 
| style="background:silver" |SendNotification
| style="background:silver" align="center" | No
+
| style="background:silver" align="center" | No (0.28+ Yes)
 
| style="background:silver" | Send a notification to one or more frontends which will appear in the Notification Center.
 
| style="background:silver" | Send a notification to one or more frontends which will appear in the Notification Center.
 
|-  
 
|-  
Line 112: Line 120:
  
 
=Myth APIs=
 
=Myth APIs=
 +
 +
==GetSetting==
 +
 +
The <span style="color:LimeGreen">GetSetting</span> API takes the following arguments:
 +
 +
{{ServicesApiParam|name=Key|required=Required|type=String|comment=The mythconverg.setting value to retrieve}}
 +
{{ServicesApiParam|name=HostName|required=Optional|type=String|comment=If not used or empty the backend will use it's own HostName, use _GLOBAL_ to get a NULL setting}}
 +
{{ServicesApiParam|name=Default|required=Optional|type=String|comment=Default value if there's no match in the database}}
 +
 +
Example Queries:
 +
 +
<code>http://BackendIP:6544/Myth/GetSetting?Key=JobAllowCommFlag</code>
 +
 +
<code>http://BackendIP:6544/Myth/GetSetting?Key=mythfilldatabaseLastRunStart&HostName=_GLOBAL_</code>
 +
 +
Example Returns:
 +
 +
String return.  Returns an empty String if there was no such setting and Default wasn't used (or was empty.)
 +
 +
<pre><String>1</String></pre>
 +
<pre><String>2016-02-13T00:00:05Z</String></pre>
 +
 +
==GetSettingList==
 +
 +
The <span style="color:LimeGreen">GetSettingList</span> API takes the following argument:
 +
 +
{{ServicesApiParam|name=HostName|required=Optional|type=String|comment=If not used or empty the backend will return NULL settings}}
 +
 +
Example Query:
 +
 +
<code>http://BackendIP:6544/Myth/GetSettingList</code>
 +
 +
Example Return:
 +
 +
<pre>
 +
<HostName>backendHostName (or empty for NULL settings)</HostName>
 +
<Settings>
 +
<String>
 +
<Key>AC3PassThru</Key>
 +
<Value>1</Value>
 +
</String>
 +
...
 +
<String>
 +
<Key>weatherbackgroundfetch</Key>
 +
<Value>0</Value>
 +
</String>
 +
</Settings>
 +
</SettingList>
 +
</pre>
  
 
==SendMessage==
 
==SendMessage==
Line 131: Line 188:
 
:<span style="color:SteelBlue">udpPort</Span> ('''Optional''')
 
:<span style="color:SteelBlue">udpPort</Span> ('''Optional''')
 
:: '''Parameter Type:''' Integer
 
:: '''Parameter Type:''' Integer
:: UDP port to be used in combination with broadcast addres
+
:: UDP port to be used in combination with broadcast address
  
 
Example Query:
 
Example Query:
Line 199: Line 256:
 
:: The priority level of the notification
 
:: The priority level of the notification
 
:: 0 = default, 1 = low, 2 = medium, 3 = high, 4 = higher, 5 = highest
 
:: 0 = default, 1 = low, 2 = medium, 3 = high, 4 = higher, 5 = highest
 +
 +
:<span style="color:SteelBlue">Type</Span> ('''Optional''')
 +
:: '''Parameter Type:''' String
 +
:: The type of notification, valid values are:
 +
:: normal, error, warning, check, busy.
 +
:: this value is ignored if Error is set
  
 
:<span style="color:SteelBlue">Address</Span> ('''Optional''')
 
:<span style="color:SteelBlue">Address</Span> ('''Optional''')
Line 206: Line 269:
 
:<span style="color:SteelBlue">udpPort</Span> ('''Optional''')
 
:<span style="color:SteelBlue">udpPort</Span> ('''Optional''')
 
:: '''Parameter Type:''' Integer
 
:: '''Parameter Type:''' Integer
:: UDP port to be used in combination with broadcast addres
+
:: UDP port to be used in combination with broadcast address
  
 
Example Query:
 
Example Query:

Revision as of 15:41, 13 February 2016

What is this?

See Services API


Myth Service API List

API Command POST Required? Description
AddStorageGroupDir Yes TBD
CheckDatabase Yes TBD
AddStorageGroupDir Yes TBD
BackupDatabase Yes TBD
GetBackendInfo No (new in 0.28) Get basic information about the backend's configuration.
GetConnectionInfo No TBD
ChangePassword Yes TBD
GetHostName No TBD
GetHosts No TBD
GetKeys No TBD
GetLogs No TBD
GetSettings No Used prior to 0.28
GetSetting No Gets an individual setting in 0.28+
GetSettingList No Gets a list of settings in 0.28+
GetStorageGroupDirs No TBD
GetTimeZone No TBD
ProfileDelete Yes TBD
ProfileSubmit Yes TBD
ProfileText Yes TBD
ProfileURL Yes TBD
ProfileUpdated No TBD
PutSetting Yes TBD
RemoveStorageGroupDir Yes TBD
SendMessage No (0.28+ Yes) Send a message to one or more frontends, which will appear as a popup message on the screen.
SendNotification No (0.28+ Yes) Send a notification to one or more frontends which will appear in the Notification Center.
TestDBSettings Yes TBD

Myth APIs

GetSetting

The GetSetting API takes the following arguments:


    Key (Required)
        Parameter Type: String
        The mythconverg.setting value to retrieve.


    HostName (Optional)
        Parameter Type: String
        If not used or empty the backend will use it's own HostName, use _GLOBAL_ to get a NULL setting.


    Default (Optional)
        Parameter Type: String
        Default value if there's no match in the database.


Example Queries:

http://BackendIP:6544/Myth/GetSetting?Key=JobAllowCommFlag

http://BackendIP:6544/Myth/GetSetting?Key=mythfilldatabaseLastRunStart&HostName=_GLOBAL_

Example Returns:

String return. Returns an empty String if there was no such setting and Default wasn't used (or was empty.)

<String>1</String>
<String>2016-02-13T00:00:05Z</String>

GetSettingList

The GetSettingList API takes the following argument:


    HostName (Optional)
        Parameter Type: String
        If not used or empty the backend will return NULL settings.


Example Query:

http://BackendIP:6544/Myth/GetSettingList

Example Return:

<HostName>backendHostName (or empty for NULL settings)</HostName>
<Settings>
<String>
<Key>AC3PassThru</Key>
<Value>1</Value>
</String>
...
<String>
<Key>weatherbackgroundfetch</Key>
<Value>0</Value>
</String>
</Settings>
</SettingList>

SendMessage

The SendMessage API takes the following arguments:

Message (Required)
Parameter Type: String
The message to appear on the frontend popup.
Timeout (Optional)
Parameter Type: Integer
how long the message will be displayed for, if 0 or not set, user will have to dismiss it manually
Address (Optional)
Parameter Type: String
Broadcast address
udpPort (Optional)
Parameter Type: Integer
UDP port to be used in combination with broadcast address

Example Query:

http://BackendIP:6544/Frontend/SendMessage?Message=Hello World

Example Return:

Boolean return. Returns true if the message was sent, false if the message failed.

<bool>true</bool>

SendNotification

The SendNotification API takes the following arguments:

Message (Required)
Parameter Type: String
The message to appear on the frontend notification center.
Error ("Optional")
Parameter Type: Boolean
The notification will be set as an error
Origin (Optional)
Parameter Type: String
The notification's origin
Description (Optional)
Parameter Type: String
The description to be sent in the notification
Image (Optional)
Parameter Type: String
The path or URL to image to be displayed in notification
Extra (Optional)
Parameter Type: String
The extra text to be sent in the notification
Progress (Optional)
Parameter Type: Float
A value between 0 and 1 (inclusive) indicating the progressiong percentage (1 is 100%).
- a negative value indicates not to display a progress bar
ProgressText (Optional)
Parameter Type: String
The text to be shown alongside the progress bar (if visible)
Timeout (Optional)
Parameter Type: Integer
The number of seconds the notification will be displayed for
Note that a notification can't be displayed for less than 5s
Fullscreen (Optional)
Parameter Type: Boolean
Display the notification in full screen mode
Visibility (Optional)
Parameter Type: Unsigned Integer
A bitmask value setting the visibility of the notification
(bit 0: video playback, bit 1: settings, bit 2: setup wizard, bit 3: video library
bit 4: music, bit 5: recordings library)
Priority (Optional)
Parameter Type: Unsigned Integer
The priority level of the notification
0 = default, 1 = low, 2 = medium, 3 = high, 4 = higher, 5 = highest
Type (Optional)
Parameter Type: String
The type of notification, valid values are:
normal, error, warning, check, busy.
this value is ignored if Error is set
Address (Optional)
Parameter Type: String
Broadcast address
udpPort (Optional)
Parameter Type: Integer
UDP port to be used in combination with broadcast address

Example Query:

http://BackendIP:6544/Frontend/SendNotification?Message=Hello World

Example Return:

Boolean return. Returns true if the notification was sent, false if the notification failed.

<bool>true</bool>