Export LDIF File (QgldExportLdifInst) API


  Required Parameter Group:

1 Input data Input Char(*)
2 Length of input data Input Binary(4)
3 Format name Input Char(8)
4 Error code I/O Char(*)
5 Instance name Input Char(8)

  Default Public Authority: *USE

  Library Name/Service Program: QSYS/QGLDUAPI

  Threadsafe: No

The Export LDIF File (QgldExportLdifInst) API exports the directory server instance contents to a Lightweight Directory Access Protocol Data Interchange Format (LDIF) file.


Authorities and Locks

Directory Authority
The caller must provide the administrator DN and password if the caller does not have *ALLOBJ and *IOSYSCFG special authorities and the caller is not a Directory Services administrator. The caller is a Directory Services administrator if the Directory Services server has been configured to grant administrator access to authorized users and the caller is authorized to the 'Directory Services Administrator' function of the operating system.

Object Authorities
The caller must have Execute (*X) authority to each directory in the path name preceding the name of the LDIF file. The caller must have Write (*W) authority to the LDIF file.

Required Parameter Group

Input data
INPUT; CHAR(*)

Input data required to identify the LDIF file and the administrator name and password. The content and format of this structure are determined by the format name. See Format of Input Data for a description of these formats.

Length of input data
INPUT; BINARY(4)

The length of the input data structure.

Format name
INPUT; CHAR(8)

The content and format of the input data. The possible format name follows:

LDIF0100 Export LDIF file.
LDIF0200 Export LDIF file with options.

See Format of Input Data for a description of this format.

Error code
I/O; CHAR(*)

The structure in which to return error information. For the format of the structure, see Error code parameter.

Instance name
Input; CHAR(8)

Contains the name of the Directory Server instance have data exported from. If a NULL pointer or blanks is specified, the default instance name, QUSRDIR is used.


Format of Input Data

For details about the format of the input data, see the following section. For details about the fields in each format, see Field Descriptions.


LDIF0100 Format

Offset Type Field
Dec Hex
0 0 BINARY(4) Offset to LDIF file
4 4 BINARY(4) Length of LDIF file
8 8 BINARY(4) Offset to administrator DN
12 C BINARY(4) Length of administrator DN
16 10 BINARY(4) Offset to administrator password
20 14 BINARY(4) Length of administrator password
24 18 BINARY(4) Offset to subtree DN
28 1C BINARY(4) Length of subtree DN
CHAR(*) LDIF file
CHAR(*) Administrator DN
CHAR(*) Administrator password
CHAR(*) Subtree DN


LDIF0200 Format

Offset Type Field
Dec Hex
0 0 BINARY(4) Offset to LDIF file
4 4 BINARY(4) Length of LDIF file
8 8 BINARY(4) Offset to administrator DN
12 C BINARY(4) Length of administrator DN
16 10 BINARY(4) Offset to administrator password
20 14 BINARY(4) Length of administrator password
24 18 BINARY(4) Offset to subtree DN
28 1C BINARY(4) Length of subtree DN
32 20 BINARY(4) Additional fields indicator
Additional fields if indicator is equal to 1 or greater:
36 24 BINARY(4) Include cn=localhost
40 28 BINARY(4) Include cn=pwdpolicy
44 2C BINARY(4) Include nested replication contexts
Additional fields if indicator is equal to 2 or greater:
48 30 BINARY(4) Include operational attributes
Additional fields if indicator is equal to 3 or greater:
52 34 BINARY(4) Offset to AES passphrase
56 38 BINARY(4) Length of AES passphrase
Start of change60End of change Start of change3CEnd of change BINARY(4) Offset to AES encryption salt
Start of change64End of change Start of change40End of change BINARY(4) Length of AES encryption salt
Start of changeAdditional fields if indicator is equal to 4:End of change
Start of change68End of change Start of change44End of change Start of changeBINARY(4)End of change Start of changeOffset to filter DNEnd of change
Start of change72End of change Start of change48End of change Start of changeBINARY(4)End of change Start of changeLength of filter DNEnd of change
Start of change76End of change Start of change4CEnd of change Start of changeBINARY(4)End of change Start of changeOffset to filter commentEnd of change
Start of change80End of change Start of change50End of change Start of changeBINARY(4)End of change Start of changeLength of filter commentEnd of change
Variable length string fields:
CHAR(*) LDIF file
CHAR(*) Administrator DN
CHAR(*) Administrator password
CHAR(*) Subtree DN
CHAR(*) AES passphrase
CHAR(*) AES encryption salt
Start of changeCHAR(*)End of change Start of changeFilter DNEnd of change
Start of changeCHAR(*)End of change Start of changeFilter commentEnd of change


Field Descriptions

Additional fields indicator. Additional fields supplied for a format. See the format descriptions for possible uses and values of this field.

Administrator DN. The distinguished name of the server administrator. This field is specified in UCS-2 (CCSID 13488).

Administrator password. The password for the server administrator. This field is specified in UCS-2 (CCSID 13488).

AES encryption salt. The value for the AES encryption salt for exported passwords. This must be 12 characters in length. If this field is used, the AES passphrase field must also be used. This field is specified in UTF-16 (CCSID 13488). Valid characters include the following characters:

