Difference between revisions of "DBus Methods"

From Mumble Wiki
Jump to: navigation, search
(added categories)
m (removed documentation category)
 
(6 intermediate revisions by 3 users not shown)
Line 3: Line 3:
 
= net.sourceforge.mumble.Meta =
 
= net.sourceforge.mumble.Meta =
  
== start ==
+
*'''start'''
Starts a virtual server
+
:Starts a virtual server
=== input parameters ===
+
:input parameters:
* [int] server_id The specific server
+
:* [int] server_id The specific server
 +
*'''stop'''
 +
:Stops a virtual server
 +
:input parameters:
 +
:*[int] server_id The specific server
  
== stop ==
+
*'''newServer'''
Stops a virtual server
+
:Creates a new virtual server
=== input parameters ===
+
:output parameters:
* [int] server_id The specific server
+
:* [int] server_id The id of the new created server
  
== newServer ==
+
*'''deleteServer'''
Creates a new virtual server
+
:deletes a virtual server
=== output parameters ===
+
:input parameters:
* [int] server_id The id of the new created server
+
:*[int] server_id The specific server
  
== deleteServer ==
+
*'''getBootedServers'''
deletes a virtual server
+
:Returns a list of all active servers
=== input parameters ===
+
:output parameters:
* [int] server_id The specific server
+
:*[int]* server_id
  
== getBootedServers ==
+
*'''getAllServers'''
Returns a list of all active servers
+
:Returns a list of all servers
=== output parameters ===
+
:output parameters:
* [int]* server_id
+
:* [int]* server_id
  
== getAllServers ==
+
*'''isBooted'''
Returns a list of all servers
+
:check, whether a server is booted
=== output parameters ===
+
:input parameters:
* [int]* server_id
+
:* [int] server_id
 +
:output parameters:
 +
:* [boolean] is_booted
  
== isBooted ==
+
*'''getConf'''
check, whether a server is booted
+
:receive the configuration of a server by key
=== input parameters ===
+
:input parameters:
* [int] server_id
+
:* [int] server_id
=== output parameters ===
+
:* [string] key
* [boolean] is_booted
+
:output parameters:
 +
:* [string] value
  
== getConf ==
+
*'''getAllConf'''
receive the configuration of a server by key
+
:receive the whole configuration of a server
=== input parameters ===
+
:input parameters:
* [int] server_id
+
:* [int] server_id
* [string] key
+
:output parameters:
=== output parameters ===
+
:* [string|string]* key->value map
* [string] value
+
  
== getAllConf ==
+
*'''getDefaultConf'''
receive the whole configuration of a server
+
:receive the default configuration
=== input parameters ===
+
:output parameters:
* [int] server_id
+
:* [string|string]* key->value map
=== output parameters ===
+
* [string|string]* key->value map
+
  
== getDefaultConf ==
+
*'''setConf'''
receive the default configuration
+
:set the value of a specific key on a specific server
=== output parameters ===
+
:input parameters:
* [string|string]* key->value map
+
:* [int] server_id
 +
:* [string] key
 +
:* [string] value
  
== setConf ==
+
*'''setSuperUserPassword'''
set the value of a specific key on a specific server
+
:set the superuser password on a specific server
=== input parameters ===
+
:input parameters:
* [int] server_id
+
:* [int] server_id
* [string] key
+
:* [string] password
* [string] value
+
  
== setSuperUserPassword ==
+
*'''rotateLogs'''
set the superuser password on a specific server
+
:rotate the logs
=== input parameters ===
+
* [int] server_id
+
* [string] password
+
  
== rotateLogs ==
+
*'''getLog'''
rotate the logs
+
:get the log of a specific server in a specific time frame
 +
:input parameters:
 +
:* [int] server_id
 +
:* [int] min_seconds
 +
:* [int] max_seconds
  
== getLog ==
+
*'''quit'''
get the log of a specific server in a specific time frame
+
:shutdown the server
=== input parameters ===
+
* [int] server_id
+
* [int] min_seconds
+
* [int] max_seconds
+
 
+
== quit ==
+
shutdown the server
+
  
 
= Server-specific methods =
 
= Server-specific methods =
Line 153: Line 152:
 
</pre>
 
</pre>
  
= Structures(e.g. omagad, what is PlayerInfo ???) =
+
= Structures (e.g. omagad, what is PlayerInfo ???) =
  
"PlayerInfo" is a tuple(static list) containing(dont forget to transform session before sending it):
+
*'''PlayerInfo''' is a tuple (static list) containing (dont forget to transform session before sending it):
(session:long, mute:bool, deaf:bool, suppressed:bool, selfMute:bool, selfDeaf:bool, channel:int)   
+
:(session:long, mute:bool, deaf:bool, suppressed:bool, selfMute:bool, selfDeaf:bool, channel:int)   
  
"PlayerInfoExtended" is a tuple(static list) containing(you just receive it with getPlayerState, you never have to send one)(notice that the 7 first are exactly the same as PlayInfo):
+
*'''PlayerInfoExtended''' is a tuple (static list) containing (you just receive it with getPlayerState, you never have to send one)(notice that the 7 first are exactly the same as PlayerInfo: (session:long, mute:bool, deaf:bool, suppressed:bool, selfMute:bool, selfDeaf:bool, channel:int, id:int, name:unicode str, onlinesecs:int, bytespersecond:int))
(session:long, mute:bool, deaf:bool, suppressed:bool, selfMute:bool, selfDeaf:bool, channel:int, id:int, name:unicode str, onlinesecs:int, bytespersecond:int)
+
:
  
