共用方式為


ShareLeaseClient class

建構函式

ShareLeaseClient(ShareClient | ShareFileClient, string)

建立 ShareLeaseClient 的實例。

屬性

leaseId

取得租用標識碼。

url

取得 URL。

方法

acquireLease(number, LeaseOperationOptions)

建立和管理檔案、共用或共用快照集的鎖定,以進行寫入和刪除作業。

breakLease(LeaseOperationOptions)

強制結束租用。

changeLease(string, LeaseOperationOptions)

變更現有租用的標識碼。

releaseLease(LeaseOperationOptions)

如果不再需要租用,請釋放租用,讓另一個用戶端可以立即取得租用。

renewLease(LeaseOperationOptions)

若要更新租用。 僅適用於共用或共用快照集的租用。 請注意,即使租用已過期,也可能會更新租用,前提是該共用自該租用到期后尚未再次租用。 當您更新租用時,租用持續時間時鐘會重設。

建構函式詳細資料

ShareLeaseClient(ShareClient | ShareFileClient, string)

建立 ShareLeaseClient 的實例。

new ShareLeaseClient(client: ShareClient | ShareFileClient, leaseId?: string)

參數

client

ShareClient | ShareFileClient

要發出租用作業要求的用戶端。

leaseId

string

初始建議的租用標識碼。

屬性詳細資料

leaseId

取得租用標識碼。

string leaseId

屬性值

string

url

取得 URL。

string url

屬性值

string

方法詳細資料

acquireLease(number, LeaseOperationOptions)

建立和管理檔案、共用或共用快照集的鎖定,以進行寫入和刪除作業。

function acquireLease(duration?: number, options?: LeaseOperationOptions): Promise<LeaseOperationResponse>

參數

duration

number

指定以秒為單位的租用持續時間。 對於檔案,對於永不過期的租用,唯一允許的值是 -1。 針對共用,必須 -1 或介於 15 到 60 之間。

options
LeaseOperationOptions

租用管理作業的選項。

傳回

取得租用作業的響應數據。

breakLease(LeaseOperationOptions)

強制結束租用。

function breakLease(options?: LeaseOperationOptions): Promise<LeaseOperationResponse>

參數

options
LeaseOperationOptions

租用管理作業的選項。

傳回

中斷租用作業的響應數據。

changeLease(string, LeaseOperationOptions)

變更現有租用的標識碼。

function changeLease(proposedLeaseId: string, options?: LeaseOperationOptions): Promise<LeaseOperationResponse>

參數

proposedLeaseId

string

建議的新租用標識碼。

options
LeaseOperationOptions

租用管理作業的選項。

傳回

變更租用作業的響應數據。

releaseLease(LeaseOperationOptions)

如果不再需要租用,請釋放租用,讓另一個用戶端可以立即取得租用。

function releaseLease(options?: LeaseOperationOptions): Promise<LeaseOperationResponse>

參數

options
LeaseOperationOptions

租用管理作業的選項。

傳回

發行租用作業的響應數據。

renewLease(LeaseOperationOptions)

若要更新租用。 僅適用於共用或共用快照集的租用。 請注意,即使租用已過期,也可能會更新租用,前提是該共用自該租用到期后尚未再次租用。 當您更新租用時,租用持續時間時鐘會重設。

function renewLease(options?: LeaseOperationOptions): Promise<LeaseOperationResponse>

參數

options
LeaseOperationOptions

租用管理作業的選項。

傳回

更新租用作業的響應數據。