prefect.server.utilities.leasing
Classes
ResourceLease
LeaseStorage
Methods:
create_lease
resource_ids: The IDs of the resources that the lease is associated with.ttl: How long the lease should initially be held for.metadata: Additional metadata associated with the lease.
- A ResourceLease object representing the lease.
read_expired_lease_ids
limit: The maximum number of expired leases to read.
- A list of UUIDs representing the expired leases.
read_lease
lease_id: The ID of the lease to read.
- A ResourceLease object representing the lease, or None if not found.
renew_lease
lease_id: The ID of the lease to renew.ttl: The new amount of time the lease should be held for.
- True if the lease was successfully renewed, False if the lease
- does not exist or has already expired. None may be returned by
- legacy implementations for backwards compatibility (treated as success).
revoke_lease
lease_id: The ID of the lease to release.