! " # $ % & ' ( ) * + , - . / ? > = < ; : @ [ \ ] ^ _ ` { } | ~

ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789

If AES encryption is not being used on the target server, specify a length and offset to this field of zero. If not specified, AES encryption will not be used to export the data.

AES passphrase. The value for the AES passphrase for exported passwords. A minimum of 12 characters and maximum of 1016 characters is allowed. If this field is used, the AES encryption salt field must also be used. This field is specified in UTF-16 (CCSID 13488). Valid characters include the following characters:

! " # $ % & ' ( ) * + , - . / ? > = < ; : @ [ \ ] ^ _ ` { } | ~

ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789

If AES encryption is not being used on the target server, specify a length and offset to this field of zero. If not specified, AES encryption will not be used to export the data.

Include cn=localhost. Indicates whether data located under the distinguished name cn=localhost should be included in the exported data. If format LDIF0100 is used, cn=localhost is not included in the exported data. The following values may be specified:

0 The contents of cn=localhost are not included in the exported data.
1 The contents of cn=localhost are included in the exported data.

The value 1 can only be specified when no subtree DN is specified.

Include cn=pwdpolicy. Indicates whether data located under the distinguished name cn=pwdpolicy should be included in the exported data. If format LDIF0100 is used, cn=pwdpolicy is not included in the exported data. The following values may be specified:

0 The contents of cn=pwdpolicy are not included in the exported data.
1 The contents of cn=pwdpolicy are included in the exported data.

The value 1 can only be specified when no subtree DN is specified.

Include nested replication contexts. Indicates whether nested replication contexts should be included in the exported data. For example, if a directory contains the replication contexts o=acme and cn=external users,o=acme, this option can be used to export data under the distinguished name o=acme while excluding all entries under the distinguished name cn=external users,o=acme. If format LDIF0100 is used, nested replication contexts are included in the exported data. The following values may be specified:

0 Data from nested replication contexts is not included in the exported data.
1 Data from nested replication contexts is included in the exported data.

The value 0 can only be specified if a subtree DN is specified.

Include operational attributes. Indicates whether the following four operational attributes will be exported: creatorsName, createTimestamp, modifiersName, and modifyTimestamp. If no value is specified, these operational attributes will be included in the exported data. The following values may be specified:

0 The operational attributes are not included in the exported data.
1 The operational attributes are included in the exported data.

LDIF file. The integrated file system path name of the LDIF file to be used. This field is specified in UCS-2 (CCSID 13488).

Length of administrator DN. The length, in Unicode characters, of the administrator DN field.

Length of administrator password. The length, in Unicode characters, of the administrator password field.

Length of AES encryption salt. The length, in UTF-16 (CCSID 13488) characters, of the AES encryption salt. If AES encryption is not being used on the target server, specify a length of zero. If not specified, AES encryption will not be used to export the data.

Length of AES passphrase. The length, in UTF-16 (CCSID 13488) characters, of the AES passphrase. If AES encryption is not being used on the target server, specify a length of zero. If not specified, AES encryption will not be used to export the data.

Start of changeLength of filter comment. The length, in Unicode characters, of the filter comment field.End of change

Start of changeLength of filter DN. The length, in Unicode characters, of the filter DN field.End of change

Length of LDIF file. The length, in Unicode characters, of the LDIF file field.

Length of subtree DN. The length, in Unicode characters, of the subtree DN field.

Offset to administrator DN. The offset, in bytes, from the start of the input data to the administrator DN field.

Offset to administrator password. The offset, in bytes, from the start of the input data to the administrator password field.

Offset to AES encryption salt. The offset, in bytes, from the start of the input data area to the AES encryption salt. If AES encryption is not being used on the target server, specify an offset to this field of zero. If not specified, AES encryption will not be used to export the data.

Offset to AES passphrase. The offset, in bytes, from the start of the input data area to the AES passphrase. If AES encryption is not being used on the target server, specify an offset to this field of zero. If not specified, AES encryption will not be used to export the data.

Start of changeOffset to filter comment. The offset, in bytes, from the start of the input data to the filter comment field.End of change

Start of changeOffset to filter DN. The offset, in bytes, from the start of the input data to the filter DN field.End of change

Offset to LDIF file. The offset, in bytes, from the start of the input data to the LDIF file field.

Offset to subtree DN. The offset, in bytes, from the start of the input data to the subtree DN field.

Subtree DN. The distinguished name (DN) of the root of a directory subtree to export to the LDIF file. This object, and all descendant objects will be exported. To export the entire directory tree, specify 0 (zero) for the offset to subtree DN and length of subtree DN fields. This field is specified in UCS-2 (CCSID 13488).


Error Messages

Message ID Error Message Text
GLD0202 E Administrator DN or password not correct.
GLD0213 E Error opening or creating file.
GLD0215 E Server has not been configured.
GLD0218 E *ALLOBJ and *IOSYSCFG special authorities required.
GLD022B E Cannot find object &1.



API Introduced: i 6.1

[ Back to top | UNIX-Type APIs | APIs by category ]