Skip to content

Instantly share code, notes, and snippets.

@ableasdale
Created August 23, 2017 13:42
Show Gist options
  • Save ableasdale/ec9dd29c6a5d32f9d5312fc69f5edcbe to your computer and use it in GitHub Desktop.
Save ableasdale/ec9dd29c6a5d32f9d5312fc69f5edcbe to your computer and use it in GitHub Desktop.
MarkLogic: Getting the status of a backup using the ReST API
xquery version "1.0-ml";
declare variable $payload-status := '{"operation": "backup-status", "job-id" : "' || "8774639830166037592" || '","host-name": "' || xdmp:host-name() || '"}';
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