Loading TOC...

MarkLogic 12 EA 2 Product Documentation
admin:appserver-copy

admin:appserver-copy(
   $config as element(configuration),
   $appserver-id as xs:unsignedLong,
   $target-group-id as xs:unsignedLong?,
   $appserver-name as xs:string,
   $port as xs:unsignedLong
) as element(configuration)

Summary

This function creates a new App Server specification with the same settings as the App Server with the specified ID. The new App Server configuration will have the specified name. You can copy the App Server to a new one either in the same group (by specifying $old-group-id and $new-group-id with the same group ID) or in a different group.

Parameters
config A configuration specification, typically as returned from one of the Admin module functions.
appserver-id The ID of the App Server. Typically, this is the result of an admin:appserver-get-id call.
target-group-id The optional group ID of the new group to which the App Server is copied. If no ID is provided, the App Server will be copied to the same group it exists in. Typically, this is the result of an admin:group-get-id call.
appserver-name The new name for the App Server.
port The port number for the new App Server.

Required Privileges

This operation requires at least one of the following privileges:

http://marklogic.com/xdmp/privileges/admin/group-security

http://marklogic.com/xdmp/privileges/admin/group-security/{id}

Example


  xquery version "1.0-ml";

  import module namespace admin = "http://marklogic.com/xdmp/admin"
		  at "/MarkLogic/admin.xqy";

  let $config := admin:get-configuration()
  let $group-id := admin:group-get-id($config, "Default")
  let $appserver-id := admin:appserver-get-id($config, $group-id,
                       "myAppServer")
  return
  admin:appserver-copy($config, $appserver-id, $group-id,
                       "myNewAppServer", 8012)

  (: returns the new configuration element -- use admin:save-configuration
     to save the changes to the configuration or pass the configuration
     to other Admin API functions to make other changes.  :)

  

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