MarkLogic 10 Product Documentation
flexrep:pull-insert

flexrep:pull-insert(
   $pull as element(flexrep:pull)
) as empty-sequence()

Summary

This function inserts the specified pull configuration into the Replica database.

Parameters
pull The pull replication configuration obtained by the flexrep:pull-get function.

Example

  (: This query must be executed on a Replica database. :)
  xquery version "1.0-ml"; 

  import module namespace flexrep = "http://marklogic.com/xdmp/flexible-replication" 
      at "/MarkLogic/flexrep.xqy";

  (: Specify the ID of the replicated CPF domain obtained from the Master's 
     Triggers database. :)
  let $domain:= 9535475951259984368

  (: Specify the ID of the replication target obtained from the Master database. :)
  let $target-id := 18130470845627037840

  (: Specify the HTTP options for the replication target. :)
  let $http-options := 
    <flexrep:http-options 
     xmlns:flexrep="http://marklogic.com/xdmp/flexible-replication">
      <http:authentication xmlns:http="xdmp:http">
        <http:username>admin</http:username>
        <http:password>admin</http:password>
      </http:authentication>
      <http:client-cert xmlns:http="xdmp:http"/>
      <http:client-key xmlns:http="xdmp:http"/>
      <http:pass-phrase xmlns:http="xdmp:http"/>
    </flexrep:http-options>

  let $pullconfig := flexrep:pull-create(
    "Master",
    $domain,
    $target-id,
    "http://localhost:8010/",
    $http-options)

  (: Insert the pull configuration into the Replica database. :)
  return flexrep:pull-insert($pullconfig) 

  (: Inserts a pull replication configuration element into the Replica database. :)
     

Required Privileges

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

Powered by MarkLogic Server | Terms of Use | Privacy Policy