Python Api
IE10.1
|
Classes | |
class | PluginError |
plugin error code More... | |
class | Thread |
Wrapper class of threading.Thread for pluginfw If we need use multi-threads in plugin, we need copy the context to new thread. More... | |
Functions | |
def | GetOpUserId () |
get the operation user id. More... | |
def | GetOpUserName () |
get the operation user name. More... | |
def | GetTaskId () |
get the worker task id. More... | |
def | GetAPIContext () |
Get Context Object Pointer in FW Worker, this Context Object is local in thread. More... | |
def | SetAPIContext (contextAddr) |
This method will clone one Context Object in new thread. More... | |
def | ReleaseAPIContext () |
set the plugin API context to null. More... | |
def | AddLog (content, logType=INFO) |
Add logs to plugin exction. More... | |
def | GetExcutionLogs () |
get excution log in current task. More... | |
def | IsUserStopped () |
Test if the task has canceled by user. More... | |
def | SetError (errorCode, errorMsg) |
Set the error message and error code. More... | |
def | GetRunParam () |
Get the plugin running params. More... | |
def | GetXfTaskId () |
Get the xf task id of plugin schedluler(benchmrak task id,discover task id,schedule plugin task id) More... | |
def | GetTaskSourceType () |
Get the xf task source type. More... | |
def | GetTaskSourceId () |
get the task source id,it is the Id of benchmarkdefine or shceduleplugin More... | |
def | GetTaskTargetDevices () |
Get target devices of current task,work only if current task type is Benchmark,otherwise return empty list. More... | |
def | GetTaskAPIServerIDList () |
Get sdn scope range of current task,work only if current task type is Benchmark,otherwise return empty list. More... | |
def | GetQualifyDeviceIds () |
Variables | |
int | DEBUG = 0 |
debug log level More... | |
int | INFO = 1 |
info log level More... | |
int | WARNING = 2 |
waring log level More... | |
int | ERROR = 3 |
error log level More... | |
def pluginfw.AddLog | ( | content, | |
logType = INFO |
|||
) |
Add logs to plugin exction.
content | (string) content of log. |
logType | (string) log level. |
def pluginfw.GetAPIContext | ( | ) |
Get Context Object Pointer in FW Worker, this Context Object is local in thread.
If we need use multi-threads in plugin, we need use this method in C++ Thread and use SetAPIContext in Python Thread before call any C++ API.
sample code:
def pluginfw.GetExcutionLogs | ( | ) |
get excution log in current task.
def pluginfw.GetOpUserId | ( | ) |
get the operation user id.
def pluginfw.GetOpUserName | ( | ) |
get the operation user name.
def pluginfw.GetQualifyDeviceIds | ( | ) |
def pluginfw.GetRunParam | ( | ) |
Get the plugin running params.
def pluginfw.GetTaskAPIServerIDList | ( | ) |
Get sdn scope range of current task,work only if current task type is Benchmark,otherwise return empty list.
def pluginfw.GetTaskId | ( | ) |
get the worker task id.
def pluginfw.GetTaskSourceId | ( | ) |
get the task source id,it is the Id of benchmarkdefine or shceduleplugin
def pluginfw.GetTaskSourceType | ( | ) |
Get the xf task source type.
def pluginfw.GetTaskTargetDevices | ( | ) |
Get target devices of current task,work only if current task type is Benchmark,otherwise return empty list.
def pluginfw.GetXfTaskId | ( | ) |
Get the xf task id of plugin schedluler(benchmrak task id,discover task id,schedule plugin task id)
def pluginfw.IsUserStopped | ( | ) |
Test if the task has canceled by user.
if we check it is true in plugin,we should End the script as soon as possible. otherwise,it maybe kill by xfagent.
def pluginfw.ReleaseAPIContext | ( | ) |
set the plugin API context to null.
def pluginfw.SetAPIContext | ( | contextAddr | ) |
This method will clone one Context Object in new thread.
Only first call will do clone, more calls will do nothing
contextAddr | (C++ pointer)address of plugin API context,is get from C++ Api by call GetAPIContext |
def pluginfw.SetError | ( | errorCode, | |
errorMsg | |||
) |
Set the error message and error code.
errorCode | (int) error code |
errorMsg | (string) error message |
int pluginfw.DEBUG = 0 |
debug log level
int pluginfw.ERROR = 3 |
error log level
int pluginfw.INFO = 1 |
info log level
int pluginfw.WARNING = 2 |
waring log level