Skip to content

command export

Ryan Newington edited this page May 27, 2016 · 1 revision

<command> element (object export)

When used during an object export operation, the <command> element supports the following additional functionality

Value declarations

During an export operation, value declarations are supported for any attribute that is present on the export object.

Rule-based commands

A command that will only be executed if the conditions of a rule or rule group are met. If the conditions are not met, the command is skipped. The following attributes are supported for rule-based commands;

XML Attribute Description Allowed Values
rule-id Optional. The ID of a rule or rule group to evaluate before executing the command A valid ID or a rule or rule group specified in the <rules> node. See [rules] for more information on creating rules and using rule ID references

Example

<command rule-id="GroupMembersDeleted">/home/deleteallmembers.sh {dn:$1}</command>
...
<rules>
    <rule xsi:type="sshma:rule-AttributeChangeRule" id="GroupMembersDeleted" attribute="member" triggers="Delete"/>
</rules>

The example above executes the command only if the rule object 'GroupMembersDeleted' evaluates successfully

Multivalued attribute enumeration

When used during an object export operation containing a multi-valued attribute, the <command> element supports the abilty to execute for each value in the multi-value array.

XML Attribute Description Allowed Values
xsi:type The type of command Required. The value must be sshma:mv-command
rule-id Optional. The ID of a rule or rule group to evaluate before executing the command A valid ID or a rule or rule group specified in the <rules> node. See [rules] for more information on creating rules and using rule ID references
for-each The name of the multivalued attribute Any multivalued attribute name that is defined in the schema for the specified object
value-modification The type of value modification to iterate through Required. add or delete

Example

<command xsi:type="sshma:mv-command" rule-id="groupMemberModified" for-each="member" value-modification="add">/home/addmember.sh {member:$1} {dn:$1}</command>
<command xsi:type="sshma:mv-command" rule-id="groupMemberModified" for-each="member" value-modification="delete">/home/deletemember.sh {member:$1} {dn:$1}</command>

The example above runs a set of commands to add and remove individual members from a group. The first command performs the add operations and the second performs the delete operations.

Clone this wiki locally