MarkLogic 12 EA 1 Product Documentation
admin:forest-backup-set-enabled

admin:forest-backup-set-enabled(
   $config as element(configuration),
   $forest-id as xs:unsignedLong,
   $backup-id as xs:unsignedLong,
   $enabled as xs:boolean
) as element(configuration)

Summary

This function enables forest backup for the specified forest.

Parameters
config A configuration specification, typically as returned from one of the Admin module functions.
forest-id The ID of the forest. For example, xdmp:forest("myForest") specifies the ID for a forest named "myForest".
backup-id The ID of the backup, found by XPath to the backup location (for example, //fa:backup-id/).
enabled Enables forest backup. The default is true, which means the forest backup will occur.

Required Privileges

This operation requires at least one of the following privileges:

http://marklogic.com/xdmp/privileges/admin/database

http://marklogic.com/xdmp/privileges/admin/database/{id}

http://marklogic.com/xdmp/privileges/admin/database/forest-backup/{id}

http://marklogic.com/xdmp/privileges/admin/forest

http://marklogic.com/xdmp/privileges/admin/forest/{id}

http://marklogic.com/xdmp/privileges/admin/forest/backup/{id}

Example



xquery version "1.0-ml";

import module namespace admin = "http://marklogic.com/xdmp/admin"
      at "/MarkLogic/admin.xqy";
declare namespace fa =  "http://marklogic.com/xdmp/assignments";

  let $config := admin:get-configuration()
  let $forest-id xdmp:forest("Documents")
  let $backup-ids := admin:forest-get-backups(
  admin:get-configuration(), xdmp:forest("Documents"))//fa:backup-id/fn:data()
  return
  admin:forest-backup-set-enabled($config, $forest-id, backup-ids, fn:true())

 (: returns the new configuration element -- use admin:save-configuration
    to save the changes to the configuration or pass the configuration
    to other Admin API functions to make other changes.  :)
    
Powered by MarkLogic Server | Terms of Use | Privacy Policy