flexrep.pullSetEnabled( pull as element(flexrep.pull), flag as Boolean ) as element(flexrep.pull)
Set the enabled flag for a pull. This provides a way for a target cluster to disable pull replication when necessary.
Parameters | |
---|---|
pull | The pull configuration. |
flag | True if the pull is enabled, false if it is disabled. |
const flexrep = require('/MarkLogic/flexrep'); //? declareUpdate(); 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.configurationCreate(domain); const domainId = flexrep.configurationGetId(cfg); let pull = flexrep.pullGet(domainId); flexrep.pullInsert( flexrep.pullSetEnabled( pull, fn.not(flexrep.pullGetEnabled(pull))));