Loading TOC...

MarkLogic 12 EA 1 Product Documentation
admin.forestDeleteBackupById

admin.forestDeleteBackupById(
   config as element(configuration),
   forest-id as (Number|String),
   backup-id as (Number|String)[]
) as element(configuration)

Summary

This function deletes the forest backup specified by the forest ID.

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 to delete, found by XPath to the backup location (for example, //fa:backup-id/).

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



  let admin = require("/MarkLogic/admin.xqy")
  let config = admin.getConfiguration()
  let forestId = xdmp.forest("Documents")
  let backupIds = fn.head(admin.forestGetBackups(
  admin.getConfiguration(), xdmp.forest("Documents"))).xpath("fa:backup-id/fn:data()", {"fa": "http://marklogic.com/xdmp/assignments"})
  admin.forestDeleteBackupById(config, forestId, backupIds)
    

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