Loading TOC...

MarkLogic 10 Product Documentation
flexrep.targetStatus

flexrep.targetStatus(
   domain-id as (Number|String),
   target-ids as (Number|String)[]
) as Sequence

Summary

This function returns the replication status for the specified targets within the specified replicated domain.

Parameters
domain-id The ID of the replicated domain.
target-ids The IDs of the replication targets.

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')
         });
 
  let cfg = flexrep.configurationGet(domain, true);
  let targetId = flexrep.configurationTargetGetId(cfg, 'Replica');

  flexrep.targetStatus(domain, targetId); 

  // Returns the status of the specified target.
   

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.