
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 and security role.
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.
namedescusergrouphostplatformtsversionparamsThis is a complex structure with the following children:
paramconfigsThis 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": [{"forest-name":"dhf1"}],"database":[{"database-name":"dhdb1","forest" :["dhf1"]}],"server":[{"server-name":"dhf1","server-type":"http","root":"/","port":8100,"content-database":"dhdb1"}]}]}' http://localhost:8002/manage/v3
==> Apply json configuration, creating a forest, a database, and an HTTP application server.
cat config.xml
==>
<configuration xmlns="http://marklogic.com/manage/config">
<configs>
<config>
<forests>
<forest>
<forest-name>Forest1</forest-name>
</forest>
<forest>
<forest-name>Forest2</forest-name>
</forest>
<forest>
<forest-name>Forest3</forest-name>
</forest>
<forest>
<forest-name>Forest4</forest-name>
</forest>
</forests>
<databases>
<database>
<database-name>SchemasDb</database-name>
<forests>
<forest>Forest1</forest>
</forests>
</database>
<database>
<database-name>TriggersDb</database-name>
<forests>
<forest>Forest2</forest>
</forests>
</database>
<database>
<database-name>Database1</database-name>
<schema-database>SchemasDb</schema-database>
<triggers-database>TriggersDb</triggers-database>
<forests>
<forest>Forest3</forest>
<forest>Forest4</forest>
</forests>
</database>
</databases>
</config>
</configs>
</configuration>
curl -v -X POST --anyauth --user username:password --header "Content-Type:application/xml" -d@config.xml http://localhost:8002/manage/v3
==> Apply XML configuration, creating 4 forests, 3 databases, attaching the forests to the databases, and setting the schema and trigger databases for Database1.
curl -v -X POST --anyauth --user username:password --header "Content-Type:application/zip" -d@myconfig.zip 'http://localhost:8002/manage/v3'
==> Apply zip configuration generated with a scenario.
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.