Loading TOC...

MarkLogic 9 Product Documentation
POST /manage/v3

Summary

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,
Request Headers
Accept The expected MIME type of the response. If the format parameter is present, it takes precedence over the Accept header. The allowed values are application/xml, application/json. The default value is application/xml.
Content-type The MIME type of the data in the request body. Depending upon the value of the format parameter or Accept header, can be application/xml or application/json.
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.

Response

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.

Required Privileges

This operation requires the 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.

Usage Notes

The structure of the data in the request body and response body is as shown below.

name

Configuration profile name.

desc

Configuration description.

user

Configuration was generated by this user.

group

Configuration was generated by host in this group.

host

Configuration was generated by this host.

platform

Configuration was generated by host running on this platform.

ts

Configuration was generated at this timestamp.

version

Configuration was generated by host running this version of MarkLogic.

params

Configuration params contains sequence of param elements.

This is a complex structure with the following children:

param

Configuration param contains name-value pairs.

configs

Configuration configs contains sequence of config elements.

This is a complex structure with the following children:

config

Configuration config contains resource properties.

Example


   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. 
    

Example


   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. 
    

Example


   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 iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.