BlobLeaseClient
in package
FinalYes
Manages a lease on an Azure Storage blob or container.
Table of Contents
Constants
- INFINITE_LEASE_DURATION : mixed = -1
Properties
- $credential : StorageSharedKeyCredential|TokenCredential|null
- $leaseId : string|null
- $uri : UriInterface
- $client : Client
- $container : bool
- $options : BlobLeaseClientOptions
Methods
- __construct() : mixed
- acquire() : BlobLease
- Acquires a finite or infinite lease on the target resource.
- acquireAsync() : PromiseInterface
- Asynchronously acquires a finite or infinite lease.
- break() : BlobLease
- Breaks the active lease, optionally shortening its remaining break period.
- breakAsync() : PromiseInterface
- Asynchronously breaks the active lease.
- change() : BlobLease
- Changes the active lease to the proposed lease ID.
- changeAsync() : PromiseInterface
- Asynchronously changes the active lease ID.
- release() : ReleasedObjectInfo
- Releases the active lease, allowing another client to acquire one immediately.
- releaseAsync() : PromiseInterface
- Asynchronously releases the active lease.
- renew() : BlobLease
- Renews the active lease.
- renewAsync() : PromiseInterface
- Asynchronously renews the active lease.
- conditionHeaders() : array<string, string>
- createLeaseId() : string
- updateLeaseIdFromResponse() : BlobLease
Constants
INFINITE_LEASE_DURATION
public
mixed
INFINITE_LEASE_DURATION
= -1
Properties
$credential read-only
public
StorageSharedKeyCredential|TokenCredential|null
$credential
= null
$leaseId
public
string|null
$leaseId
= null
$uri read-only
public
UriInterface
$uri
$client read-only
private
Client
$client
$container read-only
private
bool
$container
= false
$options read-only
private
BlobLeaseClientOptions
$options
= new BlobLeaseClientOptions()
Methods
__construct()
public
__construct(UriInterface $uri[, StorageSharedKeyCredential|TokenCredential|null $credential = null ][, string|null $leaseId = null ][, bool $container = false ][, BlobLeaseClientOptions $options = new BlobLeaseClientOptions() ]) : mixed
Parameters
- $uri : UriInterface
- $credential : StorageSharedKeyCredential|TokenCredential|null = null
- $leaseId : string|null = null
- $container : bool = false
- $options : BlobLeaseClientOptions = new BlobLeaseClientOptions()
acquire()
Acquires a finite or infinite lease on the target resource.
public
acquire([int $durationSeconds = self::INFINITE_LEASE_DURATION ][, AcquireBlobLeaseOptions $options = new AcquireBlobLeaseOptions() ]) : BlobLease
Parameters
- $durationSeconds : int = self::INFINITE_LEASE_DURATION
- $options : AcquireBlobLeaseOptions = new AcquireBlobLeaseOptions()
Return values
BlobLeaseacquireAsync()
Asynchronously acquires a finite or infinite lease.
public
acquireAsync([int $durationSeconds = self::INFINITE_LEASE_DURATION ][, AcquireBlobLeaseOptions $options = new AcquireBlobLeaseOptions() ]) : PromiseInterface
Parameters
- $durationSeconds : int = self::INFINITE_LEASE_DURATION
- $options : AcquireBlobLeaseOptions = new AcquireBlobLeaseOptions()
Return values
PromiseInterfacebreak()
Breaks the active lease, optionally shortening its remaining break period.
public
break([int|null $breakPeriodSeconds = null ][, BreakBlobLeaseOptions $options = new BreakBlobLeaseOptions() ]) : BlobLease
Parameters
- $breakPeriodSeconds : int|null = null
- $options : BreakBlobLeaseOptions = new BreakBlobLeaseOptions()
Return values
BlobLeasebreakAsync()
Asynchronously breaks the active lease.
public
breakAsync([int|null $breakPeriodSeconds = null ][, BreakBlobLeaseOptions $options = new BreakBlobLeaseOptions() ]) : PromiseInterface
Parameters
- $breakPeriodSeconds : int|null = null
- $options : BreakBlobLeaseOptions = new BreakBlobLeaseOptions()
Return values
PromiseInterfacechange()
Changes the active lease to the proposed lease ID.
public
change(string $proposedLeaseId[, ChangeBlobLeaseOptions $options = new ChangeBlobLeaseOptions() ]) : BlobLease
Parameters
- $proposedLeaseId : string
- $options : ChangeBlobLeaseOptions = new ChangeBlobLeaseOptions()
Return values
BlobLeasechangeAsync()
Asynchronously changes the active lease ID.
public
changeAsync(string $proposedLeaseId[, ChangeBlobLeaseOptions $options = new ChangeBlobLeaseOptions() ]) : PromiseInterface
Parameters
- $proposedLeaseId : string
- $options : ChangeBlobLeaseOptions = new ChangeBlobLeaseOptions()
Return values
PromiseInterfacerelease()
Releases the active lease, allowing another client to acquire one immediately.
public
release([ReleaseBlobLeaseOptions $options = new ReleaseBlobLeaseOptions() ]) : ReleasedObjectInfo
Parameters
- $options : ReleaseBlobLeaseOptions = new ReleaseBlobLeaseOptions()
Return values
ReleasedObjectInforeleaseAsync()
Asynchronously releases the active lease.
public
releaseAsync([ReleaseBlobLeaseOptions $options = new ReleaseBlobLeaseOptions() ]) : PromiseInterface
Parameters
- $options : ReleaseBlobLeaseOptions = new ReleaseBlobLeaseOptions()
Return values
PromiseInterfacerenew()
Renews the active lease.
public
renew([RenewBlobLeaseOptions $options = new RenewBlobLeaseOptions() ]) : BlobLease
Parameters
- $options : RenewBlobLeaseOptions = new RenewBlobLeaseOptions()
Return values
BlobLeaserenewAsync()
Asynchronously renews the active lease.
public
renewAsync([RenewBlobLeaseOptions $options = new RenewBlobLeaseOptions() ]) : PromiseInterface
Parameters
- $options : RenewBlobLeaseOptions = new RenewBlobLeaseOptions()
Return values
PromiseInterfaceconditionHeaders()
private
conditionHeaders(BlobRequestConditions|null $conditions, string $operation) : array<string, string>
Parameters
- $conditions : BlobRequestConditions|null
- $operation : string
Return values
array<string, string>createLeaseId()
private
static createLeaseId() : string
Return values
stringupdateLeaseIdFromResponse()
private
updateLeaseIdFromResponse(ResponseInterface $response) : BlobLease
Parameters
- $response : ResponseInterface