|
|
admin:forest-copy(
|
|
$config as element(configuration),
|
|
$forest-id as xs:unsignedLong,
|
|
$forest-name as xs:string,
|
|
$data-directory as xs:string?
|
| ) as element(configuration) |
|
 |
Summary:
This function creates a new forest specification with the
same settings as the forest with the specified ID. The new
forest configuration will have the specified name. It
copies the forest configuration, but does not copy
the forest data.
|
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") specified the ID
for a forest named "myForest".
|
$forest-name
:
The name for the new forest.
|
$data-directory
:
The optional data directory of the forest. If no directory
is specified, then it will be a private forest.
|
|
Example:
xquery version "1.0-ml";
import module namespace admin = "http://marklogic.com/xdmp/admin"
at "/MarkLogic/admin.xqy";
admin:forest-copy(admin:get-configuration(), xdmp:forest("myForest"),
"myNewForest",())
|
|
|
|
admin:forest-delete(
|
|
$config as element(configuration),
|
|
$forest-ids as xs:unsignedLong*,
|
|
$delete-data as xs:boolean
|
| ) as element(configuration) |
|
 |
Summary:
This function deletes the configuration for the specified
forest from the configuration.
|
Parameters:
$config
:
A configuration specification, typically as returned
from one of the Admin module functions.
|
$forest-ids
:
One or more forest ids. For example,
xdmp:forest("myForest") specified the ID
for a forest named "myForest".
|
$delete-data
:
If set to true, deletes the data directory as well as the
configuration (Note: all documents in the forest will be
permanently deleted). If set to false, deletes only the
configuration information, leaving the forest data in the
data directory on disk.
|
|
Usage Notes:
Any forest whose ID you pass into this function must not be attached
to a database when the transaction begins, otherwise an exception is
thrown. If you need to detach the forest, do so in a separate transaction
before using them in this function.
|
Example:
xquery version "1.0-ml";
import module namespace admin = "http://marklogic.com/xdmp/admin"
at "/MarkLogic/admin.xqy";
let $config := admin:get-configuration()
return
admin:forest-delete($config, admin:forest-get-id($config, "Documents"),
fn:false())
=> deletes the forest configuration for the forest
named "Documents"
|
|
|
|
admin:forest-set-updates-allowed(
|
|
$config as element(configuration),
|
|
$forest-id as xs:unsignedLong,
|
|
$value as xs:string
|
| ) as element(configuration) |
|
 |
Summary:
This function sets the updates-allowed state for a
forest configuration.
|
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") specified the ID
for a forest named "myForest".
|
$value
:
The new updates-allowed state of the forest. Must be one of
all for all updates allowed,
delete-only for only deletes allowed,
read-only for no updates allowed and to cause
updating transactions to abort immediately,
flash-backup for no updates allowed and to make
updating transactions retry for a time period specified in
the group's retry timeout.
|
|
Example:
xquery version "1.0-ml";
import module namespace admin = "http://marklogic.com/xdmp/admin"
at "/MarkLogic/admin.xqy";
let $config := admin:get-configuration()
return
admin:forest-set-updates-allowed($config,
admin:forest-get-id($config, "Documents"),
"delete-only")
=> sets the updates-allowed state of the forest named "Documents" to
the true state
|
|
|
|
admin:forest-weekly-backup(
|
|
$backup-dir as xs:string,
|
|
$backup-period as xs:positiveInteger,
|
|
$days as xs:string+,
|
|
$start-time as xs:time
|
| ) as element(as:forest-backup) |
|
 |
Summary:
This function constructs a weekly scheduled backup.
|
Parameters:
$backup-dir
:
The directory where the backup will be saved to.
|
$backup-period
:
The how many weeks between each backup.
|
$days
:
The day(s) of the week. Must be a sequence of zero
or more of monday, tuesday,
wednesday, thusday,
friday, saturday,
sunday.
|
$start-time
:
A time for the scheduled backup to start.
|
|
Example:
xquery version "1.0-ml";
import module namespace admin = "http://marklogic.com/xdmp/admin"
at "/MarkLogic/admin.xqy";
admin:forest-weekly-backup("/backup-dir", 2, "monday", xs:time("09:45:00"))
(: returns the weekly backup specification :)
|
|
|