Skip to content

[BUG] GET /_cat/snapshots incorrectly requires a repository #16648

@dblock

Description

@dblock

Describe the bug

According to https://opensearch.org/docs/latest/api-reference/cat/cat-snapshots/ GET /_cat/snapshots should return all snapshots for a repository, but there's no way to specify a repository (/_cat/snapshots/{repository} works).

Instead it returns a 400 requiring a repository name.

400 (application/json) | {
  "error": {
    "root_cause": [
      {
        "type": "action_request_validation_exception",
        "reason": "Validation Failed: 1: repository is missing;"
      }
    ],
    "type": "action_request_validation_exception",
    "reason": "Validation Failed: 1: repository is missing;"
  },
  "status": 400
}

Either the doc is incorrect and this endpoint should not be exposed without a required repository parameter, or the code is broken for /_cat/snapshots.

Related component

Storage:Snapshots

To Reproduce

curl ...

Expected behavior

Behave as described in https://opensearch.org/docs/latest/api-reference/cat/cat-snapshots/.

Additional Details

Vanilla 2.18 with path.repo=/tmp/opensearch/repo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    🆕 New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions