The communication is a python library that lets you send commands to Ockle from a python shell using an external program.
Ockle PDU and servers manager Client calls to the Ockle server
Created on Apr 25, 2012
@author: Guy Sheffer <guy.sheffer at mail.huji.ac.il>
Delete an INI file from Ockle’s configuration
Parameters: | iniPath – the path of the ini file starting from the ‘etc’ folder |
---|---|
Returns: | A response from Ockle |
Delete a section from an INI file in Ockle’s configuration
Parameters: |
|
---|---|
Returns: | A response from Ockle |
Get the status of the Auto Control plugin
Returns: | A dict with a key ‘status’ holding the status of Auto Control |
---|
Get the currently available controller types list
Returns: | a sorted dict of controllers, the key is the name of the controller, and extra information is within the dict’s value |
---|
Get the currently available PDU types list
Returns: | a sorted dict of PDUs, the key is the name of the PDU, and extra information is within the dict’s value |
---|
Get the list of available plugins
Returns: | a dict with the plugin names as keys and the description as the value |
---|
Get the currently configured controls of a given server
Returns: | a sorted dict of controls, the key is the name of the test, and extra information is within the dict’s value |
---|
Get the currently configured servers list
Returns: | a sorted dict of servers, the key is the name of the server, and extra information is within the dict’s value |
---|
Get the currently configured tests of a given server
Returns: | a sorted dict of tests, the key is the name of the test, and extra information is within the dict’s value |
---|
Get the currently available testers type list
Returns: | a sorted dict of testers, the key is the name of the tester, and extra information is within the dict’s value |
---|
Get a dict of the current controllers that are configured
Returns: | A dict of controllers with the key as their name and the value as their description |
---|
Get the configuration folder of all controllers
Returns: | A string of the folder name |
---|
Send a command to the Ockle server, and return the responce dict
Parameters: |
|
---|---|
Returns: | A dict with the response data, None if we failed to connect |
Get an INI file from Ockle’s configuration
Parameters: | iniPath – the path of the ini file starting from the ‘etc’ folder |
---|---|
Returns: | A string with the ini file contents |
Get a dict of the current PDUs that are configured
Returns: | A dict of PDUs with the key as their name and the value as their description |
---|
Get the configuration folder of all PDUs
Returns: | A string of the folder name |
---|
Get a dict of the available dependencies that can be created for a server
Parameters: | server – the server that is going to have the new dependency |
---|---|
Returns: | A dict of servers and their description |
Get a dict of the current servers that are configured
Returns: | A dict of servers with the key as their name and the value as their description |
---|
Get the configuration folder of all servers
Returns: | A string of the folder name |
---|
Get a server tree status from the Ockle server, and return a dict ready to be parsed by a pyramid view
Returns: | a string with the dot graph |
---|
Get information of the server
Parameters: | serverName – the server’s name |
---|---|
Returns: | a dict of string of the server’s info |
Get a dict of the current testers that are configured
Returns: | A dict of testers with the key as their name and the value as their description |
---|
Get the configuration folder of all testers
Returns: | A string of the folder name |
---|
A command to list all available commands on the communication server
Returns: | A dict with the command names as the key and a description if available as their value |
---|
Get the config on an ini file @param configPath: the path to the config relative to etc @return: a dict of the config
Load an INI file and template data so it would display correctly. Is called with loadINIFileConfig(configPath)
Parameters: | templatesPaths – A path, or list of paths relative to ‘src/config’ |
---|---|
Returns: | A dicts of the template |
Switch a server outlet on or off
Parameters: | dataDict – a dict holding two keys: ‘server’ key for the server’s name and an ‘obj’ key for the outlet’s name |
---|---|
Returns: | the OpState of the test |
Get a dict of servers that this server is dependent on
Parameters: | server – The server to check for |
---|---|
Returns: | a dict of servers that this server is dependent on |
Set the status of Auto Control
Param : | dataDict: A dictionary with the field status which is either ‘on’ or ‘off’ |
---|---|
Returns: | A dict similar to ::func: getAutoControlStatus |
Set an INI file from Ockle’s configuration
Parameters: |
|
---|---|
Returns: | A response from Ockle |
Set a server on or off
Parameters: | dataDict – A dict with two keys, one with the key ‘server’ which holds the server name in its value, and another with the key ‘state’ where its value is wither ‘on’ or ‘off’ |
---|---|
Returns: | A dict with the key ‘status’ containing a string reply from Ockle |
Switch a server control on or off
Parameters: | dataDict – a dict holding three keys: ‘server’ key for the server’s name, an ‘obj’ key for the control’s name and the ‘state’ key with a string ‘on’ or ‘off’ |
---|---|
Returns: | the OpState of the control |
A master command to turn all the servers on the network on or off
Parameters: | dataDict – a dict with the key ‘state’ that has a string ‘true’ or ‘false’ |
---|---|
Returns: | a dict with the key ‘status’ with a string reply from Ockle |
Switch a server outlet on or off
Parameters: | dataDict – a dict holding three keys: ‘server’ key for the server’s name, an ‘obj’ key for the outlet’s name and the ‘state’ key with a string ‘on’ or ‘off’ |
---|---|
Returns: | the OpState of the outlet |
Here is a simple example on how to use the ockle_client module:
import webserver.ockle_client.ClientCalls as ockleClient
ockleClient.PORT = 8088
ockleClient.OCKLE_SERVER_HOSTNAME = 'localhost'
print ockleClient.listCommands()