How to pass snapshot id to zfs/snapshot/id/{id} endpoint?

rmblr

Dabbler
Joined
Jul 16, 2019
Messages
13
The 2.0 api has an /zfs/snapshot/id/{id} endpoint you can GET and DELETE.

Snapshot ids are the snapshot names which have the format like: tank/dataset@snapname. This results in a GET or DELETE request to /zfs/snapshot/id/tank/dataset@snapname which returns an 404.

The source is here, but isn't particularity illuminating.

What's the proper encoding for the snapshot id?
 

rmblr

Dabbler
Joined
Jul 16, 2019
Messages
13
The answer is: url escape the name of the snapshot:

tank/foo@snapshot1
becomes tank%2Ffoo%40snapshot1
 
Top