Data.Cloud.AzureAPI.TAzureBlobService.AcquireContainerLease

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function AcquireContainerLease(const AContainerName: string; var ALeaseId: string; ALeaseDuration: Integer;
const AResponseInfo: TCloudResponseInfo): Boolean;

C++

bool __fastcall AcquireContainerLease(const System::UnicodeString AContainerName, System::UnicodeString &ALeaseId, int ALeaseDuration, Data::Cloud::Cloudapi::TCloudResponseInfo* const AResponseInfo);

Properties

Type Visibility Source Unit Parent
function public
Data.Cloud.AzureAPI.pas
Data.Cloud.AzureAPI.hpp
Data.Cloud.AzureAPI TAzureBlobService

Description

Attempts to acquire a lease (lock for delete operations) on the specified container for the specified amount of time.

AcquireContainerLease accepts the following parameters:

  • ContainerName is the name of the target container.
  • LeaseId must be a valid GUID that you propose as the identifier for the new lease. If the proposed GUID is not used, AcquireContainerLease changes the value of LeaseId to the GUID that is used instead. If acquiring the lease fails, AcquireContainerLease fills LeaseId with an empty string.
    Note: You may need the value of LeaseId to call ChangeContainerLease, ReleaseContainerLease, or RenewContainerLease.
  • LeaseDuration is the desired duration of the lease. Valid values are -1 (infinite time), or a number of seconds between 15 and 60.
  • ResponseInfo is an optional instance of TCloudResponseInfo to store the information of the response. Use a nil value if you do not need the information of the response.

AcquireContainerLease returns True if the lease is acquired, or False otherwise.

See Also