Created
August 23, 2017 13:37
-
-
Save ableasdale/84336fe0a26f39cd75ef1d92afe872af to your computer and use it in GitHub Desktop.
MarkLogic - ReST and XQuery: perform a database backup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "1.0-ml"; | |
declare variable $payload-status := '{"operation": "backup-database", "forest": ["Documents"], "backup-dir": "/tmp" }'; | |
xdmp:http-post("http://localhost:8002/manage/v2/databases/Documents?format=json", | |
<options xmlns="xdmp:http"> | |
<authentication method="digest"> | |
<username>admin</username> | |
<password>admin</password> | |
</authentication> | |
<data>{$payload-status}</data> | |
<headers> | |
<content-type>application/json</content-type> | |
<accept>application/json</accept> | |
</headers> | |
</options>) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment