MarkLogic Server 11.0 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 and security role.

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": [{"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. 
    

Example

   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.
    

Example


   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. 
    
Powered by MarkLogic Server | Terms of Use | Privacy Policy