Removed Share Lease due to it not supported until STG 76 (#1016)

* Removed Share Lease due to it not supported until STG 76

* Update breaking change.

* Added removed APIs list in change log.
This commit is contained in:
Kan Tang 2020-11-23 21:39:02 -08:00 committed by GitHub
parent 72019486a1
commit fdc06b978d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 113 deletions

View File

@ -2,6 +2,14 @@
## 12.0.0-beta.6 (Unreleased)
### Breaking Changes
* Removed Share Lease related API due to it not supported in recent service versions.
- ShareClient::AcquireLease
- ShareClient::ReleaseLease
- ShareClient::ChangeLease
- ShareClient::BreakLease
- ShareClient::RenewLease
## 12.0.0-beta.5 (2020-11-13)

View File

@ -219,66 +219,6 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
const ListFilesAndDirectoriesSegmentOptions& options
= ListFilesAndDirectoriesSegmentOptions()) const;
/**
* @brief Acquires a lease on the share.
*
* @param proposedLeaseId Proposed lease ID, in a GUID string format.
* @param duration Specifies the duration of the lease, in seconds, or
* Azure::Storage::InfiniteLeaseDuration for a lease that never expires. A non-infinite lease
* can be between 15 and 60 seconds. A lease duration cannot be changed using renew or change.
* @param options Optional parameters to execute this function.
* @return Azure::Core::Response<Models::AcquireShareLeaseResult> describing the lease.
*/
Azure::Core::Response<Models::AcquireShareLeaseResult> AcquireLease(
const std::string& proposedLeaseId,
int32_t duration,
const AcquireShareLeaseOptions& options = AcquireShareLeaseOptions()) const;
/**
* @brief Releases the share's previously-acquired lease.
*
* @param leaseId ID of the previously-acquired lease.
* @param options Optional parameters to execute this function.
* @return Azure::Core::Response<Models::ReleaseShareLeaseResult> describing the updated lease
* status.
*/
Azure::Core::Response<Models::ReleaseShareLeaseResult> ReleaseLease(
const std::string& leaseId,
const ReleaseShareLeaseOptions& options = ReleaseShareLeaseOptions()) const;
/**
* @brief Changes the lease of an active lease.
*
* @param leaseId ID of the previously-acquired lease.
* @param proposedLeaseId Proposed lease ID, in a GUID string format.
* @param options Optional parameters to execute this function.
* @return Azure::Core::Response<Models::ChangeShareLeaseResult> describing the changed lease.
*/
Azure::Core::Response<Models::ChangeShareLeaseResult> ChangeLease(
const std::string& leaseId,
const std::string& proposedLeaseId,
const ChangeShareLeaseOptions& options = ChangeShareLeaseOptions()) const;
/**
* @brief Breaks the previously-acquired lease.
*
* @param options Optional parameters to execute this function.
* @return Azure::Core::Response<Models::BreakShareLeaseResult> describing the broken lease.
*/
Azure::Core::Response<Models::BreakShareLeaseResult> BreakLease(
const BreakShareLeaseOptions& options = BreakShareLeaseOptions()) const;
/**
* @brief Renew the previously-acquired lease.
*
* @param leaseId ID of the previously-acquired lease.
* @param options Optional parameters to execute this function.
* @return Azure::Core::Response<Models::BreakShareLeaseResult> describing the renewed lease.
*/
Azure::Core::Response<Models::RenewShareLeaseResult> RenewLease(
const std::string& leaseId,
const RenewShareLeaseOptions& options = RenewShareLeaseOptions()) const;
private:
Azure::Core::Http::Url m_shareUri;
std::shared_ptr<Azure::Core::Http::HttpPipeline> m_pipeline;

View File

@ -274,57 +274,4 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
std::move(ret), result.ExtractRawResponse());
}
Azure::Core::Response<Models::AcquireShareLeaseResult> ShareClient::AcquireLease(
const std::string& proposedLeaseId,
int32_t duration,
const AcquireShareLeaseOptions& options) const
{
Details::ShareRestClient::Share::AcquireLeaseOptions protocolLayerOptions;
protocolLayerOptions.ProposedLeaseIdOptional = proposedLeaseId;
protocolLayerOptions.LeaseDuration = duration;
return Details::ShareRestClient::Share::AcquireLease(
m_shareUri, *m_pipeline, options.Context, protocolLayerOptions);
}
Azure::Core::Response<Models::ChangeShareLeaseResult> ShareClient::ChangeLease(
const std::string& leaseId,
const std::string& proposedLeaseId,
const ChangeShareLeaseOptions& options) const
{
Details::ShareRestClient::Share::ChangeLeaseOptions protocolLayerOptions;
protocolLayerOptions.LeaseIdRequired = leaseId;
protocolLayerOptions.ProposedLeaseIdOptional = proposedLeaseId;
return Details::ShareRestClient::Share::ChangeLease(
m_shareUri, *m_pipeline, options.Context, protocolLayerOptions);
}
Azure::Core::Response<Models::ReleaseShareLeaseResult> ShareClient::ReleaseLease(
const std::string& leaseId,
const ReleaseShareLeaseOptions& options) const
{
Details::ShareRestClient::Share::ReleaseLeaseOptions protocolLayerOptions;
protocolLayerOptions.LeaseIdRequired = leaseId;
return Details::ShareRestClient::Share::ReleaseLease(
m_shareUri, *m_pipeline, options.Context, protocolLayerOptions);
}
Azure::Core::Response<Models::BreakShareLeaseResult> ShareClient::BreakLease(
const BreakShareLeaseOptions& options) const
{
Details::ShareRestClient::Share::BreakLeaseOptions protocolLayerOptions;
protocolLayerOptions.LeaseBreakPeriod = options.BreakPeriod;
return Details::ShareRestClient::Share::BreakLease(
m_shareUri, *m_pipeline, options.Context, protocolLayerOptions);
}
Azure::Core::Response<Models::RenewShareLeaseResult> ShareClient::RenewLease(
const std::string& leaseId,
const RenewShareLeaseOptions& options) const
{
Details::ShareRestClient::Share::RenewLeaseOptions protocolLayerOptions;
protocolLayerOptions.LeaseIdRequired = leaseId;
return Details::ShareRestClient::Share::RenewLease(
m_shareUri, *m_pipeline, options.Context, protocolLayerOptions);
}
}}}} // namespace Azure::Storage::Files::Shares