Loading TOC...

pkg:revert

pkg:revert(
   $ticket-id as xs:string
) as pkgins:revert($ticket)

Summary

[DEPRECATED: use cma:generate-config and cma:apply-config instead.]

Revert configuration settings to those prior to a particular package installation.

Parameters
ticket-id The id of a ticket created by a previous successful call to pkg:install.

Usage Notes

Reverting a package installation restores all settings to their state at the time ticket was created by calling pkg:install. If other configuration changes are applied between the successful install and the attempt to revert, those changes are lost.

Successful calls to pkg:install create a ticket associated with the configuration changes. Use the revert-uri returned by pkg:install to revert the changes.

Reverting an installed package does not remove any forests associated with databases that are removed.

Example

xquery version "1.0-ml";
import module namespace pkg = "http://marklogic.com/manage/package" 
    at "/MarkLogic/manage/package/package.xqy";

(: install a package :)
pkg:install("mypackage");

(: Produces the following for some previously saved pkg:

  <install-status xmlns="http://marklogic.com/manage/package">
    <success>true</success>
    <restart>false</restart>
    <ticket-id>/tickets/17841336193093321431</ticket-id>
    <revert-uri>/manage/v2/tickets/17841336193093321431/revert</revert-uri>
  </install-status>

:)

(: revert the above install :)
import module namespace pkg = "http://marklogic.com/manage/package" 
    at "/MarkLogic/manage/package/package.xqy";

pkg:revert("/tickets/ticket/17841336193093321431")

  
  => The changes applied by the package are reverted:

  <pkg:revert-status xmlns:pkg="http://marklogic.com/manage/package">
    <pkg:success>true</pkg:success>
    <pkg:restart>false</pkg:restart>
    <pkg:ticket-id>/tickets/ticket/5620889718989064792</pkg:ticket-id>
    <pkg:revert-uri>/manage/v2/tickets/5620889718989064792/revert</pkg:revert-uri>
  </pkg:revert-status>


  

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.