Loading TOC...

POST /manage/v2/packages

Summary

This resource address creates a new package and returns the URI of the created package.

URL Parameters
pkgname The name of the new package to be created.
format The format of the output. This can be either xml or json.
Request Headers
Content-type The MIME type of the data in the request body. Depending upon the value of the format parameter or Accept header, either application/zip, 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, either application/xml or application/json.
Location A header that identifies the URI of the created package.

Required Privileges

This operation requires the manage-admin role, or the following privilege:

http://marklogic.com/xdmp/privileges/manage

Example

     The following is an example of how to package the configuration of the 
     "Documents" database.

     curl -o Documents.xml --digest -u admin:admin \
     http://localhost:8002/manage/v2/databases/Documents?view=package

     ==> Download the configuration of the Documents database to the Documents.xml file. 

     curl -X POST --digest -u admin:admin -H "Content-type: application/xml" \
     -d @Documents.xml "http://localhost:8002/manage/v2/packages?pkgname=test-package" 

     ==> Insert the configuration file into a new package, named "test-package". 

     (: If you have a package ZIP file, you can use it to create a whole package
        as shown below. :)
 
     curl -X POST --digest -u admin:admin -H "Content-type: application/zip" \
     --data-binary @mypackage.zip \
     "http://localhost:8002/manage/v2/packages?pkgname=mypackage"
 
     ==> Insert the package saved in "mypackage.zip" into a new package, named "mypackage"
    
    

Comments

    Powered by MarkLogic Server 7.0-4.1 and rundmc | Terms of Use | Privacy Policy