BlobLeaseClient class
A client that manages leases for a ContainerClient or a BlobClient.
Constructors
Blob |
Creates an instance of BlobLeaseClient. |
Properties
lease |
Gets the lease Id. |
url | Gets the url. |
Methods
Constructor Details
BlobLeaseClient(BlobClient | ContainerClient, string)
Creates an instance of BlobLeaseClient.
new BlobLeaseClient(client: BlobClient | ContainerClient, leaseId?: string)
Parameters
- client
The client to make the lease operation requests.
- leaseId
-
string
Initial proposed lease id.
Property Details
leaseId
Gets the lease Id.
string leaseId
Property Value
string
url
Gets the url.
string url
Property Value
string
Method Details
acquireLease(number, LeaseOperationOptions)
Establishes and manages a lock on a container for delete operations, or on a blob for write and delete operations. The lock duration can be 15 to 60 seconds, or can be infinite.
See https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container and See https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob
function acquireLease(duration: number, options?: LeaseOperationOptions): Promise<LeaseOperationResponse>
Parameters
- duration
-
number
Must be between 15 to 60 seconds, or infinite (-1)
- options
- LeaseOperationOptions
option to configure lease management operations.
Returns
Promise<LeaseOperationResponse>
Response data for acquire lease operation.
breakLease(number, LeaseOperationOptions)
To end the lease but ensure that another client cannot acquire a new lease until the current lease period has expired.
See https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container and See https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob
function breakLease(breakPeriod: number, options?: LeaseOperationOptions): Promise<LeaseOperationResponse>
Parameters
- breakPeriod
-
number
Break period
- options
- LeaseOperationOptions
Optional options to configure lease management operations.
Returns
Promise<LeaseOperationResponse>
Response data for break lease operation.
changeLease(string, LeaseOperationOptions)
To change the ID of the lease.
See https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container and See https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob
function changeLease(proposedLeaseId: string, options?: LeaseOperationOptions): Promise<LeaseOperationResponse>
Parameters
- proposedLeaseId
-
string
the proposed new lease Id.
- options
- LeaseOperationOptions
option to configure lease management operations.
Returns
Promise<LeaseOperationResponse>
Response data for change lease operation.
releaseLease(LeaseOperationOptions)
To free the lease if it is no longer needed so that another client may immediately acquire a lease against the container or the blob.
See https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container and See https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob
function releaseLease(options?: LeaseOperationOptions): Promise<LeaseOperationResponse>
Parameters
- options
- LeaseOperationOptions
option to configure lease management operations.
Returns
Promise<LeaseOperationResponse>
Response data for release lease operation.
renewLease(LeaseOperationOptions)
To renew the lease.
See https://docs.microsoft.com/en-us/rest/api/storageservices/lease-container and See https://docs.microsoft.com/en-us/rest/api/storageservices/lease-blob
function renewLease(options?: LeaseOperationOptions): Promise<Lease>
Parameters
- options
- LeaseOperationOptions
Optional option to configure lease management operations.
Returns
Promise<Lease>
Response data for renew lease operation.