This page was generated
March  13,  2012
4:49  AM
XQuery & XSLT Built-In & Modules Function Reference

Module: Packaging API

The Packaging API is a REST-based API that allows you to export and import MarkLogic Server App Server and database configurations.

REST Resource Summary
/manage/v1/list/package This resource address returns configuration information for the specified App Servers and/or databases.
/manage/v1/package/compare This resource address is used in a POST request to import a packaged configuaration for resources to a host and compare it against the configurations of the host's local resources.
/manage/v1/package/install This resource address is used in a POST request to install a packaged configuration on the local host.
/manage/v1/tickets/ticket/{ticket-number}/revert Each /manage/v1/package/install resource address returns ticket number.
REST Resource Detail
/manage/v1/list/package
Summary:

This resource address returns configuration information for the specified App Servers and/or databases.

Parameters:
$appserver : The App Server to package. The App Server is specified using the format group-name/server-name. For example, appserver=Default/App-Services. This option can be repeated.
$database : The database to package, for example database=Documents. This option can be repeated.

Example:
  http:/localhost:8002/manage/v1/list/package?database=App-Services&appserver=Default/Manage

  (: Returns configuration information for the App-Services database and Manage
     App Server. :)
    

/manage/v1/package/compare
Summary:

This resource address is used in a POST request to import a packaged configuaration for resources to a host and compare it against the configurations of the host's local resources.

Example:
   xquery version "1.0-ml";

   let $package :=
   xdmp:http-get("http://host1:8002/manage/v1/list/package?database=Documents",
     <options xmlns="xdmp:http">
       <authentication method="digest">
         <username>admin</username>
         <password>admin</password>
       </authentication>
     </options>)[2]

   return
   xdmp:http-post("http://host2:8002/manage/v1/package/compare/",
     <options xmlns="xdmp:http">
       <authentication method="digest ">
         <username>admin</username>
         <password>admin</password>
       </authentication>
       <data>{xdmp:quote($package)}</data>
       <headers>
         <content-type>text/xml</content-type>
       </headers>
     </options>)

  (: Imports and compares a configuration of the Documents database on host1 to
     the Documents database on host2. :)
    

/manage/v1/package/install
Summary:

This resource address is used in a POST request to install a packaged configuration on the local host. Returns an XML node containing a ticket number that identifies the installed configuration.

Example:
   xquery version "1.0-ml";

   let $package :=
   xdmp:http-get("http://host1:8002/manage/v1/list/package?database=Documents",
     <options xmlns="xdmp:http">
       <authentication method="digest">
         <username>admin</username>
         <password>admin</password>
       </authentication>
     </options>)[2]

   return
   xdmp:http-post("http://host2:8002/manage/v1/package/install/",
     <options xmlns="xdmp:http">
       <authentication method="digest ">
         <username>admin</username>
         <password>admin</password>
       </authentication>
       <data>{xdmp:quote($package)}</data>
       <headers>
         <content-type>text/xml</content-type>
       </headers>
     </options>)

  (: installs a configuration of the Documents database on host1 to
     the Documents database on host2. :)
    

/manage/v1/tickets/ticket/{ticket-number}/revert
Summary:

Each /manage/v1/package/install resource address returns ticket number. You can use this resource address in a POST request to revert a configuration to that specified by the ticket.

Example:
  http:/localhost:8002/manage/v1/tickets/ticket/17972973415247483208/revert/

  (: Reverts the configuration to that specified by the ticket. :)