A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://aka.ms/azsdk-python-storage-blob-blobleaseclient below:

azure.storage.blob.BlobLeaseClient class | Microsoft Learn

BlobLeaseClient Class

Creates a new BlobLeaseClient.

This client provides lease operations on a BlobClient or ContainerClient. :param client: The client of the blob or container to lease. :type client: Union[BlobClient, ContainerClient] :param lease_id: A string representing the lease ID of an existing lease. This value does not need to be specified in order to acquire a new lease, or break one. :type lease_id: Optional[str]

Constructor
BlobLeaseClient(client: BlobClient | ContainerClient, lease_id: str | None = None)
Parameters Methods acquire

Requests a new lease.

If the container does not have an active lease, the Blob service creates a lease on the container and returns a new lease ID.

break_lease

Break the lease, if the container or blob has an active lease.

Once a lease is broken, it cannot be renewed. Any authorized request can break the lease; the request is not required to specify a matching lease ID. When a lease is broken, the lease break period is allowed to elapse, during which time no lease operation except break and release can be performed on the container or blob. When a lease is successfully broken, the response indicates the interval in seconds until a new lease can be acquired.

change

Change the lease ID of an active lease.

release

Release the lease.

The lease may be released if the client lease id specified matches that associated with the container or blob. Releasing the lease allows another client to immediately acquire the lease for the container or blob as soon as the release is complete.

renew

Renews the lease.

The lease can be renewed if the lease ID specified in the lease client matches that associated with the container or blob. Note that the lease may be renewed even if it has expired as long as the container or blob has not been leased again since the expiration of that lease. When you renew a lease, the lease duration clock resets.

acquire

Requests a new lease.

If the container does not have an active lease, the Blob service creates a lease on the container and returns a new lease ID.

acquire(lease_duration: int = -1, **kwargs: Any) -> None
Parameters Keyword-Only Parameters Returns break_lease

Break the lease, if the container or blob has an active lease.

Once a lease is broken, it cannot be renewed. Any authorized request can break the lease; the request is not required to specify a matching lease ID. When a lease is broken, the lease break period is allowed to elapse, during which time no lease operation except break and release can be performed on the container or blob. When a lease is successfully broken, the response indicates the interval in seconds until a new lease can be acquired.

break_lease(lease_break_period: int | None = None, **kwargs: Any) -> int
Parameters Keyword-Only Parameters Returns change

Change the lease ID of an active lease.

change(proposed_lease_id: str, **kwargs: Any) -> None
Parameters Keyword-Only Parameters Returns release

Release the lease.

The lease may be released if the client lease id specified matches that associated with the container or blob. Releasing the lease allows another client to immediately acquire the lease for the container or blob as soon as the release is complete.

release(**kwargs: Any) -> None
Keyword-Only Parameters Returns renew

Renews the lease.

The lease can be renewed if the lease ID specified in the lease client matches that associated with the container or blob. Note that the lease may be renewed even if it has expired as long as the container or blob has not been leased again since the expiration of that lease. When you renew a lease, the lease duration clock resets.

renew(**kwargs: Any) -> None
Keyword-Only Parameters Returns Attributes etag

The ETag of the lease currently being maintained. This will be None if no lease has yet been acquired or modified.

etag: str | None
id

The ID of the lease currently being maintained. This will be None if no lease has yet been acquired.

id: str
last_modified

The last modified timestamp of the lease currently being maintained. This will be None if no lease has yet been acquired or modified.

last_modified: datetime | None

Collaborate with us on GitHub

The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide. In this article

Was this page helpful?


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4