Data.Cloud.AzureAPI.TAzureBlobService.AcquireContainerLease
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:
ContainerNameis the name of the target container.LeaseIdmust 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 ofLeaseIdto the GUID that is used instead. If acquiring the lease fails, AcquireContainerLease fillsLeaseIdwith an empty string.- Note: You may need the value of
LeaseIdto call ChangeContainerLease, ReleaseContainerLease, or RenewContainerLease.
- Note: You may need the value of
LeaseDurationis the desired duration of the lease. Valid values are -1 (infinite time), or a number of seconds between 15 and 60.ResponseInfois 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.