Uploaded image for project: 'Couchbase Documentation'
  1. Couchbase Documentation
  2. DOC-7844

[Backup] Create repository REST api endpoint is invalid

    XMLWordPrintable

Details

    • DOC-2021-Mar14-S5, DOC-2021-Mar28-S6
    • 1

    Description

      Build: 7.0.0-3874

      Doc ref: https://docs-staging.couchbase.com/server/7.0/rest-api/backup-create-repository.html

      As per the above document, REST API endpoint is specified as

      POST /cluster/self/repository/active/<new-repository-name>

      But while using the same, encountered 404 page not found response,

      POST http://10.112.191.101:8097/cluster/self/repository/active/repo_1 body: archive=%2Fdata%2Fcb_backups&bucket=travel-sample&plan=_hourly_backups headers: {'Accept': '*/*', 'Connection': 'close', 'Authorization': 'Basic QWRtaW5pc3RyYXRvcjpwYXNzd29yZA==', 'Content-Type': 'application/x-www-form-urlencoded'} error: 404 reason: status: 404, content: 404 page not found

      Actual working endpoint:

       

       

      /api/v1/cluster/self/repository/active/<new-repository-name>

       

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          tony.hillman Tony Hillman added a comment -

          The versioning requirement is documented on the main page, and repeated in the examples on each page.

          tony.hillman Tony Hillman added a comment - The versioning requirement is documented on the main page, and repeated in the examples on each page.
          tony.hillman Tony Hillman added a comment -

          And that's the convention we've used for all the Backup Service REST API endpoints. On the introduction page, https://docs-staging.couchbase.com/server/7.0/rest-api/backup-rest-api.html, we have written:

          "All calls listed below require the Full Admin role, and use port 8097. Each URI, in Couchbase Server Enterprise Edition Version 7.0, must be prefixed with /api/v1. Note that for all cluster references, in Couchbase Server Enterprise Edition Version 7.0, only the host cluster is supported, and is referred to as self."

          However, examples on each page use the full endpoint.

          tony.hillman Tony Hillman added a comment - And that's the convention we've used for all the Backup Service REST API endpoints. On the introduction page, https://docs-staging.couchbase.com/server/7.0/rest-api/backup-rest-api.html,  we have written: "All calls listed below require the Full Admin role, and use port  8097 . Each URI, in Couchbase Server Enterprise Edition Version 7.0, must be prefixed with  /api/v1 . Note that for all cluster references, in Couchbase Server Enterprise Edition Version 7.0, only the host cluster is supported, and is referred to as  self." However, examples on each page use the full endpoint.
          asad.zaidi Asad Zaidi (Inactive) added a comment - - edited

          Looks like there's a '/api/v1' missing in the request in the documentation. 

          Here's what the actual request looks like:

          curl -u Administrator:password -X POST "http://10.112.210.101:8097/api/v1/cluster/self/repository/active/my_repo" -H  "accept: */*" -H  "Content-Type: application/json" -d "{\"plan\": \"_hourly_backups\", \"archive\": \"/tmp/my_archive\"}"

          Note the data is JSON and the mime type is 'application/json', but I don't think it matters if it's set incorrectly.

          As a side note, from Carlos' design document on the backup service: "For future proofing the API will be versioned. The API root path will be /api/v1. The REST API accepts JSON and returns JSON. For brevity the API root (/api/v1) has not been included."

          asad.zaidi Asad Zaidi (Inactive) added a comment - - edited Looks like there's a '/api/v1' missing in the request in the documentation.  Here's what the actual request looks like: curl -u Administrator:password -X POST "http://10.112.210.101:8097/api/v1/cluster/self/repository/active/my_repo" -H  "accept: */*" -H  "Content-Type: application/json" -d "{\"plan\": \"_hourly_backups\", \"archive\": \"/tmp/my_archive\"}" Note the data is JSON and the mime type is 'application/json', but I don't think it matters if it's set incorrectly. As a side note, from Carlos' design document on the backup service: "For future proofing the API will be versioned. The API root path will be /api/v1. The REST API accepts JSON and returns JSON. For brevity the API root (/api/v1) has not been included."

          People

            tony.hillman Tony Hillman
            ashwin.govindarajulu Ashwin Govindarajulu
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty