Description
The @elastic/platform-deployment-management team is maintaining the Snapshot Restore plugin in Kibana and we would like to request adding a state
query parameter to the Get snapshot API that would allow us to resolve a bug (elastic/kibana#159324) and an enhancement request (elastic/kibana#137432).
For fixing the bug (which we are currently working on), we need to fetch the last successful snapshot from a managed repository. Without any query parameter for the state of the snapshots, what we can do is fetch all snapshots and search for a successful one on the client side, but this might create performance issues for users with many snapshots. Therefore, we thought it would be more effiecient if we had a state
query parameter so that we can fetch just one snapshot with a request like this:
await clusterClient.asCurrentUser.snapshot.get({
repository: managedRepositoryName,
snapshot: '_all',
ignore_unavailable: true,
sort: 'start_time',
order: 'desc',
state: 'SUCCESS',
size: 1,
});
The second issue is another use case where we would need a state
query parameter so that we can efficiently filter the list of snapshots by state without having to fetch all existing snapshots.