Skip to content

Commit

Permalink
Merge pull request opensearch-project#761 from peternied/cat-all
Browse files Browse the repository at this point in the history
Cat command always shows all indices
  • Loading branch information
peternied authored Jun 24, 2024
2 parents 179aef1 + 73f2092 commit 641bbe2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ConnectionResult:

def cat_indices(cluster: Cluster, as_json=False):
as_json_suffix = "?format=json" if as_json else "?v"
cat_indices_path = f"/_cat/indices{as_json_suffix}"
cat_indices_path = f"/_cat/indices/_all{as_json_suffix}"
r = cluster.call_api(cat_indices_path)
return r.json() if as_json else r.content

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,10 @@ def test_cli_snapshot_status(runner, env, mocker):

def test_cli_cat_indices_e2e(runner, env):
with requests_mock.Mocker() as rm:
rm.get(f"{env.source_cluster.endpoint}/_cat/indices",
rm.get(f"{env.source_cluster.endpoint}/_cat/indices/_all",
status_code=200,
text=source_cat_indices)
rm.get(f"{env.target_cluster.endpoint}/_cat/indices",
rm.get(f"{env.target_cluster.endpoint}/_cat/indices/_all",
status_code=200,
text=target_cat_indices)
result = runner.invoke(cli, ['--config-file', str(VALID_SERVICES_YAML), 'clusters', 'cat-indices'],
Expand Down

0 comments on commit 641bbe2

Please sign in to comment.