Skip to content

Commit 6c77f62

Browse files
committed
Cat/Snapshots 'repository' param is not in-fact required, despite spec
1 parent 87f23a1 commit 6c77f62

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/Elasticsearch/Endpoints/Cat/Snapshots.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,12 @@ public function setRepository($repository)
3939
*/
4040
public function getURI()
4141
{
42-
if (isset($this->repository) !== true) {
43-
throw new RuntimeException(
44-
'repository is required for Cat Snapshots '
45-
);
46-
}
4742
$repository = $this->repository;
48-
$uri = "/_cat/snapshots/$repository/";
49-
return $uri;
43+
if (isset($this->repository) === true) {
44+
return "/_cat/snapshots/$repository/";
45+
}
46+
47+
return "/_cat/snapshots/";
5048
}
5149

5250
/**

0 commit comments

Comments
 (0)