Example about how to cancel a gateway lease

I’m in search of a didactic example about how to cancel a lease on a gateway. The documentation about this topic is quite compact and I guess it’s very useful as reference for experts, but it’s a bit hard for newbies like me. I searched for more descriptive examples but I couldn’t find any. Can anybody give me a reference or post such an example? Thanks.

If you want to “manually” cancel a lease, you can go via

cvmfs_swissknife lease -a drop -u <gw endpoint> -k <gw key> -p <lease path>`

You can use

curl <gw endpoint>/api/v1/leases | jq

to get the list of active leases and their paths.

Thanks @jakob, this is much simpler than using the gateway API: my fundamental difficulty with the API is how to obtain the HMAC for the POST request, but with cvmfs_swissknife it seems it’s not needed.

Hi @jakob, sorry to bother you again but I cannot make cvmfs_swissknife work using your hint. I get this error:

# cvmfs_swissknife lease -a drop -u http://my.gateway.url -k /etc/cvmfs/keys/my.repo.gw -p my.repo/path/to/sw/
Error reading session token from file

I think the content of my.repo.gw is correct, since I use it to configure the publishers which can acquire leases. Am I missing something or doing something wrong?