Difference between revisions of "DBus Methods"
Deubeuliou (talk | contribs) (layout) |
m (removed documentation category) |
||
(13 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
− | This is a documentation of the DBus interface. Mostly useful for creating scripts for interacting with | + | This is a documentation of the DBus interface. Mostly useful for creating scripts for interacting with Murmur. |
= net.sourceforge.mumble.Meta = | = net.sourceforge.mumble.Meta = | ||
− | + | *'''start''' | |
− | Starts a virtual server | + | :Starts a virtual server |
− | + | :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 | ||
− | + | *'''newServer''' | |
− | + | :Creates a new virtual server | |
− | + | :output parameters: | |
− | * [int] server_id The | + | :* [int] server_id The id of the new created server |
− | + | *'''deleteServer''' | |
− | + | :deletes a virtual server | |
− | + | :input parameters: | |
− | * [int] server_id The | + | :*[int] server_id The specific server |
− | + | *'''getBootedServers''' | |
− | + | :Returns a list of all active servers | |
− | + | :output parameters: | |
− | * [int] server_id | + | :*[int]* server_id |
− | + | *'''getAllServers''' | |
− | Returns a list of all | + | :Returns a list of all servers |
− | + | :output parameters: | |
− | * [int]* server_id | + | :* [int]* server_id |
− | + | *'''isBooted''' | |
− | + | :check, whether a server is booted | |
− | + | :input parameters: | |
− | * [int]* | + | :* [int] server_id |
+ | :output parameters: | ||
+ | :* [boolean] is_booted | ||
− | + | *'''getConf''' | |
− | + | :receive the configuration of a server by key | |
− | + | :input parameters: | |
− | * [int] server_id | + | :* [int] server_id |
− | + | :* [string] key | |
− | * [ | + | :output parameters: |
+ | :* [string] value | ||
− | + | *'''getAllConf''' | |
− | receive the configuration of a server | + | :receive the whole configuration of a server |
− | + | :input parameters: | |
− | * [int] server_id | + | :* [int] server_id |
− | + | :output parameters: | |
− | + | :* [string|string]* key->value map | |
− | * [string] value | ||
− | + | *'''getDefaultConf''' | |
− | receive the | + | :receive the default configuration |
− | + | :output parameters: | |
− | + | :* [string|string]* key->value map | |
− | |||
− | * [string|string]* key->value map | ||
− | + | *'''setConf''' | |
− | + | :set the value of a specific key on a specific server | |
− | + | :input parameters: | |
− | * [string | + | :* [int] server_id |
+ | :* [string] key | ||
+ | :* [string] value | ||
− | + | *'''setSuperUserPassword''' | |
− | set the | + | :set the superuser password on a specific server |
− | + | :input parameters: | |
− | * [int] server_id | + | :* [int] server_id |
− | * [string] | + | :* [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 == | == getPlayers == | ||
* input:nothing | * input:nothing | ||
* returns a list of PlayerInfoExtended(see below) | * returns a list of PlayerInfoExtended(see below) | ||
− | = getChannels = | + | == getChannels == |
* input:nothing | * input:nothing | ||
* returns a list of ChannelInfo(idem) | * returns a list of ChannelInfo(idem) | ||
− | = getACL = | + | == getACL == |
* input:chan identifier(int) | * input:chan identifier(int) | ||
* returns a list containing [a list of ACLInfo, a list of GroupInfo, a boolean for inherit] | * returns a list containing [a list of ACLInfo, a list of GroupInfo, a boolean for inherit] | ||
− | = setACL (todo) = | + | == setACL (todo) == |
* | * | ||
* | * | ||
− | = getBans = | + | == getBans == |
* nothing | * nothing | ||
* list of BanInfo | * list of BanInfo | ||
− | = setBans = | + | == setBans == |
* list of BanInfo | * list of BanInfo | ||
* nothing | * nothing | ||
− | = getPlayerState = | + | == getPlayerState == |
* player session id(unsigned int) (warning, unsigned ints are special, see below) | * player session id(unsigned int) (warning, unsigned ints are special, see below) | ||
* PlayerInfo | * PlayerInfo | ||
− | = setPlayerState = | + | == setPlayerState == |
* PlayerInfo | * PlayerInfo | ||
* nothing | * nothing | ||
− | = getPlayerNames = | + | == getPlayerNames == |
* list of session id(unsigned ints) (warning, same as above) | * list of session id(unsigned ints) (warning, same as above) | ||
* list of names(unicode strings) | * list of names(unicode strings) | ||
− | = getPlayerIds = | + | == getPlayerIds == |
* list of names(strs on unicode strs) | * list of names(strs on unicode strs) | ||
* list of IDs(ints(regular ones)) | * list of IDs(ints(regular ones)) | ||
− | = addChannel = | + | == addChannel == |
* name(str or unicode str) , parent's id(int) | * name(str or unicode str) , parent's id(int) | ||
* id of the new chan(int) | * id of the new chan(int) | ||
− | = removeChannel = | + | == removeChannel == |
* chan id(int) | * chan id(int) | ||
* nothing | * nothing | ||
− | = setChannelState = | + | == setChannelState == |
* ChannelInfo | * ChannelInfo | ||
* nothing | * nothing | ||
− | = kickPlayer = | + | == kickPlayer == |
* session id(unsigned int) , reason(str or unicode str) | * session id(unsigned int) , reason(str or unicode str) | ||
* nothing | * 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.) | 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.) | ||
+ | <pre> | ||
>>>import dbus | >>>import dbus | ||
>>>egg=178L | >>>egg=178L | ||
− | >>>spam = dbus.UInt32( | + | >>>spam = dbus.UInt32(egg) #may vary depending on your plateform |
and now, spam is a dBus unsigned int and is ready to be sent | and now, spam is a dBus unsigned int and is ready to be sent | ||
+ | </pre> | ||
− | + | = 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 | + | :(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)) | |
− | (id:int, name:str, | + | : |
− | + | *'''ChannelInfo''' is a tuple containing: | |
− | (name:str, | + | :(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: | To access the server interface, proceed as following: | ||
+ | <pre> | ||
>>>import dbus | >>>import dbus | ||
>>>bus = dbus.SystemBus() # assuming that you are using a system bus | >>>bus = dbus.SystemBus() # assuming that you are using a system bus | ||
Line 178: | Line 180: | ||
>>> # to use methods, do: | >>> # to use methods, do: | ||
>>>server.method(args) | >>>server.method(args) | ||
+ | </pre> | ||
+ | |||
+ | [[Category:Development]] | ||
+ | [[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.
Contents
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)