This endpoint enables applying named configurations to MarkLogic resources, overriding parameters and setting options. The configurations may be applied to an individual resource, a set of resources, or a full cluster.
URL Parameters | |
---|---|
name |
The configuration profile name to be run, for example "myClusterTestConfig" .
|
format |
The configuration format.
The allowed values are xml | json .
The default value is xml .
|
resource-type |
The resource type the configuration applies to.
The allowed values are: "forest", "database", "server", "group", "user", "role" .
|
resource-id |
The list of specific resources' identifiers to apply the configuration to.
The value is string array, for example ["resource-id1", "resource-id2", ...] .
|
resource-name |
The regular expression to select specific resources by their names, for example "ha-*" .
|
params |
The serialized JSON object with scenario-specific values for parameters to override default values when the configuration is applied.
For more details and the list of available parameters, see Usage Notes in cma:apply-config .
As the best practice, pass scenario-specific parameters to this endpoint in the params object of the request body, rather than in this URL parameter,
|
Response Headers | |
---|---|
Content-type |
The MIME type of the data in the response body. Depending upon the
value of the format parameter or Accept header, can be
application/xml or application/json .
|
- 200 (OK)
- Returned upon successful completion of the operation. The response body contains the requested data.
- 401 (Unauthorized)
- Returned if the user does not have the necessary privileges to perform the operation.
manage-admin
role, or the
following privilege:
http://marklogic.com/xdmp/privileges/manage-admin
The user username
in Example sections below shall have the above role and/or privilege.
The structure of the data in the request body and response body is as shown below.
name
desc
user
group
host
platform
ts
version
params
This is a complex structure with the following children:
param
configs
This is a complex structure with the following children:
config
curl -v -X POST --anyauth --user username:password --header "Content-Type:application/json" -d'{"config": [{"forest": [{"forest-name":"f1"}, {"forest-name":"f2"}, {"forest-name":"f3"}]}]}' http://localhost:8002/manage/v3 ==> Apply json configuration, creating three forests with a single HTTP request.
curl -v -X POST --anyauth --user username:password --header "Content-Type:application/json" -d'{"name":"myConfig","param":[],"config":[{"forest": ["dhf1"],"database":[{"database-name":"dhdb1"}],"server":[{"server-name":"dhf1","server-type":"http","root":"/","port":8100,"content-database":"dhdb1"}]}]}' http://node1:8002/manage/v3 ==> Apply json configuration, creating a forest, a database, and an HTTP application server.
curl -v -X POST --anyauth --user username:password --header "Content-Type:application/zip" -d@myconfig.zip "http://node1:8002/manage/v3" ==> Apply zip configuration.
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.