|
|
pkg:install(
|
|
$pkgname as xs:string
|
| ) as pkgins:install($pkgname) |
|
 |
Summary:
Install the named package.
|
Parameters:
$pkgname
:
The name of the package to install.
|
|
Usage Notes:
Only users with the admin role may install packages.
Installing a package creates a ticket. Use info:ticket
to check the status of the ticket.
Modifying some settings requires a server restart. If package
installation requires a server restart to complete, the returned
result directs you to restart.
The returned status reports success or failure in
the pkg:result-status child element. If the installation
fails, the live configuration is unchanged and errors are reported.
Attempting to install two or more packages concurrently may leave your
configuration in an indeterminate state.
|
Example:
(: install a package previously created on the server :)
import module namespace pkg = "http://marklogic.com/manage/package"
at "/MarkLogic/manage/package/package.xqy";
pkg:install("mypackage")
=> The settings in "mypackage are applied and a status is
returned, indicating success or failure. For example:
<install-status xmlns="http://marklogic.com/manage/package">
<success>true</success>
<restart>false</restart>
<ticket-id>/tickets/ticket/10368962049703559638</ticket-id>
<revert-uri>/manage/v2/tickets/10368962049703559638/revert</revert-uri>
</install-status>
|
|
|
|
pkg:revert(
|
|
$ticket-id as xs:string
|
| ) as pkgins:revert($ticket) |
|
 |
Summary:
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>
|
|
|