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)
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.
http://marklogic.com/xdmp/privileges/admin/group-security
http://marklogic.com/xdmp/privileges/admin/group-security/{id}
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. :)