Skip to main content

Callbacks

Logging callbacks

Debug Log

Logs a message at debug (5) level.

Signature: log.debug(message)

Parameters:

  • message - The message that should be logged

Error Log

Logs a message at error (1) level.

Signature: log.error(message)

Parameters:

  • message - The message that should be logged

Info Log

Logs a message at info (4) level.

Signature: log.info(message)

Parameters:

  • message - The message that should be logged

Warning Log

Logs a message at warning (2) level.

Signature: log.warning(message)

Parameters:

  • message - The message that should be logged

Listing callbacks

Add Account

Adds an account and it's information to the list file.

Signature: agent.addAccount('stableid', 'longid', 'shortid', attrsDict, groupsDict)

Parameters:

  • stableid - The ID for the account that cannot be changed

  • longid - The ID for the account that will be used to identify it in operations

  • shortid - The ID for the account that is human readable and will be displayed in the UI

  • attrsDict - Dictionary object of the attributes for the account

  • groupsDict - Dictionary object of the memberships for the account

Return Value:

Remarks:

This callback should only be used in the list users operation.

For the expected format on the dictionary objects see the definitions section for full details.

Add Computer

Adds a computer and it's information to the list file.

Signature: agent.addComputer('compid', 'desc', disabledStatus, attrsDict)

Parameters:

  • compid - The id of the computer object that will be used to identify it in operations

  • desc - The description for the computer that is human readable and will be displayed in the UI

  • disabledStatus - Boolean flag for if the computer is enabled or disabled

  • attrsDict - Dictionary object of the attributes for the computer object

Remarks:

This callback should only be used in the list computers operation

For the expected format on the dictionary objects see the definitions section for full details.

Add Group

Adds a group and it's information to the list file.

Signature: agent.addGroup('stableid', 'longid', 'shortid', attrsDict, ownersDict, membersDict)

Parameters:

  • stableid - The ID for the group that cannot be changed

  • longid - The ID for the group that will be used to identify it in operations

  • shortid - The ID for the account that is human readable and will be displayed in the UI

  • attrsDict - Dictionary object of the attributes for the group

  • ownersDict - Dictionary object of the owners for the group

  • membersDict - Dictionary object of the group's members

Remarks:

This callback should only be used in the list groups operation

For the expected format on the dictionary objects see the definitions section for full details.

Add Subscriber

Adds a subscriber and it's information to the list file.

Signature: agent.addSubscriber('subid', 'desc', disabledStatus, 'subacct', 'stableid', 'longid', 'shortid', 'securitydomain', attrsDict)

Parameters:

  • subid - The ID for the subscriber that will be used to identify it in operations

  • desc - The description for the subscriber that is human readable and will be displayed in the UI

  • disabledStatus - Boolean flag for if the subscriber is enabled or disabled

  • subacct - Long ID for the subscription account

  • stableid - Stable ID for the subscription account

  • longid - Long ID for the subscription account

  • shortid - The ID for the subscription account that is human readable and will be displayed in the UI

  • securitydomain - The security domain of the subscription account

  • attrsDict - Dictionary object of the attributes for the subscriber

Remarks:

This callback should only be used in the list subscribers operation

For the expected format on the dictionary objects see the definitions section for full details.

Return callbacks

Add Account Attribute

Adds an attribute and it's value(s) to the output KVG.

Signature: agent.addAccountAttr('name', valueList)

Parameters:

  • name - The name of the attribute

  • valueList - One or more values for the attribute

Remarks:

For the valueList either a single string value may be specified or a list of string values if the attribute can be multi-valued.

Add Address Attribute

Defines an address attribute for the scripted platform.

Signature: agent.addAddressAttr('name', 'desc', 'type', 'valueDefault', required, advancedOptions)

Parameters:

  • name - Name of the address attribute

  • desc - Description of the address attribute

  • type - The type of the address attribute

  • valueDefault - The default value that should be used if the address attribute is not specified

  • required - Boolean flag for If the address attribute is required to be specified

  • advancedOptions - Defines the potential values when adding a "restricted" type attribute

Remarks:

Valid options for the type parameter are: "boolean" "integer" "kvgroup" "restricted" "script" "string" "dir" "file" "readonly" "multivalue".

If an address attribute with restricted type is being added, the syntax for defining the restricted values in advancedOptions is:

{'restrictedValues':<list of potential restricted values>, 'advanced': 'true'}

Where the syntax for each restricted value option is:

{'value': '<value>', 'description': '<description>'}

Add Challenge

Adds a challenge string to the agent output.

Signature: agent.addChallenge('challenge')

Parameters:

  • challenge - The challenge string that should be returned

Remarks:

This callback should only be used with the Challenge Response operation

Add Custom Attributes

Adds attributes to a custom list file.

Signature: agent.addCustomAttrs('id', attrsDict)

Parameters:

  • id - ID for the object to add attributes for

  • attrsDict - Dictionary object of the attributes for the object

Remarks:

