create/delete database in marklogic using rest api

286 views Asked by At

I have created one rest-api instance in marklogic.I am able to delete/add the documents in some already existing database using curl easily.

Can somebody Please help on how to create n delete the database using curl command and how can we parameterized the command to delete associated forests and app-servers.

Also I am able to delete the rest-api instance that I created i.e, appserver itself but not associated database and forests.

Thanks in advance..!!

1

There are 1 answers

7
Dave Cassel On

You can create, delete, and modify app servers, databases, forests, and just about everything else through the Management API. For instance, here's how you delete a forest called "example":

$ curl --anyauth --user user:password -X DELETE -i \
  http://localhost:8002/manage/v2/forests/example?level=full

You can also delete a REST API app server, along with its content and modules databases and their forests, in one command:

$ curl --anyauth --user user:password -X DELETE -i \
  'http://localhost:8002/v1/rest-apis/RESTstop?include=content&include=modules'