CloudPageBlob.AcquireLeaseAsync Method (Nullable, String, AccessCondition, BlobRequestOptions, OperationContext)

Windows Runtime Azure Storage Client Library

Acquires a lease on this blob.

Namespace: Microsoft.WindowsAzure.Storage.Blob
Assembly: Microsoft.WindowsAzure.Storage (in Microsoft.WindowsAzure.Storage.dll)

Usage

Visual Basic
Dim instance As CloudPageBlob
Dim leaseTime As Nullable(Of TimeSpan)
Dim proposedLeaseId As String
Dim accessCondition As AccessCondition
Dim options As BlobRequestOptions
Dim operationContext As OperationContext
Dim returnValue As IAsyncOperation(Of String)

returnValue = instance.AcquireLeaseAsync(leaseTime, proposedLeaseId, accessCondition, options, operationContext)

Syntax

Visual Basic
Public Function AcquireLeaseAsync ( _
	leaseTime As Nullable(Of TimeSpan), _
	proposedLeaseId As String, _
	accessCondition As AccessCondition, _
	options As BlobRequestOptions, _
	operationContext As OperationContext _
) As IAsyncOperation(Of String)
C#
public IAsyncOperation<string> AcquireLeaseAsync (
	Nullable<TimeSpan> leaseTime,
	string proposedLeaseId,
	AccessCondition accessCondition,
	BlobRequestOptions options,
	OperationContext operationContext
)
C++
public:
virtual IAsyncOperation<String^>^ AcquireLeaseAsync (
	Nullable<TimeSpan> leaseTime, 
	String^ proposedLeaseId, 
	AccessCondition^ accessCondition, 
	BlobRequestOptions^ options, 
	OperationContext^ operationContext
) sealed
J#
public final IAsyncOperation<String> AcquireLeaseAsync (
	Nullable<TimeSpan> leaseTime, 
	String proposedLeaseId, 
	AccessCondition accessCondition, 
	BlobRequestOptions options, 
	OperationContext operationContext
)
JScript
public final function AcquireLeaseAsync (
	leaseTime : Nullable<TimeSpan>, 
	proposedLeaseId : String, 
	accessCondition : AccessCondition, 
	options : BlobRequestOptions, 
	operationContext : OperationContext
) : IAsyncOperation<String>

Parameters

leaseTime

A TimeSpan representing the span of time for which to acquire the lease, which will be rounded down to seconds. If null, an infinite lease will be acquired. If not null, this must be greater than zero.

proposedLeaseId

A string representing the proposed lease ID for the new lease, or null if no lease ID is proposed.

accessCondition

An AccessCondition object that represents the access conditions for the blob. If null, no condition is used.

options

The options for this operation. If null, default options will be used.

operationContext

An OperationContext object that represents the context for the current operation.

Return Value

The ID of the acquired lease.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows Vista, Windows 7, Windows Server 2008, Windows 8.1, Windows Server 2012 R2, Windows 8 and Windows Server 2012

Target Platforms

See Also