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'); var config = admin.getConfiguration() var groupId = admin.groupGetId(config, "Default") var 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.
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.