Archive a Repository

    +
    The Backup Service REST API supports the archiving of currently active repositories.

    HTTP Method and URI

    POST /repository/active/<repository-id>/archive

    Description

    Archives the specified repository. This means that no further scheduled or manually triggered tasks can be run on the repository; with the exception of those that retrieve information, restore data, and examine data. (See Get Information on Repositories, Restore Data, and Examine Backed-Up Data, respectively.)

    Note that a repository that has been archived cannot be returned to active state.

    Curl Syntax

    curl -X POST http://<backup-node-ip-address-or-domain-name>:8097/api/v1/cluster/self/\
      repository/active/<repository-id>/archive
      -d <repository-id-specification>
      -u Administrator:password

    The username and password must identify an administrator with the Full Admin role. The repository-id argument must specify the name of an active repository defined on the cluster. Additionally, a respository-id-specification must be provided, as a JSON payload; whose syntax is as follows:

    {
      "id":<archived-repository-id>
    }

    The archived-repository-id is the name that the repository is to bear, once it has been archived.

    Responses

    Success returns 200 OK.

    Incorrect specification of the repository-id path-parameter returns 404 Object Not Found, and a message such as the following: {"status":404,"msg":"could not find active repository with id:quickRepo"}. An otherwise incorrectly specified URI alsp returns 404 Object Not Found.

    Incorrect specification, within the JSON payload, of the repository id returns 400 Bad Request, and a message such as the following: {"status":400,"msg":"repository id must follow the rules ^[0-9A-Za-z][0-9A-Za-z_-]{0,49}$"}.

    Failure to authenticate returns 401 Unauthorized.

    Examples

    The following example archives the currently active repository quickRepo:

    curl -v -X POST  http://127.0.0.1:8097/api/v1/cluster/self/\
    repository/active/quickRepo/archive \
    --data '{"id": "quickRepo"}' \
    -u   -u <username>:<password>

    Successful execution returns 200 OK.

    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.

    Information on getting information from an archived repository is provided in Get Information on Repositories. Information on restoring data from an archived repository is provided in Restore Data. Information on examining data within an archived repository is provided in Examine Backed-Up Data.