diff --git a/src/Elasticsearch/Endpoints/Cat/Snapshots.php b/src/Elasticsearch/Endpoints/Cat/Snapshots.php index b3734b1d5..72d544f3f 100644 --- a/src/Elasticsearch/Endpoints/Cat/Snapshots.php +++ b/src/Elasticsearch/Endpoints/Cat/Snapshots.php @@ -39,14 +39,12 @@ public function setRepository($repository) */ public function getURI() { - if (isset($this->repository) !== true) { - throw new RuntimeException( - 'repository is required for Cat Snapshots ' - ); - } $repository = $this->repository; - $uri = "/_cat/snapshots/$repository/"; - return $uri; + if (isset($this->repository) === true) { + return "/_cat/snapshots/$repository/"; + } + + return "/_cat/snapshots/"; } /**