A newer version of this documentation is available.

View Latest

Delete a Repository

      +
      The Backup Service REST API allows an archived repository to be deleted.

      HTTP Methods and URIs

      DELETE /cluster/self/repository/archived/<repository-id>
      
      DELETE /cluster/self/repository/archived/<repository-id>"?remove_repository=true"

      Description

      These delete an archived repository. They cannot be used on a repository that is either active or imported. No other interfaces for repository-deletion are provided: therefore, in order to be deleted, a repository must first be archived. For information on archiving a repository, see Archive a Repository.

      Curl Syntax

      curl -X POST http://<backup-node-ip-address-or-domain-name>:8097/cluster/self\
        /repository/archived/<repository-id>
        -u <username>:<password>
      
      curl -X POST http://<backup-node-ip-address-or-domain-name>:8097/cluster/self\
        /repository/archived/<repository-id>"?remove_repository=true"
        -u <username>:<password>

      The repository-id argument must be the name of a currently active repository. If repository-id is specified with the remove_repository=true query-parameter, the repository data is removed from disk, as well as being removed from the Backup Service. If repository-id is specified without the query-paramter, the repository is removed from the Backup Service, but remains on disk.

      The username and password must identify an administrator with the Full Admin role.

      Responses

      Success returns 200 OK. If the specified repository cannot be found, or if the URI is otherwise incorrectly specified, 404 Object Not Found is returned. If the query-parameter is incorrectly specified, 400 Bad Request is returned. If an internal server error prevents deletion of the repository, 500 Internal Server Error is returned.

      Failure to authenticate returns 401 Unauthorized.

      Examples

      The following call deletes the archived repository quickRepo:

      curl -v -X DELETE http://127.0.0.1:8097/api/v1/cluster/self/\
      repository/archived/quickRepo \
      -u Administrator:password

      Success returns 200 OK, and the archived repository is deleted from the Backup Service. However, since the query-parameter has not been specified, the repository and its data survive on disk.

      The following call deletes the archived repository oldRepo, specifying the query-parameter:

      curl -v -X DELETE http://127.0.0.1:8097/api/v1/cluster/self/\
      repository/archived/oldRepo?remove_repository=true \
      -u Administrator:password

      Success returns 200 OK. Since the query-parameter remove_repository=true has been specified, the archived repository is deleted both from the Backup Service and from disk.

      See Also

      An overview of the Backup Service is provided in Backup Service. A step-by-step guide to using Couchbase Web Console to configure and use the Backup Service is provided in Manage Backup and Restore. To create a repository with the REST API, see Create a Repository.