This callback should only be used with the custom operation. For the expected format on the attrsDict object see the definitions section for full details.

Add Group Attribute

Adds a group attribute and it's value(s) to the output KVG.

Signature: agent.addGroupAttr('name', valueList)

Parameters:

  • name - The name of the attribute

  • valueList - One or more values for the attribute

Remarks:

For the valueList either a single string value may be specified or a list of string values if the attribute can be multi-valued.

Add Retry Data

Adds the retry data to the agent output KVG.

Signature: agent.retryData('retrydata')

Parameters:

  • retrydata - The value for the data to retry for the operation.

Remarks:

This callback is usually used along with retryTime for agent codes such as ACTryAgainLater.

Add Retry Time

Adds the retry time to the agent output KVG.

Signature: agent.retryTime(retrytime)

Parameters:

  • retrytime - The value for the number of times to retry for the operation.

Remarks:

This callback is usually used along with retryData for agent codes such as ACTryAgainLater.

Add Response

Adds a response and it's attributes to the output KVG.

Signature: agent.addResponse('response', attrsDict)

Parameters:

  • response - The response message

  • attrsDict - Dictionary object of the attributes for the response

Remarks:

This callback should only be used with the challenge response operation. For the expected format on the attrsDict object see the definitions section for full details.

Add Supported Operation

Adds an operation to the supported operations for a platform

Signature: agent.addSupportedOp(operation)

Parameters:

  • operation - The string for the operation that should be supported

Remarks:

The operation string should take the form OpReset, OpGroupUserAdd, OpListUsers, etc.

Set Error Message

Sets the agent error message in the output KVG.

Signature: agent.error('errormsg')

Parameters:

  • errormsg - The message that should be set

Set Info Message

Sets the agent info message in the output KVG.

Signature: agent.info('infomsg')

Parameters:

  • infomsg - The message that should be set

Set Account Expired

Sets the account expiration value in the output KVG.

Signature: agent.isAcctExpired(expiredStatus)

Parameters:

  • expiredStatus - Boolean flag indicating if the account is expired or not

Remarks:

This callback should only be used with the isacctexpired operation

Set Account Enabled

Sets the account expired value in the output KVG.

Signature: agent.isEnabled(enabledStatus)

Parameters:

  • enabledStatus - Boolean flag indicating if the account is enabled or not

Remarks:

This callback should only be used with the isEnabled operation

Set Account Locked

Sets the account expired value in the output KVG.

Signature: agent.isLocked(lockedStatus)

Parameters:

  • lockedStatus - Boolean flag indicating if the account is locked or not

Remarks:

This callback should only be used with the isLocked operation

Set Groups

Sets the groups for a newly created account in the output KVG.

Signature: agent.groups(groupList)

Parameters:

  • groupList - One or more groups the account is a member of

Remarks:

This callback should only be used with the create operation

Set Password Expired

Sets the password expired value in the output KVG.

Signature: agent.isPwExpired(expiredStatus)

Parameters:

  • expiredStatus - Boolean flag indicating if the password is expired or not

Remarks:

This callback should only be used with the ispwexpired operation

Set Long ID

Sets the long id value for the object in the output KVG

Signature: agent.longId('longid')

Parameters:

  • longid - The long id of the object

Remarks:

This callback should only be used with the create, update, groupcreate and groupupdate operation

Set Server Info

Sets the server information in the output KVG.

Signature: agent.serverInfo('version', attrsDict)

Parameters:

  • version - Version string of the target system

  • attrsDict - Optional dictionary object of attributes of the target

Remarks:

This callback should only be used with the serverinfo operation. For the expected format on the attrsDict object see the definitions section for full details.

Set Short ID

Sets the short id value for the object in the output KVG.

Signature: agent.shortId('shortid')

Parameters:

  • shortid - The short id id of the object

Remarks:

This callback should only be used with the create, update, groupcreate and groupupdate operation.

Set Stable ID

Sets the stable id value for the object in the output KVG.

Signature: agent.stableId('stableid')

Parameters:

  • stableid - The stable id of the object

Remarks:

This callback should only be used with the create, update, groupcreate and groupupdate operation.

Set Warning Message

Sets the agent warning message in the output KVG.

Signature: agent.warning('warningmsg')

Parameters:

  • warningmsg - The message that should be set

Other callbacks

Run Agent

Runs an agent.

Signature: agent.run(agentexe, agentinput, opinput, attributes)

Parameters:

  • agentexe - The binary that should be run

  • agentinput - The agent input for the operation

  • opinput - The operation input for the operation

  • attributes - The attributes for the operation

Return Value:

  • Agent return code from operation that was run

Remarks:

The agentinput, opinput and attributes are what is normally stored in the cinfo['agentinput'], cinfo['opinput'], cinfo['attributes'] respectively. If calling list operations the filename should be changed for the list file. If wrapping a list operation the listing callbacks should be called to populate the agent's list file from the wrapped agent's list files.