ShareLeaseClient class
建構函式
Share |
建立 ShareLeaseClient 的實例。 |
屬性
lease |
取得租用標識碼。 |
url | 取得 URL。 |
方法
acquire |
建立和管理檔案、共用或共用快照集的鎖定,以進行寫入和刪除作業。 |
break |
強制結束租用。 |
change |
變更現有租用的標識碼。 |
release |
如果不再需要租用,請釋放租用,讓另一個用戶端可以立即取得租用。 |
renew |
若要更新租用。 僅適用於共用或共用快照集的租用。 請注意,即使租用已過期,也可能會更新租用,前提是該共用自該租用到期后尚未再次租用。 當您更新租用時,租用持續時間時鐘會重設。 |
建構函式詳細資料
ShareLeaseClient(ShareClient | ShareFileClient, string)
建立 ShareLeaseClient 的實例。
new ShareLeaseClient(client: ShareClient | ShareFileClient, leaseId?: string)
參數
- client
要發出租用作業要求的用戶端。
- 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
租用管理作業的選項。
傳回
Promise<LeaseOperationResponse>
取得租用作業的響應數據。
breakLease(LeaseOperationOptions)
強制結束租用。
function breakLease(options?: LeaseOperationOptions): Promise<LeaseOperationResponse>
參數
- options
- LeaseOperationOptions
租用管理作業的選項。
傳回
Promise<LeaseOperationResponse>
中斷租用作業的響應數據。
changeLease(string, LeaseOperationOptions)
變更現有租用的標識碼。
function changeLease(proposedLeaseId: string, options?: LeaseOperationOptions): Promise<LeaseOperationResponse>
參數
- proposedLeaseId
-
string
建議的新租用標識碼。
- options
- LeaseOperationOptions
租用管理作業的選項。
傳回
Promise<LeaseOperationResponse>
變更租用作業的響應數據。
releaseLease(LeaseOperationOptions)
如果不再需要租用,請釋放租用,讓另一個用戶端可以立即取得租用。
function releaseLease(options?: LeaseOperationOptions): Promise<LeaseOperationResponse>
參數
- options
- LeaseOperationOptions
租用管理作業的選項。
傳回
Promise<LeaseOperationResponse>
發行租用作業的響應數據。
renewLease(LeaseOperationOptions)
若要更新租用。 僅適用於共用或共用快照集的租用。 請注意,即使租用已過期,也可能會更新租用,前提是該共用自該租用到期后尚未再次租用。 當您更新租用時,租用持續時間時鐘會重設。
function renewLease(options?: LeaseOperationOptions): Promise<LeaseOperationResponse>
參數
- options
- LeaseOperationOptions
租用管理作業的選項。
傳回
Promise<LeaseOperationResponse>
更新租用作業的響應數據。