C.3 Python (idmlib.py) Reference

These scripts are written for the Linux and UNIX Perl interpreter. They are located in the scripts folder below the folder where the driver was installed (/opt/novell/usdrv/ by default).

Subscriber events are submitted to subscriber.py, which then calls the script for the event. Modify the Perl script file corresponding to the event type: add.py, modify.py, modify-password.py, delete.py, move.py, rename.py. Queries of the external system should be handled in query.py.

The Publisher calls poll.py periodically. The frequency of the poll is determined by the Polling Interval driver parameter (60 seconds by default). Edit poll.py to allow the driver to respond to events in the external account management system.

The Publisher calls heartbeat.py periodically to determine whether the external account management system is responding correctly.

The built-in functions below are defined in idmLib.py.

C.3.1 General Functions

idmgetvar(VariableName)

Returns the string value for the Driver parameter specified by the string ParamName.

idmtrace(Message)

Appends the specified message to the user-defined trace file.

exec(Command)

Executes an external program using the specified command line, and returns its numerical exit code on completion.

status(Level, Message)

Sends a status document with given level and message to return to the Identity Manager engine when the script completes.

status_success(Message)

Sends a status document with a success level and message to return to the Identity Manager engine when the script completes.

status_warning(Message)

Sends a status document with a warning level and message to return to the Identity Manager engine when the script completes.

status_retry(Message)

Sends a status document with a retry level and message to return to the Identity Manager engine when the script completes.

status_error(Message)

Sends a status document with a error level and message to return to the Identity Manager engine when the script completes.

status_fatal(Message)

Sends a status document with a fatal level and message to return to the Identity Manager engine when the script completes.

C.3.2 Subscriber Functions

idmgetsubvar(VariableName)

Returns the string value for the Subscriber parameter specified by the string VariableName.

idmgetvar(Name)

Returns a string value for the item specified by Name through standard output. If no values exist, Empty is returned. If the value is multi-valued, each value is separated by a newline character.

idmsetvar(Name, Value)

Sets a single string value for the item specified by Name to be returned to the driver engine.

C.3.3 Publisher Functions

idmgetpubvar(VariableName)

Returns the string value for the Publisher parameter specified by the string VariableName.

C.3.4 Query Functions

idmquery(ClassName, Association, ReadAttrs)

Performs a query to the engine with the given ClassName, Association and ReadAttrs.

idmgetqva(ParamName)

Retrieves a string value for the query result item, specified by ParamName, through standard output. If no values exist, Empty is returned. If the value is multi-valued, each value is separated by a newline character.

C.3.5 Heartbeat Functions

heartbeat_success(Message)

Use these functions in the heartbeat.py script to indicate the status of the external application. Heartbeat documents are sent to the engine in following format:

  <status level="success" type="heartbeat">This is a heartbeat message</status>

heartbeat_error(Message)

Use these functions in the heartbeat.py script to indicate the status of the external application. Heartbeat documents are sent to the engine in following format:

  <status level="success" type="heartbeat">This is a heartbeat message</status>

heartbeat_warning($Message)

Use these functions in the heartbeat.py script to indicate the status of the external application. Heartbeat documents are sent to the engine in following format:

  <status level="success" type="heartbeat">This is a heartbeat message</status>