A newer version of this documentation is available.

View Latest
March 23, 2025
+ 12
The rotation period and size for Backup Service configuration data can be set and returned by means of the REST API.

HTTP Methods and URIs

POST /config

PUT /config

GET /config

Description

Used with the POST http method, the /config URI establishes, with PUT modifies, and with GET retrieves the rotation limits for Backup Service configuration data.

Curl Syntax

curl -X POST http://<backup-node-ip-address-or-domain-name>:8097/config
  -u -u <username>:<password>
  -d <rotation-settings>

curl -X PUT http://<backup-node-ip-address-or-domain-name>:8097/config
  -u -u <username>:<password>
  -d <rotation-settings>

curl -X GET http://<backup-node-ip-address-or-domain-name>:8097/config
  -u -u <username>:<password>
  -d <rotation-settings>

The username and password must be those of a user with the Full Admin role. The rotation-settings must be specified as a JSON payload. The settings are:

  • historyRotationPeriod. A number of days. The default value is 30, the minimum 1, the maximum 365. When this number of days has elapsed, the configuration file is rotated.

  • historyRotationSize. A number of megabytes. The default value is 50, the minimum 5, the maximum 200.

When this size is reached, the configuration file is rotated.

Note that the configuration file grows in size due to the progressive accumulation of task-history for the cluster. On rotation, a sequentially numbered copy of the current configuration file is made. The current configuration file is then deleted, and a new file is created when new data is written.

Responses

For all three http methods, success returns 200 OK. If an improper value is expressed, 400 Bad Request is returned, with a message such as the following: {"status":400,"msg":"rotation size has to be between 5 and 200"}.

Failure to authenticate returns 401 Unauthorized. An internal error that prevents return or modification of the limits returns 500 Internal Server Error.

Examples

The following call returns the current configuration limits:

curl -v -X GET http://127.0.0.1:8091/_p/backup/api/v1/config \
-u Administrator:password

If successful, the call returns 200 OK, and the following object:

{"history_rotation_period":30,"history_rotation_size":50}

The following call modifies both rotation period and size:

curl -v -X POST http://127.0.0.1:8091/_p/backup/api/v1/config -u Administrator:password \
--data '{"history_rotation_period":32,"history_rotation_size":51}'

Success 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.