add a py sdk function to release a reserved share

This commit is contained in:
Kenneth Bingham 2025-01-28 17:58:37 -05:00
parent 32611af5f4
commit 141d219ef7
No known key found for this signature in database
GPG Key ID: 31709281860130B6

View File

@ -104,3 +104,19 @@ def DeleteShare(root: Root, shr: model.Share):
ShareApi(zrok).unshare(body=req)
except Exception as e:
raise Exception("error deleting share", e)
def ReleaseReservedShare(root: Root, shr: model.Share):
req = UnshareRequest(env_zid=root.env.ZitiIdentity,
shr_token=shr.Token,
reserved=True)
try:
zrok = root.Client()
except Exception as e:
raise Exception("error getting zrok client", e)
try:
ShareApi(zrok).unshare(body=req)
except Exception as e:
raise Exception("error releasing share", e)