Skip to content
This repository was archived by the owner on Apr 8, 2025. It is now read-only.

Commit 82ea080

Browse files
Jinming-Huvinjiang
authored andcommitted
Premium file share properties
1 parent bf0add5 commit 82ea080

File tree

4 files changed

+77
-2
lines changed

4 files changed

+77
-2
lines changed

Microsoft.WindowsAzure.Storage/includes/was/file.h

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,6 @@ namespace azure { namespace storage {
406406
/// Initializes a new instance of the <see cref="azure::storage::cloud_file_share_properties" /> class.
407407
/// </summary>
408408
cloud_file_share_properties()
409-
: m_quota(0)
410409
{
411410
}
412411

@@ -426,6 +425,10 @@ namespace azure { namespace storage {
426425
m_quota = other.m_quota;
427426
m_etag = std::move(other.m_etag);
428427
m_last_modified = std::move(other.m_last_modified);
428+
m_next_allowed_quota_downgrade_time = std::move(other.m_next_allowed_quota_downgrade_time);
429+
m_provisioned_iops = std::move(other.m_provisioned_iops);
430+
m_provisioned_ingress = std::move(other.m_provisioned_ingress);
431+
m_provisioned_egress = std::move(other.m_provisioned_egress);
429432
}
430433
return *this;
431434
}
@@ -468,11 +471,47 @@ namespace azure { namespace storage {
468471
return m_last_modified;
469472
}
470473

474+
/// <summary>
475+
/// Gets the next allowed quota downgrade time for the share, expressed as a UTC value.
476+
/// </summary>
477+
/// <returns>The share's last-modified time, in UTC format.</returns>
478+
utility::datetime next_allowed_quota_downgrade_time() const {
479+
return m_next_allowed_quota_downgrade_time;
480+
}
481+
482+
/// <summary>
483+
/// Gets the provisioned IOPS for the share.
484+
/// </summary>
485+
/// <returns>Allowed IOPS for this share.</returns>
486+
utility::size64_t provisioned_iops() const {
487+
return m_provisioned_iops;
488+
}
489+
490+
/// <summary>
491+
/// Gets the allowed network ingress rate for the share.
492+
/// </summary>
493+
/// <returns>Allowed network ingress rate for the share, in MiB/s.</returns>
494+
utility::size64_t provisioned_ingress() const {
495+
return m_provisioned_ingress;
496+
}
497+
498+
/// <summary>
499+
/// Gets the allowed network egress rate for the share.
500+
/// </summary>
501+
/// <returns>Allowed network egress rate for the share, in MiB/s.</returns>
502+
utility::size64_t provisioned_egress() const {
503+
return m_provisioned_egress;
504+
}
505+
471506
private:
472507

473-
utility::size64_t m_quota;
508+
utility::size64_t m_quota{ 0 };
474509
utility::string_t m_etag;
475510
utility::datetime m_last_modified;
511+
utility::datetime m_next_allowed_quota_downgrade_time;
512+
utility::size64_t m_provisioned_iops{ 0 };
513+
utility::size64_t m_provisioned_ingress{ 0 };
514+
utility::size64_t m_provisioned_egress{ 0 };
476515

477516
void update_etag_and_last_modified(const cloud_file_share_properties& other);
478517

Microsoft.WindowsAzure.Storage/includes/wascore/constants.dat

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,10 @@ DAT(ms_header_previous_snapshot_url, _XPLATSTR("x-ms-previous-snapshot-url"))
213213
DAT(ms_header_encryption_key, _XPLATSTR("x-ms-encryption-key"))
214214
DAT(ms_header_encryption_key_sha256, _XPLATSTR("x-ms-encryption-key-sha256"))
215215
DAT(ms_header_encryption_algorithm, _XPLATSTR("x-ms-encryption-algorithm"))
216+
DAT(ms_header_share_next_allowed_quota_downgrade_time, _XPLATSTR("x-ms-share-next-allowed-quota-downgrade-time"))
217+
DAT(ms_header_share_provisioned_egress_mbps, _XPLATSTR("x-ms-share-provisioned-egress-mbps"))
218+
DAT(ms_header_share_provisioned_ingress_mbps, _XPLATSTR("x-ms-share-provisioned-ingress-mbps"))
219+
DAT(ms_header_share_provisioned_iops, _XPLATSTR("x-ms-share-provisioned-iops"))
216220

217221
// header values
218222
DAT(header_value_storage_version, _XPLATSTR("2019-07-07"))
@@ -380,6 +384,10 @@ DAT(xml_service_stats_geo_replication_status_bootstrap, _XPLATSTR("bootstrap"))
380384
DAT(xml_service_stats_geo_replication_last_sync_time, _XPLATSTR("LastSyncTime"))
381385
DAT(xml_url, _XPLATSTR("Url"))
382386
DAT(xml_quota, _XPLATSTR("Quota"))
387+
DAT(xml_provisioned_iops, _XPLATSTR("ProvisionedIops"))
388+
DAT(xml_provisioned_ingress_mbps, _XPLATSTR("ProvisionedIngressMBps"))
389+
DAT(xml_provisioned_egress_mpbs, _XPLATSTR("ProvisionedEgressMBps"))
390+
DAT(xml_next_allowed_quota_downgrade_time, _XPLATSTR("NextAllowedQuotaDowngradeTime"))
383391
DAT(xml_range, _XPLATSTR("Range"))
384392
DAT(xml_share, _XPLATSTR("Share"))
385393
DAT(xml_shares, _XPLATSTR("Shares"))

Microsoft.WindowsAzure.Storage/src/file_response_parsers.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ namespace azure { namespace storage { namespace protocol {
2929
properties.m_quota = parse_quota(response);
3030
properties.m_etag = parse_etag(response);
3131
properties.m_last_modified = parse_last_modified(response);
32+
properties.m_next_allowed_quota_downgrade_time = parse_datetime_rfc1123(get_header_value(response.headers(), ms_header_share_next_allowed_quota_downgrade_time));
33+
response.headers().match(ms_header_share_provisioned_egress_mbps, properties.m_provisioned_egress);
34+
response.headers().match(ms_header_share_provisioned_ingress_mbps, properties.m_provisioned_ingress);
35+
response.headers().match(ms_header_share_provisioned_iops, properties.m_provisioned_iops);
3236
return properties;
3337
}
3438

Microsoft.WindowsAzure.Storage/src/protocol_xml.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -779,6 +779,30 @@ namespace azure { namespace storage { namespace protocol {
779779
extract_current_element(m_properties.m_quota);
780780
return;
781781
}
782+
783+
if (element_name == xml_provisioned_iops)
784+
{
785+
extract_current_element(m_properties.m_provisioned_iops);
786+
return;
787+
}
788+
789+
if (element_name == xml_provisioned_ingress_mbps)
790+
{
791+
extract_current_element(m_properties.m_provisioned_ingress);
792+
return;
793+
}
794+
795+
if (element_name == xml_provisioned_egress_mpbs)
796+
{
797+
extract_current_element(m_properties.m_provisioned_egress);
798+
return;
799+
}
800+
801+
if (element_name == xml_next_allowed_quota_downgrade_time)
802+
{
803+
m_properties.m_next_allowed_quota_downgrade_time = parse_datetime_rfc1123(get_current_element_text());;
804+
return;
805+
}
782806
}
783807

784808
if (element_name == xml_name)

0 commit comments

Comments
 (0)