Changes the type of the specified replica on the specified directory server.
#include <ldapx.h> int ldap_change_replica_type ( LDAP *ld, char *dn, char *serverDN, LDAP_REPLICA_TYPE replicaType, int sflags);
(IN) Points to the handle for the LDAP session.
(IN) Points to the distinguished name, in LDAP format, of the replica's partition root.
(IN) Points to the distinguished name, in LDAP format, of the server on which the replica resides.
(IN) Specifies the new type for the replica (see Section 6.7, Replica Types).
(IN) Specifies whether all the servers in the replica ring must be up before proceeding. When set to zero, the status of the servers is not checked. When set to LDAP_ENSURE_SERVERS_UP, all the servers must be up for the operation to proceed.
0x00 |
LDAP_SUCCESS |
0x01 |
LDAP_OPERATIONS_ERROR: A string is returned with this error code that indicates the source of the error. |
0x53 |
LDAP_ENCODING_ERROR |
0x5A |
LDAP_NO_MEMORY |
0x5C |
LDAP_NOT_SUPPORTED |
Non-zero |
Non-zero values indicate errors. See |
This operation is performed on the server with the master replica of the replica that is being changed.
The replica type of the master replica cannot be changed by directly calling this function. The master's replica type can only be changed as a side effect of using this function to change another replica to the master replica. When this happens, the old master automatically becomes a secondary replica.
The caller must have supervisor rights to the master replica.
For sample code, see chgrepl.c.
The requestName is set to the OID (2.16.840.1.113719.1.27.100.15) and the requestValue is a BER encoding of the following:
RequestBer flags INTEGER replicaType INTEGER serverName LDAPDN dn LDAPDN
The responseName is set to the OID (2.16.840.1.113719.1.27.100.16) and there is no responseValue.
ResponseBer NULL