Get Snapshot list

Hi all,
I’m trying to get the list of the snapshot and I can’t find a clean way to do this.
Now I’m retrieving the event list of the bank and I’m process all the string to find the ones that start with “snapshot”, but this solution seem pretty unclean to me…

Do you have any suggestion or this is the only way to do this?
Thank you kindly

The Studio runtime implements snapshots as a special kind of event. In fact, snapshots and events have so much in common that they share the same API. You use Studio::System::getEvent() to retrieve a snapshot description, Studio::EventDescription::createInstance() to create an instance, and Studio::EventInstance::start() to activate a snapshot.

This is all well and good, except when you really just want to get the list of snapshots, not mixed with events. Your exact case! Then the unification of events and snapshots works against you, and the API does not provide any obvious way to distinguish the two.

So I think your solution of checking the string prefix, as “unclean” as it may feel, is the easiest way to distinguish a snapshot from a regular event.

To make life a bit nicer in the future, we will consider adding an isSnapshot() function to Studio::EventDescription.

1 Like

Update: The upcoming 1.08.05 release will feature the new Studio::EventDescription::isSnapshot() function.