Perform an Immediate Prune

      +
      The Backup Service REST API allows an immediate prune to be triggered.

      HTTP Method and URI

      POST /cluster/self/repository/active/<repository-id>/prune

      Description

      Triggers an immediate pruning of backups for the specified active repository. As a result, the need to wait for a scheduled pruning can be skipped when necessary.

      Curl Syntax

      curl -X POST http://<backup-node-ip-address-or-domain-name>:8097/cluster/self\
      /repository/active/<repository-id>/prune \
        -u <username>:<password>

      The username and password must identify an administrator with the Full Admin role. The repository-id must be the name of an active repository on the cluster.

      Responses

      Value Description Value example

      200 OK and JSON array containing repository information depending on the specific endpoint.

      Successful call.

      {"status":404,"msg":"repository `res4tRepo does not exist"}`

      400

      Invalid parameter.

      400 Object Not found

      The repository in the endpoint URI does not exist.

      {"status":400,"msg":"invalid request body","extras":"invalid character '{' looking for beginning of object key string"}}

      401 Unauthorized

      Authorization failure due to incorrect username or password.

      403 Forbidden, plus a JSON message explaining the minimum permissions.

      The provided username has insufficient privileges to call this method.

      404 Object Not Found

      Error in the URI path.

      500 Could not retrieve the requested repository

      Error in Couchbase Server.

      {"status":500,"msg":"could not send task","extras":"failed bucket check for bucket 'travel-sample': bucket UUIDs don’t match bf5e2d0ec35e7957ed96509b8ed7e13f != 15b15c78439db91ba73f27ac4d6ba116"}

      Example

      The following example requests an immediate pruning for the repoNewForPrune active repository:

      curl -v -X POST http://127.0.0.1:8097/api/v1/cluster/self/\
      repository/active/repoNewForPrune/prune \
      -u Administrator:password \
      -d '{"full_backup": true}' | jq

      If successful, the call returns 200 OK, and a message similar to the following:

      [
        {
        "task_name": "PRUNE-975564a7-f6c2-491e-8488-ef2cdcffb0a6"
        }
      ]

      See Also