Agreement

Usage example

master = topology.ms["master1"]
consumer = topology.ms["consumer1"]
# Create
repl_agreement = master.agreement.create(suffix=DEFAULT_SUFFIX,
                                         host=consumer.host,
                                         port=consumer.port)
# List
ents = master.agreement.list(suffix=DEFAULT_SUFFIX,
                             consumer_host=consumer.host,
                             consumer_port=consumer.port)
# Delete
ents = master1.agreement.delete(suffix=DEFAULT_SUFFIX)

Module documentation

class lib389.agreement.Agreement(instance, dn=None, winsync=False)[source]

A replication agreement from this server instance to another instance of directory server.

  • must attributes: [ ‘cn’ ]

  • RDN attribute: ‘cn’

Parameters
  • instance (lib389.DirSrv) – An instance

  • dn (str) – Entry DN

begin_reinit()[source]

Begin a total reinit of the consumer. This will send our data to the server we are replicating too.

check_reinit()[source]

Check the status of a reinit. Returns done, inprogress, and error text. A correct reinit will return (True, False, False).

Returns

tuple(done, error), where done, error are bool.

get_agmt_maxcsn()[source]

Get the agreement maxcsn from the database RUV entry :returns: CSN string if found, otherwise None is returned

get_agmt_status(binddn=None, bindpw=None, return_json=False)[source]

Return the status message :param binddn: Specifies a specific bind DN to use when contacting the remote consumer :type binddn: str :param bindpw: Password for the bind DN :type bindpw: str :returns: A status message about the replication agreement

get_consumer_maxcsn(binddn=None, bindpw=None)[source]

Attempt to get the consumer’s maxcsn from its database RUV entry :param binddn: Specifies a specific bind DN to use when contacting the remote consumer :type binddn: str :param bindpw: Password for the bind DN :type bindpw: str :returns: CSN string if found, otherwise “Unavailable” is returned

get_lag_time(suffix, agmt_name, binddn=None, bindpw=None)[source]

Get the lag time between the supplier and the consumer :param suffix: The replication suffix :type suffix: str :param agmt_name: The name of the agreement :type agmt_name: str :param binddn: Specifies a specific bind DN to use when contacting the remote consumer :type binddn: str :param bindpw: Password for the bind DN :type bindpw: str :returns: A time-formated string of the the replication lag (HH:MM:SS). :raises: ValueError - if unable to get consumer’s maxcsn

get_wait_for_async_results_utf8()[source]

Get the current value of nsDS5ReplicaWaitForAsyncResults.

Returns

str

pause()[source]

Pause outgoing changes from this server to consumer. Note that this does not pause the consumer, only that changes will not be sent from this master to consumer: the consumer may still receive changes from other replication paths!

remove_wait_for_async_results()[source]

Reset nsDS5ReplicaWaitForAsyncResults to default.

resume()[source]

Resume sending updates from this master to consumer directly.

set_flowcontrolwindow(value)[source]

Set nsds5ReplicaFlowControlWindow to value.

Parameters

value (str) – During total update Number of entries to send without waiting ack

set_wait_for_async_results(value)[source]

Set nsDS5ReplicaWaitForAsyncResults to value.

Parameters

value (str) – Time in milliseconds.

status(winsync=False, just_status=False, use_json=False, binddn=None, bindpw=None)[source]

Get the status of a replication agreement :param winsync: Specifies if the the agreement is a winsync replication agreement :type winsync: boolean :param just_status: Just return the status string and not all of the status attributes :type just_status: boolean :param use_json: Return the status in a JSON object :type use_json: boolean :param binddn: Specifies a specific bind DN to use when contacting the remote consumer :type binddn: str :param bindpw: Password for the bind DN :type bindpw: str :returns: A status message :raises: ValueError - if failing to get agmt status

wait_reinit(timeout=300)[source]

Wait for a reinit to complete. Returns done and error. A correct reinit will return (True, False). :param timeout: timeout value for how long to wait for the reinit :type timeout: int :returns: tuple(done, error), where done, error are bool.