<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE stax SYSTEM "/stax.dtd">
<!--
! CDDL HEADER START
!
! The contents of this file are subject to the terms of the
! Common Development and Distribution License, Version 1.0 only
! (the "License"). You may not use this file except in compliance
! with the License.
!
! You can obtain a copy of the license at
! trunk/opends/resource/legal-notices/OpenDS.LICENSE
! or https://OpenDS.dev.java.net/OpenDS.LICENSE.
! See the License for the specific language governing permissions
! and limitations under the License.
!
! When distributing Covered Code, include this CDDL HEADER in each
! file and include the License file at
! trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
! add the following below this CDDL HEADER, with the fields enclosed
! by brackets "[]" replaced with your own identifying information:
! Portions Copyright [yyyy] [name of copyright owner]
!
! CDDL HEADER END
!
! Copyright 2007-2010 Sun Microsystems, Inc.
! Portions Copyright 2012 ForgeRock AS
! -->
<stax>
<function name="_dsconfigCommonArgs">
<function-prolog>
This function resolves common dsconfig arguments
</function-prolog>
<function-no-args />
<script>
if dsInstanceHost:
STAFCmdParamsList.append('-h %s' % dsInstanceHost)
if dsInstanceAdminPort:
STAFCmdParamsList.append('-p %s' % dsInstanceAdminPort)
if dsInstanceDn:
STAFCmdParamsList.append('-D "%s"' % dsInstanceDn)
if dsInstancePswd:
STAFCmdParamsList.append('-w "%s"' % dsInstancePswd)
STAFCmdParamsList.append('-n')
STAFCmdParamsList.append('-X')
</script>
</function>
<!-- Set property value using dsconfig -->
<function name="dsconfigSet" scope="local">
<function-prolog>
This function modifies a property value using dsconfig
</function-prolog>
<function-map-args>
<function-arg-def name="location"
type="optional"
default="STAF_REMOTE_HOSTNAME">
<function-arg-description>
Location of target host
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="dsPath"
type="optional"
default="'%s/%s' % (DIRECTORY_INSTANCE_BIN,OPENDSNAME)">
<function-arg-description>
Pathname to installation root
</function-arg-description>
<function-arg-property name="type" value="filepath" />
</function-arg-def>
<function-arg-def name="dsInstanceHost"
type="optional"
default="STAF_REMOTE_HOSTNAME">
<function-arg-description>
Directory server hostname or IP address
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="dsInstanceAdminPort"
type="optional"
default="DIRECTORY_INSTANCE_ADMIN_PORT">
<function-arg-description>
Directory server admin port number
</function-arg-description>
<function-arg-property name="type" value="Port number" />
</function-arg-def>
<function-arg-def name="dsInstanceDn" type="required">
<function-arg-description>
Bind DN
</function-arg-description>
<function-arg-property name="type" value="DN" />
</function-arg-def>
<function-arg-def name="dsInstancePswd" type="required">
<function-arg-description>
Bind password
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="objectName" type="required">
<function-arg-description>
Object to modify, e.g. password validator
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="propertyType" type="optional" default="''">
<function-arg-description>
Property type to modify, e.g. validator
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="propertyName" type="optional" default="''">
<function-arg-description>
Property to modify, e.g. enabled
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="attributeName" type="required">
<function-arg-description>
Attribute to modify, e.g. min-password-length
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="attributeValue" type="optional" default="'none'">
<function-arg-description>
New attribute value
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="modifyType" type="optional" default="'set'">
<function-arg-description>
The modify type. Default value is set.
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="expectedRC" type="optional" default="0">
<function-arg-description>
Expected return code value. Default value is 0.
Wildcard 'noCheck' to not check the RC
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="knownIssue" type="optional" default="None">
<function-arg-description>
Known issue. Corresponds to an issue number.
</function-arg-description>
</function-arg-def>
</function-map-args>
<sequence>
<!-- Local variables -->
<script>
mylocation=location
STAFCmdParams=''
STAFCmd=''
if dsPath:
dsBinPath='%s/%s' % (dsPath,fileFolder)
STAFCmd='%s/%s%s' % (dsBinPath,DSCONFIG,fileExt)
STAFCmdParamsList=[]
STAFCmdParamsList.append('set-%s-prop ' % (objectName))
if propertyType:
STAFCmdParamsList.append('--%s-name "%s" ' % (propertyType,propertyName))
if modifyType == 'reset':
STAFCmdParamsList.append('--%s %s' % (modifyType,attributeName))
else:
STAFCmdParamsList.append('--%s "%s:%s"' % (modifyType,attributeName,attributeValue))
</script>
<call function="'_dsconfigCommonArgs'" />
<script>
STAFCmdParams=' '.join(STAFCmdParamsList)
</script>
<message>
'%s %s' % (STAFCmd, STAFCmdParams)
</message>
<call function="'runCommand'">
{ 'name' : 'Modify dsconfig object',
'location' : location,
'command' : STAFCmd,
'arguments' : STAFCmdParams,
'expectedRC' : expectedRC,
'knownIssue' : knownIssue
}
</call>
<return>
STAXResult
</return>
</sequence>
</function>
<!-- Get property value using dsconfig -->
<function name="dsconfigGet" scope="local">
<function-prolog>
This function get a property value using dsconfig
</function-prolog>
<function-map-args>
<function-arg-def name="location"
type="optional"
default="STAF_REMOTE_HOSTNAME">
<function-arg-description>
Location of target host
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="dsPath"
type="optional"
default="'%s/%s' % (DIRECTORY_INSTANCE_BIN,OPENDSNAME)">
<function-arg-description>
Pathname to installation root
</function-arg-description>
<function-arg-property name="type" value="filepath" />
</function-arg-def>
<function-arg-def name="dsInstanceHost"
type="optional"
default="STAF_REMOTE_HOSTNAME">
<function-arg-description>
Directory server hostname or IP address
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="dsInstanceAdminPort"
type="optional"
default="DIRECTORY_INSTANCE_ADMIN_PORT">
<function-arg-description>
Directory server admin port number
</function-arg-description>
<function-arg-property name="type" value="Port number" />
</function-arg-def>
<function-arg-def name="dsInstanceDn" type="required">
<function-arg-description>
Bind DN
</function-arg-description>
<function-arg-property name="type" value="DN" />
</function-arg-def>
<function-arg-def name="dsInstancePswd" type="required">
<function-arg-description>
Bind password
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="objectName" type="required">
<function-arg-description>
Object to get, e.g. password validator. it's used to make the subcommand name get-...-prop
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="propertyType" type="required">
<function-arg-description>
Property type to get, e.g. backend. it's used to make the property type: --backend-name
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="propertyName" type="required">
<function-arg-description>
Property to get, e.g. userroot
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="attributeName" type="required">
<function-arg-description>
Attribute to get, e.g. min-password-length
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="extraParams" type="optional">
<function-arg-description>
Optional extra parameters for specific test cases. ie -m
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="expectedAttributeValue" type="optional" default="'none'">
<function-arg-description>
expected attribute value
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="expectedRC" type="optional" default="0">
<function-arg-description>
Expected return code value. Default value is 0.
Wildcard 'noCheck' to not check the RC
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="knownIssue" type="optional" default="None">
<function-arg-description>
Known issue. Corresponds to an issue number.
</function-arg-description>
</function-arg-def>
</function-map-args>
<sequence>
<!-- Local variables -->
<script>
mylocation=location
STAFCmdParams=''
STAFCmd=''
if dsPath:
dsBinPath='%s/%s' % (dsPath,fileFolder)
STAFCmd='%s/%s%s' % (dsBinPath,DSCONFIG,fileExt)
STAFCmdParamsList=[]
STAFCmdParamsList.append('get-%s-prop ' % (objectName))
STAFCmdParamsList.append('--%s-name "%s" -s' % (propertyType,propertyName))
STAFCmdParamsList.append('--property "%s"' % (attributeName))
if extraParams:
STAFCmdParamsList.append(extraParams)
</script>
<call function="'_dsconfigCommonArgs'" />
<script>
STAFCmdParams=' '.join(STAFCmdParamsList)
</script>
<message>
'%s %s' % (STAFCmd, STAFCmdParams)
</message>
<call function="'runCommand'" >
{ 'name' : 'Get dsconfig object',
'location' : location,
'command' : STAFCmd,
'arguments' : STAFCmdParams,
'expectedRC': expectedRC,
'knownIssue': knownIssue
}
</call>
<script>
STAXCode=RC
STAXReason=STAXResult[0][1]
</script>
<if expr="expectedAttributeValue != 'none'">
<call function="'checktestString'">
{ 'expectedString' : expectedAttributeValue,
'returnString' : STAXReason
}
</call>
</if>
<return>
STAXReason
</return>
</sequence>
</function>
<!-- generic wrapper on dsconfig -->
<!-- can be used to list, get or set a list of attribues -->
<function name="dsconfig" scope="local">
<function-prolog>
This function lists, get or set a list of attributes using dsconfig
</function-prolog>
<function-map-args>
<function-arg-def name="location"
type="optional"
default="STAF_REMOTE_HOSTNAME">
<function-arg-description>
Location of target host
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="dsPath"
type="optional"
default="'%s/%s' % (DIRECTORY_INSTANCE_BIN,OPENDSNAME)">
<function-arg-description>
Pathname to installation root
</function-arg-description>
<function-arg-property name="type" value="filepath" />
</function-arg-def>
<function-arg-def name="dsInstanceHost"
type="optional"
default="STAF_REMOTE_HOSTNAME">
<function-arg-description>
Directory server hostname or IP address
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="dsInstanceAdminPort"
type="optional"
default="DIRECTORY_INSTANCE_ADMIN_PORT">
<function-arg-description>
Directory server admin port number
</function-arg-description>
<function-arg-property name="type" value="Port number" />
</function-arg-def>
<function-arg-def name="dsInstanceDn"
type="optional"
default="DIRECTORY_INSTANCE_DN">
<function-arg-description>
Bind DN
</function-arg-description>
<function-arg-property name="type" value="DN" />
</function-arg-def>
<function-arg-def name="dsInstancePswd"
type="optional"
default="DIRECTORY_INSTANCE_PSWD">
<function-arg-description>
Bind password
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="subcommand" type="required">
<function-arg-description>
dsconfig subcommand to execute
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="objectType" type="optional">
<function-arg-description>
Object type to modify, e.g. backend-name
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="objectName" type="optional">
<function-arg-description>
object name to modify, e.g. userroot
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="optionsString" type="optional">
<function-arg-description>
String containing the dsconfig options. e.g. --set enabled:true --set key-store-pin:servercert
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="advanced" type="optional">
<function-arg-description>
Boolean containing whether to use the advanced option or not
</function-arg-description>
<function-arg-property name="type" value="boolean" />
</function-arg-def>
<function-arg-def name="expectedRC" type="optional" default="0">
<function-arg-description>
Expected return code value. Default value is 0.
Wildcard 'noCheck' to not check the RC
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="expectedString" type="optional" default="None">
<function-arg-description>
Expected return string value.
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="knownIssue" type="optional" default="None">
<function-arg-description>
Known issue. Corresponds to an issue number.
</function-arg-description>
</function-arg-def>
</function-map-args>
<sequence>
<!-- Local variables -->
<script>
mylocation=location
STAFCmdParams=''
STAFCmd=''
if dsPath:
dsBinPath='%s/%s' % (dsPath,fileFolder)
STAFCmd='%s/%s%s' % (dsBinPath,DSCONFIG,fileExt)
STAFCmdParamsList=[]
STAFCmdParamsList.append(subcommand)
if objectType:
STAFCmdParamsList.append('--%s "%s" ' % (objectType,objectName))
if optionsString:
STAFCmdParamsList.append(' %s' % optionsString)
if advanced:
STAFCmdParamsList.append(' --advanced')
</script>
<call function="'_dsconfigCommonArgs'" />
<script>
STAFCmdParams=' '.join(STAFCmdParamsList)
</script>
<call function="'runCommand'">
{ 'name' : 'execute dsconfig subcommand',
'location' : location,
'command' : STAFCmd,
'arguments' : STAFCmdParams,
'expectedRC' : expectedRC,
'expectedString' : expectedString,
'knownIssue' : knownIssue
}
</call>
<return>
STAXResult
</return>
</sequence>
</function>
<!-- Modify password policy using dsconfig -->
<function name="modifyPwdPolicy">
<function-prolog>
This function modifies a password policy using dsconfig
</function-prolog>
<function-map-args>
<function-arg-def name="location"
type="optional"
default="STAF_REMOTE_HOSTNAME">
<function-arg-description>
Location of target host
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="dsPath"
type="optional"
default="'%s/%s' % (DIRECTORY_INSTANCE_BIN,OPENDSNAME)">
<function-arg-description>
Pathname to installation root
</function-arg-description>
<function-arg-property name="type" value="filepath" />
</function-arg-def>
<function-arg-def name="dsInstanceHost"
type="optional"
default="STAF_REMOTE_HOSTNAME">
<function-arg-description>
Directory server hostname or IP address
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="dsInstanceAdminPort"
type="optional"
default="DIRECTORY_INSTANCE_ADMIN_PORT">
<function-arg-description>
Directory server admin port number
</function-arg-description>
<function-arg-property name="type" value="Port number" />
</function-arg-def>
<function-arg-def name="dsInstanceDn" type="required">
<function-arg-description>
Bind DN
</function-arg-description>
<function-arg-property name="type" value="DN" />
</function-arg-def>
<function-arg-def name="dsInstancePswd" type="required">
<function-arg-description>
Bind password
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="propertyName" type="required">
<function-arg-description>
Property to modify, e.g. enabled
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="attributeName" type="required">
<function-arg-description>
Attribute to modify, e.g. min-password-length
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="attributeValue" type="optional" default="'none'">
<function-arg-description>
New attribute value
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="modifyType" type="optional" default="'set'">
<function-arg-description>
The modify type. Default value is set.
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="expectedRC" type="optional" default="0">
<function-arg-description>
Expected return code value. Default value is 0
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
</function-map-args>
<sequence>
<call function="'dsconfigSet'">
{ 'location' : location,
'dsPath' : dsPath,
'dsInstanceHost' : dsInstanceHost,
'dsInstanceAdminPort' : dsInstanceAdminPort,
'dsInstanceDn' : dsInstanceDn,
'dsInstancePswd' : dsInstancePswd,
'objectName' : 'password-policy',
'propertyType' : 'policy',
'propertyName' : propertyName,
'attributeName' : attributeName,
'attributeValue' : attributeValue,
'modifyType' : modifyType,
'expectedRC' : expectedRC
}
</call>
<return>
STAXResult
</return>
</sequence>
</function>
<!-- Modify password validator using dsconfig -->
<function name="modifyPwdValidator">
<function-prolog>
This function modifies a password validator using dsconfig
</function-prolog>
<function-map-args>
<function-arg-def name="location"
type="optional"
default="STAF_REMOTE_HOSTNAME">
<function-arg-description>
Location of target host
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="dsPath"
type="optional"
default="'%s/%s' % (DIRECTORY_INSTANCE_BIN,OPENDSNAME)">
<function-arg-description>
Pathname to installation root
</function-arg-description>
<function-arg-property name="type" value="filepath" />
</function-arg-def>
<function-arg-def name="dsInstanceHost"
type="optional"
default="STAF_REMOTE_HOSTNAME">
<function-arg-description>
Directory server hostname or IP address
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="dsInstanceAdminPort"
type="optional"
default="DIRECTORY_INSTANCE_ADMIN_PORT">
<function-arg-description>
Directory server admin port number
</function-arg-description>
<function-arg-property name="type" value="Port number" />
</function-arg-def>
<function-arg-def name="dsInstanceDn" type="required">
<function-arg-description>
Bind DN
</function-arg-description>
<function-arg-property name="type" value="DN" />
</function-arg-def>
<function-arg-def name="dsInstancePswd" type="required">
<function-arg-description>
Bind password
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="propertyName" type="required">
<function-arg-description>
Property to modify, e.g. enabled
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="attributeName" type="required">
<function-arg-description>
Attribute to modify, e.g. match-attribute
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="attributeValue" type="optional" default="'none'">
<function-arg-description>
New attribute value
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="modifyType" type="optional" default="'set'">
<function-arg-description>
The modify type. Default value is set.
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="expectedRC" type="optional" default="0">
<function-arg-description>
Expected return code value. Default value is 0
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="knownIssue" type="optional" default="None">
<function-arg-description>
Known issue. Corresponds to an issue number.
</function-arg-description>
</function-arg-def>
</function-map-args>
<sequence>
<call function="'dsconfigSet'">
{ 'location' : location,
'dsPath' : dsPath,
'dsInstanceHost' : dsInstanceHost,
'dsInstanceAdminPort' : dsInstanceAdminPort,
'dsInstanceDn' : dsInstanceDn,
'dsInstancePswd' : dsInstancePswd,
'objectName' : 'password-validator',
'propertyType' : 'validator',
'propertyName' : propertyName,
'attributeName' : attributeName,
'attributeValue' : attributeValue,
'modifyType' : modifyType,
'expectedRC' : expectedRC,
'knownIssue' : knownIssue
}
</call>
<return>
STAXResult
</return>
</sequence>
</function>
<!-- Modify password policy using dsconfig -->
<function name="modifyGlobal">
<function-prolog>
This function modifies a global attribute value using dsconfig
</function-prolog>
<function-map-args>
<function-arg-def name="location"
type="optional"
default="STAF_REMOTE_HOSTNAME">
<function-arg-description>
Location of target host
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="dsPath"
type="optional"
default="'%s/%s' % (DIRECTORY_INSTANCE_BIN,OPENDSNAME)">
<function-arg-description>
Pathname to installation root
</function-arg-description>
<function-arg-property name="type" value="filepath" />
</function-arg-def>
<function-arg-def name="dsInstanceHost"
type="optional"
default="STAF_REMOTE_HOSTNAME">
<function-arg-description>
Directory server hostname or IP address
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="dsInstanceAdminPort"
type="optional"
default="DIRECTORY_INSTANCE_ADMIN_PORT">
<function-arg-description>
Directory server admin port number
</function-arg-description>
<function-arg-property name="type" value="Port number" />
</function-arg-def>
<function-arg-def name="dsInstanceDn" type="required">
<function-arg-description>
Bind DN
</function-arg-description>
<function-arg-property name="type" value="DN" />
</function-arg-def>
<function-arg-def name="dsInstancePswd" type="required">
<function-arg-description>
Bind password
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="attributeName" type="required">
<function-arg-description>
Attribute to modify, e.g. bind-with-dn-requires-password
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="attributeValue" type="required">
<function-arg-description>
New attribute value
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="expectedRC" type="optional" default="0">
<function-arg-description>
Expected return code value. Default value is 0.
Wildcard 'noCheck' to not check the RC
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
</function-map-args>
<sequence>
<!-- Local variables -->
<script>
mylocation=location
STAFCmdParams=''
STAFCmd=''
if dsPath:
dsBinPath='%s/%s' % (dsPath,fileFolder)
STAFCmd='%s/%s%s' % (dsBinPath,DSCONFIG,fileExt)
if attributeValue:
attributeValue=attributeValue.replace('"','QUOT')
STAFCmdParamsList=[]
STAFCmdParamsList.append('set-global-configuration-prop ')
STAFCmdParamsList.append('--set "%s:%s"' % (attributeName,attributeValue))
</script>
<call function="'_dsconfigCommonArgs'" />
<script>
STAFCmdParams=' '.join(STAFCmdParamsList)
</script>
<call function="'runCommand'">
{ 'name' : 'Modify dsconfig object',
'location' : location,
'command' : STAFCmd,
'arguments' : STAFCmdParams,
'expectedRC': expectedRC
}
</call>
<return>
STAXResult
</return>
</sequence>
</function>
<!-- Modify identity mapper using dsconfig -->
<function name="modifyIdentityMapper">
<function-prolog>
This function modifies an identity mapper using dsconfig
</function-prolog>
<function-map-args>
<function-arg-def name="location"
type="optional"
default="STAF_REMOTE_HOSTNAME">
<function-arg-description>
Location of target host
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="dsPath"
type="optional"
default="'%s/%s' % (DIRECTORY_INSTANCE_BIN,OPENDSNAME)">
<function-arg-description>
Pathname to installation root
</function-arg-description>
<function-arg-property name="type" value="filepath" />
</function-arg-def>
<function-arg-def name="dsInstanceHost"
type="optional"
default="STAF_REMOTE_HOSTNAME">
<function-arg-description>
Directory server hostname or IP address
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="dsInstanceAdminPort"
type="optional"
default="DIRECTORY_INSTANCE_ADMIN_PORT">
<function-arg-description>
Directory server admin port number
</function-arg-description>
<function-arg-property name="type" value="Port number" />
</function-arg-def>
<function-arg-def name="dsInstanceDn" type="required">
<function-arg-description>
Bind DN
</function-arg-description>
<function-arg-property name="type" value="DN" />
</function-arg-def>
<function-arg-def name="dsInstancePswd" type="required">
<function-arg-description>
Bind password
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="mapperName" type="required">
<function-arg-description>
Mapper to modify, e.g. Exact Match
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="attributeName" type="required">
<function-arg-description>
Attribute to modify, e.g. match-attribute
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="attributeValue" type="required">
<function-arg-description>
New attribute value
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="modifyType" type="optional" default="'set'">
<function-arg-description>
The modify type. Default value is set.
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="expectedRC" type="optional" default="0">
<function-arg-description>
Expected return code value. Default value is 0
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
</function-map-args>
<sequence>
<call function="'dsconfigSet'">
{ 'location' : location,
'dsPath' : dsPath,
'dsInstanceHost' : dsInstanceHost,
'dsInstanceAdminPort' : dsInstanceAdminPort,
'dsInstanceDn' : dsInstanceDn,
'dsInstancePswd' : dsInstancePswd,
'objectName' : 'identity-mapper',
'propertyType' : 'mapper',
'propertyName' : mapperName,
'attributeName' : attributeName,
'attributeValue' : attributeValue,
'modifyType' : modifyType,
'expectedRC' : expectedRC
}
</call>
<return>
STAXResult
</return>
</sequence>
</function>
<!-- Modify password policy using dsconfig -->
<function name="modifyGlobalAci">
<function-prolog>
This function modifies a global aci using dsconfig
</function-prolog>
<function-map-args>
<function-arg-def name="location"
type="optional"
default="STAF_REMOTE_HOSTNAME">
<function-arg-description>
Location of target host
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="dsPath"
type="optional"
default="'%s/%s' % (DIRECTORY_INSTANCE_BIN,OPENDSNAME)">
<function-arg-description>
Pathname to installation root
</function-arg-description>
<function-arg-property name="type" value="filepath" />
</function-arg-def>
<function-arg-def name="dsInstanceHost"
type="optional"
default="STAF_REMOTE_HOSTNAME">
<function-arg-description>
Directory server hostname or IP address
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="dsInstanceAdminPort"
type="optional"
default="DIRECTORY_INSTANCE_ADMIN_PORT">
<function-arg-description>
Directory server admin port number
</function-arg-description>
<function-arg-property name="type" value="Port number" />
</function-arg-def>
<function-arg-def name="dsInstanceDn" type="required">
<function-arg-description>
Bind DN
</function-arg-description>
<function-arg-property name="type" value="DN" />
</function-arg-def>
<function-arg-def name="dsInstancePswd" type="required">
<function-arg-description>
Bind password
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="aciValue" type="required">
<function-arg-description>
New property value
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="opType" type="optional" default="set">
<function-arg-description>
Operation type, one of set, add, and remove
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="expectedRC" type="optional" default="0">
<function-arg-description>
Expected return code value. Default value is 0.
Wildcard 'noCheck' to not check the RC
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
</function-map-args>
<sequence>
<script>
mylocation=location
STAFCmdParams=''
STAFCmd=''
if dsPath:
dsBinPath='%s/%s' % (dsPath,fileFolder)
STAFCmd='%s/%s%s' % (dsBinPath,DSCONFIG,fileExt)
if aciValue:
aciValue=aciValue.replace('"','\\"')
if is_windows_platform(mylocation):
aciValue=aciValue.replace(r'||',r'"||"')
STAFCmdParamsList=[]
STAFCmdParamsList.append('set-access-control-handler-prop ')
STAFCmdParamsList.append('--%s "global-aci:%s"' % (opType,aciValue))
</script>
<call function="'_dsconfigCommonArgs'" />
<script>
STAFCmdParams=' '.join(STAFCmdParamsList)
</script>
<call function="'runCommand'">
{ 'name' : 'Modify dsconfig object',
'location' : location,
'command' : STAFCmd,
'arguments' : STAFCmdParams,
'expectedRC': expectedRC
}
</call>
<return>
STAXResult
</return>
</sequence>
</function>
<!-- Modify password policy using dsconfig -->
<function name="modifySaslMech">
<function-prolog>
This function modifies a sasl mechanism using dsconfig
</function-prolog>
<function-map-args>
<function-arg-def name="location"
type="optional"
default="STAF_REMOTE_HOSTNAME">
<function-arg-description>
Location of target host
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="dsPath"
type="optional"
default="'%s/%s' % (DIRECTORY_INSTANCE_BIN,OPENDSNAME)">
<function-arg-description>
Pathname to installation root
</function-arg-description>
<function-arg-property name="type" value="filepath" />
</function-arg-def>
<function-arg-def name="dsInstanceHost"
type="optional"
default="STAF_REMOTE_HOSTNAME">
<function-arg-description>
Directory server hostname or IP address
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="dsInstanceAdminPort"
type="optional"
default="DIRECTORY_INSTANCE_ADMIN_PORT">
<function-arg-description>
Directory server admin port number
</function-arg-description>
<function-arg-property name="type" value="Port number" />
</function-arg-def>
<function-arg-def name="dsInstanceDn" type="required">
<function-arg-description>
Bind DN
</function-arg-description>
<function-arg-property name="type" value="DN" />
</function-arg-def>
<function-arg-def name="dsInstancePswd" type="required">
<function-arg-description>
Bind password
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="handlerName" type="required">
<function-arg-description>
Handle to modify, e.g. DIGEST-MD5
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="propertyName" type="required">
<function-arg-description>
Property to modify, e.g. realm
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="propertyValue" type="required">
<function-arg-description>
New property value
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="modifyType" type="optional" default="'set'">
<function-arg-description>
The modify type. Default value is set.
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="expectedRC" type="optional" default="0">
<function-arg-description>
Expected return code value. Default value is 0
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
</function-map-args>
<sequence>
<call function="'dsconfigSet'">
{ 'location' : location,
'dsPath' : dsPath,
'dsInstanceHost' : dsInstanceHost,
'dsInstanceAdminPort' : dsInstanceAdminPort,
'dsInstanceDn' : dsInstanceDn,
'dsInstancePswd' : dsInstancePswd,
'objectName' : 'sasl-mechanism-handler',
'propertyType' : 'handler',
'propertyName' : handlerName,
'attributeName' : propertyName,
'attributeValue' : propertyValue,
'modifyType' : modifyType,
'expectedRC' : expectedRC
}
</call>
<return>
STAXResult
</return>
</sequence>
</function>
<function name="addIndex">
<function-prolog>
This function eases adding JEB DB indexes
</function-prolog>
<function-map-args>
<function-arg-def name="location"
type="optional"
default="STAF_REMOTE_HOSTNAME">
<function-arg-description>
Location of target host
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="dsPath"
type="optional"
default="'%s/%s' % (DIRECTORY_INSTANCE_BIN,OPENDSNAME)">
<function-arg-description>
Pathname to installation root
</function-arg-description>
<function-arg-property name="type" value="filepath" />
</function-arg-def>
<function-arg-def name="host"
type="optional"
default="STAF_REMOTE_HOSTNAME">
<function-arg-description>
Directory server hostname or IP address
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="adminPort"
type="optional"
default="DIRECTORY_INSTANCE_ADMIN_PORT">
<function-arg-description>
Directory server admin port number
</function-arg-description>
<function-arg-property name="type" value="Port number" />
</function-arg-def>
<function-arg-def name="rootDN"
type="optional"
default="DIRECTORY_INSTANCE_DN">
<function-arg-description>
Bind DN
</function-arg-description>
<function-arg-property name="type" value="DN" />
</function-arg-def>
<function-arg-def name="rootPwd"
type="optional"
default="DIRECTORY_INSTANCE_PSWD">
<function-arg-description>
Bind password
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="backendID"
default="DIRECTORY_INSTANCE_BE"
type="optional">
<function-arg-description>
The Back-end ID on to which to add an index
</function-arg-description>
</function-arg-def>
<function-arg-def name="indexAttribute" type="required">
<function-arg-description>
ldap attribute on to which to add indexing
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="indexTypes" type="required">
<function-arg-description>
type of index to add
This has to be provided as a python array like
[ 'presence', 'substring' ]
</function-arg-description>
<function-arg-property name="type" value="enum">
<function-arg-property-description>
This argument can only have one of those values
</function-arg-property-description>
<function-arg-property-data type="choice" value="'equality'" />
<function-arg-property-data type="choice" value="'ordering'" />
<function-arg-property-data type="choice" value="'presence'" />
<function-arg-property-data type="choice" value="'substring'" />
</function-arg-property>
</function-arg-def>
<function-arg-def name="expectedRC" type="optional" default="0">
<function-arg-description>
Expected return code value. Default value is 0.
Wildcard 'noCheck' to not check the RC
</function-arg-description>
</function-arg-def>
</function-map-args>
<sequence>
<!-- Local variables -->
<script>
dsconfigParams=''
dsconfigCmd=''
dsBinPath='%s/%s' % (dsPath,fileFolder)
dsconfigCmd='%s/%s%s' % (dsBinPath,DSCONFIG,fileExt)
dsconfigParams = 'create-local-db-index -n -X -h %s -p %s -D "%s" -w %s --backend-name %s --index-name %s --set index-type:%s' % (host,adminPort,rootDN,rootPwd,backendID, indexAttribute, ' --set index-type:'.join(indexTypes))
</script>
<call function="'runCommand'">
{ 'name' : 'dsconfig addIndex',
'location' : location,
'command' : dsconfigCmd,
'arguments' : dsconfigParams,
'expectedRC': expectedRC
}
</call>
<return>
STAXResult
</return>
</sequence>
</function>
<function name="modifyIndex">
<function-prolog>
This function eases modifying JEB DB indexes
</function-prolog>
<function-map-args>
<function-arg-def name="location"
type="optional"
default="STAF_REMOTE_HOSTNAME">
<function-arg-description>
Location of target host
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="dsPath"
type="optional"
default="'%s/%s' % (DIRECTORY_INSTANCE_BIN,OPENDSNAME)">
<function-arg-description>
Pathname to installation root
</function-arg-description>
<function-arg-property name="type" value="filepath" />
</function-arg-def>
<function-arg-def name="host"
type="optional"
default="STAF_REMOTE_HOSTNAME">
<function-arg-description>
Directory server hostname or IP address
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="adminPort"
type="optional"
default="DIRECTORY_INSTANCE_ADMIN_PORT">
<function-arg-description>
Directory server admin port number
</function-arg-description>
<function-arg-property name="type" value="Port number" />
</function-arg-def>
<function-arg-def name="rootDN"
type="optional"
default="DIRECTORY_INSTANCE_DN">
<function-arg-description>
Bind DN
</function-arg-description>
<function-arg-property name="type" value="DN" />
</function-arg-def>
<function-arg-def name="rootPwd"
type="optional"
default="DIRECTORY_INSTANCE_PSWD">
<function-arg-description>
Bind password
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="backendID"
default="DIRECTORY_INSTANCE_BE"
type="optional">
<function-arg-description>
The Back-end ID on to which to add an index
</function-arg-description>
</function-arg-def>
<function-arg-def name="indexAttribute" type="required">
<function-arg-description>
ldap attribute on to which add indexing
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="operation">
<function-arg-description>
This parameters defines the operation to be performed.
</function-arg-description>
<function-arg-property name="type" value="enum">
<function-arg-property-description>
This argument can only have one of the following values
</function-arg-property-description>
<function-arg-property-data type="choice" value="'add'" />
<function-arg-property-data type="choice" value="'remove'" />
<function-arg-property-data type="choice" value="'reset'" />
<function-arg-property-data type="choice" value="'set'" />
</function-arg-property>
</function-arg-def>
<function-arg-def name="indexProperty" type="required">
<function-arg-description>
the property to manipulate if the operation is add or set
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="indexPropertyValue" type="optional">
<function-arg-description>
the value for the provided property
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="expectedRC" type="optional" default="0">
<function-arg-description>
Expected return code value. Default value is 0.
Wildcard 'noCheck' to not check the RC
</function-arg-description>
</function-arg-def>
</function-map-args>
<sequence>
<!-- Local variables -->
<script>
dsconfigParams=''
dsconfigCmd=''
dsBinPath='%s/%s' % (dsPath,fileFolder)
dsconfigCmd='%s/%s%s' % (dsBinPath,DSCONFIG,fileExt)
operationArguments = indexProperty
if indexPropertyValue:
operationArguments = '%s:%s' % (indexProperty, indexPropertyValue)
dsconfigParams = 'set-local-db-index-prop -n -X -h %s -p %s -D "%s" -w %s --backend-name %s --index-name %s --%s %s' % ( host, adminPort, rootDN, rootPwd, backendID, indexAttribute, operation, operationArguments)
</script>
<call function="'runCommand'">
{ 'name' : 'dsconfig modifyIndex',
'location' : location,
'command' : dsconfigCmd,
'arguments' : dsconfigParams,
'expectedRC': expectedRC
}
</call>
<return>
STAXResult
</return>
</sequence>
</function>
<function name="removeIndex">
<function-prolog>
This function eases removing JEB DB indexes from STAX
</function-prolog>
<function-map-args>
<function-arg-def name="location"
type="optional"
default="STAF_REMOTE_HOSTNAME">
<function-arg-description>
Location of target host
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="dsPath"
type="optional"
default="'%s/%s' % (DIRECTORY_INSTANCE_BIN,OPENDSNAME)">
<function-arg-description>
Pathname to installation root
</function-arg-description>
<function-arg-property name="type" value="filepath" />
</function-arg-def>
<function-arg-def name="host"
type="optional"
default="STAF_REMOTE_HOSTNAME">
<function-arg-description>
Directory server hostname or IP address
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="adminPort"
type="optional"
default="DIRECTORY_INSTANCE_ADMIN_PORT">
<function-arg-description>
Directory server port number
</function-arg-description>
<function-arg-property name="type" value="Port number" />
</function-arg-def>
<function-arg-def name="rootDN"
type="optional"
default="DIRECTORY_INSTANCE_DN">
<function-arg-description>
Bind DN
</function-arg-description>
<function-arg-property name="type" value="DN" />
</function-arg-def>
<function-arg-def name="rootPwd"
type="optional"
default="DIRECTORY_INSTANCE_PSWD">
<function-arg-description>
Bind password
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="backendID"
default="DIRECTORY_INSTANCE_BE"
type="optional">
<function-arg-description>
The Back-end ID on to which to remove an index from
</function-arg-description>
</function-arg-def>
<function-arg-def name="indexAttribute" type="required">
<function-arg-description>
ldap attribute on to which to remove indexing
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="expectedRC" type="optional" default="0">
<function-arg-description>
Expected return code value. Default value is 0.
Wildcard 'noCheck' to not check the RC
</function-arg-description>
</function-arg-def>
</function-map-args>
<sequence>
<!-- Local variables -->
<script>
dsconfigParams=''
dsconfigCmd=''
dsBinPath='%s/%s' % (dsPath,fileFolder)
dsconfigCmd='%s/%s%s' % (dsBinPath,DSCONFIG,fileExt)
dsconfigParams = 'delete-local-db-index -n -X -h %s -p %s -D "%s" -w %s --backend-name %s --index-name %s' % (host,adminPort,rootDN,rootPwd,backendID, indexAttribute)
</script>
<call function="'runCommand'">
{ 'name' : 'dsconfig removeIndex',
'location' : location,
'command' : dsconfigCmd,
'arguments' : dsconfigParams,
'expectedRC': expectedRC
}
</call>
<return>
STAXResult
</return>
</sequence>
</function>
<!-- Create synchronization provider using dsconfig -->
<function name="createSyncProvider">
<function-prolog>
This function creates a synchronization provider using dsconfig
</function-prolog>
<function-map-args>
<function-arg-def name="location"
type="optional"
default="STAF_REMOTE_HOSTNAME">
<function-arg-description>
Location of target host
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="dsPath"
type="optional"
default="'%s/%s' % (DIRECTORY_INSTANCE_BIN,OPENDSNAME)">
<function-arg-description>
Pathname to installation root
</function-arg-description>
<function-arg-property name="type" value="filepath" />
</function-arg-def>
<function-arg-def name="dsInstanceHost"
type="optional"
default="STAF_REMOTE_HOSTNAME">
<function-arg-description>
Directory server hostname or IP address
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="dsInstanceAdminPort" type="required">
<function-arg-description>
Directory server admin port number
</function-arg-description>
<function-arg-property name="type" value="Port number" />
</function-arg-def>
<function-arg-def name="dsInstanceDn" type="required">
<function-arg-description>
Bind DN
</function-arg-description>
<function-arg-property name="type" value="DN" />
</function-arg-def>
<function-arg-def name="dsInstancePswd" type="required">
<function-arg-description>
Bind password
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="providerName"
type="optional"
default="MultimasterSync">
<function-arg-description>
Name for the synchronization provider
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="providerType"
type="optional"
default="MultimasterType">
<function-arg-description>
Synchronization provider type
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="expectedRC" type="optional" default="0">
<function-arg-description>
Expected return code value. Default value is 0.
Wildcard 'noCheck' to not check the RC
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
</function-map-args>
<sequence>
<!-- Local variables -->
<script>
mylocation=location
STAFCmdParams=''
STAFCmd=''
if dsPath:
dsBinPath='%s/%s' % (dsPath,fileFolder)
STAFCmd='%s/%s%s' % (dsBinPath,DSCONFIG,fileExt)
STAFCmdParamsList=[]
STAFCmdParamsList.append('create-synchronization-provider')
STAFCmdParamsList.append('--provider-name "%s"' % providerName)
STAFCmdParamsList.append('-t %s' % providerType)
STAFCmdParamsList.append('--set "enabled:true"')
</script>
<call function="'_dsconfigCommonArgs'" />
<script>
STAFCmdParams=' '.join(STAFCmdParamsList)
</script>
<call function="'runCommand'">
{ 'name' : 'Modify dsconfig object',
'location' : location,
'command' : STAFCmd,
'arguments' : STAFCmdParams,
'expectedRC': expectedRC
}
</call>
<return>
STAXResult
</return>
</sequence>
</function>
<!-- List synchronization providers using dsconfig -->
<function name="listSyncProviders">
<function-prolog>
This function list the synchronization providers using dsconfig
</function-prolog>
<function-map-args>
<function-arg-def name="location"
type="optional"
default="STAF_REMOTE_HOSTNAME">
<function-arg-description>
Location of target host
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="dsPath"
type="optional"
default="'%s/%s' % (DIRECTORY_INSTANCE_BIN,OPENDSNAME)">
<function-arg-description>
Pathname to installation root
</function-arg-description>
<function-arg-property name="type" value="filepath" />
</function-arg-def>
<function-arg-def name="dsInstanceHost"
type="optional"
default="STAF_REMOTE_HOSTNAME">
<function-arg-description>
Directory server hostname or IP address
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="dsInstanceAdminPort" type="required">
<function-arg-description>
Directory server admin port number
</function-arg-description>
<function-arg-property name="type" value="Port number" />
</function-arg-def>
<function-arg-def name="dsInstanceDn" type="required">
<function-arg-description>
Bind DN
</function-arg-description>
<function-arg-property name="type" value="DN" />
</function-arg-def>
<function-arg-def name="dsInstancePswd" type="required">
<function-arg-description>
Bind password
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="expectedRC" type="optional" default="0">
<function-arg-description>
Expected return code value. Default value is 0.
Wildcard 'noCheck' to not check the RC
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
</function-map-args>
<sequence>
<!-- Local variables -->
<script>
mylocation=location
STAFCmdParams=''
STAFCmd=''
if dsPath:
dsBinPath='%s/%s' % (dsPath,fileFolder)
STAFCmd='%s/%s%s' % (dsBinPath,DSCONFIG,fileExt)
STAFCmdParamsList=[]
STAFCmdParamsList.append('list-synchronization-providers')
</script>
<call function="'_dsconfigCommonArgs'" />
<script>
STAFCmdParams=' '.join(STAFCmdParamsList)
</script>
<call function="'runCommand'">
{ 'name' : 'List synchronization providers',
'location' : location,
'command' : STAFCmd,
'arguments' : STAFCmdParams,
'expectedRC': expectedRC
}
</call>
<return>
STAXResult
</return>
</sequence>
</function>
<!-- Create a replication server using dsconfig -->
<function name="createReplicationServer">
<function-prolog>
This function creates a replication server under a given synchronization provider using dsconfig
</function-prolog>
<function-map-args>
<function-arg-def name="location"
type="optional"
default="STAF_REMOTE_HOSTNAME">
<function-arg-description>
Location of target host
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="dsPath"
type="optional"
default="'%s/%s' % (DIRECTORY_INSTANCE_BIN,OPENDSNAME)">
<function-arg-description>
Pathname to installation root
</function-arg-description>
<function-arg-property name="type" value="filepath" />
</function-arg-def>
<function-arg-def name="dsInstanceHost"
type="optional"
default="STAF_REMOTE_HOSTNAME">
<function-arg-description>
Directory server hostname or IP address
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="dsInstanceAdminPort" type="required">
<function-arg-description>
Directory server admin port number
</function-arg-description>
<function-arg-property name="type" value="Port number" />
</function-arg-def>
<function-arg-def name="dsInstanceDn" type="required">
<function-arg-description>
Bind DN
</function-arg-description>
<function-arg-property name="type" value="DN" />
</function-arg-def>
<function-arg-def name="dsInstancePswd" type="required">
<function-arg-description>
Bind password
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="providerName"
type="optional"
default="MultimasterSync">
<function-arg-description>
Name for the synchronization provider
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="replicationPort" type="required">
<function-arg-description>
Replication port number
</function-arg-description>
<function-arg-property name="type" value="Port number" />
</function-arg-def>
<function-arg-def name="replicationServerId" type="required">
<function-arg-description>
Replication server ID
</function-arg-description>
<function-arg-property name="type" value="ID number" />
</function-arg-def>
<function-arg-def name="replicationServerList" type="required">
<function-arg-description>
List of replication servers (as in host:replicationServerPort)
</function-arg-description>
<function-arg-property name="type" value="list" />
</function-arg-def>
<function-arg-def name="expectedRC" type="optional" default="0">
<function-arg-description>
Expected return code value. Default value is 0.
Wildcard 'noCheck' to not check the RC
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
</function-map-args>
<sequence>
<!-- Local variables -->
<script>
mylocation=location
STAFCmdParams=''
STAFCmd=''
if dsPath:
dsBinPath='%s/%s' % (dsPath,fileFolder)
STAFCmd='%s/%s%s' % (dsBinPath,DSCONFIG,fileExt)
STAFCmdParamsList=[]
STAFCmdParamsList.append('create-replication-server')
STAFCmdParamsList.append('--provider-name "%s"' % providerName)
STAFCmdParamsList.append('--set "replication-port:%s"' % replicationPort)
STAFCmdParamsList.append('--set "replication-server-id:%s"' % replicationServerId)
for replServer in replicationServerList :
STAFCmdParamsList.append('--set "replication-server:%s"' % replServer)
</script>
<call function="'_dsconfigCommonArgs'" />
<script>
STAFCmdParams=' '.join(STAFCmdParamsList)
</script>
<call function="'runCommand'">
{ 'name' : 'Modify dsconfig object',
'location' : location,
'command' : STAFCmd,
'arguments' : STAFCmdParams,
'expectedRC': expectedRC
}
</call>
<return>
STAXResult
</return>
</sequence>
</function>
<!-- Create a replication server using dsconfig -->
<function name="CreateBackendWithScript">
<!--
-->
<function-prolog>
This function creates a backend server under a given synchronization provider using dsconfig
</function-prolog>
<function-map-args>
<function-arg-def name="location"
type="optional"
default="STAF_REMOTE_HOSTNAME">
<function-arg-description>
Location of target host
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="dsPath"
type="optional"
default="'%s/%s' % (DIRECTORY_INSTANCE_BIN,OPENDSNAME)">
<function-arg-description>
Pathname to installation root
</function-arg-description>
<function-arg-property name="type" value="filepath" />
</function-arg-def>
<function-arg-def name="dsInstanceHost"
type="optional"
default="STAF_REMOTE_HOSTNAME">
<function-arg-description>
Directory server hostname or IP address
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="dsInstanceAdminPort" type="required">
<function-arg-description>
Directory server admin port number
</function-arg-description>
<function-arg-property name="type" value="Port number" />
</function-arg-def>
<function-arg-def name="dsInstanceDn" type="required">
<function-arg-description>
Bind DN
</function-arg-description>
<function-arg-property name="type" value="DN" />
</function-arg-def>
<function-arg-def name="dsInstancePswd" type="required">
<function-arg-description>
Bind password
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="dsBackendID"
type="optional"
default="DIRECTORY_INSTANCE_BE">
<function-arg-description>
Name backend
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="dsBaseDN"
type="optional"
default="DIRECTORY_INSTANCE_SFX">
<function-arg-description>
base dn
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="dsLdapDB"
type="optional"
default="'tmp'">
<function-arg-description>
back end db for based dn
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="dsImportTempDir"
type="optional"
default="'/tmp'">
<function-arg-description>
temporary import dir
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="expectedRC" type="optional" default="0">
<function-arg-description>
Expected return code value. Default value is 0.
Wildcard 'noCheck' to not check the RC
</function-arg-description>
</function-arg-def>
</function-map-args>
<sequence>
<!-- Local variables -->
<script>
mylocation=location
STAFCmdParams=''
STAFCmd=''
baseDNOption='--set base-dn:"%s"' % dsBaseDN
if dsPath:
dsBinPath='%s/%s' % (dsPath,fileFolder)
STAFCmd='%s/%s%s' % (dsBinPath,DSCONFIG,fileExt)
STAFCmdParamsList=[]
STAFCmdParamsList.append('create-backend')
#STAFCmdParamsList.append('-n')
#STAFCmdParamsList.append('-h %s' % dsInstanceHost)
#STAFCmdParamsList.append('-D %s' % dsInstanceDn)
#STAFCmdParamsList.append('-w %s' % dsInstancePswd)
#STAFCmdParamsList.append('-p %s' % dsInstanceAdminPort)
STAFCmdParamsList.append('--backend-name %s' % dsBackendID)
STAFCmdParamsList.append('--type local-db')
STAFCmdParamsList.append(baseDNOption)
STAFCmdParamsList.append('--set enabled:true')
STAFCmdParamsList.append('--set writability-mode:enabled')
STAFCmdParamsList.append('--set import-temp-directory:%s' % dsImportTempDir)
STAFCmdParamsList.append('--set db-directory:%s' % dsLdapDB)
</script>
<call function="'_dsconfigCommonArgs'" />
<script>
STAFCmdParams=' '.join(STAFCmdParamsList)
</script>
<call function="'runCommand'">
{ 'name' : 'Modify dsconfig object',
'location' : location,
'command' : STAFCmd,
'arguments' : STAFCmdParams,
'expectedRC': expectedRC
}
</call>
<return>
STAXResult
</return>
</sequence>
</function>
<!-- Create a multimaster domain using dsconfig -->
<function name="createMultimasterDomain">
<function-prolog>
This function creates a multimaster domain under a given synchronization provider using dsconfig
</function-prolog>
<function-map-args>
<function-arg-def name="location"
type="optional"
default="STAF_REMOTE_HOSTNAME">
<function-arg-description>
Location of target host
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="dsPath"
type="optional"
default="'%s/%s' % (DIRECTORY_INSTANCE_BIN,OPENDSNAME)">
<function-arg-description>
Pathname to installation root
</function-arg-description>
<function-arg-property name="type" value="filepath" />
</function-arg-def>
<function-arg-def name="dsInstanceHost"
type="optional"
default="STAF_REMOTE_HOSTNAME">
<function-arg-description>
Directory server hostname or IP address
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="dsInstanceAdminPort" type="required">
<function-arg-description>
Directory server admin port number
</function-arg-description>
<function-arg-property name="type" value="Port number" />
</function-arg-def>
<function-arg-def name="dsInstanceDn" type="required">
<function-arg-description>
Bind DN
</function-arg-description>
<function-arg-property name="type" value="DN" />
</function-arg-def>
<function-arg-def name="dsInstancePswd" type="required">
<function-arg-description>
Bind password
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="providerName"
type="optional"
default="MultimasterSync">
<function-arg-description>
Name for the synchronization provider
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="domainName" type="required">
<function-arg-description>
Name for multimaster domain
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="replicationDn" type="required">
<function-arg-description>
DN of the replicated suffix
</function-arg-description>
<function-arg-property name="type" value="DN" />
</function-arg-def>
<function-arg-def name="serverId" type="required">
<function-arg-description>
Server ID
</function-arg-description>
<function-arg-property name="type" value="ID number" />
</function-arg-def>
<function-arg-def name="replicationServerList" type="required">
<function-arg-description>
List of replication servers (as in host:replicationServerPort)
</function-arg-description>
<function-arg-property name="type" value="list" />
</function-arg-def>
<function-arg-def name="expectedRC" type="optional" default="0">
<function-arg-description>
Expected return code value. Default value is 0.
Wildcard 'noCheck' to not check the RC
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
</function-map-args>
<sequence>
<!-- Local variables -->
<script>
mylocation=location
STAFCmdParams=''
STAFCmd=''
if dsPath:
dsBinPath='%s/%s' % (dsPath,fileFolder)
STAFCmd='%s/%s%s' % (dsBinPath,DSCONFIG,fileExt)
STAFCmdParamsList=[]
STAFCmdParamsList.append('create-multimaster-domain')
STAFCmdParamsList.append('--provider-name "%s"' % providerName)
STAFCmdParamsList.append('--domain-name "%s"' % domainName)
STAFCmdParamsList.append('--set "base-dn:%s"' % replicationDn)
STAFCmdParamsList.append('--set "server-id:%s"' % serverId)
for replServer in replicationServerList :
STAFCmdParamsList.append('--set "replication-server:%s"' % replServer)
</script>
<call function="'_dsconfigCommonArgs'" />
<script>
STAFCmdParams=' '.join(STAFCmdParamsList)
</script>
<call function="'runCommand'">
{ 'name' : 'Modify dsconfig object',
'location' : location,
'command' : STAFCmd,
'arguments' : STAFCmdParams,
'expectedRC': expectedRC
}
</call>
<return>
STAXResult
</return>
</sequence>
</function>
<function name="GetDSConfigProperties">
<function-prolog>
This function get the value of the given server's attributes
It will call dsconfig, then extract the attributes value.
</function-prolog>
<function-map-args>
<function-arg-def name="location"
type="optional"
default="STAF_REMOTE_HOSTNAME">
<function-arg-description>
Location of target host
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="dsPath"
type="optional"
default="'%s/%s' % (DIRECTORY_INSTANCE_BIN,OPENDSNAME)">
<function-arg-description>
Pathname to installation root
</function-arg-description>
<function-arg-property name="type" value="filepath" />
</function-arg-def>
<function-arg-def name="dsInstanceHost"
type="optional"
default="STAF_REMOTE_HOSTNAME">
<function-arg-description>
Directory server hostname or IP address
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="dsInstanceAdminPort"
type="optional"
default="DIRECTORY_INSTANCE_ADMIN_PORT">
<function-arg-description>
Directory server admin port number
</function-arg-description>
<function-arg-property name="type" value="Port number" />
</function-arg-def>
<function-arg-def name="dsInstanceDn" type="required">
<function-arg-description>
Bind DN
</function-arg-description>
<function-arg-property name="type" value="DN" />
</function-arg-def>
<function-arg-def name="dsInstancePswd" type="required">
<function-arg-description>
Bind password
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="subcommand" type="required">
<function-arg-description>
dsconfig subcommand to execute
e.g. get-backend-prop
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="optionsString" type="optional">
<function-arg-description>
String containing the dsconfig options
e.g. --backend-name userRoot --property base-dn
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="myVariableName" type="required">
<function-arg-description>
Variable containing the dsconfig properties
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
<function-arg-def name="expectedRC" type="optional" default="0">
<function-arg-description>
Expected return code value. Default value is 0.
Wildcard 'noCheck' to not check the RC
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
</function-map-args>
<sequence>
<script>
if optionsString:
optionsString = '%s --script-friendly' % optionsString
else:
optionsString = '--script-friendly'
</script>
<!-- Call dsconfig -->
<call function="'dsconfig'">
{
'location' : location ,
'dsPath' : dsPath ,
'dsInstanceHost' : dsInstanceHost ,
'dsInstanceAdminPort' : dsInstanceAdminPort ,
'dsInstanceDn' : dsInstanceDn ,
'dsInstancePswd' : dsInstancePswd ,
'subcommand' : subcommand ,
'optionsString' : optionsString ,
'expectedRC' : expectedRC
}
</call>
<if expr='RC == 0'>
<script>
vars()[myVariableName] = create_property_table(STAXResult[0][1], '\t')
</script>
</if>
<return>
STAXResult
</return>
</sequence>
</function>
<function name="disconnectReplicationServers">
<function-prolog>
This function breaks the connection among a group of replication servers
by resetting the replication-server attribute in the replication server of
a given list of servers.
</function-prolog>
<function-list-args>
<function-arg-def name="location"
type="optional"
default="STAF_REMOTE_HOSTNAME">
<function-arg-description>
Location of target host
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="dsPath"
type="optional"
default="'%s/%s' % (DIRECTORY_INSTANCE_BIN,OPENDSNAME)">
<function-arg-description>
Pathname to installation root
</function-arg-description>
<function-arg-property name="type" value="filepath" />
</function-arg-def>
<function-arg-def name="serverList" type="required">
<function-arg-description>
List of the servers whose replication servers are to be disconnected.
</function-arg-description>
<function-arg-property name="type" value="Server-list"/>
</function-arg-def>
<function-arg-def name="expectedRC" type="optional" default="0">
<function-arg-description>
Expected return code value. Default value is 0.
Wildcard 'noCheck' to not check the RC
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
</function-list-args>
<sequence>
<paralleliterate var="server" in="serverList">
<sequence>
<script>
ldapServer = '%s:%s' % (server.getHostname(),
server.getPort())
replicationServer = server.getChangelogServer()
replServer = '%s:%s' % (server.getHostname(),
replicationServer.getPort())
</script>
<message>
'Disconnecting \nreplication server: %s \nin server: %s' \
% (replServer, ldapServer)
</message>
<!-- Remove peer RS from replicated domain -->
<call function="'dsconfig'">
{ 'location' : server.getHostname(),
'dsPath' : '%s/%s' % (server.getDir(),OPENDSNAME),
'dsInstanceHost' : server.getHostname(),
'dsInstanceAdminPort' : server.getAdminPort(),
'dsInstanceDn' : server.getRootDn(),
'dsInstancePswd' : server.getRootPwd(),
'subcommand' : 'set-replication-server-prop',
'objectType' : 'provider-name',
'objectName' : 'Multimaster Synchronization',
'optionsString' : '--reset replication-server',
'expectedRC' : expectedRC
}
</call>
</sequence>
</paralleliterate>
<return>
STAXResult
</return>
</sequence>
</function>
<function name="reconnectReplicationServers">
<function-prolog>
This function re-establishes the connection among a group of replication
servers by setting the replication-server attribute in the replication
server of a server with the replication servers of a given list of servers
</function-prolog>
<function-list-args>
<function-arg-def name="location"
type="optional"
default="STAF_REMOTE_HOSTNAME">
<function-arg-description>
Location of target host
</function-arg-description>
<function-arg-property name="type" value="hostname" />
</function-arg-def>
<function-arg-def name="dsPath"
type="optional"
default="'%s/%s' % (DIRECTORY_INSTANCE_BIN,OPENDSNAME)">
<function-arg-description>
Pathname to installation root
</function-arg-description>
<function-arg-property name="type" value="filepath" />
</function-arg-def>
<function-arg-def name="serverList" type="required">
<function-arg-description>
List of the servers whose replication servers are to be reconnected.
</function-arg-description>
<function-arg-property name="type" value="Server-list"/>
</function-arg-def>
<function-arg-def name="expectedRC" type="optional" default="0">
<function-arg-description>
Expected return code value. Default value is 0.
Wildcard 'noCheck' to not check the RC
</function-arg-description>
<function-arg-property name="type" value="string" />
</function-arg-def>
</function-list-args>
<sequence>
<script>
optionList = []
replServerList = []
mainServer = serverList[0]
</script>
<iterate var="server" in="serverList">
<sequence>
<script>
ldapServer = '%s:%s' % (server.getHostname(),
server.getPort())
replicationServer = server.getChangelogServer()
replServer = '%s:%s' % (server.getHostname(),
replicationServer.getPort())
optionList.append('--add replication-server:%s' % replServer)
replServerList.append(replServer)
</script>
</sequence>
</iterate>
<script>
optionString = ' '.join(optionList)
replServers = ' '.join(replServerList)
</script>
<message>
'Reconnecting \nreplication servers: %s \nin server: %s:%s' \
% (replServers, mainServer.getHostname(),
mainServer.getPort())
</message>
<!-- Remove peer RS from replicated domain -->
<call function="'dsconfig'">
{ 'location' : mainServer.getHostname(),
'dsPath' : '%s/%s' \
% (mainServer.getDir(),OPENDSNAME),
'dsInstanceHost' : mainServer.getHostname(),
'dsInstanceAdminPort' : mainServer.getAdminPort(),
'dsInstanceDn' : mainServer.getRootDn(),
'dsInstancePswd' : mainServer.getRootPwd(),
'subcommand' : 'set-replication-server-prop',
'objectType' : 'provider-name',
'objectName' : 'Multimaster Synchronization',
'optionsString' : optionString,
'expectedRC' : expectedRC
}
</call>
<return>
STAXResult
</return>
</sequence>
</function>
</stax>