mirror of
https://github.com/openziti/zrok.git
synced 2025-06-11 20:36:38 +02:00
add a py sdk function to release a reserved share
This commit is contained in:
parent
32611af5f4
commit
141d219ef7
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user