"ChannelInfo" is a tuple containing:
+
*'''ChannelInfo''' is a tuple containing:
(id:int, name:str, parent:int, links:list of ints)
+
:(id:int, name:str, parent:int, links:list of ints)
  
"GroupInfo":
+
*'''GroupInfo''':
(name:str, inherited:bool, inherit:bool, inheritable:bool, add:list, remove:list, members:list)
+
:(name:str, inherited:bool, inherit:bool, inheritable:bool, add:list, remove:list, members:list)
  
"ACLInfo":
+
*'''ACLInfo''':
(applyThere:bool, applySubs:bool, inherited:bool, id:int, group:str, allow:long, deny:long)
+
:(applyThere:bool, applySubs:bool, inherited:bool, id:int, group:str, allow:long, deny:long)
  
"BanInfo":
+
*'''BanInfo''':
(address:long, bits:int)
+
:(address:long, bits:int)
  
 
= Implementation =
 
= Implementation =
Line 184: Line 183:
  
 
[[Category:Development]]
 
[[Category:Development]]
[[Category:Documentation]]
 
 
[[Category:Documentation English]]
 
[[Category:Documentation English]]

Latest revision as of 19:45, 23 October 2014

This is a documentation of the DBus interface. Mostly useful for creating scripts for interacting with Murmur.

net.sourceforge.mumble.Meta

  • start
Starts a virtual server
input parameters:
  • [int] server_id The specific server
  • stop
Stops a virtual server
input parameters:
  • [int] server_id The specific server
  • newServer
Creates a new virtual server
output parameters:
  • [int] server_id The id of the new created server
  • deleteServer
deletes a virtual server
input parameters:
  • [int] server_id The specific server
  • getBootedServers
Returns a list of all active servers
output parameters:
  • [int]* server_id
  • getAllServers
Returns a list of all servers
output parameters:
  • [int]* server_id
  • isBooted
check, whether a server is booted
input parameters:
  • [int] server_id
output parameters:
  • [boolean] is_booted
  • getConf
receive the configuration of a server by key
input parameters:
  • [int] server_id
  • [string] key
output parameters:
  • [string] value
  • getAllConf
receive the whole configuration of a server
input parameters:
  • [int] server_id
output parameters:
  • [string|string]* key->value map
  • getDefaultConf
receive the default configuration
output parameters:
  • [string|string]* key->value map
  • setConf
set the value of a specific key on a specific server
input parameters:
  • [int] server_id
  • [string] key
  • [string] value
  • setSuperUserPassword
set the superuser password on a specific server
input parameters:
  • [int] server_id
  • [string] password
  • rotateLogs
rotate the logs
  • getLog
get the log of a specific server in a specific time frame
input parameters:
  • [int] server_id
  • [int] min_seconds
  • [int] max_seconds
  • quit
shutdown the server

Server-specific methods

getPlayers

  • input:nothing
  • returns a list of PlayerInfoExtended(see below)

getChannels

  • input:nothing
  • returns a list of ChannelInfo(idem)

getACL

  • input:chan identifier(int)
  • returns a list containing [a list of ACLInfo, a list of GroupInfo, a boolean for inherit]

setACL (todo)

getBans

  • nothing
  • list of BanInfo

setBans

  • list of BanInfo
  • nothing

getPlayerState

  • player session id(unsigned int) (warning, unsigned ints are special, see below)
  • PlayerInfo

setPlayerState

  • PlayerInfo
  • nothing

getPlayerNames

  • list of session id(unsigned ints) (warning, same as above)
  • list of names(unicode strings)

getPlayerIds

  • list of names(strs on unicode strs)
  • list of IDs(ints(regular ones))

addChannel

  • name(str or unicode str) , parent's id(int)
  • id of the new chan(int)

removeChannel

  • chan id(int)
  • nothing

setChannelState

  • ChannelInfo
  • nothing

kickPlayer

  • session id(unsigned int) , reason(str or unicode str)
  • nothing

Warning

unsigned ints are a bit strange. They look like longs when Python reads them (1786L for instance) but Python must transform them before sending them ot dbus.)

>>>import dbus
>>>egg=178L
>>>spam = dbus.UInt32(egg)  #may vary depending on your plateform
and now, spam is a dBus unsigned int and is ready to be sent

Structures (e.g. omagad, what is PlayerInfo ???)

  • PlayerInfo is a tuple (static list) containing (dont forget to transform session before sending it):
(session:long, mute:bool, deaf:bool, suppressed:bool, selfMute:bool, selfDeaf:bool, channel:int)
  • PlayerInfoExtended is a tuple (static list) containing (you just receive it with getPlayerState, you never have to send one)(notice that the 7 first are exactly the same as PlayerInfo: (session:long, mute:bool, deaf:bool, suppressed:bool, selfMute:bool, selfDeaf:bool, channel:int, id:int, name:unicode str, onlinesecs:int, bytespersecond:int))
  • ChannelInfo is a tuple containing:
(id:int, name:str, parent:int, links:list of ints)
  • GroupInfo:
(name:str, inherited:bool, inherit:bool, inheritable:bool, add:list, remove:list, members:list)
  • ACLInfo:
(applyThere:bool, applySubs:bool, inherited:bool, id:int, group:str, allow:long, deny:long)
  • BanInfo:
(address:long, bits:int)

Implementation

To access the server interface, proceed as following:

>>>import dbus
>>>bus = dbus.SystemBus() # assuming that you are using a system bus
>>>server = bus.get_object('net.sourceforge.mumble.murmur', '/1') # assuming that you want to control the server number 1
>>> # to use methods, do:
>>>server.method(args)