Last active
April 26, 2016 18:09
-
-
Save ableasdale/009b227d1635371ceee9 to your computer and use it in GitHub Desktop.
MarkLogic: Create a backup using a ReST API call
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"; | |
| (: See http://docs.marklogic.com/REST/POST/manage/v2/databases/%5Bid-or-name%5D :) | |
| 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>username</username> | |
| <password>password</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