Show: Delphi C++
Display Preferences


From RAD Studio API Documentation
Jump to: navigation, search


function AcquireContainerLease(const ContainerName: string; var LeaseId: string; LeaseDuration: Integer;  ResponseInfo: TCloudResponseInfo): Boolean;


bool __fastcall AcquireContainerLease(const System::UnicodeString ContainerName, System::UnicodeString &LeaseId, int LeaseDuration, Data::Cloud::Cloudapi::TCloudResponseInfo* ResponseInfo);


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


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

Personal tools
In Other Languages
Previous Versions