# Java API, get "\_all" snapshots in a given repository

**URL:** <https://discuss.elastic.co/t/java-api-get--all-snapshots-in-a-given-repository/23265>\
**Category:** Elasticsearch\
**Created:** [April 15, 2015, 10:15pm UTC](https://discuss.elastic.co/t/java-api-get--all-snapshots-in-a-given-repository/23265 "2015-04-15T22:15:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bitsofinfo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bitsofinfo/32/459_2.png) [@bitsofinfo](https://discuss.elastic.co/u/bitsofinfo)\
**Post date:** [April 15, 2015, 10:15pm UTC](https://discuss.elastic.co/t/java-api-get--all-snapshots-in-a-given-repository/23265/1 "2015-04-15T22:15:59Z")

</div>

Hi,  
Via the REST api I can get an listing of all snapshots within a given  
repository such as

"\_snapshot/myrepo/\_all"

How can I do this via the Java API? It appears I can only specify "known"  
snapshots via "GetSnapshotsRequest"

Is there anyway via the Java API to get a complete listing without any  
prior knowledge of snapshot names?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/a198c928-3805-4ef3-b52e-8f3aff8d3a37%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a198c928-3805-4ef3-b52e-8f3aff8d3a37%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![bitsofinfo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bitsofinfo/32/459_2.png) [@bitsofinfo](https://discuss.elastic.co/u/bitsofinfo)\
**Post date:** [April 15, 2015, 10:30pm UTC](https://discuss.elastic.co/t/java-api-get--all-snapshots-in-a-given-repository/23265/2 "2015-04-15T22:30:04Z")

</div>

Answered my own question here (just pass an empty array to snapshots)

> <https://github.com/elastic/elasticsearch/blob/4ab268bab2cfd7fc3cb4c4808f706d5049c1fae5/src/main/java/org/elasticsearch/rest/action/admin/cluster/snapshots/status/RestSnapshotsStatusAction.java>

On Wednesday, April 15, 2015 at 4:16:00 PM UTC-6, [bitsof...@gmail.com](mailto:bitsof...@gmail.com) wrote:

> Hi,  
> Via the REST api I can get an listing of all snapshots within a given  
> repository such as
> 
> "\_snapshot/myrepo/\_all"
> 
> How can I do this via the Java API? It appears I can only specify "known"  
> snapshots via "GetSnapshotsRequest"
> 
> Is there anyway via the Java API to get a complete listing without any  
> prior knowledge of snapshot names?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/d3f620fa-3595-4cf4-80c4-6cfca856452c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/d3f620fa-3595-4cf4-80c4-6cfca856452c%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 12:19am UTC](https://discuss.elastic.co/t/java-api-get--all-snapshots-in-a-given-repository/23265/3 "2017-07-06T00:19:28Z")

</div>


