From 62e607a20f549a5262f9d7ebb56aeb0da1826d52 Mon Sep 17 00:00:00 2001 From: Elham Rezvani Date: Tue, 15 Aug 2017 14:48:40 -0700 Subject: [PATCH 01/11] Revert "Revert "Revert "[Apr17][8.2] Disable ShareSnapshot""" This reverts commit a4af5af346a90804ee29809b4a198d8a2b130c60. --- Lib/ClassLibraryCommon/File/CloudFileShare.cs | 16 ++++----- .../DirectoryHttpWebRequestFactory.cs | 6 ++-- .../Protocol/FileHttpWebRequestFactory.cs | 10 +++--- .../Protocol/ShareHttpWebRequestFactory.cs | 35 +++++++++---------- Lib/Common/File/CloudFile.Common.cs | 4 +-- Lib/Common/File/CloudFileClient.Common.cs | 2 +- Lib/Common/File/CloudFileDirectory.Common.cs | 4 +-- Lib/Common/File/CloudFileShare.Common.cs | 12 +++---- Lib/Common/File/Protocol/FileShareEntry.cs | 2 +- Lib/Common/File/ShareListingDetails.cs | 7 +++- Lib/WindowsRuntime/File/CloudFileShare.cs | 8 ++--- .../ShareHttpRequestMessageFactory.cs | 28 +++++++-------- changelog.txt | 3 ++ 13 files changed, 72 insertions(+), 65 deletions(-) diff --git a/Lib/ClassLibraryCommon/File/CloudFileShare.cs b/Lib/ClassLibraryCommon/File/CloudFileShare.cs index 08df94dd9..64a37dce7 100644 --- a/Lib/ClassLibraryCommon/File/CloudFileShare.cs +++ b/Lib/ClassLibraryCommon/File/CloudFileShare.cs @@ -334,7 +334,7 @@ public virtual Task CreateIfNotExistsAsync(FileRequestOptions options, Ope /// An object that represents the context for the current operation. /// A object that is a share snapshot. [DoesServiceRequest] - internal CloudFileShare Snapshot(IDictionary metadata = null, AccessCondition accessCondition = null, FileRequestOptions options = null, OperationContext operationContext = null) + public CloudFileShare Snapshot(IDictionary metadata = null, AccessCondition accessCondition = null, FileRequestOptions options = null, OperationContext operationContext = null) { this.AssertNoSnapshot(); FileRequestOptions modifiedOptions = FileRequestOptions.ApplyDefaults(options, this.ServiceClient); @@ -352,7 +352,7 @@ internal CloudFileShare Snapshot(IDictionary metadata = null, Ac /// A user-defined object that will be passed to the callback delegate. /// An that references the asynchronous operation. [DoesServiceRequest] - internal ICancellableAsyncResult BeginSnapshot(AsyncCallback callback, object state) + public ICancellableAsyncResult BeginSnapshot(AsyncCallback callback, object state) { return this.BeginSnapshot(null /* metadata */, null /* accessCondition */, null /* options */, null /* operationContext */, callback, state); } @@ -368,7 +368,7 @@ internal ICancellableAsyncResult BeginSnapshot(AsyncCallback callback, object st /// A user-defined object that will be passed to the callback delegate. /// An that references the asynchronous operation. [DoesServiceRequest] - internal ICancellableAsyncResult BeginSnapshot(IDictionary metadata, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state) + public ICancellableAsyncResult BeginSnapshot(IDictionary metadata, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state) { this.AssertNoSnapshot(); FileRequestOptions modifiedOptions = FileRequestOptions.ApplyDefaults(options, this.ServiceClient); @@ -385,7 +385,7 @@ internal ICancellableAsyncResult BeginSnapshot(IDictionary metad /// /// An that references the pending asynchronous operation. /// A object that is a share snapshot. - internal CloudFileShare EndSnapshot(IAsyncResult asyncResult) + public CloudFileShare EndSnapshot(IAsyncResult asyncResult) { return Executor.EndExecuteAsync(asyncResult); } @@ -396,7 +396,7 @@ internal CloudFileShare EndSnapshot(IAsyncResult asyncResult) /// /// A object of type that represents the asynchronous operation. [DoesServiceRequest] - internal Task SnapshotAsync() + public Task SnapshotAsync() { return this.SnapshotAsync(CancellationToken.None); } @@ -407,7 +407,7 @@ internal Task SnapshotAsync() /// A to observe while waiting for a task to complete. /// A object of type that represents the asynchronous operation. [DoesServiceRequest] - internal Task SnapshotAsync(CancellationToken cancellationToken) + public Task SnapshotAsync(CancellationToken cancellationToken) { return AsyncExtensions.TaskFromApm(this.BeginSnapshot, this.EndSnapshot, cancellationToken); } @@ -421,7 +421,7 @@ internal Task SnapshotAsync(CancellationToken cancellationToken) /// An object that represents the context for the current operation. /// A object of type that represents the asynchronous operation. [DoesServiceRequest] - internal Task SnapshotAsync(IDictionary metadata, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext) + public Task SnapshotAsync(IDictionary metadata, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext) { return this.SnapshotAsync(metadata, accessCondition, options, operationContext, CancellationToken.None); } @@ -436,7 +436,7 @@ internal Task SnapshotAsync(IDictionary metadata /// A to observe while waiting for a task to complete. /// A object of type that represents the asynchronous operation. [DoesServiceRequest] - internal Task SnapshotAsync(IDictionary metadata, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken) + public Task SnapshotAsync(IDictionary metadata, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken) { return AsyncExtensions.TaskFromApm(this.BeginSnapshot, this.EndSnapshot, metadata, accessCondition, options, operationContext, cancellationToken); } diff --git a/Lib/ClassLibraryCommon/File/Protocol/DirectoryHttpWebRequestFactory.cs b/Lib/ClassLibraryCommon/File/Protocol/DirectoryHttpWebRequestFactory.cs index f5e6a621c..abf5ce5ae 100644 --- a/Lib/ClassLibraryCommon/File/Protocol/DirectoryHttpWebRequestFactory.cs +++ b/Lib/ClassLibraryCommon/File/Protocol/DirectoryHttpWebRequestFactory.cs @@ -105,7 +105,7 @@ public static HttpWebRequest GetProperties(Uri uri, int? timeout, AccessConditio /// A flag indicating whether to set the x-ms-version HTTP header. /// An object for tracking the current operation. /// A web request to use to perform the operation. - internal static HttpWebRequest GetProperties(Uri uri, int? timeout, DateTimeOffset? shareSnapshot, AccessCondition accessCondition, bool useVersionHeader, OperationContext operationContext) + public static HttpWebRequest GetProperties(Uri uri, int? timeout, DateTimeOffset? shareSnapshot, AccessCondition accessCondition, bool useVersionHeader, OperationContext operationContext) { UriQueryBuilder directoryBuilder = GetDirectoryUriQueryBuilder(); DirectoryHttpWebRequestFactory.AddShareSnapshot(directoryBuilder, shareSnapshot); @@ -139,7 +139,7 @@ public static HttpWebRequest GetMetadata(Uri uri, int? timeout, AccessCondition /// A flag indicating whether to set the x-ms-version HTTP header. /// An object for tracking the current operation. /// A web request to use to perform the operation. - internal static HttpWebRequest GetMetadata(Uri uri, int? timeout, DateTimeOffset? shareSnapshot, AccessCondition accessCondition, bool useVersionHeader, OperationContext operationContext) + public static HttpWebRequest GetMetadata(Uri uri, int? timeout, DateTimeOffset? shareSnapshot, AccessCondition accessCondition, bool useVersionHeader, OperationContext operationContext) { UriQueryBuilder directoryBuilder = GetDirectoryUriQueryBuilder(); DirectoryHttpWebRequestFactory.AddShareSnapshot(directoryBuilder, shareSnapshot); @@ -173,7 +173,7 @@ public static HttpWebRequest List(Uri uri, int? timeout, FileListingContext list /// A flag indicating whether to set the x-ms-version HTTP header. /// An object for tracking the current operation. /// A web request to use to perform the operation. - internal static HttpWebRequest List(Uri uri, int? timeout, FileListingContext listingContext, DateTimeOffset? shareSnapshot, bool useVersionHeader, OperationContext operationContext) + public static HttpWebRequest List(Uri uri, int? timeout, FileListingContext listingContext, DateTimeOffset? shareSnapshot, bool useVersionHeader, OperationContext operationContext) { UriQueryBuilder directoryBuilder = GetDirectoryUriQueryBuilder(); DirectoryHttpWebRequestFactory.AddShareSnapshot(directoryBuilder, shareSnapshot); diff --git a/Lib/ClassLibraryCommon/File/Protocol/FileHttpWebRequestFactory.cs b/Lib/ClassLibraryCommon/File/Protocol/FileHttpWebRequestFactory.cs index 158cd6035..eaf2519a1 100644 --- a/Lib/ClassLibraryCommon/File/Protocol/FileHttpWebRequestFactory.cs +++ b/Lib/ClassLibraryCommon/File/Protocol/FileHttpWebRequestFactory.cs @@ -152,7 +152,7 @@ public static HttpWebRequest GetProperties(Uri uri, int? timeout, AccessConditio /// A flag indicating whether to set the x-ms-version HTTP header. /// An object for tracking the current operation. /// A web request for performing the operation. - internal static HttpWebRequest GetProperties(Uri uri, int? timeout, DateTimeOffset? shareSnapshot, AccessCondition accessCondition, bool useVersionHeader, OperationContext operationContext) + public static HttpWebRequest GetProperties(Uri uri, int? timeout, DateTimeOffset? shareSnapshot, AccessCondition accessCondition, bool useVersionHeader, OperationContext operationContext) { UriQueryBuilder builder = new UriQueryBuilder(); FileHttpWebRequestFactory.AddShareSnapshot(builder, shareSnapshot); @@ -186,7 +186,7 @@ public static HttpWebRequest GetMetadata(Uri uri, int? timeout, AccessCondition /// A flag indicating whether to set the x-ms-version HTTP header. /// An object for tracking the current operation. /// A web request for performing the operation. - internal static HttpWebRequest GetMetadata(Uri uri, int? timeout, DateTimeOffset? shareSnapshot, AccessCondition accessCondition, bool useVersionHeader, OperationContext operationContext) + public static HttpWebRequest GetMetadata(Uri uri, int? timeout, DateTimeOffset? shareSnapshot, AccessCondition accessCondition, bool useVersionHeader, OperationContext operationContext) { UriQueryBuilder builder = new UriQueryBuilder(); FileHttpWebRequestFactory.AddShareSnapshot(builder, shareSnapshot); @@ -289,7 +289,7 @@ public static HttpWebRequest ListRanges(Uri uri, int? timeout, long? offset, lon /// A flag indicating whether to set the x-ms-version HTTP header. /// An object for tracking the current operation. /// A web request to use to perform the operation. - internal static HttpWebRequest ListRanges(Uri uri, int? timeout, long? offset, long? count, DateTimeOffset? shareSnapshot, AccessCondition accessCondition, bool useVersionHeader, OperationContext operationContext) + public static HttpWebRequest ListRanges(Uri uri, int? timeout, long? offset, long? count, DateTimeOffset? shareSnapshot, AccessCondition accessCondition, bool useVersionHeader, OperationContext operationContext) { if (offset.HasValue) { @@ -386,7 +386,7 @@ public static HttpWebRequest Get(Uri uri, int? timeout, AccessCondition accessCo /// A flag indicating whether to set the x-ms-version HTTP header. /// An object for tracking the current operation. /// A web request for performing the operation. - internal static HttpWebRequest Get(Uri uri, int? timeout, DateTimeOffset? shareSnapshot, AccessCondition accessCondition, bool useVersionHeader, OperationContext operationContext) + public static HttpWebRequest Get(Uri uri, int? timeout, DateTimeOffset? shareSnapshot, AccessCondition accessCondition, bool useVersionHeader, OperationContext operationContext) { UriQueryBuilder builder = new UriQueryBuilder(); FileHttpWebRequestFactory.AddShareSnapshot(builder, shareSnapshot); @@ -442,7 +442,7 @@ public static HttpWebRequest Get(Uri uri, int? timeout, long? offset, long? coun /// A flag indicating whether to set the x-ms-version HTTP header. /// An object for tracking the current operation. /// A web request to use to perform the operation. - internal static HttpWebRequest Get(Uri uri, int? timeout, long? offset, long? count, bool rangeContentMD5, DateTimeOffset? shareSnapshot, AccessCondition accessCondition, bool useVersionHeader, OperationContext operationContext) + public static HttpWebRequest Get(Uri uri, int? timeout, long? offset, long? count, bool rangeContentMD5, DateTimeOffset? shareSnapshot, AccessCondition accessCondition, bool useVersionHeader, OperationContext operationContext) { if (offset.HasValue && offset.Value < 0) { diff --git a/Lib/ClassLibraryCommon/File/Protocol/ShareHttpWebRequestFactory.cs b/Lib/ClassLibraryCommon/File/Protocol/ShareHttpWebRequestFactory.cs index 44d5f21f9..70728c1c1 100644 --- a/Lib/ClassLibraryCommon/File/Protocol/ShareHttpWebRequestFactory.cs +++ b/Lib/ClassLibraryCommon/File/Protocol/ShareHttpWebRequestFactory.cs @@ -92,7 +92,7 @@ public static HttpWebRequest Delete(Uri uri, int? timeout, AccessCondition acces /// A flag indicating whether to set the x-ms-version HTTP header. /// An object for tracking the current operation. /// A web request to use to perform the operation. - internal static HttpWebRequest Delete(Uri uri, int? timeout, DateTimeOffset? snapshot, DeleteShareSnapshotsOption deleteSnapshotsOption, AccessCondition accessCondition, bool useVersionHeader, OperationContext operationContext) + public static HttpWebRequest Delete(Uri uri, int? timeout, DateTimeOffset? snapshot, DeleteShareSnapshotsOption deleteSnapshotsOption, AccessCondition accessCondition, bool useVersionHeader, OperationContext operationContext) { if ((snapshot != null) && (deleteSnapshotsOption != DeleteShareSnapshotsOption.None)) { @@ -143,7 +143,7 @@ public static HttpWebRequest GetMetadata(Uri uri, int? timeout, AccessCondition /// A flag indicating whether to set the x-ms-version HTTP header. /// An object for tracking the current operation. /// A web request to use to perform the operation. - internal static HttpWebRequest GetMetadata(Uri uri, int? timeout, DateTimeOffset? snapshot, AccessCondition accessCondition, bool useVersionHeader, OperationContext operationContext) + public static HttpWebRequest GetMetadata(Uri uri, int? timeout, DateTimeOffset? snapshot, AccessCondition accessCondition, bool useVersionHeader, OperationContext operationContext) { UriQueryBuilder shareBuilder = GetShareUriQueryBuilder(); ShareHttpWebRequestFactory.AddShareSnapshot(shareBuilder, snapshot); @@ -177,7 +177,7 @@ public static HttpWebRequest GetProperties(Uri uri, int? timeout, AccessConditio /// A flag indicating whether to set the x-ms-version HTTP header. /// An object for tracking the current operation. /// A web request to use to perform the operation. - internal static HttpWebRequest GetProperties(Uri uri, int? timeout, DateTimeOffset? snapshot, AccessCondition accessCondition, bool useVersionHeader, OperationContext operationContext) + public static HttpWebRequest GetProperties(Uri uri, int? timeout, DateTimeOffset? snapshot, AccessCondition accessCondition, bool useVersionHeader, OperationContext operationContext) { UriQueryBuilder shareBuilder = GetShareUriQueryBuilder(); ShareHttpWebRequestFactory.AddShareSnapshot(shareBuilder, snapshot); @@ -259,7 +259,7 @@ public static HttpWebRequest GetStats(Uri uri, int? timeout, bool useVersionHead /// A flag indicating whether to set the x-ms-version HTTP header. /// An object that represents the context for the current operation. /// A object. - internal static HttpWebRequest Snapshot(Uri uri, int? timeout, AccessCondition accessCondition, bool useVersionHeader, OperationContext operationContext) + public static HttpWebRequest Snapshot(Uri uri, int? timeout, AccessCondition accessCondition, bool useVersionHeader, OperationContext operationContext) { UriQueryBuilder builder = new UriQueryBuilder(); builder.Add(Constants.QueryConstants.ResourceType, "share"); @@ -343,20 +343,19 @@ public static HttpWebRequest List(Uri uri, int? timeout, ListingContext listingC sb.Append("metadata"); } - //TODO: Enable with ShareSnapshot - //if ((detailsIncluded & ShareListingDetails.Snapshots) == ShareListingDetails.Snapshots) - //{ - // if (!started) - // { - // started = true; - // } - // else - // { - // sb.Append(","); - // } - - // sb.Append("snapshots"); - //} + if ((detailsIncluded & ShareListingDetails.Snapshots) == ShareListingDetails.Snapshots) + { + if (!started) + { + started = true; + } + else + { + sb.Append(","); + } + + sb.Append("snapshots"); + } builder.Add("include", sb.ToString()); } diff --git a/Lib/Common/File/CloudFile.Common.cs b/Lib/Common/File/CloudFile.Common.cs index d95af53c9..b8233dde5 100644 --- a/Lib/Common/File/CloudFile.Common.cs +++ b/Lib/Common/File/CloudFile.Common.cs @@ -220,7 +220,7 @@ public StorageUri StorageUri /// Gets the absolute URI to the file, including query string information if the file's share is a snapshot. /// /// A specifying the absolute URI to the file, including snapshot query information if the file's share is a snapshot. - internal Uri SnapshotQualifiedUri + public Uri SnapshotQualifiedUri { get { @@ -242,7 +242,7 @@ internal Uri SnapshotQualifiedUri /// /// An object of type containing the file's URIs for both the primary and secondary locations, /// including snapshot query information if the file's share is a snapshot. - internal StorageUri SnapshotQualifiedStorageUri + public StorageUri SnapshotQualifiedStorageUri { get { diff --git a/Lib/Common/File/CloudFileClient.Common.cs b/Lib/Common/File/CloudFileClient.Common.cs index bcedf5525..377006fcd 100644 --- a/Lib/Common/File/CloudFileClient.Common.cs +++ b/Lib/Common/File/CloudFileClient.Common.cs @@ -122,7 +122,7 @@ public virtual CloudFileShare GetShareReference(string shareName) /// A string containing the name of the share. /// A specifying the snapshot timestamp, if the share is a snapshot. /// A reference to a share. - internal CloudFileShare GetShareReference(string shareName, DateTimeOffset? snapshotTime) + public CloudFileShare GetShareReference(string shareName, DateTimeOffset? snapshotTime) { CommonUtility.AssertNotNullOrEmpty("shareName", shareName); return new CloudFileShare(shareName, snapshotTime, this); diff --git a/Lib/Common/File/CloudFileDirectory.Common.cs b/Lib/Common/File/CloudFileDirectory.Common.cs index 27dc68b5f..3582e00c9 100644 --- a/Lib/Common/File/CloudFileDirectory.Common.cs +++ b/Lib/Common/File/CloudFileDirectory.Common.cs @@ -121,7 +121,7 @@ public Uri Uri /// Gets the absolute URI to the directory, including query string information if the directory's share is a snapshot. /// /// A specifying the absolute URI to the directory, including snapshot query information if the directory's share is a snapshot. - internal Uri SnapshotQualifiedUri + public Uri SnapshotQualifiedUri { get { @@ -143,7 +143,7 @@ internal Uri SnapshotQualifiedUri /// /// An object of type containing the directory's URIs for both the primary and secondary locations, /// including snapshot query information if the directory's share is a snapshot. - internal StorageUri SnapshotQualifiedStorageUri + public StorageUri SnapshotQualifiedStorageUri { get { diff --git a/Lib/Common/File/CloudFileShare.Common.cs b/Lib/Common/File/CloudFileShare.Common.cs index e2536ffe8..fa8bdd7d8 100644 --- a/Lib/Common/File/CloudFileShare.Common.cs +++ b/Lib/Common/File/CloudFileShare.Common.cs @@ -57,7 +57,7 @@ public CloudFileShare(Uri shareAddress, StorageCredentials credentials) /// The absolute URI to the share. /// A specifying the snapshot timestamp, if the share is a snapshot. /// A object. - internal CloudFileShare(Uri shareAddress, DateTimeOffset? snapshotTime, StorageCredentials credentials) + public CloudFileShare(Uri shareAddress, DateTimeOffset? snapshotTime, StorageCredentials credentials) : this(new StorageUri(shareAddress), snapshotTime, credentials) { } @@ -79,7 +79,7 @@ public CloudFileShare(StorageUri shareAddress, StorageCredentials credentials) /// The absolute URI to the share. /// A specifying the snapshot timestamp, if the share is a snapshot. /// A object. - internal CloudFileShare(StorageUri shareAddress, DateTimeOffset? snapshotTime, StorageCredentials credentials) + public CloudFileShare(StorageUri shareAddress, DateTimeOffset? snapshotTime, StorageCredentials credentials) { CommonUtility.AssertNotNull("shareAddress", shareAddress); CommonUtility.AssertNotNull("shareAddress", shareAddress.PrimaryUri); @@ -151,13 +151,13 @@ public Uri Uri /// /// If the share is not a snapshot, the value of this property is null. /// - internal DateTimeOffset? SnapshotTime { get; set; } + public DateTimeOffset? SnapshotTime { get; internal set; } /// /// Gets a value indicating whether this share is a snapshot. /// /// true if this share is a snapshot; otherwise, false. - internal bool IsSnapshot + public bool IsSnapshot { get { @@ -169,7 +169,7 @@ internal bool IsSnapshot /// Gets the absolute URI to the share, including query string information if the share is a snapshot. /// /// A specifying the absolute URI to the share, including snapshot query information if the share is a snapshot. - internal Uri SnapshotQualifiedUri + public Uri SnapshotQualifiedUri { get { @@ -191,7 +191,7 @@ internal Uri SnapshotQualifiedUri /// /// An object of type containing the share's URIs for both the primary and secondary locations, /// including snapshot query information if the share is a snapshot. - internal StorageUri SnapshotQualifiedStorageUri + public StorageUri SnapshotQualifiedStorageUri { get { diff --git a/Lib/Common/File/Protocol/FileShareEntry.cs b/Lib/Common/File/Protocol/FileShareEntry.cs index 6d8a5b962..4cd09ff4d 100644 --- a/Lib/Common/File/Protocol/FileShareEntry.cs +++ b/Lib/Common/File/Protocol/FileShareEntry.cs @@ -69,6 +69,6 @@ internal FileShareEntry() /// Gets the share's snapshot time, if any. /// /// A specifying the snapshot timestamp, if the share is a snapshot. - internal DateTimeOffset? SnapshotTime { get; set; } + public DateTimeOffset? SnapshotTime { get; internal set; } } } diff --git a/Lib/Common/File/ShareListingDetails.cs b/Lib/Common/File/ShareListingDetails.cs index 3aaed78de..48c1d217e 100644 --- a/Lib/Common/File/ShareListingDetails.cs +++ b/Lib/Common/File/ShareListingDetails.cs @@ -35,9 +35,14 @@ public enum ShareListingDetails /// Metadata = 0x1, + /// + /// Retrieve share snapshots. + /// + Snapshots = 0x2, + /// /// Retrieve all available details. /// - All = Metadata + All = Metadata | Snapshots } } diff --git a/Lib/WindowsRuntime/File/CloudFileShare.cs b/Lib/WindowsRuntime/File/CloudFileShare.cs index af723158f..96c77d25f 100644 --- a/Lib/WindowsRuntime/File/CloudFileShare.cs +++ b/Lib/WindowsRuntime/File/CloudFileShare.cs @@ -158,7 +158,7 @@ public virtual Task CreateIfNotExistsAsync(FileRequestOptions options, Ope /// /// A share snapshot. [DoesServiceRequest] - internal virtual Task SnapshotAsync() + public virtual Task SnapshotAsync() { return this.SnapshotAsync(null /* metadata */, null /* accessCondition */, null /* options */, null /* operationContext */); } @@ -169,7 +169,7 @@ internal virtual Task SnapshotAsync() /// A to observe while waiting for a task to complete. /// A share snapshot. [DoesServiceRequest] - internal virtual Task SnapshotAsync(CancellationToken cancellationToken) + public virtual Task SnapshotAsync(CancellationToken cancellationToken) { return this.SnapshotAsync(null /* metadata */, null /* accessCondition */, null /* options */, null /* operationContext */, cancellationToken); } @@ -183,7 +183,7 @@ internal virtual Task SnapshotAsync(CancellationToken cancellati /// An object that represents the context for the current operation. /// A share snapshot. [DoesServiceRequest] - internal virtual Task SnapshotAsync(IDictionary metadata, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext) + public virtual Task SnapshotAsync(IDictionary metadata, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext) { return this.SnapshotAsync(metadata, accessCondition, options, operationContext, CancellationToken.None); } @@ -198,7 +198,7 @@ internal virtual Task SnapshotAsync(IDictionary /// A to observe while waiting for a task to complete. /// A share snapshot. [DoesServiceRequest] - internal virtual Task SnapshotAsync(IDictionary metadata, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken) + public virtual Task SnapshotAsync(IDictionary metadata, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken) { FileRequestOptions modifiedOptions = FileRequestOptions.ApplyDefaults(options, this.ServiceClient); return Task.Run(async () => await Executor.ExecuteAsync( diff --git a/Lib/WindowsRuntime/File/Protocol/ShareHttpRequestMessageFactory.cs b/Lib/WindowsRuntime/File/Protocol/ShareHttpRequestMessageFactory.cs index 04d16fdf0..92c32ad74 100644 --- a/Lib/WindowsRuntime/File/Protocol/ShareHttpRequestMessageFactory.cs +++ b/Lib/WindowsRuntime/File/Protocol/ShareHttpRequestMessageFactory.cs @@ -215,20 +215,20 @@ public static StorageRequestMessage List(Uri uri, int? timeout, ListingContext l StringBuilder sb = new StringBuilder(); bool started = false; - //TODO: Enable for ShareSnapshot - //if ((detailsIncluded & ShareListingDetails.Snapshots) == ShareListingDetails.Snapshots) - //{ - // if (!started) - // { - // started = true; - // } - // else - // { - // sb.Append(","); - // } - - // sb.Append("snapshots"); - //} + + if ((detailsIncluded & ShareListingDetails.Snapshots) == ShareListingDetails.Snapshots) + { + if (!started) + { + started = true; + } + else + { + sb.Append(","); + } + + sb.Append("snapshots"); + } if ((detailsIncluded & ShareListingDetails.Metadata) == ShareListingDetails.Metadata) { diff --git a/changelog.txt b/changelog.txt index a575bbb18..0062ac156 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,6 @@ +Changes in 8.5.0 : +- Files: Added support for creating the snapshot of a share. See the service documentation for more information on how to use this API. + Changes in 8.4.0 : - BlockBlobs: For Blob Storage Accounts, added support for getting and setting the tier on a block blob. - All: Added a property called CustomUserAgent to the OperationContext class to provide the option for users to prepend a customized value to the existing UserAgent header value. From 43919c66cc2a35e5e6195496b4967ef03ba20f45 Mon Sep 17 00:00:00 2001 From: Elham Rezvani Date: Tue, 15 Aug 2017 14:49:01 -0700 Subject: [PATCH 02/11] Revert "Revert "Revert "[8.2][Sharesnapshot]Disable DelSnpshOptns""" This reverts commit 998ec793c0dc6c06cdc5b10f155ad03baead1ca1. --- Lib/ClassLibraryCommon/File/CloudFileShare.cs | 18 +++++++++--------- Lib/Common/File/DeleteShareSnapshotsOption.cs | 2 +- Lib/WindowsRuntime/File/CloudFileShare.cs | 4 ++-- .../WindowsRuntime/File/CloudFileClientTest.cs | 3 +-- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/Lib/ClassLibraryCommon/File/CloudFileShare.cs b/Lib/ClassLibraryCommon/File/CloudFileShare.cs index 64a37dce7..7e96bda7c 100644 --- a/Lib/ClassLibraryCommon/File/CloudFileShare.cs +++ b/Lib/ClassLibraryCommon/File/CloudFileShare.cs @@ -463,7 +463,7 @@ public virtual void Delete(AccessCondition accessCondition = null, FileRequestOp /// An object that specifies additional options for the request. /// An object that represents the context for the current operation. [DoesServiceRequest] - internal virtual void Delete(DeleteShareSnapshotsOption deleteSnapshotsOption, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext) + public virtual void Delete(DeleteShareSnapshotsOption deleteSnapshotsOption, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext) { FileRequestOptions modifiedOptions = FileRequestOptions.ApplyDefaults(options, this.ServiceClient); Executor.ExecuteSync( @@ -480,11 +480,11 @@ internal virtual void Delete(DeleteShareSnapshotsOption deleteSnapshotsOption, A /// A user-defined object that will be passed to the callback delegate. /// An that references the asynchronous operation. [DoesServiceRequest] - internal virtual ICancellableAsyncResult BeginDelete(AsyncCallback callback, object state) + public virtual ICancellableAsyncResult BeginDelete(AsyncCallback callback, object state) { return this.BeginDelete(DeleteShareSnapshotsOption.None, null /* accessCondition */, null /* options */, null /*operationContext */, callback, state); } - + /// /// Begins an asynchronous operation to delete a share. /// @@ -495,7 +495,7 @@ internal virtual ICancellableAsyncResult BeginDelete(AsyncCallback callback, obj /// A user-defined object that will be passed to the callback delegate. /// An that references the asynchronous operation. [DoesServiceRequest] - internal virtual ICancellableAsyncResult BeginDelete(AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state) + public virtual ICancellableAsyncResult BeginDelete(AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state) { return this.BeginDelete(DeleteShareSnapshotsOption.None, accessCondition, options, operationContext, callback, state); } @@ -511,7 +511,7 @@ internal virtual ICancellableAsyncResult BeginDelete(AccessCondition accessCondi /// A user-defined object that will be passed to the callback delegate. /// An that references the asynchronous operation. [DoesServiceRequest] - internal virtual ICancellableAsyncResult BeginDelete(DeleteShareSnapshotsOption deleteSnapshotsOption, AccessCondition accessCondition, + public virtual ICancellableAsyncResult BeginDelete(DeleteShareSnapshotsOption deleteSnapshotsOption, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state) { FileRequestOptions modifiedOptions = FileRequestOptions.ApplyDefaults(options, this.ServiceClient); @@ -591,7 +591,7 @@ public virtual Task DeleteAsync(AccessCondition accessCondition, FileRequestOpti /// A to observe while waiting for a task to complete. /// A object that represents the current operation. [DoesServiceRequest] - internal virtual Task DeleteAsync(DeleteShareSnapshotsOption deleteSnapshotsOption, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken) + public virtual Task DeleteAsync(DeleteShareSnapshotsOption deleteSnapshotsOption, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken) { return AsyncExtensions.TaskFromVoidApm(this.BeginDelete, this.EndDelete, deleteSnapshotsOption, accessCondition, options, operationContext, cancellationToken); } @@ -620,7 +620,7 @@ public virtual bool DeleteIfExists(AccessCondition accessCondition = null, FileR /// An object that represents the context for the current operation. /// true if the share did not already exist and was created; otherwise false. [DoesServiceRequest] - internal virtual bool DeleteIfExists(DeleteShareSnapshotsOption deleteSnapshotsOption, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext) + public virtual bool DeleteIfExists(DeleteShareSnapshotsOption deleteSnapshotsOption, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext) { FileRequestOptions modifiedOptions = FileRequestOptions.ApplyDefaults(options, this.ServiceClient); operationContext = operationContext ?? new OperationContext(); @@ -706,7 +706,7 @@ public virtual ICancellableAsyncResult BeginDeleteIfExists(AccessCondition acces /// A user-defined object that will be passed to the callback delegate. /// An that references the asynchronous operation. [DoesServiceRequest] - internal virtual ICancellableAsyncResult BeginDeleteIfExists(DeleteShareSnapshotsOption deleteSnapshotsOption, AccessCondition accessCondition, + public virtual ICancellableAsyncResult BeginDeleteIfExists(DeleteShareSnapshotsOption deleteSnapshotsOption, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, AsyncCallback callback, object state) { FileRequestOptions modifiedOptions = FileRequestOptions.ApplyDefaults(options, this.ServiceClient); @@ -878,7 +878,7 @@ public virtual Task DeleteIfExistsAsync(AccessCondition accessCondition, F /// A to observe while waiting for a task to complete. /// A object that represents the current operation. [DoesServiceRequest] - internal virtual Task DeleteIfExistsAsync(DeleteShareSnapshotsOption deleteSnapshotsOption, AccessCondition accessCondition, + public virtual Task DeleteIfExistsAsync(DeleteShareSnapshotsOption deleteSnapshotsOption, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken) { return AsyncExtensions.TaskFromApm(this.BeginDeleteIfExists, this.EndDeleteIfExists, deleteSnapshotsOption, accessCondition, options, operationContext, cancellationToken); diff --git a/Lib/Common/File/DeleteShareSnapshotsOption.cs b/Lib/Common/File/DeleteShareSnapshotsOption.cs index 53727e969..6639d00c4 100644 --- a/Lib/Common/File/DeleteShareSnapshotsOption.cs +++ b/Lib/Common/File/DeleteShareSnapshotsOption.cs @@ -20,7 +20,7 @@ namespace Microsoft.WindowsAzure.Storage.File /// /// The set of options describing delete operation. /// - internal enum DeleteShareSnapshotsOption + public enum DeleteShareSnapshotsOption { /// /// Delete the share only. If the share has snapshots, this option will result in an error from the service. diff --git a/Lib/WindowsRuntime/File/CloudFileShare.cs b/Lib/WindowsRuntime/File/CloudFileShare.cs index 96c77d25f..6e1d6c19e 100644 --- a/Lib/WindowsRuntime/File/CloudFileShare.cs +++ b/Lib/WindowsRuntime/File/CloudFileShare.cs @@ -251,7 +251,7 @@ public virtual Task DeleteAsync(AccessCondition accessCondition, FileRequestOpti /// An object that represents the context for the current operation. /// A to observe while waiting for a task to complete. [DoesServiceRequest] - internal virtual Task DeleteAsync(DeleteShareSnapshotsOption deleteSnapshotsOption, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken) + public virtual Task DeleteAsync(DeleteShareSnapshotsOption deleteSnapshotsOption, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken) { FileRequestOptions modifiedOptions = FileRequestOptions.ApplyDefaults(options, this.ServiceClient); return Task.Run(async () => await Executor.ExecuteAsyncNullReturn( @@ -306,7 +306,7 @@ public virtual Task DeleteIfExistsAsync(AccessCondition accessCondition, F /// A to observe while waiting for a task to complete. /// true if the share already existed and was deleted; otherwise, false. [DoesServiceRequest] - internal virtual Task DeleteIfExistsAsync(DeleteShareSnapshotsOption deleteSnapshotsOption, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken) + public virtual Task DeleteIfExistsAsync(DeleteShareSnapshotsOption deleteSnapshotsOption, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken) { FileRequestOptions modifiedOptions = FileRequestOptions.ApplyDefaults(options, this.ServiceClient); operationContext = operationContext ?? new OperationContext(); diff --git a/Test/WindowsRuntime/File/CloudFileClientTest.cs b/Test/WindowsRuntime/File/CloudFileClientTest.cs index f69ebd718..37b5d3713 100644 --- a/Test/WindowsRuntime/File/CloudFileClientTest.cs +++ b/Test/WindowsRuntime/File/CloudFileClientTest.cs @@ -404,8 +404,7 @@ public async Task CloudFileClientServerTimeoutAsync() Assert.IsNull(timeout); } - //TODO: Enable for ShareSnapshot release - //[TestMethod] + [TestMethod] [Description("Test list shares with a snapshot")] [TestCategory(ComponentCategory.File)] [TestCategory(TestTypeCategory.UnitTest)] From 45ba4d5b8838b037a0f8a0390672aa32dc60cf9b Mon Sep 17 00:00:00 2001 From: Elham Rezvani Date: Tue, 15 Aug 2017 20:58:00 -0700 Subject: [PATCH 03/11] [8.5]ShareSnapshot Facade changes --- ...oft.WindowsAzure.Storage.File.CloudFile.cs | 4 ++-- ...ndowsAzure.Storage.File.CloudFileClient.cs | 2 +- ...wsAzure.Storage.File.CloudFileDirectory.cs | 4 ++-- ...indowsAzure.Storage.File.CloudFileShare.cs | 19 +++++++++---------- ...Storage.File.DeleteShareSnapshotsOption.cs | 2 +- ...re.Storage.File.Protocol.FileShareEntry.cs | 4 ++-- ...sAzure.Storage.File.ShareListingDetails.cs | 3 ++- 7 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.File.CloudFile.cs b/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.File.CloudFile.cs index 3fa6de7ff..379b5533a 100644 --- a/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.File.CloudFile.cs +++ b/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.File.CloudFile.cs @@ -88,7 +88,7 @@ public StorageUri StorageUri } } - internal Uri SnapshotQualifiedUri + public Uri SnapshotQualifiedUri { get { @@ -96,7 +96,7 @@ internal Uri SnapshotQualifiedUri } } - internal StorageUri SnapshotQualifiedStorageUri + public StorageUri SnapshotQualifiedStorageUri { get { diff --git a/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.File.CloudFileClient.cs b/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.File.CloudFileClient.cs index 33bf8e300..996fe6d4e 100644 --- a/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.File.CloudFileClient.cs +++ b/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.File.CloudFileClient.cs @@ -136,7 +136,7 @@ public virtual CloudFileShare GetShareReference(string shareName) { throw new System.NotImplementedException(); } - internal CloudFileShare GetShareReference(string shareName, DateTimeOffset? snapshotTime) + public CloudFileShare GetShareReference(string shareName, DateTimeOffset? snapshotTime) { throw new System.NotImplementedException(); } diff --git a/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.File.CloudFileDirectory.cs b/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.File.CloudFileDirectory.cs index 940207cc3..3cceef70a 100644 --- a/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.File.CloudFileDirectory.cs +++ b/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.File.CloudFileDirectory.cs @@ -34,7 +34,7 @@ public StorageUri StorageUri get; private set; } - internal Uri SnapshotQualifiedUri + public Uri SnapshotQualifiedUri { get { @@ -42,7 +42,7 @@ internal Uri SnapshotQualifiedUri } } - internal StorageUri SnapshotQualifiedStorageUri + public StorageUri SnapshotQualifiedStorageUri { get { diff --git a/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.File.CloudFileShare.cs b/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.File.CloudFileShare.cs index c59e5c20e..f29ecb07a 100644 --- a/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.File.CloudFileShare.cs +++ b/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.File.CloudFileShare.cs @@ -35,12 +35,12 @@ public StorageUri StorageUri get; private set; } - internal DateTimeOffset? SnapshotTime + public DateTimeOffset? SnapshotTime { - get; set; + get; internal set; } - internal bool IsSnapshot + public bool IsSnapshot { get { @@ -48,7 +48,7 @@ internal bool IsSnapshot } } - internal Uri SnapshotQualifiedUri + public Uri SnapshotQualifiedUri { get { @@ -56,7 +56,7 @@ internal Uri SnapshotQualifiedUri } } - internal StorageUri SnapshotQualifiedStorageUri + public StorageUri SnapshotQualifiedStorageUri { get { @@ -89,7 +89,7 @@ public CloudFileShare(Uri shareAddress, StorageCredentials credentials) { throw new System.NotImplementedException(); } - internal CloudFileShare(Uri shareAddress, DateTimeOffset? snapshotTime, StorageCredentials credentials) + public CloudFileShare(Uri shareAddress, DateTimeOffset? snapshotTime, StorageCredentials credentials) : this(new StorageUri(shareAddress), snapshotTime, credentials) { throw new System.NotImplementedException(); @@ -99,7 +99,7 @@ public CloudFileShare(StorageUri shareAddress, StorageCredentials credentials) { throw new System.NotImplementedException(); } - internal CloudFileShare(StorageUri shareAddress, DateTimeOffset? snapshotTime, StorageCredentials credentials) + public CloudFileShare(StorageUri shareAddress, DateTimeOffset? snapshotTime, StorageCredentials credentials) { throw new System.NotImplementedException(); } @@ -112,7 +112,6 @@ internal CloudFileShare(FileShareProperties properties, IDictionary DeleteIfExistsAsync(AccessCondition accessCondition, F { throw new System.NotImplementedException(); } - internal virtual Task DeleteIfExistsAsync(DeleteShareSnapshotsOption deleteSnapshotsOption, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken) + public virtual Task DeleteIfExistsAsync(DeleteShareSnapshotsOption deleteSnapshotsOption, AccessCondition accessCondition, FileRequestOptions options, OperationContext operationContext, CancellationToken cancellationToken) { throw new System.NotImplementedException(); } diff --git a/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.File.DeleteShareSnapshotsOption.cs b/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.File.DeleteShareSnapshotsOption.cs index b7f27aea6..1c61f4e8d 100644 --- a/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.File.DeleteShareSnapshotsOption.cs +++ b/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.File.DeleteShareSnapshotsOption.cs @@ -1,7 +1,7 @@ namespace Microsoft.WindowsAzure.Storage.File { -internal enum DeleteShareSnapshotsOption +public enum DeleteShareSnapshotsOption { None, IncludeSnapshots, diff --git a/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.File.Protocol.FileShareEntry.cs b/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.File.Protocol.FileShareEntry.cs index d0a7020fb..350ecb382 100644 --- a/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.File.Protocol.FileShareEntry.cs +++ b/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.File.Protocol.FileShareEntry.cs @@ -24,9 +24,9 @@ public Uri Uri get; internal set; } - internal DateTimeOffset? SnapshotTime + public DateTimeOffset? SnapshotTime { - get; set; + get; internal set; } internal FileShareEntry() diff --git a/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.File.ShareListingDetails.cs b/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.File.ShareListingDetails.cs index 2aee0f0a5..39ce6fdb8 100644 --- a/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.File.ShareListingDetails.cs +++ b/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.File.ShareListingDetails.cs @@ -6,7 +6,8 @@ public enum ShareListingDetails { None = 0, Metadata = 1, - All = Metadata, + Snapshots = 2, + All = Snapshots | Metadata, } } \ No newline at end of file From 2585852df4baeb5f6eae2140c0beef99cc71fc84 Mon Sep 17 00:00:00 2001 From: Elham Rezvani Date: Wed, 4 Oct 2017 13:58:03 -0700 Subject: [PATCH 04/11] Fix sharesnapshot nullref --- Lib/ClassLibraryCommon/File/CloudFile.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/ClassLibraryCommon/File/CloudFile.cs b/Lib/ClassLibraryCommon/File/CloudFile.cs index 8562d5bab..7b97439cc 100644 --- a/Lib/ClassLibraryCommon/File/CloudFile.cs +++ b/Lib/ClassLibraryCommon/File/CloudFile.cs @@ -2506,7 +2506,7 @@ public virtual Task DeleteAsync(AccessCondition accessCondition, FileRequestOpti [DoesServiceRequest] public virtual bool DeleteIfExists(AccessCondition accessCondition = null, FileRequestOptions options = null, OperationContext operationContext = null) { - this.share.AssertNoSnapshot(); + this.Share.AssertNoSnapshot(); FileRequestOptions modifiedOptions = FileRequestOptions.ApplyDefaults(options, this.ServiceClient); operationContext = operationContext ?? new OperationContext(); @@ -3909,7 +3909,7 @@ public virtual Task StartCopyAsync(CloudBlob source, AccessCondition sou [DoesServiceRequest] public virtual void AbortCopy(string copyId, AccessCondition accessCondition = null, FileRequestOptions options = null, OperationContext operationContext = null) { - this.share.AssertNoSnapshot(); + this.Share.AssertNoSnapshot(); FileRequestOptions modifiedOptions = FileRequestOptions.ApplyDefaults(options, this.ServiceClient); Executor.ExecuteSync( this.AbortCopyImpl(copyId, accessCondition, modifiedOptions), From 6d53fa5b23ec50668b3d9f8ddd502fc38cd54fa6 Mon Sep 17 00:00:00 2001 From: Elham Rezvani Date: Wed, 4 Oct 2017 14:23:34 -0700 Subject: [PATCH 05/11] [8.5] Assembly version update --- ...rosoft.WindowsAzure.Storage.Shared.Protocol.Constants.cs | 2 +- ...dowsAzure.Storage.Shared.Protocol.EncryptionConstants.cs | 2 +- ....WindowsAzure.Storage.Shared.Protocol.HeaderConstants.cs | 4 ++-- .../Properties/AssemblyInfo.cs | 4 ++-- .../Microsoft.WindowsAzure.Storage.Facade/project.json | 2 +- Lib/AspNet/Microsoft.WindowsAzure.Storage/AssemblyInfo.cs | 6 +++--- .../WindowsAzure.StorageK.nuspec | 2 +- Lib/AspNet/Microsoft.WindowsAzure.Storage/project.json | 2 +- Lib/Common/Shared/Protocol/Constants.cs | 2 +- Lib/WindowsDesktop/Properties/AssemblyInfo.cs | 4 ++-- Lib/WindowsDesktop/WindowsAzure.Storage.nuspec | 2 +- Lib/WindowsPhone/Properties/AssemblyInfo.cs | 4 ++-- Lib/WindowsPhoneRT/Properties/AssemblyInfo.cs | 4 ++-- Lib/WindowsRuntime/Properties/AssemblyInfo.cs | 4 ++-- README.md | 2 +- .../project.json | 4 ++-- .../project.json | 4 ++-- Test/WindowsDesktop/Properties/AssemblyInfo.cs | 4 ++-- Test/WindowsPhone/Properties/AssemblyInfo.cs | 4 ++-- Test/WindowsPhone81/Properties/AssemblyInfo.cs | 4 ++-- Test/WindowsPhoneRT.Test/Properties/AssemblyInfo.cs | 4 ++-- Test/WindowsRuntime/Properties/AssemblyInfo.cs | 4 ++-- 22 files changed, 37 insertions(+), 37 deletions(-) diff --git a/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.Shared.Protocol.Constants.cs b/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.Shared.Protocol.Constants.cs index 040cf2e38..b56388999 100644 --- a/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.Shared.Protocol.Constants.cs +++ b/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.Shared.Protocol.Constants.cs @@ -249,7 +249,7 @@ public static class EncryptionConstants public const string TableEncryptionKeyDetails = "_ClientEncryptionMetadata1"; public const string TableEncryptionPropertyDetails = "_ClientEncryptionMetadata2"; public const string AgentMetadataKey = "EncryptionLibrary"; - public const string AgentMetadataValue = ".NET 8.4.0"; + public const string AgentMetadataValue = ".NET 8.5.0"; } } diff --git a/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.Shared.Protocol.EncryptionConstants.cs b/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.Shared.Protocol.EncryptionConstants.cs index 36a37ff33..500838da7 100644 --- a/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.Shared.Protocol.EncryptionConstants.cs +++ b/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.Shared.Protocol.EncryptionConstants.cs @@ -10,7 +10,7 @@ public static class EncryptionConstants public const string TableEncryptionKeyDetails = "_ClientEncryptionMetadata1"; public const string TableEncryptionPropertyDetails = "_ClientEncryptionMetadata2"; public const string AgentMetadataKey = "EncryptionLibrary"; - public const string AgentMetadataValue = ".NET 8.4.0"; + public const string AgentMetadataValue = ".NET 8.5.0"; } } \ No newline at end of file diff --git a/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.Shared.Protocol.HeaderConstants.cs b/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.Shared.Protocol.HeaderConstants.cs index b5451878a..b840586d8 100644 --- a/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.Shared.Protocol.HeaderConstants.cs +++ b/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.Shared.Protocol.HeaderConstants.cs @@ -4,9 +4,9 @@ namespace Microsoft.WindowsAzure.Storage.Shared.Protocol public static class HeaderConstants { - public static readonly string UserAgent = "Azure-Storage/8.4.0 "; + public static readonly string UserAgent = "Azure-Storage/8.5.0 "; public const string UserAgentProductName = "Azure-Storage"; - public const string UserAgentProductVersion = "8.4.0"; + public const string UserAgentProductVersion = "8.5.0"; public const string PrefixForStorageHeader = "x-ms-"; public const string TrueHeader = "true"; public const string FalseHeader = "false"; diff --git a/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/Properties/AssemblyInfo.cs b/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/Properties/AssemblyInfo.cs index f23b501bf..a69c4f4be 100644 --- a/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/Properties/AssemblyInfo.cs +++ b/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/Properties/AssemblyInfo.cs @@ -31,8 +31,8 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("8.4.0.0")] -[assembly: AssemblyFileVersion("8.4.0.0")] +[assembly: AssemblyVersion("8.5.0.0")] +[assembly: AssemblyFileVersion("8.5.0.0")] [assembly: InternalsVisibleTo( "Microsoft.WindowsAzure.Storage.Facade.Portable, PublicKey=" + diff --git a/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/project.json b/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/project.json index 26f7fe191..ef3a50e37 100644 --- a/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/project.json +++ b/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/project.json @@ -1,6 +1,6 @@ { "title": "Microsoft.WindowsAzure.Storage", - "version": "8.4.0.0", + "version": "8.5.0.0", "authors": [ "Microsoft Corporation" ], "description": "Azure Storage SDK for NetCore", diff --git a/Lib/AspNet/Microsoft.WindowsAzure.Storage/AssemblyInfo.cs b/Lib/AspNet/Microsoft.WindowsAzure.Storage/AssemblyInfo.cs index 0b625ee46..02884ef7a 100644 --- a/Lib/AspNet/Microsoft.WindowsAzure.Storage/AssemblyInfo.cs +++ b/Lib/AspNet/Microsoft.WindowsAzure.Storage/AssemblyInfo.cs @@ -34,9 +34,9 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("8.4.0.0")] -[assembly: AssemblyFileVersion("8.4.0.0")] -[assembly: AssemblyInformationalVersion("8.4.0.0")] +[assembly: AssemblyVersion("8.5.0.0")] +[assembly: AssemblyFileVersion("8.5.0.0")] +[assembly: AssemblyInformationalVersion("8.5.0.0")] [assembly: InternalsVisibleTo( diff --git a/Lib/AspNet/Microsoft.WindowsAzure.Storage/WindowsAzure.StorageK.nuspec b/Lib/AspNet/Microsoft.WindowsAzure.Storage/WindowsAzure.StorageK.nuspec index fc42e4a96..ed06110fa 100644 --- a/Lib/AspNet/Microsoft.WindowsAzure.Storage/WindowsAzure.StorageK.nuspec +++ b/Lib/AspNet/Microsoft.WindowsAzure.Storage/WindowsAzure.StorageK.nuspec @@ -2,7 +2,7 @@ WindowsAzure.Storage - 8.4.0 + 8.5.0 Windows Azure Storage Microsoft Microsoft diff --git a/Lib/AspNet/Microsoft.WindowsAzure.Storage/project.json b/Lib/AspNet/Microsoft.WindowsAzure.Storage/project.json index 826c4d67e..acd52bd90 100644 --- a/Lib/AspNet/Microsoft.WindowsAzure.Storage/project.json +++ b/Lib/AspNet/Microsoft.WindowsAzure.Storage/project.json @@ -1,5 +1,5 @@ { - "version": "8.4.0.0", + "version": "8.5.0.0", "authors": [ "Microsoft Corporation" ], "description": "Azure Storage SDK for NetCore", diff --git a/Lib/Common/Shared/Protocol/Constants.cs b/Lib/Common/Shared/Protocol/Constants.cs index 8880bf74c..e04887d10 100644 --- a/Lib/Common/Shared/Protocol/Constants.cs +++ b/Lib/Common/Shared/Protocol/Constants.cs @@ -844,7 +844,7 @@ static HeaderConstants() /// /// Specifies the value to use for UserAgent header. /// - public const string UserAgentProductVersion = "8.4.0"; + public const string UserAgentProductVersion = "8.5.0"; /// /// Master Microsoft Azure Storage header prefix. diff --git a/Lib/WindowsDesktop/Properties/AssemblyInfo.cs b/Lib/WindowsDesktop/Properties/AssemblyInfo.cs index 4cdebbcfd..08d8039a4 100644 --- a/Lib/WindowsDesktop/Properties/AssemblyInfo.cs +++ b/Lib/WindowsDesktop/Properties/AssemblyInfo.cs @@ -35,8 +35,8 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("8.4.0.0")] -[assembly: AssemblyFileVersion("8.4.0.0")] +[assembly: AssemblyVersion("8.5.0.0")] +[assembly: AssemblyFileVersion("8.5.0.0")] #if SIGN [assembly: InternalsVisibleTo( diff --git a/Lib/WindowsDesktop/WindowsAzure.Storage.nuspec b/Lib/WindowsDesktop/WindowsAzure.Storage.nuspec index fc42e4a96..ed06110fa 100644 --- a/Lib/WindowsDesktop/WindowsAzure.Storage.nuspec +++ b/Lib/WindowsDesktop/WindowsAzure.Storage.nuspec @@ -2,7 +2,7 @@ WindowsAzure.Storage - 8.4.0 + 8.5.0 Windows Azure Storage Microsoft Microsoft diff --git a/Lib/WindowsPhone/Properties/AssemblyInfo.cs b/Lib/WindowsPhone/Properties/AssemblyInfo.cs index 4ca2911ae..cffcd9fbc 100644 --- a/Lib/WindowsPhone/Properties/AssemblyInfo.cs +++ b/Lib/WindowsPhone/Properties/AssemblyInfo.cs @@ -33,8 +33,8 @@ // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("8.4.0.0")] -[assembly: AssemblyFileVersion("8.4.0.0")] +[assembly: AssemblyVersion("8.5.0.0")] +[assembly: AssemblyFileVersion("8.5.0.0")] [assembly: NeutralResourcesLanguageAttribute("en-US")] diff --git a/Lib/WindowsPhoneRT/Properties/AssemblyInfo.cs b/Lib/WindowsPhoneRT/Properties/AssemblyInfo.cs index cc9169d5a..758631b42 100644 --- a/Lib/WindowsPhoneRT/Properties/AssemblyInfo.cs +++ b/Lib/WindowsPhoneRT/Properties/AssemblyInfo.cs @@ -24,8 +24,8 @@ // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("8.4.0.0")] -[assembly: AssemblyFileVersion("8.4.0.0")] +[assembly: AssemblyVersion("8.5.0.0")] +[assembly: AssemblyFileVersion("8.5.0.0")] [assembly: NeutralResourcesLanguageAttribute("en-US")] [assembly: ComVisible(false)] diff --git a/Lib/WindowsRuntime/Properties/AssemblyInfo.cs b/Lib/WindowsRuntime/Properties/AssemblyInfo.cs index d4b458afb..41a9330db 100644 --- a/Lib/WindowsRuntime/Properties/AssemblyInfo.cs +++ b/Lib/WindowsRuntime/Properties/AssemblyInfo.cs @@ -26,8 +26,8 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("8.4.0.0")] -[assembly: AssemblyFileVersion("8.4.0.0")] +[assembly: AssemblyVersion("8.5.0.0")] +[assembly: AssemblyFileVersion("8.5.0.0")] [assembly: ComVisible(false)] diff --git a/README.md b/README.md index 59f9d788b..e9554ad28 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Microsoft Azure Storage SDK for .NET (8.4.0) +# Microsoft Azure Storage SDK for .NET (8.5.0) The Microsoft Azure Storage SDK for .NET allows you to build Azure applications that take advantage of scalable cloud computing resources. diff --git a/Test/AspNet/Facade/Microsoft.WindowsAzure.Storage.Facade.NetCore.Test/project.json b/Test/AspNet/Facade/Microsoft.WindowsAzure.Storage.Facade.NetCore.Test/project.json index deecf3a40..2b8a1b479 100644 --- a/Test/AspNet/Facade/Microsoft.WindowsAzure.Storage.Facade.NetCore.Test/project.json +++ b/Test/AspNet/Facade/Microsoft.WindowsAzure.Storage.Facade.NetCore.Test/project.json @@ -1,13 +1,13 @@ { "title": "Microsoft.WindowsAzure.Storage.Facade.NetCore.Test", - "version": "8.4.0.0", + "version": "8.5.0.0", "testRunner": "xunit", "dependencies": { "xunit": "2.1.0", "dotnet-test-xunit": "2.2.0-preview2-build1029", "XUnitForMsTest": "1.0.0.0", - "WindowsAzure.Storage": "8.4.0-facade" + "WindowsAzure.Storage": "8.5.0-facade" }, "frameworks": { diff --git a/Test/AspNet/Facade/Microsoft.WindowsAzure.Storage.Facade.Portable/project.json b/Test/AspNet/Facade/Microsoft.WindowsAzure.Storage.Facade.Portable/project.json index a6628a4c7..1c51dcbb4 100644 --- a/Test/AspNet/Facade/Microsoft.WindowsAzure.Storage.Facade.Portable/project.json +++ b/Test/AspNet/Facade/Microsoft.WindowsAzure.Storage.Facade.Portable/project.json @@ -1,8 +1,8 @@ { - "version": "8.4.0.0", + "version": "8.5.0.0", "supports": {}, "dependencies": { - "WindowsAzure.Storage": "8.4.0-facade" + "WindowsAzure.Storage": "8.5.0-facade" }, "frameworks": { ".NETPortable,Version=v4.5,Profile=Profile259": {} diff --git a/Test/WindowsDesktop/Properties/AssemblyInfo.cs b/Test/WindowsDesktop/Properties/AssemblyInfo.cs index 2997c6c61..b8c7b01df 100644 --- a/Test/WindowsDesktop/Properties/AssemblyInfo.cs +++ b/Test/WindowsDesktop/Properties/AssemblyInfo.cs @@ -33,6 +33,6 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("8.4.0.0")] -[assembly: AssemblyFileVersion("8.4.0.0")] +[assembly: AssemblyVersion("8.5.0.0")] +[assembly: AssemblyFileVersion("8.5.0.0")] diff --git a/Test/WindowsPhone/Properties/AssemblyInfo.cs b/Test/WindowsPhone/Properties/AssemblyInfo.cs index 152f217b0..282fcba18 100644 --- a/Test/WindowsPhone/Properties/AssemblyInfo.cs +++ b/Test/WindowsPhone/Properties/AssemblyInfo.cs @@ -33,7 +33,7 @@ // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("8.4.0.0")] -[assembly: AssemblyFileVersion("8.4.0.0")] +[assembly: AssemblyVersion("8.5.0.0")] +[assembly: AssemblyFileVersion("8.5.0.0")] [assembly: NeutralResourcesLanguageAttribute("en-US")] diff --git a/Test/WindowsPhone81/Properties/AssemblyInfo.cs b/Test/WindowsPhone81/Properties/AssemblyInfo.cs index deda8631b..41a7b719b 100644 --- a/Test/WindowsPhone81/Properties/AssemblyInfo.cs +++ b/Test/WindowsPhone81/Properties/AssemblyInfo.cs @@ -34,7 +34,7 @@ // by using the '*' as shown below: -[assembly: AssemblyVersion("8.4.0.0")] -[assembly: AssemblyFileVersion("8.4.0.0")] +[assembly: AssemblyVersion("8.5.0.0")] +[assembly: AssemblyFileVersion("8.5.0.0")] [assembly: NeutralResourcesLanguageAttribute("en-US")] diff --git a/Test/WindowsPhoneRT.Test/Properties/AssemblyInfo.cs b/Test/WindowsPhoneRT.Test/Properties/AssemblyInfo.cs index ea8757856..6503ec6b7 100644 --- a/Test/WindowsPhoneRT.Test/Properties/AssemblyInfo.cs +++ b/Test/WindowsPhoneRT.Test/Properties/AssemblyInfo.cs @@ -25,7 +25,7 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("8.4.0.0")] -[assembly: AssemblyFileVersion("8.4.0.0")] +[assembly: AssemblyVersion("8.5.0.0")] +[assembly: AssemblyFileVersion("8.5.0.0")] [assembly: ComVisible(false)] \ No newline at end of file diff --git a/Test/WindowsRuntime/Properties/AssemblyInfo.cs b/Test/WindowsRuntime/Properties/AssemblyInfo.cs index d2c6e22cc..9f610e2e8 100644 --- a/Test/WindowsRuntime/Properties/AssemblyInfo.cs +++ b/Test/WindowsRuntime/Properties/AssemblyInfo.cs @@ -25,7 +25,7 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("8.4.0.0")] -[assembly: AssemblyFileVersion("8.4.0.0")] +[assembly: AssemblyVersion("8.5.0.0")] +[assembly: AssemblyFileVersion("8.5.0.0")] [assembly: ComVisible(false)] From d877aac3197ac66d5dcc5ae8b29ae81e13e4ae71 Mon Sep 17 00:00:00 2001 From: Dogu Arslan Date: Tue, 7 Nov 2017 19:41:28 +0000 Subject: [PATCH 06/11] Byte type property support to TableEntity.Flatten/ConvertBack API s (#537) * TableEntityAdapter class and unit tests * Update on code comments, typos. * Additional unit tests for struct type POCO objects. * New struct type test entity with value and reference type properties. Does not implement ITableEntity interface or inherit from TableEntity. * Updated changelog, additional remarks for api usage. * Additional remarks for api usage * byte type property support to tableentity * unit test updates --- Lib/Common/Table/EntityPropertyConverter.cs | 10 ++++++++++ .../Table/TableOperationUnitTests.cs | 4 +++- Test/Common/Table/Entities/ComplexEntity.cs | 8 ++++++++ Test/WindowsRuntime/Table/TableOperationUnitTests.cs | 2 +- changelog.txt | 3 +++ 5 files changed, 25 insertions(+), 2 deletions(-) diff --git a/Lib/Common/Table/EntityPropertyConverter.cs b/Lib/Common/Table/EntityPropertyConverter.cs index f1a202f39..eae9360bd 100644 --- a/Lib/Common/Table/EntityPropertyConverter.cs +++ b/Lib/Common/Table/EntityPropertyConverter.cs @@ -222,6 +222,11 @@ private static EntityProperty CreateEntityPropertyWithType(object value, Type ty { return new EntityProperty((byte[])value); } + else if (type == typeof(byte)) + { + byte[] temp = new byte[] { (byte)value}; + return new EntityProperty(temp); + } else if (type == typeof(bool)) { return new EntityProperty((bool)value); @@ -445,6 +450,11 @@ private static object ChangeType(object propertyValue, Type propertyType) return unchecked((ulong)(long)propertyValue); } + if (type == typeof(byte)) + { + return ((byte[])propertyValue)[0]; + } + return Convert.ChangeType(propertyValue, type, CultureInfo.InvariantCulture); } diff --git a/Test/ClassLibraryCommon/Table/TableOperationUnitTests.cs b/Test/ClassLibraryCommon/Table/TableOperationUnitTests.cs index 55ff9222e..de3ab3b4f 100644 --- a/Test/ClassLibraryCommon/Table/TableOperationUnitTests.cs +++ b/Test/ClassLibraryCommon/Table/TableOperationUnitTests.cs @@ -3022,7 +3022,7 @@ public void FlattenAndRecomposeComplexObjectWithNestedComplexProperties() // Validate IgnoreProperty Attribute Assert.IsFalse(flattenedProperties.ContainsKey("IgnoredProperty")); Assert.IsFalse(flattenedProperties.ContainsKey("InnerComplexEntityWithNestedComplexProperties[ o_0 ]IgnoredProperty")); - Assert.AreEqual(154, flattenedProperties.Count); + Assert.AreEqual(156, flattenedProperties.Count); ComplexEntityWithNestedComplexProperties recomposedObject = TableEntity.ConvertBack(flattenedProperties, entityPropertyConverterOptions, operationContext); @@ -3129,6 +3129,8 @@ private static ComplexEntity CreateComplexEntity(string pk, int seed) complexEntity.LongPrimitiveNull = complexEntity.LongPrimitive; complexEntity.Guid = Guid.NewGuid(); complexEntity.GuidNull = complexEntity.Guid; + complexEntity.SingleByte = 200; + return complexEntity; } diff --git a/Test/Common/Table/Entities/ComplexEntity.cs b/Test/Common/Table/Entities/ComplexEntity.cs index 663935032..da0be814e 100644 --- a/Test/Common/Table/Entities/ComplexEntity.cs +++ b/Test/Common/Table/Entities/ComplexEntity.cs @@ -134,6 +134,13 @@ public Byte[] Binary set { binary = value; } } + private byte singleByte = 0; + public byte SingleByte + { + get { return singleByte; } + set { singleByte = value; } + } + private Byte[] binaryNull = null; public Byte[] BinaryNull { @@ -353,6 +360,7 @@ public static void AssertEquality(ComplexEntity a, ComplexEntity b) Assert.AreEqual(a.DateTime, b.DateTime); Assert.AreEqual(a.DateTimeN, b.DateTimeN); Assert.AreEqual(a.DateTimeNull, b.DateTimeNull); + Assert.AreEqual(a.SingleByte, b.SingleByte); } public static EdmType ComplexEntityPropertyResolver(string pk, string rk, string propName, string propValue) diff --git a/Test/WindowsRuntime/Table/TableOperationUnitTests.cs b/Test/WindowsRuntime/Table/TableOperationUnitTests.cs index 210b76046..feaea3ca0 100644 --- a/Test/WindowsRuntime/Table/TableOperationUnitTests.cs +++ b/Test/WindowsRuntime/Table/TableOperationUnitTests.cs @@ -1599,7 +1599,7 @@ public void FlattenAndRecomposeComplexObjectWithNestedComplexProperties() // Validate IgnoreProperty Attribute Assert.IsFalse(flattenedProperties.ContainsKey("IgnoredProperty")); Assert.IsFalse(flattenedProperties.ContainsKey("InnerComplexEntityWithNestedComplexProperties[ o_0 ]IgnoredProperty")); - Assert.AreEqual(154, flattenedProperties.Count); + Assert.AreEqual(156, flattenedProperties.Count); ComplexEntityWithNestedComplexProperties recomposedObject = TableEntity.ConvertBack(flattenedProperties, entityPropertyConverterOptions, operationContext); diff --git a/changelog.txt b/changelog.txt index 0062ac156..89db8c19f 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,6 @@ +Changes in 8.6.0 : +- Tables : Added support for Byte type property in TableEntity Flatten/ConvertBack methods. + Changes in 8.5.0 : - Files: Added support for creating the snapshot of a share. See the service documentation for more information on how to use this API. From 4d8a6c29455a3ec2eeb9f6a8062a10e7d3347d65 Mon Sep 17 00:00:00 2001 From: Josh Friedman Date: Tue, 12 Sep 2017 16:29:07 -0700 Subject: [PATCH 07/11] For blob tiers support last modified tier time and getting inferred header when listing --- Lib/ClassLibraryCommon/Blob/CloudBlockBlob.cs | 1 + .../Blob/Protocol/BlobHttpResponseParsers.cs | 9 ++++- Lib/Common/Blob/BlobProperties.cs | 11 +++++- Lib/Common/Blob/Protocol/ListBlobsResponse.cs | 14 ++++++- Lib/Common/Shared/Protocol/Constants.cs | 15 ++++++++ Lib/WindowsRuntime/Blob/CloudBlockBlob.cs | 1 + .../Blob/Protocol/BlobHttpResponseParsers.cs | 9 ++++- .../Blob/CloudBlockBlobTest.cs | 37 +++++++++++++++++++ .../Blob/CloudPageBlobTest.cs | 2 +- .../WindowsRuntime/Blob/CloudBlockBlobTest.cs | 33 +++++++++++++++++ Test/WindowsRuntime/Blob/CloudPageBlobTest.cs | 4 +- 11 files changed, 128 insertions(+), 8 deletions(-) diff --git a/Lib/ClassLibraryCommon/Blob/CloudBlockBlob.cs b/Lib/ClassLibraryCommon/Blob/CloudBlockBlob.cs index b2459506f..d155c2dcf 100644 --- a/Lib/ClassLibraryCommon/Blob/CloudBlockBlob.cs +++ b/Lib/ClassLibraryCommon/Blob/CloudBlockBlob.cs @@ -2737,6 +2737,7 @@ private RESTCommand SetStandardBlobTierImpl(StandardBlobTier standardB CloudBlob.UpdateETagLMTLengthAndSequenceNumber(this.attributes, resp, false); this.attributes.Properties.RehydrationStatus = null; + this.attributes.Properties.BlobTierInferred = false; if (resp.StatusCode.Equals(HttpStatusCode.OK)) { this.attributes.Properties.StandardBlobTier = standardBlobTier; diff --git a/Lib/ClassLibraryCommon/Blob/Protocol/BlobHttpResponseParsers.cs b/Lib/ClassLibraryCommon/Blob/Protocol/BlobHttpResponseParsers.cs index bc123ba2c..090f331f6 100644 --- a/Lib/ClassLibraryCommon/Blob/Protocol/BlobHttpResponseParsers.cs +++ b/Lib/ClassLibraryCommon/Blob/Protocol/BlobHttpResponseParsers.cs @@ -148,7 +148,7 @@ public static BlobProperties GetProperties(HttpWebResponse response) properties.StandardBlobTier = standardBlobTier; properties.PremiumPageBlobTier = premiumPageBlobTier; - if (properties.PremiumPageBlobTier.HasValue && !properties.BlobTierInferred.HasValue) + if ((properties.PremiumPageBlobTier.HasValue || properties.StandardBlobTier.HasValue) && !properties.BlobTierInferred.HasValue) { properties.BlobTierInferred = false; } @@ -157,6 +157,13 @@ public static BlobProperties GetProperties(HttpWebResponse response) string rehydrationStatusString = response.Headers[Constants.HeaderConstants.ArchiveStatusHeader]; properties.RehydrationStatus = BlobHttpResponseParsers.GetRehydrationStatus(rehydrationStatusString); + // Get the time the tier of the blob was last modified + string accessTierChangeTimeString = response.Headers[Constants.HeaderConstants.AccessTierChangeTimeHeader]; + if (!string.IsNullOrEmpty(accessTierChangeTimeString)) + { + properties.BlobTierLastModifiedTime = DateTimeOffset.Parse(accessTierChangeTimeString, CultureInfo.InvariantCulture); + } + return properties; } diff --git a/Lib/Common/Blob/BlobProperties.cs b/Lib/Common/Blob/BlobProperties.cs index 650f1ad66..5d3e53916 100644 --- a/Lib/Common/Blob/BlobProperties.cs +++ b/Lib/Common/Blob/BlobProperties.cs @@ -59,6 +59,7 @@ public BlobProperties(BlobProperties other) this.PremiumPageBlobTier = other.PremiumPageBlobTier; this.StandardBlobTier = other.StandardBlobTier; this.RehydrationStatus = other.RehydrationStatus; + this.BlobTierLastModifiedTime = other.BlobTierLastModifiedTime; } /// @@ -195,9 +196,15 @@ public BlobProperties(BlobProperties other) public PremiumPageBlobTier? PremiumPageBlobTier { get; internal set; } /// - /// Gets a value indicating if the tier of the premium page blob has been inferred. + /// Gets a value indicating if the tier of the blob has been inferred. /// - /// A bool representing if the premium blob tier has been inferred. + /// A bool representing if the blob tier has been inferred. public bool? BlobTierInferred { get; internal set; } + + /// + /// Gets the time for when the tier of the blob was last-modified, expressed as a UTC value. + /// + /// A containing the time for when the tier of the blob was last-modified, in UTC format. + public DateTimeOffset? BlobTierLastModifiedTime { get; internal set; } } } diff --git a/Lib/Common/Blob/Protocol/ListBlobsResponse.cs b/Lib/Common/Blob/Protocol/ListBlobsResponse.cs index 6486975bb..4e3465146 100644 --- a/Lib/Common/Blob/Protocol/ListBlobsResponse.cs +++ b/Lib/Common/Blob/Protocol/ListBlobsResponse.cs @@ -211,7 +211,9 @@ private IListBlobEntry ParseBlobEntry(Uri baseUri) string copyDestinationSnapshotTime = null; string blobTierString = null; + bool? blobTierInferred = null; string rehydrationStatusString = null; + DateTimeOffset? blobTierLastModifiedTime = null; this.reader.ReadStartElement(); while (this.reader.IsStartElement()) @@ -355,6 +357,15 @@ private IListBlobEntry ParseBlobEntry(Uri baseUri) rehydrationStatusString = reader.ReadElementContentAsString(); break; + case Constants.AccessTierInferred: + blobTierInferred = reader.ReadElementContentAsBoolean(); + break; + + case Constants.AccessTierChangeTimeElement: + string t = reader.ReadElementContentAsString(); + blobTierLastModifiedTime = DateTimeOffset.Parse(t, CultureInfo.InvariantCulture); + break; + default: reader.Skip(); break; @@ -408,10 +419,11 @@ private IListBlobEntry ParseBlobEntry(Uri baseUri) BlobHttpResponseParsers.GetBlobTier(blob.Properties.BlobType, blobTierString, out standardBlobTier, out premiumPageBlobTier); blob.Properties.StandardBlobTier = standardBlobTier; blob.Properties.PremiumPageBlobTier = premiumPageBlobTier; - blob.Properties.BlobTierInferred = false; } blob.Properties.RehydrationStatus = BlobHttpResponseParsers.GetRehydrationStatus(rehydrationStatusString); + blob.Properties.BlobTierLastModifiedTime = blobTierLastModifiedTime; + blob.Properties.BlobTierInferred = blobTierInferred; return new ListBlobEntry(name, blob); } diff --git a/Lib/Common/Shared/Protocol/Constants.cs b/Lib/Common/Shared/Protocol/Constants.cs index e04887d10..cbac48080 100644 --- a/Lib/Common/Shared/Protocol/Constants.cs +++ b/Lib/Common/Shared/Protocol/Constants.cs @@ -522,6 +522,16 @@ static class Constants /// public const string AccessTierElement = "AccessTier"; + /// + /// Constant for the access tier being inferred. + /// + public const string AccessTierInferred = "AccessTierInferred"; + + /// + /// Constant for the access tier change time. + /// + public const string AccessTierChangeTimeElement = "AccessTierChangeTime"; + /// /// Constant for the archive status. /// @@ -1016,6 +1026,11 @@ static HeaderConstants() /// public const string AccessTierInferredHeader = PrefixForStorageHeader + "access-tier-inferred"; + /// + /// Header for the last time the tier was modified. + /// + public const string AccessTierChangeTimeHeader = PrefixForStorageHeader + "access-tier-change-time"; + /// /// Header that specifies blob caching control. /// diff --git a/Lib/WindowsRuntime/Blob/CloudBlockBlob.cs b/Lib/WindowsRuntime/Blob/CloudBlockBlob.cs index ad9b7b969..04d88443d 100644 --- a/Lib/WindowsRuntime/Blob/CloudBlockBlob.cs +++ b/Lib/WindowsRuntime/Blob/CloudBlockBlob.cs @@ -1193,6 +1193,7 @@ private RESTCommand SetStandardBlobTierImpl(StandardBlobTier standardB CloudBlob.UpdateETagLMTLengthAndSequenceNumber(this.attributes, resp, false); this.attributes.Properties.RehydrationStatus = null; + this.attributes.Properties.BlobTierInferred = false; if (resp.StatusCode.Equals(HttpStatusCode.OK)) { this.attributes.Properties.StandardBlobTier = standardBlobTier; diff --git a/Lib/WindowsRuntime/Blob/Protocol/BlobHttpResponseParsers.cs b/Lib/WindowsRuntime/Blob/Protocol/BlobHttpResponseParsers.cs index 7f7278bf3..e6d742099 100644 --- a/Lib/WindowsRuntime/Blob/Protocol/BlobHttpResponseParsers.cs +++ b/Lib/WindowsRuntime/Blob/Protocol/BlobHttpResponseParsers.cs @@ -156,11 +156,18 @@ public static BlobProperties GetProperties(HttpResponseMessage response) } } - if (properties.PremiumPageBlobTier.HasValue && !properties.BlobTierInferred.HasValue) + if ((properties.PremiumPageBlobTier.HasValue || properties.StandardBlobTier.HasValue) && !properties.BlobTierInferred.HasValue) { properties.BlobTierInferred = false; } + // Get the time the tier of the blob was last modified + string accessTierChangeTimeString = response.Headers.GetHeaderSingleValueOrDefault(Constants.HeaderConstants.AccessTierChangeTimeHeader); + if (!string.IsNullOrEmpty(accessTierChangeTimeString)) + { + properties.BlobTierLastModifiedTime = DateTimeOffset.Parse(accessTierChangeTimeString, CultureInfo.InvariantCulture); + } + return properties; } diff --git a/Test/ClassLibraryCommon/Blob/CloudBlockBlobTest.cs b/Test/ClassLibraryCommon/Blob/CloudBlockBlobTest.cs index 2fbaa44c0..7c56e9a79 100644 --- a/Test/ClassLibraryCommon/Blob/CloudBlockBlobTest.cs +++ b/Test/ClassLibraryCommon/Blob/CloudBlockBlobTest.cs @@ -3180,21 +3180,37 @@ public void CloudBlockBlobSetStandardBlobTier() CloudBlockBlob blob = container.GetBlockBlobReference("blob1"); CreateForTestTask(blob, 2, 1024); + blob.FetchAttributes(); + Assert.IsTrue(blob.Properties.StandardBlobTier.HasValue); + Assert.IsFalse(blob.Properties.PremiumPageBlobTier.HasValue); + Assert.IsTrue(blob.Properties.BlobTierInferred.Value); + + CloudBlockBlob listBlob = (CloudBlockBlob)container.ListBlobs().ToList().First(); + Assert.IsTrue(listBlob.Properties.StandardBlobTier.HasValue); + Assert.IsFalse(listBlob.Properties.PremiumPageBlobTier.HasValue); + Assert.IsTrue(listBlob.Properties.BlobTierInferred.Value); + blob.SetStandardBlobTier(blobTier); Assert.AreEqual(blobTier, blob.Properties.StandardBlobTier.Value); Assert.IsFalse(blob.Properties.PremiumPageBlobTier.HasValue); Assert.IsFalse(blob.Properties.RehydrationStatus.HasValue); + Assert.IsFalse(blob.Properties.BlobTierLastModifiedTime.HasValue); + Assert.IsFalse(blob.Properties.BlobTierInferred.Value); CloudBlockBlob blob2 = container.GetBlockBlobReference("blob1"); blob2.FetchAttributes(); Assert.AreEqual(blobTier, blob2.Properties.StandardBlobTier.Value); Assert.IsFalse(blob2.Properties.PremiumPageBlobTier.HasValue); Assert.IsFalse(blob2.Properties.RehydrationStatus.HasValue); + Assert.IsTrue(blob2.Properties.BlobTierLastModifiedTime.HasValue); + Assert.IsFalse(blob2.Properties.BlobTierInferred.Value); CloudBlockBlob blob3 = (CloudBlockBlob)container.ListBlobs().ToList().First(); Assert.AreEqual(blobTier, blob3.Properties.StandardBlobTier.Value); Assert.IsFalse(blob3.Properties.PremiumPageBlobTier.HasValue); Assert.IsFalse(blob3.Properties.RehydrationStatus.HasValue); + Assert.IsTrue(blob3.Properties.BlobTierLastModifiedTime.HasValue); + Assert.IsFalse(blob3.Properties.BlobTierInferred.HasValue); blob.Delete(); } @@ -3220,38 +3236,55 @@ public void CloudBlockBlobRehydrateBlob() CloudBlockBlob blob = container.GetBlockBlobReference("blob1"); CreateForTestTask(blob, 2, 1024); + Assert.IsFalse(blob.Properties.BlobTierInferred.HasValue); + Assert.IsFalse(blob.Properties.StandardBlobTier.HasValue); + blob.FetchAttributes(); + Assert.IsTrue(blob.Properties.BlobTierInferred.HasValue); + Assert.IsTrue(blob.Properties.StandardBlobTier.HasValue); + Assert.IsFalse(blob.Properties.BlobTierLastModifiedTime.HasValue); + blob.SetStandardBlobTier(StandardBlobTier.Archive); Assert.IsNull(blob.Properties.RehydrationStatus); Assert.AreEqual(StandardBlobTier.Archive, blob.Properties.StandardBlobTier.Value); + Assert.IsFalse(blob.Properties.BlobTierLastModifiedTime.HasValue); + CloudBlockBlob blob2 = container.GetBlockBlobReference("blob2"); CreateForTestTask(blob2, 2, 1024); blob2.SetStandardBlobTier(StandardBlobTier.Archive); Assert.IsNull(blob2.Properties.RehydrationStatus); Assert.AreEqual(StandardBlobTier.Archive, blob2.Properties.StandardBlobTier.Value); + Assert.IsFalse(blob2.Properties.BlobTierLastModifiedTime.HasValue); blob.SetStandardBlobTier(StandardBlobTier.Cool); Assert.AreEqual(StandardBlobTier.Archive, blob.Properties.StandardBlobTier.Value); Assert.IsNull(blob2.Properties.RehydrationStatus); + Assert.IsFalse(blob.Properties.BlobTierLastModifiedTime.HasValue); blob.FetchAttributes(); Assert.AreEqual(RehydrationStatus.PendingToCool, blob.Properties.RehydrationStatus); Assert.AreEqual(StandardBlobTier.Archive, blob.Properties.StandardBlobTier.Value); + Assert.IsTrue(blob.Properties.BlobTierLastModifiedTime.HasValue); blob2.SetStandardBlobTier(StandardBlobTier.Hot); Assert.AreEqual(StandardBlobTier.Archive, blob2.Properties.StandardBlobTier.Value); Assert.IsNull(blob2.Properties.RehydrationStatus); + Assert.IsFalse(blob2.Properties.BlobTierLastModifiedTime.HasValue); blob2.FetchAttributes(); Assert.AreEqual(RehydrationStatus.PendingToHot, blob2.Properties.RehydrationStatus); Assert.AreEqual(StandardBlobTier.Archive, blob2.Properties.StandardBlobTier.Value); + Assert.IsTrue(blob2.Properties.BlobTierLastModifiedTime.HasValue); CloudBlockBlob listBlob = (CloudBlockBlob)container.ListBlobs().ToList().ElementAt(0); Assert.AreEqual(StandardBlobTier.Archive, listBlob.Properties.StandardBlobTier.Value); Assert.IsFalse(listBlob.Properties.PremiumPageBlobTier.HasValue); Assert.AreEqual(RehydrationStatus.PendingToCool, listBlob.Properties.RehydrationStatus.Value); + Assert.IsTrue(listBlob.Properties.BlobTierLastModifiedTime.HasValue); + Assert.AreEqual(listBlob.Properties.BlobTierLastModifiedTime.Value, blob.Properties.BlobTierLastModifiedTime.Value); CloudBlockBlob listBlob2 = (CloudBlockBlob)container.ListBlobs().ToList().ElementAt(1); Assert.AreEqual(StandardBlobTier.Archive, listBlob2.Properties.StandardBlobTier.Value); Assert.IsFalse(listBlob2.Properties.PremiumPageBlobTier.HasValue); Assert.AreEqual(RehydrationStatus.PendingToHot, listBlob2.Properties.RehydrationStatus.Value); + Assert.AreEqual(listBlob2.Properties.BlobTierLastModifiedTime.Value, blob2.Properties.BlobTierLastModifiedTime.Value); blob.Delete(); blob2.Delete(); @@ -3294,6 +3327,7 @@ public void CloudBlockBlobSetBlobTierAPM() Assert.AreEqual(blobTier, blob.Properties.StandardBlobTier.Value); Assert.IsFalse(blob.Properties.PremiumPageBlobTier.HasValue); Assert.IsFalse(blob.Properties.RehydrationStatus.HasValue); + Assert.IsFalse(blob.Properties.BlobTierLastModifiedTime.HasValue); CloudBlockBlob blob2 = container.GetBlockBlobReference("blob1"); result = blob2.BeginFetchAttributes(ar => waitHandle.Set(), null); @@ -3302,6 +3336,7 @@ public void CloudBlockBlobSetBlobTierAPM() Assert.AreEqual(blobTier, blob2.Properties.StandardBlobTier.Value); Assert.IsFalse(blob2.Properties.PremiumPageBlobTier.HasValue); Assert.IsFalse(blob2.Properties.RehydrationStatus.HasValue); + Assert.IsTrue(blob2.Properties.BlobTierLastModifiedTime.HasValue); blob.Delete(); } @@ -3341,12 +3376,14 @@ public void CloudBlockBlobSetStandardBlobTierTask() Assert.AreEqual(blobTier, blob.Properties.StandardBlobTier.Value); Assert.IsFalse(blob.Properties.PremiumPageBlobTier.HasValue); Assert.IsFalse(blob.Properties.RehydrationStatus.HasValue); + Assert.IsFalse(blob.Properties.BlobTierLastModifiedTime.HasValue); CloudBlockBlob blob2 = container.GetBlockBlobReference("blob1"); blob2.FetchAttributesAsync().Wait(); Assert.AreEqual(blobTier, blob2.Properties.StandardBlobTier.Value); Assert.IsFalse(blob2.Properties.PremiumPageBlobTier.HasValue); Assert.IsFalse(blob2.Properties.RehydrationStatus.HasValue); + Assert.IsTrue(blob2.Properties.BlobTierLastModifiedTime.HasValue); } } finally diff --git a/Test/ClassLibraryCommon/Blob/CloudPageBlobTest.cs b/Test/ClassLibraryCommon/Blob/CloudPageBlobTest.cs index 33af2c709..379b4b51f 100644 --- a/Test/ClassLibraryCommon/Blob/CloudPageBlobTest.cs +++ b/Test/ClassLibraryCommon/Blob/CloudPageBlobTest.cs @@ -3921,7 +3921,7 @@ public void CloudPageBlobSetPremiumBlobTier() CloudPageBlob blob3 = (CloudPageBlob)container.ListBlobs().ToList().First(); Assert.AreEqual(PremiumPageBlobTier.P30, blob3.Properties.PremiumPageBlobTier); - Assert.IsFalse(blob3.Properties.BlobTierInferred.Value); + Assert.IsFalse(blob3.Properties.BlobTierInferred.HasValue); CloudPageBlob blob4 = container.GetPageBlobReference("blob4"); blob4.Create(125 * Constants.GB); diff --git a/Test/WindowsRuntime/Blob/CloudBlockBlobTest.cs b/Test/WindowsRuntime/Blob/CloudBlockBlobTest.cs index bd959973b..5f993727b 100644 --- a/Test/WindowsRuntime/Blob/CloudBlockBlobTest.cs +++ b/Test/WindowsRuntime/Blob/CloudBlockBlobTest.cs @@ -1703,23 +1703,40 @@ public async Task CloudBlockBlobSetStandardBlobTierAsync() CloudBlockBlob blob = container.GetBlockBlobReference("blob1"); await CreateForTestAsync(blob, 0, 0); + await blob.FetchAttributesAsync(); + Assert.IsTrue(blob.Properties.StandardBlobTier.HasValue); + Assert.IsFalse(blob.Properties.PremiumPageBlobTier.HasValue); + Assert.IsTrue(blob.Properties.BlobTierInferred.Value); + + BlobResultSegment listBlobsResult = await container.ListBlobsSegmentedAsync(null); + CloudBlockBlob listBlob = (CloudBlockBlob)listBlobsResult.Results.ToList().First(); + Assert.IsTrue(listBlob.Properties.StandardBlobTier.HasValue); + Assert.IsFalse(listBlob.Properties.PremiumPageBlobTier.HasValue); + Assert.IsTrue(listBlob.Properties.BlobTierInferred.Value); await blob.SetStandardBlobTierAsync(blobTier); Assert.AreEqual(blobTier, blob.Properties.StandardBlobTier.Value); Assert.IsFalse(blob.Properties.PremiumPageBlobTier.HasValue); Assert.IsFalse(blob.Properties.RehydrationStatus.HasValue); + Assert.IsFalse(blob.Properties.BlobTierLastModifiedTime.HasValue); + Assert.IsFalse(blob.Properties.BlobTierInferred.Value); CloudBlockBlob blob2 = container.GetBlockBlobReference("blob1"); await blob2.FetchAttributesAsync(); Assert.AreEqual(blobTier, blob2.Properties.StandardBlobTier.Value); Assert.IsFalse(blob2.Properties.PremiumPageBlobTier.HasValue); Assert.IsFalse(blob2.Properties.RehydrationStatus.HasValue); + Assert.IsTrue(blob2.Properties.BlobTierLastModifiedTime.HasValue); + Assert.IsFalse(blob2.Properties.BlobTierInferred.Value); BlobResultSegment results = await container.ListBlobsSegmentedAsync(null); CloudBlockBlob blob3 = (CloudBlockBlob)results.Results.ToList().First(); Assert.AreEqual(blobTier, blob3.Properties.StandardBlobTier.Value); Assert.IsFalse(blob3.Properties.PremiumPageBlobTier.HasValue); Assert.IsFalse(blob3.Properties.RehydrationStatus.HasValue); + Assert.IsTrue(blob3.Properties.BlobTierLastModifiedTime.HasValue); + Assert.IsFalse(blob3.Properties.BlobTierInferred.HasValue); + Assert.AreEqual(blob2.Properties.BlobTierLastModifiedTime.Value, blob3.Properties.BlobTierLastModifiedTime); await blob.DeleteAsync(); } @@ -1745,31 +1762,47 @@ public async Task CloudBlockBlobRehydrateBlobAsync() CloudBlockBlob blob = container.GetBlockBlobReference("blob1"); await CreateForTestAsync(blob, 0, 0); + Assert.IsFalse(blob.Properties.BlobTierInferred.HasValue); + Assert.IsFalse(blob.Properties.StandardBlobTier.HasValue); + await blob.FetchAttributesAsync(); + Assert.IsTrue(blob.Properties.BlobTierInferred.HasValue); + Assert.IsTrue(blob.Properties.StandardBlobTier.HasValue); + Assert.IsFalse(blob.Properties.BlobTierLastModifiedTime.HasValue); + await blob.SetStandardBlobTierAsync(StandardBlobTier.Archive); Assert.IsNull(blob.Properties.RehydrationStatus); Assert.AreEqual(StandardBlobTier.Archive, blob.Properties.StandardBlobTier.Value); + Assert.IsFalse(blob.Properties.BlobTierLastModifiedTime.HasValue); + CloudBlockBlob blob2 = container.GetBlockBlobReference("blob2"); await CreateForTestAsync(blob2, 0, 0); await blob2.SetStandardBlobTierAsync(StandardBlobTier.Archive); + Assert.IsFalse(blob2.Properties.BlobTierLastModifiedTime.HasValue); await blob.SetStandardBlobTierAsync(StandardBlobTier.Cool); Assert.AreEqual(StandardBlobTier.Archive, blob.Properties.StandardBlobTier.Value); Assert.IsNull(blob.Properties.RehydrationStatus); + Assert.IsFalse(blob.Properties.BlobTierLastModifiedTime.HasValue); + await blob.FetchAttributesAsync(); Assert.AreEqual(RehydrationStatus.PendingToCool, blob.Properties.RehydrationStatus); Assert.AreEqual(StandardBlobTier.Archive, blob.Properties.StandardBlobTier.Value); + Assert.IsTrue(blob.Properties.BlobTierLastModifiedTime.HasValue); await blob2.SetStandardBlobTierAsync(StandardBlobTier.Hot); Assert.AreEqual(StandardBlobTier.Archive, blob2.Properties.StandardBlobTier.Value); Assert.IsNull(blob2.Properties.RehydrationStatus); + await blob2.FetchAttributesAsync(); Assert.AreEqual(RehydrationStatus.PendingToHot, blob2.Properties.RehydrationStatus); Assert.AreEqual(StandardBlobTier.Archive, blob2.Properties.StandardBlobTier.Value); + Assert.IsTrue(blob2.Properties.BlobTierLastModifiedTime.HasValue); CloudBlockBlob listBlob = (CloudBlockBlob)container.ListBlobsSegmentedAsync(null).Result.Results.ToList().ElementAt(0); Assert.AreEqual(StandardBlobTier.Archive, listBlob.Properties.StandardBlobTier.Value); Assert.IsFalse(listBlob.Properties.PremiumPageBlobTier.HasValue); Assert.AreEqual(RehydrationStatus.PendingToCool, listBlob.Properties.RehydrationStatus.Value); + Assert.IsTrue(listBlob.Properties.BlobTierLastModifiedTime.HasValue); CloudBlockBlob listBlob2 = (CloudBlockBlob)container.ListBlobsSegmentedAsync(null).Result.Results.ToList().ElementAt(1); Assert.AreEqual(StandardBlobTier.Archive, listBlob2.Properties.StandardBlobTier.Value); diff --git a/Test/WindowsRuntime/Blob/CloudPageBlobTest.cs b/Test/WindowsRuntime/Blob/CloudPageBlobTest.cs index a5db686ea..08e0c5d68 100644 --- a/Test/WindowsRuntime/Blob/CloudPageBlobTest.cs +++ b/Test/WindowsRuntime/Blob/CloudPageBlobTest.cs @@ -1416,7 +1416,7 @@ public async Task CloudPageBlobSetPremiumBlobTierOnCreateAsync() BlobResultSegment results = await container.ListBlobsSegmentedAsync(null); CloudPageBlob blob3 = (CloudPageBlob)results.Results.ToList().First(); Assert.AreEqual(PremiumPageBlobTier.P30, blob3.Properties.PremiumPageBlobTier); - Assert.IsFalse(blob3.Properties.BlobTierInferred.Value); + Assert.IsFalse(blob3.Properties.BlobTierInferred.HasValue); byte[] data = GetRandomBuffer(512); @@ -1491,7 +1491,7 @@ public async Task CloudPageBlobSetPremiumBlobTierAsync() BlobResultSegment results = await container.ListBlobsSegmentedAsync(null); CloudPageBlob blob3 = (CloudPageBlob)results.Results.ToList().First(); Assert.AreEqual(PremiumPageBlobTier.P30, blob3.Properties.PremiumPageBlobTier); - Assert.IsFalse(blob3.Properties.BlobTierInferred.Value); + Assert.IsFalse(blob3.Properties.BlobTierInferred.HasValue); Assert.IsFalse(blob3.Properties.StandardBlobTier.HasValue); Assert.IsFalse(blob3.Properties.RehydrationStatus.HasValue); From 812f8f9866e0ce23f28bc3bcdb3edcdf09f623c8 Mon Sep 17 00:00:00 2001 From: erezvani Date: Mon, 13 Nov 2017 13:55:35 -0800 Subject: [PATCH 08/11] AccountSAS Test fixes-Serverside update:No IP returned in ErrorMessage --- .gitignore | 13 +- Test/ClassLibraryCommon/AccountSASTests.cs | 46 +-- .../Blob/CloudBlockBlobTest.cs | 4 +- Test/ClassLibraryCommon/Blob/SASTests.cs | 16 +- Test/ClassLibraryCommon/File/FileSASTests.cs | 5 +- .../Queue/CloudQueueTest.cs | 5 +- .../Table/SAS/TableSasUnitTests.cs | 5 +- Test/WindowsRuntime/AccountSasTests.cs | 298 +----------------- 8 files changed, 22 insertions(+), 370 deletions(-) diff --git a/.gitignore b/.gitignore index 2851a9a1c..c4a01a254 100644 --- a/.gitignore +++ b/.gitignore @@ -113,7 +113,7 @@ AppPackages/ Packages/ # Test Config -Test/Common/TestConfigurations.xml +*TestConfigurations.xml # Fiddler dlls Test/FaultInjection/Dependencies/DotNet2/FiddlerCore.dll @@ -139,15 +139,8 @@ objfre/ *.playlist # NetCore Dependency -Lib/AspNet/Microsoft.WindowsAzure.Storage/project.lock.json -Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/project.lock.json -Test/AspNet/Microsoft.WindowsAzure.Storage.Test/TestConfigurations.xml -Test/AspNet/Facade/Microsoft.WindowsAzure.Storage.Facade.NetCore.Test/TestConfigurations.xml -Test/AspNet/Microsoft.WindowsAzure.Storage.Test/project.lock.json -Test/AspNet/XUnitForMsTest/project.lock.json -Test/AspNet/Facade/Microsoft.WindowsAzure.Storage.Facade.NetCore.Test/project.lock.json -Test/AspNet/Facade/Microsoft.WindowsAzure.Storage.Facade.PhoneSilverlight81.Test/project.lock.json -Test/AspNet/Facade/Microsoft.WindowsAzure.Storage.Facade.Portable/project.lock.json +*project.lock.json + # VS14 Misc. UpgradeLog.htm diff --git a/Test/ClassLibraryCommon/AccountSASTests.cs b/Test/ClassLibraryCommon/AccountSASTests.cs index 466f19ef2..7d54860f9 100644 --- a/Test/ClassLibraryCommon/AccountSASTests.cs +++ b/Test/ClassLibraryCommon/AccountSASTests.cs @@ -983,10 +983,6 @@ public void AccountSASStartExpiryTimes() public void AccountSASSignedIPs() { IPAddress invalidIP = IPAddress.Parse("255.255.255.255"); - IPAddress myBlobIP = GetMyBlobIPAddressFromService(); - IPAddress myQueueIP = GetMyQueueIPAddressFromService(); - IPAddress myTableIP = GetMyTableIPAddressFromService(); - IPAddress myFileIP = GetMyFileIPAddressFromService(); SharedAccessAccountPolicy policy = GetPolicyWithFullPermissions(); policy.IPAddressOrRange = new IPAddressOrRange(invalidIP.ToString()); @@ -996,13 +992,10 @@ public void AccountSASSignedIPs() RunQueueTest(policy, action => TestHelper.ExpectedException(() => action(), "Operation should have failed with invalid IP access."), null); RunFileTest(policy, action => TestHelper.ExpectedException(() => action(), "Operation should have failed with invalid IP access."), null); - policy.IPAddressOrRange = new IPAddressOrRange(myBlobIP.ToString()); + policy.IPAddressOrRange = null; RunBlobTest(policy, action => action(), null); - policy.IPAddressOrRange = new IPAddressOrRange(myTableIP.ToString()); RunTableTest(policy, action => action(), null); - policy.IPAddressOrRange = new IPAddressOrRange(myQueueIP.ToString()); RunQueueTest(policy, action => action(), null); - policy.IPAddressOrRange = new IPAddressOrRange(myFileIP.ToString()); RunFileTest(policy, action => action(), null); policy.IPAddressOrRange = new IPAddressOrRange(IPAddress.Parse("255.255.255.0").ToString(), invalidIP.ToString()); @@ -1011,38 +1004,6 @@ public void AccountSASSignedIPs() RunTableTest(policy, action => TestHelper.ExpectedException(() => action(), "Operation should have failed with invalid IP access."), null); RunQueueTest(policy, action => TestHelper.ExpectedException(() => action(), "Operation should have failed with invalid IP access."), null); RunFileTest(policy, action => TestHelper.ExpectedException(() => action(), "Operation should have failed with invalid IP access."), null); - - byte[] actualBlobAddressBytes = myBlobIP.GetAddressBytes(); - byte[] initialBlobAddressBytes = actualBlobAddressBytes.ToArray(); - initialBlobAddressBytes[0]--; - byte[] finalBlobAddressBytes = actualBlobAddressBytes.ToArray(); - finalBlobAddressBytes[0]++; - policy.IPAddressOrRange = new IPAddressOrRange(new IPAddress(initialBlobAddressBytes).ToString(), new IPAddress(finalBlobAddressBytes).ToString()); - RunBlobTest(policy, action => action(), null); - - byte[] actualTableAddressBytes = myTableIP.GetAddressBytes(); - byte[] initialTableAddressBytes = actualTableAddressBytes.ToArray(); - initialTableAddressBytes[0]--; - byte[] finalTableAddressBytes = actualTableAddressBytes.ToArray(); - finalTableAddressBytes[0]++; - policy.IPAddressOrRange = new IPAddressOrRange(new IPAddress(initialTableAddressBytes).ToString(), new IPAddress(finalTableAddressBytes).ToString()); - RunTableTest(policy, action => action(), null); - - byte[] actualQueueAddressBytes = myQueueIP.GetAddressBytes(); - byte[] initialQueueAddressBytes = actualQueueAddressBytes.ToArray(); - initialQueueAddressBytes[0]--; - byte[] finalQueueAddressBytes = actualQueueAddressBytes.ToArray(); - finalQueueAddressBytes[0]++; - policy.IPAddressOrRange = new IPAddressOrRange(new IPAddress(initialQueueAddressBytes).ToString(), new IPAddress(finalQueueAddressBytes).ToString()); - RunQueueTest(policy, action => action(), null); - - byte[] actualFileAddressBytes = myFileIP.GetAddressBytes(); - byte[] initialFileAddressBytes = actualFileAddressBytes.ToArray(); - initialFileAddressBytes[0]--; - byte[] finalFileAddressBytes = actualFileAddressBytes.ToArray(); - finalFileAddressBytes[0]++; - policy.IPAddressOrRange = new IPAddressOrRange(new IPAddress(initialFileAddressBytes).ToString(), new IPAddress(finalFileAddressBytes).ToString()); - RunFileTest(policy, action => action(), null); } [TestMethod] @@ -1207,12 +1168,13 @@ public void AccountSASSample() catch (StorageException) { exceptionThrown = true; - Assert.IsNotNull(actualIP); + //The IP should not be included in the error details for security reasons + Assert.IsNull(actualIP); } Assert.IsTrue(exceptionThrown); - policy.IPAddressOrRange = new IPAddressOrRange(actualIP.ToString()); + policy.IPAddressOrRange = null; accountSASToken = account.GetSharedAccessSignature(policy); accountSAS = new StorageCredentials(accountSASToken); accountWithSAS = new CloudStorageAccount(accountSAS, blobClient.StorageUri, null, null, null); diff --git a/Test/ClassLibraryCommon/Blob/CloudBlockBlobTest.cs b/Test/ClassLibraryCommon/Blob/CloudBlockBlobTest.cs index 7c56e9a79..76cce5902 100644 --- a/Test/ClassLibraryCommon/Blob/CloudBlockBlobTest.cs +++ b/Test/ClassLibraryCommon/Blob/CloudBlockBlobTest.cs @@ -1972,7 +1972,7 @@ public void CloudBlockBlobUploadFromStreamWithAccessCondition() TestHelper.ExpectedException( () => this.CloudBlockBlobUploadFromStream(container, 2 * Constants.MB, null, accessCondition, true, false, 0, false, true), "Uploading a blob on top of an non-existing blob should fail when the ETag doesn't match", - HttpStatusCode.PreconditionFailed); + HttpStatusCode.NotFound); accessCondition = AccessCondition.GenerateIfNoneMatchCondition(blob.Properties.ETag); this.CloudBlockBlobUploadFromStream(container, 2 * Constants.MB, null, accessCondition, true, true, 0, false, true); this.CloudBlockBlobUploadFromStream(container, 2 * Constants.MB, null, accessCondition, true, false, 0, false, true); @@ -2021,7 +2021,7 @@ public void CloudBlockBlobUploadFromStreamAPMWithAccessCondition() TestHelper.ExpectedException( () => this.CloudBlockBlobUploadFromStream(container, 2 * Constants.MB, null, accessCondition, true, false, 0, true, true), "Uploading a blob on top of an non-existing blob should fail when the ETag doesn't match", - HttpStatusCode.PreconditionFailed); + HttpStatusCode.NotFound); accessCondition = AccessCondition.GenerateIfNoneMatchCondition(blob.Properties.ETag); this.CloudBlockBlobUploadFromStream(container, 2 * Constants.MB, null, accessCondition, true, true, 0, true, true); diff --git a/Test/ClassLibraryCommon/Blob/SASTests.cs b/Test/ClassLibraryCommon/Blob/SASTests.cs index 70219309c..f6a21dfa5 100644 --- a/Test/ClassLibraryCommon/Blob/SASTests.cs +++ b/Test/ClassLibraryCommon/Blob/SASTests.cs @@ -700,17 +700,6 @@ public void CloudBlobSASIPAddressHelper(Func generateInitialIP byte[] target = new byte[4]; OperationContext opContext = new OperationContext(); IPAddress actualIP = null; - opContext.ResponseReceived += (sender, e) => - { - Stream stream = e.Response.GetResponseStream(); - stream.Seek(0, SeekOrigin.Begin); - using (StreamReader reader = new StreamReader(stream)) - { - string text = reader.ReadToEnd(); - XDocument xdocument = XDocument.Parse(text); - actualIP = IPAddress.Parse(xdocument.Descendants("SourceIP").First().Value); - } - }; bool exceptionThrown = false; try @@ -720,11 +709,12 @@ public void CloudBlobSASIPAddressHelper(Func generateInitialIP catch (StorageException) { exceptionThrown = true; - Assert.IsNotNull(actualIP); + //The IP should not be included in the error details for security reasons + Assert.IsNull(actualIP); } Assert.IsTrue(exceptionThrown); - ipAddressOrRange = generateFinalIPAddressOrRange(actualIP); + ipAddressOrRange = null; blockBlobToken = blockBlob.GetSharedAccessSignature(policy, null, null, null, ipAddressOrRange); blockBlobSAS = new StorageCredentials(blockBlobToken); blockBlobSASUri = blockBlobSAS.TransformUri(blockBlob.Uri); diff --git a/Test/ClassLibraryCommon/File/FileSASTests.cs b/Test/ClassLibraryCommon/File/FileSASTests.cs index d97683b99..70034db26 100644 --- a/Test/ClassLibraryCommon/File/FileSASTests.cs +++ b/Test/ClassLibraryCommon/File/FileSASTests.cs @@ -358,11 +358,12 @@ public void CloudFileSASIPAddressHelper(Func generateInitialIP catch (StorageException) { exceptionThrown = true; - Assert.IsNotNull(actualIP); + //The IP should not be included in the error details for security reasons + Assert.IsNull(actualIP); } Assert.IsTrue(exceptionThrown); - ipAddressOrRange = generateFinalIPAddressOrRange(actualIP); + ipAddressOrRange = null; fileToken = fileWithKey.GetSharedAccessSignature(policy, null, null, null, ipAddressOrRange); fileSAS = new StorageCredentials(fileToken); fileSASUri = fileSAS.TransformUri(fileWithKey.Uri); diff --git a/Test/ClassLibraryCommon/Queue/CloudQueueTest.cs b/Test/ClassLibraryCommon/Queue/CloudQueueTest.cs index 5d9839e6e..d4267f973 100644 --- a/Test/ClassLibraryCommon/Queue/CloudQueueTest.cs +++ b/Test/ClassLibraryCommon/Queue/CloudQueueTest.cs @@ -1462,11 +1462,12 @@ public void CloudQueueSASIPAddressHelper(Func generateInitialI catch (StorageException) { exceptionThrown = true; - Assert.IsNotNull(actualIP); + //The IP should not be included in the error details for security reasons + Assert.IsNull(actualIP); } Assert.IsTrue(exceptionThrown); - ipAddressOrRange = generateFinalIPAddressOrRange(actualIP); + ipAddressOrRange = null; queueToken = queue.GetSharedAccessSignature(policy, null, null, ipAddressOrRange); queueSAS = new StorageCredentials(queueToken); queueSASUri = queueSAS.TransformUri(queue.Uri); diff --git a/Test/ClassLibraryCommon/Table/SAS/TableSasUnitTests.cs b/Test/ClassLibraryCommon/Table/SAS/TableSasUnitTests.cs index 722c3562b..e11b28673 100644 --- a/Test/ClassLibraryCommon/Table/SAS/TableSasUnitTests.cs +++ b/Test/ClassLibraryCommon/Table/SAS/TableSasUnitTests.cs @@ -1257,13 +1257,12 @@ public void CloudTableSASIPAddressHelper(Func generateInitialI catch (StorageException e) { string[] parts = e.RequestInformation.HttpStatusMessage.Split(' '); - actualIP = IPAddress.Parse(parts[parts.Length - 1].Trim('.')); exceptionThrown = true; - Assert.IsNotNull(actualIP); + Assert.IsNull(actualIP); } Assert.IsTrue(exceptionThrown); - ipAddressOrRange = generateFinalIPAddressOrRange(actualIP); + ipAddressOrRange = null; tableToken = table.GetSharedAccessSignature(policy, null, null, null, null, null, null, ipAddressOrRange); tableSAS = new StorageCredentials(tableToken); tableSASUri = tableSAS.TransformUri(table.Uri); diff --git a/Test/WindowsRuntime/AccountSasTests.cs b/Test/WindowsRuntime/AccountSasTests.cs index b7e04ab0b..83f905217 100644 --- a/Test/WindowsRuntime/AccountSasTests.cs +++ b/Test/WindowsRuntime/AccountSasTests.cs @@ -225,20 +225,13 @@ public async Task AccountSASSignedIPs() await TestHelper.ExpectedExceptionAsync((async () => await RunTableTest(policy, null, opContext)), opContext, "Operation should have failed with invalid IP access.", HttpStatusCode.Forbidden, "AuthorizationSourceIPMismatch"); await TestHelper.ExpectedExceptionAsync((async () => await RunFileTest(policy, null, opContext)), opContext, "Operation should have failed with invalid IP access.", HttpStatusCode.Forbidden, "AuthorizationSourceIPMismatch"); - string myBlobIP = await GetMyBlobIPAddressFromService(); - policy.IPAddressOrRange = new IPAddressOrRange(new HostName(myBlobIP).ToString()); + policy.IPAddressOrRange = null; await RunBlobTest(policy, null); - string myTableIP = await GetMyTableIPAddressFromService(); - policy.IPAddressOrRange = new IPAddressOrRange(new HostName(myTableIP).ToString()); await RunTableTest(policy, null); - string myQueueIP = await GetMyQueueIPAddressFromService(); - policy.IPAddressOrRange = new IPAddressOrRange(new HostName(myQueueIP).ToString()); await RunQueueTest(policy, null); - string myFileIP = await GetMyFileIPAddressFromService(); - policy.IPAddressOrRange = new IPAddressOrRange(new HostName(myFileIP).ToString()); await RunFileTest(policy, null); policy.IPAddressOrRange = new IPAddressOrRange(new HostName("255.255.255.0").ToString(), invalidIP.ToString()); @@ -247,42 +240,6 @@ public async Task AccountSASSignedIPs() await TestHelper.ExpectedExceptionAsync((async () => await RunQueueTest(policy, null, opContext)), opContext, "Operation should have failed with invalid IP access.", HttpStatusCode.Forbidden, "AuthorizationSourceIPMismatch"); await TestHelper.ExpectedExceptionAsync((async () => await RunTableTest(policy, null, opContext)), opContext, "Operation should have failed with invalid IP access.", HttpStatusCode.Forbidden, "AuthorizationSourceIPMismatch"); await TestHelper.ExpectedExceptionAsync((async () => await RunFileTest(policy, null, opContext)), opContext, "Operation should have failed with invalid IP access.", HttpStatusCode.Forbidden, "AuthorizationSourceIPMismatch"); - - string blobFirstTwelveString = myBlobIP.Substring(0, myBlobIP.LastIndexOf('.')); - string blobLastFourString = myBlobIP.Substring(myBlobIP.LastIndexOf('.') + 1); - int blobLastFourInt = int.Parse(blobLastFourString); - - string initialBlobAddress = blobFirstTwelveString + "." + (blobLastFourInt - 1).ToString(); - string endBlobAddress = blobFirstTwelveString + "." + (blobLastFourInt + 1).ToString(); - policy.IPAddressOrRange = new IPAddressOrRange(new HostName(initialBlobAddress).ToString(), new HostName(endBlobAddress).ToString()); - await RunBlobTest(policy, null); - - string tableFirstTwelveString = myTableIP.Substring(0, myTableIP.LastIndexOf('.')); - string tableLastFourString = myTableIP.Substring(myTableIP.LastIndexOf('.') + 1); - int tableLastFourInt = int.Parse(tableLastFourString); - - string initialTableAddress = tableFirstTwelveString + "." + (tableLastFourInt - 1).ToString(); - string endTableAddress = tableFirstTwelveString + "." + (tableLastFourInt + 1).ToString(); - policy.IPAddressOrRange = new IPAddressOrRange(new HostName(initialTableAddress).ToString(), new HostName(endTableAddress).ToString()); - await RunTableTest(policy, null); - - string queueFirstTwelveString = myQueueIP.Substring(0, myQueueIP.LastIndexOf('.')); - string queueLastFourString = myQueueIP.Substring(myQueueIP.LastIndexOf('.') + 1); - int queueLastFourInt = int.Parse(queueLastFourString); - - string initialQueueAddress = queueFirstTwelveString + "." + (queueLastFourInt - 1).ToString(); - string endQueueAddress = queueFirstTwelveString + "." + (queueLastFourInt + 1).ToString(); - policy.IPAddressOrRange = new IPAddressOrRange(new HostName(initialQueueAddress).ToString(), new HostName(endQueueAddress).ToString()); - await RunQueueTest(policy, null); - - string fileFirstTwelveString = myFileIP.Substring(0, myFileIP.LastIndexOf('.')); - string fileLastFourString = myFileIP.Substring(myFileIP.LastIndexOf('.') + 1); - int fileLastFourInt = int.Parse(fileLastFourString); - - string initialFileAddress = fileFirstTwelveString + "." + (fileLastFourInt - 1).ToString(); - string endFileAddress = fileFirstTwelveString + "." + (fileLastFourInt + 1).ToString(); - policy.IPAddressOrRange = new IPAddressOrRange(new HostName(initialFileAddress).ToString(), new HostName(endFileAddress).ToString()); - await RunFileTest(policy, null); } [TestMethod] @@ -1091,258 +1048,7 @@ public async Task RunFileTest(SharedAccessAccountPolicy policy, int? httpsPort, fileClient.GetShareReference(shareName).DeleteIfExistsAsync().Wait(); } } - - private async Task GetMyBlobIPAddressFromService() - { - CloudBlobClient blobClient = GenerateCloudBlobClient(); - string containerName = "c" + Guid.NewGuid().ToString("N"); - CloudBlobContainer container = blobClient.GetContainerReference(containerName); - try - { - await container.CreateAsync(); - string blobName = "blob"; - CloudBlockBlob blockBlob = container.GetBlockBlobReference(blobName); - byte[] data = new byte[] { 0x1, 0x2, 0x3, 0x4 }; - await blockBlob.UploadFromByteArrayAsync(data, 0, 4); - - SharedAccessAccountPolicy policy = GetPolicyWithFullPermissions(); - HostName invalidIP = new HostName("255.255.255.255"); - policy.IPAddressOrRange = new IPAddressOrRange(invalidIP.ToString()); - - CloudStorageAccount account = new CloudStorageAccount(blobClient.Credentials, false); - string accountSASToken = account.GetSharedAccessSignature(policy); - StorageCredentials accountSAS = new StorageCredentials(accountSASToken); - CloudStorageAccount accountWithSAS = new CloudStorageAccount(accountSAS, blobClient.StorageUri, null, null, null); - CloudBlobClient blobClientWithSAS = accountWithSAS.CreateCloudBlobClient(); - CloudBlobContainer containerWithSAS = blobClientWithSAS.GetContainerReference(containerName); - CloudBlockBlob blockblobWithSAS = containerWithSAS.GetBlockBlobReference(blobName); - - byte[] target = new byte[4]; - string actualIP = null; - bool exceptionThrown = false; - try - { - await blockblobWithSAS.DownloadRangeToByteArrayAsync(target, 0, 0, 4); - } - catch (StorageException e) - { - actualIP = e.RequestInformation.ExtendedErrorInformation.AdditionalDetails["SourceIP"]; - exceptionThrown = true; - Assert.IsNotNull(actualIP); - } - - Assert.IsTrue(exceptionThrown); - return actualIP; - } - finally - { - container.DeleteIfExistsAsync().Wait(); - } - } - - private async Task GetMyQueueIPAddressFromService() - { - CloudQueueClient queueClient = GenerateCloudQueueClient(); - string queueName = "c" + Guid.NewGuid().ToString("N"); - CloudQueue queue = queueClient.GetQueueReference(queueName); - try - { - await queue.CreateAsync(); - CloudQueueMessage message = new CloudQueueMessage("content"); - await queue.AddMessageAsync(message); - - SharedAccessAccountPolicy policy = GetPolicyWithFullPermissions(); - HostName invalidIP = new HostName("255.255.255.255"); - policy.IPAddressOrRange = new IPAddressOrRange(invalidIP.ToString()); - - CloudStorageAccount account = new CloudStorageAccount(queueClient.Credentials, false); - string accountSASToken = account.GetSharedAccessSignature(policy); - StorageCredentials accountSAS = new StorageCredentials(accountSASToken); - CloudStorageAccount accountWithSAS = new CloudStorageAccount(accountSAS, null, queueClient.StorageUri, null, null); - CloudQueueClient queueClientWithSAS = accountWithSAS.CreateCloudQueueClient(); - CloudQueue queueWithSAS = queueClientWithSAS.GetQueueReference(queueName); - - string actualIP = null; - bool exceptionThrown = false; - try - { - await queueWithSAS.GetMessageAsync(); - } - catch (StorageException e) - { - actualIP = e.RequestInformation.ExtendedErrorInformation.AdditionalDetails["SourceIP"]; - exceptionThrown = true; - Assert.IsNotNull(actualIP); - } - - Assert.IsTrue(exceptionThrown); - return actualIP; - } - finally - { - queue.DeleteIfExistsAsync().Wait(); - } - } - - private async Task GetMyTableIPAddressFromService() - { - CloudTableClient tableClient = GenerateCloudTableClient(); - string tableName = "c" + Guid.NewGuid().ToString("N"); - CloudTable table = tableClient.GetTableReference(tableName); - try - { - await table.CreateAsync(); - - string propName = "prop"; - int propValue = 4; - DynamicTableEntity entity1 = new DynamicTableEntity(); - - string partitionKey = "PK"; - string rowKeyPrefix = "RK"; - entity1.PartitionKey = partitionKey; - entity1.RowKey = rowKeyPrefix + "1"; - entity1.Properties = new Dictionary() { { propName, EntityProperty.GeneratePropertyForInt(propValue) } }; - - await table.ExecuteAsync(TableOperation.Insert(entity1)); - - SharedAccessAccountPolicy policy = GetPolicyWithFullPermissions(); - HostName invalidIP = new HostName("255.255.255.255"); - policy.IPAddressOrRange = new IPAddressOrRange(invalidIP.ToString()); - - CloudStorageAccount account = new CloudStorageAccount(tableClient.Credentials, false); - string accountSASToken = account.GetSharedAccessSignature(policy); - StorageCredentials accountSAS = new StorageCredentials(accountSASToken); - CloudStorageAccount accountWithSAS = new CloudStorageAccount(accountSAS, null, null, tableClient.StorageUri, null); - CloudTableClient tableClientWithSAS = accountWithSAS.CreateCloudTableClient(); - CloudTable tableWithSAS = tableClientWithSAS.GetTableReference(tableName); - - string actualIP = null; - bool exceptionThrown = false; - - try - { - TableQuery query = new TableQuery().Where(string.Format("(PartitionKey eq '{0}') and (RowKey eq '{1}')", entity1.PartitionKey, entity1.RowKey)); - (await tableWithSAS.ExecuteQuerySegmentedAsync(query, null)).First(); - } - catch (StorageException e) - { - string[] parts = e.RequestInformation.HttpStatusMessage.Split(' '); - actualIP = parts[parts.Length - 1].Trim('.'); - exceptionThrown = true; - Assert.IsNotNull(actualIP); - } - - Assert.IsTrue(exceptionThrown); - return actualIP; - } - finally - { - table.DeleteIfExistsAsync().Wait(); - } - } - - private async Task GetMyFileIPAddressFromService() - { - CloudFileClient fileClient = GenerateCloudFileClient(); - string shareName = "c" + Guid.NewGuid().ToString("N"); - CloudFileShare share = fileClient.GetShareReference(shareName); - try - { - await share.CreateAsync(); - string fileName = "file"; - await share.GetRootDirectoryReference().CreateIfNotExistsAsync(); - CloudFile file = share.GetRootDirectoryReference().GetFileReference(fileName); - await file.CreateAsync(1024); - byte[] data = new byte[] { 0x1, 0x2, 0x3, 0x4 }; - await file.UploadFromByteArrayAsync(data, 0, 4); - - SharedAccessAccountPolicy policy = GetPolicyWithFullPermissions(); - HostName invalidIP = new HostName("255.255.255.255"); - policy.IPAddressOrRange = new IPAddressOrRange(invalidIP.ToString()); - - CloudStorageAccount account = new CloudStorageAccount(fileClient.Credentials, false); - string accountSASToken = account.GetSharedAccessSignature(policy); - StorageCredentials accountSAS = new StorageCredentials(accountSASToken); - CloudStorageAccount accountWithSAS = new CloudStorageAccount(accountSAS, null, null, null, fileClient.StorageUri); - CloudFileClient fileClientWithSAS = accountWithSAS.CreateCloudFileClient(); - CloudFileShare shareWithSAS = fileClientWithSAS.GetShareReference(shareName); - CloudFile fileWithSAS = shareWithSAS.GetRootDirectoryReference().GetFileReference(fileName); - - byte[] target = new byte[4]; - string actualIP = null; - bool exceptionThrown = false; - try - { - await fileWithSAS.DownloadRangeToByteArrayAsync(target, 0, 0, 4); - } - catch (StorageException e) - { - actualIP = e.RequestInformation.ExtendedErrorInformation.AdditionalDetails["SourceIP"]; - exceptionThrown = true; - Assert.IsNotNull(actualIP); - } - - Assert.IsTrue(exceptionThrown); - return actualIP; - } - finally - { - share.DeleteIfExistsAsync().Wait(); - } - } - - private async Task GetMyIPAddressFromService() - { - CloudBlobClient blobClient = GenerateCloudBlobClient(); - string containerName = "c" + Guid.NewGuid().ToString("N"); - CloudBlobContainer container = blobClient.GetContainerReference(containerName); - try - { - await container.CreateAsync(); - - string blobName = "blob"; - CloudBlockBlob blockBlob = container.GetBlockBlobReference(blobName); - byte[] data = new byte[] { 0x1, 0x2, 0x3, 0x4 }; - await blockBlob.UploadFromByteArrayAsync(data, 0, 4); - - SharedAccessAccountPolicy policy = GetPolicyWithFullPermissions(); - HostName invalidIP = new HostName("255.255.255.255"); - policy.IPAddressOrRange = new IPAddressOrRange(invalidIP.ToString()); - - CloudStorageAccount account = new CloudStorageAccount(blobClient.Credentials, false); - string accountSASToken = account.GetSharedAccessSignature(policy); - StorageCredentials accountSAS = new StorageCredentials(accountSASToken); - CloudStorageAccount accountWithSAS = new CloudStorageAccount(accountSAS, blobClient.StorageUri, null, null, null); - CloudBlobClient blobClientWithSAS = accountWithSAS.CreateCloudBlobClient(); - CloudBlobContainer containerWithSAS = blobClientWithSAS.GetContainerReference(containerName); - CloudBlockBlob blockblobWithSAS = containerWithSAS.GetBlockBlobReference(blobName); - - byte[] target = new byte[4]; - OperationContext opContext = new OperationContext(); - string actualIP = null; - - bool exceptionThrown = false; - try - { - await blockblobWithSAS.DownloadRangeToByteArrayAsync(target, 0, 0, 4, null, null, opContext); - } - catch (StorageException e) - { - exceptionThrown = true; - actualIP = e.RequestInformation.ExtendedErrorInformation.AdditionalDetails["SourceIP"]; - Assert.IsNotNull(actualIP); - } - - Assert.IsTrue(exceptionThrown); - return actualIP; - } - finally - { - container.DeleteIfExistsAsync().Wait(); - } - - } - + private SharedAccessAccountPolicy GetPolicyWithFullPermissions() { SharedAccessAccountPolicy policy = new SharedAccessAccountPolicy(); From 6815736aed78dd813b8b05038cadc6a2a798e254 Mon Sep 17 00:00:00 2001 From: erezvani Date: Mon, 13 Nov 2017 14:09:15 -0800 Subject: [PATCH 09/11] [8.6]Update Assembly Versions --- ...rosoft.WindowsAzure.Storage.Shared.Protocol.Constants.cs | 2 +- ...dowsAzure.Storage.Shared.Protocol.EncryptionConstants.cs | 2 +- ....WindowsAzure.Storage.Shared.Protocol.HeaderConstants.cs | 4 ++-- .../Properties/AssemblyInfo.cs | 4 ++-- .../Microsoft.WindowsAzure.Storage.Facade/project.json | 2 +- Lib/AspNet/Microsoft.WindowsAzure.Storage/AssemblyInfo.cs | 6 +++--- .../WindowsAzure.StorageK.nuspec | 2 +- Lib/AspNet/Microsoft.WindowsAzure.Storage/project.json | 2 +- Lib/Common/Shared/Protocol/Constants.cs | 2 +- Lib/WindowsDesktop/Properties/AssemblyInfo.cs | 4 ++-- Lib/WindowsPhone/Properties/AssemblyInfo.cs | 4 ++-- Lib/WindowsPhoneRT/Properties/AssemblyInfo.cs | 4 ++-- Lib/WindowsRuntime/Properties/AssemblyInfo.cs | 4 ++-- .../AspNet/Microsoft.WindowsAzure.Storage.Test/project.json | 4 ++-- Test/WindowsPhone/Properties/AssemblyInfo.cs | 4 ++-- Test/WindowsPhone81/Properties/AssemblyInfo.cs | 4 ++-- Test/WindowsRuntime/Properties/AssemblyInfo.cs | 4 ++-- 17 files changed, 29 insertions(+), 29 deletions(-) diff --git a/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.Shared.Protocol.Constants.cs b/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.Shared.Protocol.Constants.cs index b56388999..5d28b1b93 100644 --- a/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.Shared.Protocol.Constants.cs +++ b/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.Shared.Protocol.Constants.cs @@ -249,7 +249,7 @@ public static class EncryptionConstants public const string TableEncryptionKeyDetails = "_ClientEncryptionMetadata1"; public const string TableEncryptionPropertyDetails = "_ClientEncryptionMetadata2"; public const string AgentMetadataKey = "EncryptionLibrary"; - public const string AgentMetadataValue = ".NET 8.5.0"; + public const string AgentMetadataValue = ".NET 8.6.0"; } } diff --git a/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.Shared.Protocol.EncryptionConstants.cs b/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.Shared.Protocol.EncryptionConstants.cs index 500838da7..649581ac8 100644 --- a/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.Shared.Protocol.EncryptionConstants.cs +++ b/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.Shared.Protocol.EncryptionConstants.cs @@ -10,7 +10,7 @@ public static class EncryptionConstants public const string TableEncryptionKeyDetails = "_ClientEncryptionMetadata1"; public const string TableEncryptionPropertyDetails = "_ClientEncryptionMetadata2"; public const string AgentMetadataKey = "EncryptionLibrary"; - public const string AgentMetadataValue = ".NET 8.5.0"; + public const string AgentMetadataValue = ".NET 8.6.0"; } } \ No newline at end of file diff --git a/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.Shared.Protocol.HeaderConstants.cs b/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.Shared.Protocol.HeaderConstants.cs index b840586d8..3ed3ff6c4 100644 --- a/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.Shared.Protocol.HeaderConstants.cs +++ b/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.Shared.Protocol.HeaderConstants.cs @@ -4,9 +4,9 @@ namespace Microsoft.WindowsAzure.Storage.Shared.Protocol public static class HeaderConstants { - public static readonly string UserAgent = "Azure-Storage/8.5.0 "; + public static readonly string UserAgent = "Azure-Storage/8.6.0 "; public const string UserAgentProductName = "Azure-Storage"; - public const string UserAgentProductVersion = "8.5.0"; + public const string UserAgentProductVersion = "8.6.0"; public const string PrefixForStorageHeader = "x-ms-"; public const string TrueHeader = "true"; public const string FalseHeader = "false"; diff --git a/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/Properties/AssemblyInfo.cs b/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/Properties/AssemblyInfo.cs index a69c4f4be..831a700c8 100644 --- a/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/Properties/AssemblyInfo.cs +++ b/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/Properties/AssemblyInfo.cs @@ -31,8 +31,8 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("8.5.0.0")] -[assembly: AssemblyFileVersion("8.5.0.0")] +[assembly: AssemblyVersion("8.6.0.0")] +[assembly: AssemblyFileVersion("8.6.0.0")] [assembly: InternalsVisibleTo( "Microsoft.WindowsAzure.Storage.Facade.Portable, PublicKey=" + diff --git a/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/project.json b/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/project.json index ef3a50e37..1a784f013 100644 --- a/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/project.json +++ b/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/project.json @@ -1,6 +1,6 @@ { "title": "Microsoft.WindowsAzure.Storage", - "version": "8.5.0.0", + "version": "8.6.0.0", "authors": [ "Microsoft Corporation" ], "description": "Azure Storage SDK for NetCore", diff --git a/Lib/AspNet/Microsoft.WindowsAzure.Storage/AssemblyInfo.cs b/Lib/AspNet/Microsoft.WindowsAzure.Storage/AssemblyInfo.cs index 02884ef7a..c6d35f976 100644 --- a/Lib/AspNet/Microsoft.WindowsAzure.Storage/AssemblyInfo.cs +++ b/Lib/AspNet/Microsoft.WindowsAzure.Storage/AssemblyInfo.cs @@ -34,9 +34,9 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("8.5.0.0")] -[assembly: AssemblyFileVersion("8.5.0.0")] -[assembly: AssemblyInformationalVersion("8.5.0.0")] +[assembly: AssemblyVersion("8.6.0.0")] +[assembly: AssemblyFileVersion("8.6.0.0")] +[assembly: AssemblyInformationalVersion("8.6.0.0")] [assembly: InternalsVisibleTo( diff --git a/Lib/AspNet/Microsoft.WindowsAzure.Storage/WindowsAzure.StorageK.nuspec b/Lib/AspNet/Microsoft.WindowsAzure.Storage/WindowsAzure.StorageK.nuspec index ed06110fa..5e1fc3e03 100644 --- a/Lib/AspNet/Microsoft.WindowsAzure.Storage/WindowsAzure.StorageK.nuspec +++ b/Lib/AspNet/Microsoft.WindowsAzure.Storage/WindowsAzure.StorageK.nuspec @@ -2,7 +2,7 @@ WindowsAzure.Storage - 8.5.0 + 8.6.0 Windows Azure Storage Microsoft Microsoft diff --git a/Lib/AspNet/Microsoft.WindowsAzure.Storage/project.json b/Lib/AspNet/Microsoft.WindowsAzure.Storage/project.json index acd52bd90..0d2a6c6ac 100644 --- a/Lib/AspNet/Microsoft.WindowsAzure.Storage/project.json +++ b/Lib/AspNet/Microsoft.WindowsAzure.Storage/project.json @@ -1,5 +1,5 @@ { - "version": "8.5.0.0", + "version": "8.6.0.0", "authors": [ "Microsoft Corporation" ], "description": "Azure Storage SDK for NetCore", diff --git a/Lib/Common/Shared/Protocol/Constants.cs b/Lib/Common/Shared/Protocol/Constants.cs index cbac48080..25f5ef82a 100644 --- a/Lib/Common/Shared/Protocol/Constants.cs +++ b/Lib/Common/Shared/Protocol/Constants.cs @@ -854,7 +854,7 @@ static HeaderConstants() /// /// Specifies the value to use for UserAgent header. /// - public const string UserAgentProductVersion = "8.5.0"; + public const string UserAgentProductVersion = "8.6.0"; /// /// Master Microsoft Azure Storage header prefix. diff --git a/Lib/WindowsDesktop/Properties/AssemblyInfo.cs b/Lib/WindowsDesktop/Properties/AssemblyInfo.cs index 08d8039a4..24527e479 100644 --- a/Lib/WindowsDesktop/Properties/AssemblyInfo.cs +++ b/Lib/WindowsDesktop/Properties/AssemblyInfo.cs @@ -35,8 +35,8 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("8.5.0.0")] -[assembly: AssemblyFileVersion("8.5.0.0")] +[assembly: AssemblyVersion("8.6.0.0")] +[assembly: AssemblyFileVersion("8.6.0.0")] #if SIGN [assembly: InternalsVisibleTo( diff --git a/Lib/WindowsPhone/Properties/AssemblyInfo.cs b/Lib/WindowsPhone/Properties/AssemblyInfo.cs index cffcd9fbc..cf48c110d 100644 --- a/Lib/WindowsPhone/Properties/AssemblyInfo.cs +++ b/Lib/WindowsPhone/Properties/AssemblyInfo.cs @@ -33,8 +33,8 @@ // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("8.5.0.0")] -[assembly: AssemblyFileVersion("8.5.0.0")] +[assembly: AssemblyVersion("8.6.0.0")] +[assembly: AssemblyFileVersion("8.6.0.0")] [assembly: NeutralResourcesLanguageAttribute("en-US")] diff --git a/Lib/WindowsPhoneRT/Properties/AssemblyInfo.cs b/Lib/WindowsPhoneRT/Properties/AssemblyInfo.cs index 758631b42..74483abc5 100644 --- a/Lib/WindowsPhoneRT/Properties/AssemblyInfo.cs +++ b/Lib/WindowsPhoneRT/Properties/AssemblyInfo.cs @@ -24,8 +24,8 @@ // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("8.5.0.0")] -[assembly: AssemblyFileVersion("8.5.0.0")] +[assembly: AssemblyVersion("8.6.0.0")] +[assembly: AssemblyFileVersion("8.6.0.0")] [assembly: NeutralResourcesLanguageAttribute("en-US")] [assembly: ComVisible(false)] diff --git a/Lib/WindowsRuntime/Properties/AssemblyInfo.cs b/Lib/WindowsRuntime/Properties/AssemblyInfo.cs index 41a9330db..59c022610 100644 --- a/Lib/WindowsRuntime/Properties/AssemblyInfo.cs +++ b/Lib/WindowsRuntime/Properties/AssemblyInfo.cs @@ -26,8 +26,8 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("8.5.0.0")] -[assembly: AssemblyFileVersion("8.5.0.0")] +[assembly: AssemblyVersion("8.6.0.0")] +[assembly: AssemblyFileVersion("8.6.0.0")] [assembly: ComVisible(false)] diff --git a/Test/AspNet/Microsoft.WindowsAzure.Storage.Test/project.json b/Test/AspNet/Microsoft.WindowsAzure.Storage.Test/project.json index 63cc7e491..2ae8115a6 100644 --- a/Test/AspNet/Microsoft.WindowsAzure.Storage.Test/project.json +++ b/Test/AspNet/Microsoft.WindowsAzure.Storage.Test/project.json @@ -1,11 +1,11 @@ { - "version": "8.1.2.0", + "version": "8.6.0.0", "testRunner": "xunit", "dependencies": { "xunit": "2.1.0", "dotnet-test-xunit": "2.2.0-preview2-build1029", - "Microsoft.WindowsAzure.Storage": "8.1.2.0", + "Microsoft.WindowsAzure.Storage": "8.6.0.0", "XUnitForMsTest": "1.0.0-*" }, diff --git a/Test/WindowsPhone/Properties/AssemblyInfo.cs b/Test/WindowsPhone/Properties/AssemblyInfo.cs index 282fcba18..0cb4f96ad 100644 --- a/Test/WindowsPhone/Properties/AssemblyInfo.cs +++ b/Test/WindowsPhone/Properties/AssemblyInfo.cs @@ -33,7 +33,7 @@ // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("8.5.0.0")] -[assembly: AssemblyFileVersion("8.5.0.0")] +[assembly: AssemblyVersion("8.6.0.0")] +[assembly: AssemblyFileVersion("8.6.0.0")] [assembly: NeutralResourcesLanguageAttribute("en-US")] diff --git a/Test/WindowsPhone81/Properties/AssemblyInfo.cs b/Test/WindowsPhone81/Properties/AssemblyInfo.cs index 41a7b719b..5e1efd5a1 100644 --- a/Test/WindowsPhone81/Properties/AssemblyInfo.cs +++ b/Test/WindowsPhone81/Properties/AssemblyInfo.cs @@ -34,7 +34,7 @@ // by using the '*' as shown below: -[assembly: AssemblyVersion("8.5.0.0")] -[assembly: AssemblyFileVersion("8.5.0.0")] +[assembly: AssemblyVersion("8.6.0.0")] +[assembly: AssemblyFileVersion("8.6.0.0")] [assembly: NeutralResourcesLanguageAttribute("en-US")] diff --git a/Test/WindowsRuntime/Properties/AssemblyInfo.cs b/Test/WindowsRuntime/Properties/AssemblyInfo.cs index 9f610e2e8..f8223b276 100644 --- a/Test/WindowsRuntime/Properties/AssemblyInfo.cs +++ b/Test/WindowsRuntime/Properties/AssemblyInfo.cs @@ -25,7 +25,7 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("8.5.0.0")] -[assembly: AssemblyFileVersion("8.5.0.0")] +[assembly: AssemblyVersion("8.6.0.0")] +[assembly: AssemblyFileVersion("8.6.0.0")] [assembly: ComVisible(false)] From 5718429b094d0411f3c04d5e2f49034b922d1fa1 Mon Sep 17 00:00:00 2001 From: erezvani Date: Mon, 13 Nov 2017 14:09:15 -0800 Subject: [PATCH 10/11] [8.6]Update Assembly Versions --- ...rosoft.WindowsAzure.Storage.Shared.Protocol.Constants.cs | 2 +- ...dowsAzure.Storage.Shared.Protocol.EncryptionConstants.cs | 2 +- ....WindowsAzure.Storage.Shared.Protocol.HeaderConstants.cs | 4 ++-- .../Properties/AssemblyInfo.cs | 4 ++-- .../Microsoft.WindowsAzure.Storage.Facade/project.json | 2 +- Lib/AspNet/Microsoft.WindowsAzure.Storage/AssemblyInfo.cs | 6 +++--- .../WindowsAzure.StorageK.nuspec | 2 +- Lib/AspNet/Microsoft.WindowsAzure.Storage/project.json | 2 +- Lib/Common/Shared/Protocol/Constants.cs | 2 +- Lib/WindowsDesktop/Properties/AssemblyInfo.cs | 4 ++-- Lib/WindowsPhone/Properties/AssemblyInfo.cs | 4 ++-- Lib/WindowsPhoneRT/Properties/AssemblyInfo.cs | 4 ++-- Lib/WindowsRuntime/Properties/AssemblyInfo.cs | 4 ++-- .../AspNet/Microsoft.WindowsAzure.Storage.Test/project.json | 4 ++-- Test/WindowsPhone/Properties/AssemblyInfo.cs | 4 ++-- Test/WindowsPhone81/Properties/AssemblyInfo.cs | 4 ++-- Test/WindowsRuntime/Properties/AssemblyInfo.cs | 4 ++-- changelog.txt | 1 + 18 files changed, 30 insertions(+), 29 deletions(-) diff --git a/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.Shared.Protocol.Constants.cs b/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.Shared.Protocol.Constants.cs index b56388999..5d28b1b93 100644 --- a/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.Shared.Protocol.Constants.cs +++ b/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.Shared.Protocol.Constants.cs @@ -249,7 +249,7 @@ public static class EncryptionConstants public const string TableEncryptionKeyDetails = "_ClientEncryptionMetadata1"; public const string TableEncryptionPropertyDetails = "_ClientEncryptionMetadata2"; public const string AgentMetadataKey = "EncryptionLibrary"; - public const string AgentMetadataValue = ".NET 8.5.0"; + public const string AgentMetadataValue = ".NET 8.6.0"; } } diff --git a/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.Shared.Protocol.EncryptionConstants.cs b/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.Shared.Protocol.EncryptionConstants.cs index 500838da7..649581ac8 100644 --- a/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.Shared.Protocol.EncryptionConstants.cs +++ b/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.Shared.Protocol.EncryptionConstants.cs @@ -10,7 +10,7 @@ public static class EncryptionConstants public const string TableEncryptionKeyDetails = "_ClientEncryptionMetadata1"; public const string TableEncryptionPropertyDetails = "_ClientEncryptionMetadata2"; public const string AgentMetadataKey = "EncryptionLibrary"; - public const string AgentMetadataValue = ".NET 8.5.0"; + public const string AgentMetadataValue = ".NET 8.6.0"; } } \ No newline at end of file diff --git a/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.Shared.Protocol.HeaderConstants.cs b/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.Shared.Protocol.HeaderConstants.cs index b840586d8..3ed3ff6c4 100644 --- a/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.Shared.Protocol.HeaderConstants.cs +++ b/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.Shared.Protocol.HeaderConstants.cs @@ -4,9 +4,9 @@ namespace Microsoft.WindowsAzure.Storage.Shared.Protocol public static class HeaderConstants { - public static readonly string UserAgent = "Azure-Storage/8.5.0 "; + public static readonly string UserAgent = "Azure-Storage/8.6.0 "; public const string UserAgentProductName = "Azure-Storage"; - public const string UserAgentProductVersion = "8.5.0"; + public const string UserAgentProductVersion = "8.6.0"; public const string PrefixForStorageHeader = "x-ms-"; public const string TrueHeader = "true"; public const string FalseHeader = "false"; diff --git a/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/Properties/AssemblyInfo.cs b/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/Properties/AssemblyInfo.cs index a69c4f4be..831a700c8 100644 --- a/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/Properties/AssemblyInfo.cs +++ b/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/Properties/AssemblyInfo.cs @@ -31,8 +31,8 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("8.5.0.0")] -[assembly: AssemblyFileVersion("8.5.0.0")] +[assembly: AssemblyVersion("8.6.0.0")] +[assembly: AssemblyFileVersion("8.6.0.0")] [assembly: InternalsVisibleTo( "Microsoft.WindowsAzure.Storage.Facade.Portable, PublicKey=" + diff --git a/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/project.json b/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/project.json index ef3a50e37..1a784f013 100644 --- a/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/project.json +++ b/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/project.json @@ -1,6 +1,6 @@ { "title": "Microsoft.WindowsAzure.Storage", - "version": "8.5.0.0", + "version": "8.6.0.0", "authors": [ "Microsoft Corporation" ], "description": "Azure Storage SDK for NetCore", diff --git a/Lib/AspNet/Microsoft.WindowsAzure.Storage/AssemblyInfo.cs b/Lib/AspNet/Microsoft.WindowsAzure.Storage/AssemblyInfo.cs index 02884ef7a..c6d35f976 100644 --- a/Lib/AspNet/Microsoft.WindowsAzure.Storage/AssemblyInfo.cs +++ b/Lib/AspNet/Microsoft.WindowsAzure.Storage/AssemblyInfo.cs @@ -34,9 +34,9 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("8.5.0.0")] -[assembly: AssemblyFileVersion("8.5.0.0")] -[assembly: AssemblyInformationalVersion("8.5.0.0")] +[assembly: AssemblyVersion("8.6.0.0")] +[assembly: AssemblyFileVersion("8.6.0.0")] +[assembly: AssemblyInformationalVersion("8.6.0.0")] [assembly: InternalsVisibleTo( diff --git a/Lib/AspNet/Microsoft.WindowsAzure.Storage/WindowsAzure.StorageK.nuspec b/Lib/AspNet/Microsoft.WindowsAzure.Storage/WindowsAzure.StorageK.nuspec index ed06110fa..5e1fc3e03 100644 --- a/Lib/AspNet/Microsoft.WindowsAzure.Storage/WindowsAzure.StorageK.nuspec +++ b/Lib/AspNet/Microsoft.WindowsAzure.Storage/WindowsAzure.StorageK.nuspec @@ -2,7 +2,7 @@ WindowsAzure.Storage - 8.5.0 + 8.6.0 Windows Azure Storage Microsoft Microsoft diff --git a/Lib/AspNet/Microsoft.WindowsAzure.Storage/project.json b/Lib/AspNet/Microsoft.WindowsAzure.Storage/project.json index acd52bd90..0d2a6c6ac 100644 --- a/Lib/AspNet/Microsoft.WindowsAzure.Storage/project.json +++ b/Lib/AspNet/Microsoft.WindowsAzure.Storage/project.json @@ -1,5 +1,5 @@ { - "version": "8.5.0.0", + "version": "8.6.0.0", "authors": [ "Microsoft Corporation" ], "description": "Azure Storage SDK for NetCore", diff --git a/Lib/Common/Shared/Protocol/Constants.cs b/Lib/Common/Shared/Protocol/Constants.cs index cbac48080..25f5ef82a 100644 --- a/Lib/Common/Shared/Protocol/Constants.cs +++ b/Lib/Common/Shared/Protocol/Constants.cs @@ -854,7 +854,7 @@ static HeaderConstants() /// /// Specifies the value to use for UserAgent header. /// - public const string UserAgentProductVersion = "8.5.0"; + public const string UserAgentProductVersion = "8.6.0"; /// /// Master Microsoft Azure Storage header prefix. diff --git a/Lib/WindowsDesktop/Properties/AssemblyInfo.cs b/Lib/WindowsDesktop/Properties/AssemblyInfo.cs index 08d8039a4..24527e479 100644 --- a/Lib/WindowsDesktop/Properties/AssemblyInfo.cs +++ b/Lib/WindowsDesktop/Properties/AssemblyInfo.cs @@ -35,8 +35,8 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("8.5.0.0")] -[assembly: AssemblyFileVersion("8.5.0.0")] +[assembly: AssemblyVersion("8.6.0.0")] +[assembly: AssemblyFileVersion("8.6.0.0")] #if SIGN [assembly: InternalsVisibleTo( diff --git a/Lib/WindowsPhone/Properties/AssemblyInfo.cs b/Lib/WindowsPhone/Properties/AssemblyInfo.cs index cffcd9fbc..cf48c110d 100644 --- a/Lib/WindowsPhone/Properties/AssemblyInfo.cs +++ b/Lib/WindowsPhone/Properties/AssemblyInfo.cs @@ -33,8 +33,8 @@ // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("8.5.0.0")] -[assembly: AssemblyFileVersion("8.5.0.0")] +[assembly: AssemblyVersion("8.6.0.0")] +[assembly: AssemblyFileVersion("8.6.0.0")] [assembly: NeutralResourcesLanguageAttribute("en-US")] diff --git a/Lib/WindowsPhoneRT/Properties/AssemblyInfo.cs b/Lib/WindowsPhoneRT/Properties/AssemblyInfo.cs index 758631b42..74483abc5 100644 --- a/Lib/WindowsPhoneRT/Properties/AssemblyInfo.cs +++ b/Lib/WindowsPhoneRT/Properties/AssemblyInfo.cs @@ -24,8 +24,8 @@ // // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("8.5.0.0")] -[assembly: AssemblyFileVersion("8.5.0.0")] +[assembly: AssemblyVersion("8.6.0.0")] +[assembly: AssemblyFileVersion("8.6.0.0")] [assembly: NeutralResourcesLanguageAttribute("en-US")] [assembly: ComVisible(false)] diff --git a/Lib/WindowsRuntime/Properties/AssemblyInfo.cs b/Lib/WindowsRuntime/Properties/AssemblyInfo.cs index 41a9330db..59c022610 100644 --- a/Lib/WindowsRuntime/Properties/AssemblyInfo.cs +++ b/Lib/WindowsRuntime/Properties/AssemblyInfo.cs @@ -26,8 +26,8 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("8.5.0.0")] -[assembly: AssemblyFileVersion("8.5.0.0")] +[assembly: AssemblyVersion("8.6.0.0")] +[assembly: AssemblyFileVersion("8.6.0.0")] [assembly: ComVisible(false)] diff --git a/Test/AspNet/Microsoft.WindowsAzure.Storage.Test/project.json b/Test/AspNet/Microsoft.WindowsAzure.Storage.Test/project.json index 63cc7e491..2ae8115a6 100644 --- a/Test/AspNet/Microsoft.WindowsAzure.Storage.Test/project.json +++ b/Test/AspNet/Microsoft.WindowsAzure.Storage.Test/project.json @@ -1,11 +1,11 @@ { - "version": "8.1.2.0", + "version": "8.6.0.0", "testRunner": "xunit", "dependencies": { "xunit": "2.1.0", "dotnet-test-xunit": "2.2.0-preview2-build1029", - "Microsoft.WindowsAzure.Storage": "8.1.2.0", + "Microsoft.WindowsAzure.Storage": "8.6.0.0", "XUnitForMsTest": "1.0.0-*" }, diff --git a/Test/WindowsPhone/Properties/AssemblyInfo.cs b/Test/WindowsPhone/Properties/AssemblyInfo.cs index 282fcba18..0cb4f96ad 100644 --- a/Test/WindowsPhone/Properties/AssemblyInfo.cs +++ b/Test/WindowsPhone/Properties/AssemblyInfo.cs @@ -33,7 +33,7 @@ // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("8.5.0.0")] -[assembly: AssemblyFileVersion("8.5.0.0")] +[assembly: AssemblyVersion("8.6.0.0")] +[assembly: AssemblyFileVersion("8.6.0.0")] [assembly: NeutralResourcesLanguageAttribute("en-US")] diff --git a/Test/WindowsPhone81/Properties/AssemblyInfo.cs b/Test/WindowsPhone81/Properties/AssemblyInfo.cs index 41a7b719b..5e1efd5a1 100644 --- a/Test/WindowsPhone81/Properties/AssemblyInfo.cs +++ b/Test/WindowsPhone81/Properties/AssemblyInfo.cs @@ -34,7 +34,7 @@ // by using the '*' as shown below: -[assembly: AssemblyVersion("8.5.0.0")] -[assembly: AssemblyFileVersion("8.5.0.0")] +[assembly: AssemblyVersion("8.6.0.0")] +[assembly: AssemblyFileVersion("8.6.0.0")] [assembly: NeutralResourcesLanguageAttribute("en-US")] diff --git a/Test/WindowsRuntime/Properties/AssemblyInfo.cs b/Test/WindowsRuntime/Properties/AssemblyInfo.cs index 9f610e2e8..f8223b276 100644 --- a/Test/WindowsRuntime/Properties/AssemblyInfo.cs +++ b/Test/WindowsRuntime/Properties/AssemblyInfo.cs @@ -25,7 +25,7 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("8.5.0.0")] -[assembly: AssemblyFileVersion("8.5.0.0")] +[assembly: AssemblyVersion("8.6.0.0")] +[assembly: AssemblyFileVersion("8.6.0.0")] [assembly: ComVisible(false)] diff --git a/changelog.txt b/changelog.txt index 89db8c19f..8b4202ccd 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,6 @@ Changes in 8.6.0 : - Tables : Added support for Byte type property in TableEntity Flatten/ConvertBack methods. +- Blobs : Added support for the last time blobTier was modified. Changes in 8.5.0 : - Files: Added support for creating the snapshot of a share. See the service documentation for more information on how to use this API. From 793140a8c2f02991308b03ac32a91b78bdf2b044 Mon Sep 17 00:00:00 2001 From: erezvani Date: Mon, 13 Nov 2017 16:09:09 -0800 Subject: [PATCH 11/11] [8.6] Facade Changes + ReadMe Update --- .../Microsoft.WindowsAzure.Storage.Blob.BlobProperties.cs | 5 +++++ ...t.WindowsAzure.Storage.Shared.Protocol.HeaderConstants.cs | 1 + Lib/WindowsDesktop/WindowsAzure.Storage.nuspec | 2 +- README.md | 2 +- Test/WindowsDesktop/Properties/AssemblyInfo.cs | 4 ++-- Test/WindowsPhoneRT.Test/Properties/AssemblyInfo.cs | 4 ++-- 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.Blob.BlobProperties.cs b/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.Blob.BlobProperties.cs index dfe5142ac..ec3dc5f16 100644 --- a/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.Blob.BlobProperties.cs +++ b/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.Blob.BlobProperties.cs @@ -109,6 +109,11 @@ public bool? BlobTierInferred get; internal set; } + public DateTimeOffset? BlobTierLastModifiedTime + { + get; internal set; + } + public BlobProperties() { throw new System.NotImplementedException(); diff --git a/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.Shared.Protocol.HeaderConstants.cs b/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.Shared.Protocol.HeaderConstants.cs index 3ed3ff6c4..cc938354b 100644 --- a/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.Shared.Protocol.HeaderConstants.cs +++ b/Lib/AspNet/Microsoft.WindowsAzure.Storage.Facade/FacadeLib/Microsoft.WindowsAzure.Storage.Shared.Protocol.HeaderConstants.cs @@ -41,6 +41,7 @@ public static class HeaderConstants public const string AccessTierHeader = "x-ms-access-tier"; public const string ArchiveStatusHeader = "x-ms-archive-status"; public const string AccessTierInferredHeader = "x-ms-access-tier-inferred"; + public const string AccessTierChangeTimeHeader = "x-ms-access-tier-change-time"; public const string BlobCacheControlHeader = "x-ms-blob-cache-control"; public const string BlobContentDispositionRequestHeader = "x-ms-blob-content-disposition"; public const string BlobContentEncodingHeader = "x-ms-blob-content-encoding"; diff --git a/Lib/WindowsDesktop/WindowsAzure.Storage.nuspec b/Lib/WindowsDesktop/WindowsAzure.Storage.nuspec index ed06110fa..5e1fc3e03 100644 --- a/Lib/WindowsDesktop/WindowsAzure.Storage.nuspec +++ b/Lib/WindowsDesktop/WindowsAzure.Storage.nuspec @@ -2,7 +2,7 @@ WindowsAzure.Storage - 8.5.0 + 8.6.0 Windows Azure Storage Microsoft Microsoft diff --git a/README.md b/README.md index 5470185d9..a1b3002c8 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Microsoft Azure Storage SDK for .NET (8.5.0) +# Microsoft Azure Storage SDK for .NET (8.6.0) The Microsoft Azure Storage SDK for .NET allows you to build Azure applications that take advantage of scalable cloud computing resources. diff --git a/Test/WindowsDesktop/Properties/AssemblyInfo.cs b/Test/WindowsDesktop/Properties/AssemblyInfo.cs index b8c7b01df..5aa228c56 100644 --- a/Test/WindowsDesktop/Properties/AssemblyInfo.cs +++ b/Test/WindowsDesktop/Properties/AssemblyInfo.cs @@ -33,6 +33,6 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("8.5.0.0")] -[assembly: AssemblyFileVersion("8.5.0.0")] +[assembly: AssemblyVersion("8.6.0.0")] +[assembly: AssemblyFileVersion("8.6.0.0")] diff --git a/Test/WindowsPhoneRT.Test/Properties/AssemblyInfo.cs b/Test/WindowsPhoneRT.Test/Properties/AssemblyInfo.cs index 6503ec6b7..b01341310 100644 --- a/Test/WindowsPhoneRT.Test/Properties/AssemblyInfo.cs +++ b/Test/WindowsPhoneRT.Test/Properties/AssemblyInfo.cs @@ -25,7 +25,7 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("8.5.0.0")] -[assembly: AssemblyFileVersion("8.5.0.0")] +[assembly: AssemblyVersion("8.6.0.0")] +[assembly: AssemblyFileVersion("8.6.0.0")] [assembly: ComVisible(false)] \ No newline at end of file