Loading TOC...

MarkLogic 10 Product Documentation
flexrep.domainStatus

flexrep.domainStatus(
   domain-id as (Number|String),
   [with-targets as Boolean],
   [terse as Boolean]
) as element(flexrep.domainStatus)

Summary

This function returns the replication status for the specified replicated CPF domain.

Parameters
domain-id The ID of the replicated domain.
with-targets Set to true to include status information for each target. Otherwise set to false.
terse Set to true to prevent counts from being returned for each of the individual states (deleted, error, updated, and so on). Otherwise set to false.

Example

const flexrep = require('/MarkLogic/flexrep');

  // Obtain the domain ID from the database used by the Master to enable CPF.
  const domain = xdmp.eval(
    'const dom = require("/MarkLogic/cpf/domains");' +
      'fn.data(dom.get("Default Master").xpath("//dom:domain-id"));',
       null,
         {
          'database' : xdmp.database('Triggers')
         });
 
  const cfg = flexrep.configurationGet(domain, true);
  const targetId = flexrep.configurationTargetGetId(cfg, 'Replica');

  flexrep.domainStatus(domain, true, false);

  // Returns the status of the domain and its targets. 
   

Required Privileges

http://marklogic.com/xdmp/privileges/flexrep-user

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.