admin.appserverCopy( config as element(configuration), appserver-id as (Number|String), target-group-id as (Number|String)?, appserver-name as String, port as (Number|String) ) 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}
const admin = require('/MarkLogic/admin.xqy'); const config = admin.getConfiguration() const groupId = admin.groupGetId(config, "Default") const appserverId = admin.appserverGetId(config, groupId, "myAppServer") admin.appserverCopy(config, appserverId, groupId, "myNewAppServer", 8012) //returns the new configuration element -- use admin.saveConfiguration //to save the changes to the configuration or pass the configuration //to other Admin API functions to make other changes.