From 9b9f93991f2c9f2a0580c9b67c7d43b7344294af Mon Sep 17 00:00:00 2001 From: Amanda Nguyen Date: Thu, 11 Jun 2020 16:33:36 -0700 Subject: [PATCH 1/4] Changing OR object to a list of the proper OR class --- .../api/Azure.Storage.Blobs.netstandard2.0.cs | 24 ++++++++-- .../Azure.Storage.Blobs/src/BlobExtensions.cs | 47 ++++++++++-------- .../src/Models/BlobInfo.cs | 7 ++- .../src/Models/BlobProperties.cs | 4 +- .../src/Models/BlobsModelFactory.cs | 2 +- .../src/Models/ObjectReplicationPolicy.cs | 31 ++++++++++++ .../src/Models/ObjectReplicationRule.cs | 48 +++++++++++++++++++ .../DownloadAsync_ObjectReplication.json | 24 +++++----- .../DownloadAsync_ObjectReplicationAsync.json | 24 +++++----- .../GetPropertiesAsync_ObjectReplication.json | 24 +++++----- ...ropertiesAsync_ObjectReplicationAsync.json | 24 +++++----- 11 files changed, 188 insertions(+), 71 deletions(-) create mode 100644 sdk/storage/Azure.Storage.Blobs/src/Models/ObjectReplicationPolicy.cs create mode 100644 sdk/storage/Azure.Storage.Blobs/src/Models/ObjectReplicationRule.cs diff --git a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.0.cs b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.0.cs index 313278bd252b..af16e7ddd9c2 100644 --- a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.0.cs +++ b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.0.cs @@ -381,7 +381,7 @@ public BlobDownloadDetails() { } public Azure.Storage.Blobs.Models.LeaseStatus LeaseStatus { get { throw null; } } public System.Collections.Generic.IDictionary Metadata { get { throw null; } } public string ObjectReplicationDestinationPolicy { get { throw null; } } - public System.Collections.Generic.IDictionary> ObjectReplicationSourceProperties { get { throw null; } } + public System.Collections.Generic.IList ObjectReplicationSourceProperties { get { throw null; } } public long TagCount { get { throw null; } } public string VersionId { get { throw null; } } } @@ -684,7 +684,7 @@ public BlobProperties() { } public Azure.Storage.Blobs.Models.LeaseStatus LeaseStatus { get { throw null; } } public System.Collections.Generic.IDictionary Metadata { get { throw null; } } public string ObjectReplicationDestinationPolicy { get { throw null; } } - public System.Collections.Generic.IDictionary> ObjectReplicationSourceProperties { get { throw null; } } + public System.Collections.Generic.IList ObjectReplicationSourceProperties { get { throw null; } } public long TagCount { get { throw null; } } public string VersionId { get { throw null; } } } @@ -806,7 +806,7 @@ public static partial class BlobsModelFactory public static Azure.Storage.Blobs.Models.BlobLease BlobLease(Azure.ETag eTag, System.DateTimeOffset lastModified, string leaseId) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Storage.Blobs.Models.BlobProperties BlobProperties(System.DateTimeOffset lastModified, Azure.Storage.Blobs.Models.LeaseDurationType leaseDuration, Azure.Storage.Blobs.Models.LeaseState leaseState, Azure.Storage.Blobs.Models.LeaseStatus leaseStatus, long contentLength, string destinationSnapshot, Azure.ETag eTag, byte[] contentHash, string contentEncoding, string contentDisposition, string contentLanguage, bool isIncrementalCopy, string cacheControl, Azure.Storage.Blobs.Models.CopyStatus copyStatus, long blobSequenceNumber, System.Uri copySource, string acceptRanges, string copyProgress, int blobCommittedBlockCount, string copyId, bool isServerEncrypted, string copyStatusDescription, string encryptionKeySha256, System.DateTimeOffset copyCompletedOn, string accessTier, Azure.Storage.Blobs.Models.BlobType blobType, bool accessTierInferred, System.Collections.Generic.IDictionary metadata, string archiveStatus, System.DateTimeOffset createdOn, System.DateTimeOffset accessTierChangedOn, string contentType) { throw null; } - public static Azure.Storage.Blobs.Models.BlobProperties BlobProperties(System.DateTimeOffset lastModified, Azure.Storage.Blobs.Models.LeaseStatus leaseStatus, long contentLength, string contentType, Azure.ETag eTag, Azure.Storage.Blobs.Models.LeaseState leaseState, string contentEncoding, string contentDisposition, string contentLanguage, string cacheControl, long blobSequenceNumber, Azure.Storage.Blobs.Models.LeaseDurationType leaseDuration, string acceptRanges, string destinationSnapshot, int blobCommittedBlockCount, bool isIncrementalCopy, bool isServerEncrypted, Azure.Storage.Blobs.Models.CopyStatus copyStatus, string encryptionKeySha256, System.Uri copySource, string encryptionScope, string copyProgress, string accessTier, string copyId, bool accessTierInferred, string copyStatusDescription, string archiveStatus, System.DateTimeOffset copyCompletedOn, System.DateTimeOffset accessTierChangedOn, Azure.Storage.Blobs.Models.BlobType blobType, string versionId, System.Collections.Generic.IDictionary> objectReplicationSourceProperties, bool isCurrentVersion, string objectReplicationDestinationPolicy, long tagCount, System.Collections.Generic.IDictionary metadata, System.DateTimeOffset expiresOn, System.DateTimeOffset createdOn, bool isSealed, byte[] contentHash) { throw null; } + public static Azure.Storage.Blobs.Models.BlobProperties BlobProperties(System.DateTimeOffset lastModified, Azure.Storage.Blobs.Models.LeaseStatus leaseStatus, long contentLength, string contentType, Azure.ETag eTag, Azure.Storage.Blobs.Models.LeaseState leaseState, string contentEncoding, string contentDisposition, string contentLanguage, string cacheControl, long blobSequenceNumber, Azure.Storage.Blobs.Models.LeaseDurationType leaseDuration, string acceptRanges, string destinationSnapshot, int blobCommittedBlockCount, bool isIncrementalCopy, bool isServerEncrypted, Azure.Storage.Blobs.Models.CopyStatus copyStatus, string encryptionKeySha256, System.Uri copySource, string encryptionScope, string copyProgress, string accessTier, string copyId, bool accessTierInferred, string copyStatusDescription, string archiveStatus, System.DateTimeOffset copyCompletedOn, System.DateTimeOffset accessTierChangedOn, Azure.Storage.Blobs.Models.BlobType blobType, string versionId, System.Collections.Generic.IList objectReplicationSourceProperties, bool isCurrentVersion, string objectReplicationDestinationPolicy, long tagCount, System.Collections.Generic.IDictionary metadata, System.DateTimeOffset expiresOn, System.DateTimeOffset createdOn, bool isSealed, byte[] contentHash) { throw null; } public static Azure.Storage.Blobs.Models.BlobQueryError BlobQueryError(string name = null, string description = null, bool isFatal = false, long position = (long)0) { throw null; } public static Azure.Storage.Blobs.Models.BlobServiceStatistics BlobServiceStatistics(Azure.Storage.Blobs.Models.BlobGeoReplication geoReplication = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -1034,6 +1034,24 @@ public enum ListContainersIncludeType Metadata = 0, Deleted = 1, } + public partial class ObjectReplicationPolicy + { + internal ObjectReplicationPolicy() { } + public string PolicyId { get { throw null; } } + public System.Collections.Generic.IList Rules { get { throw null; } } + } + public partial class ObjectReplicationRule + { + internal ObjectReplicationRule() { } + public Azure.Storage.Blobs.Models.ObjectReplicationStatus ReplicationStatus { get { throw null; } } + public string RuleId { get { throw null; } } + } + [System.FlagsAttribute] + public enum ObjectReplicationStatus + { + Complete = 0, + Failed = 1, + } public partial class PageBlobInfo { internal PageBlobInfo() { } diff --git a/sdk/storage/Azure.Storage.Blobs/src/BlobExtensions.cs b/sdk/storage/Azure.Storage.Blobs/src/BlobExtensions.cs index 7dd697b12f4e..451cedc6d737 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/BlobExtensions.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/BlobExtensions.cs @@ -107,7 +107,10 @@ internal static BlobProperties ToBlobProperties(this BlobPropertiesInternal prop CreatedOn = properties.CreatedOn, Metadata = properties.Metadata, ObjectReplicationDestinationPolicy = properties.ObjectReplicationPolicyId, - ObjectReplicationSourceProperties = BlobExtensions.ParseObjectReplicationIds(properties.ObjectReplicationRules), + ObjectReplicationSourceProperties = + properties.ObjectReplicationRules?.Count > 0 + ? BlobExtensions.ParseObjectReplicationIds(properties.ObjectReplicationRules) + : null, BlobType = properties.BlobType, CopyCompletedOn = properties.CopyCompletedOn, CopyStatusDescription = properties.CopyStatusDescription, @@ -157,40 +160,46 @@ internal static BlobProperties ToBlobProperties(this BlobPropertiesInternal prop /// /// /// If the blob has object replication policy(s) applied and is the source blob, this method will return a - /// dictionary of policy Ids, with a dictionary of rules and replication status for each policy - /// (As each policy id, could have multiple rule ids). + /// List of , which contains the Policy ID and the respective + /// rule(s) and replication status(s) for each policy. /// If the blob has object replication policy applied and is the destination blob, /// this method will return default as the policy id should be set in ObjectReplicationDestinationPolicy /// (e.g. ,). - /// Otherwise null will be returned. /// - internal static IDictionary> ParseObjectReplicationIds(this IDictionary OrIds) + internal static IList ParseObjectReplicationIds(this IDictionary OrIds) { - if (OrIds == null) - { - return null; - } - // If the dictionary is empty or it contains a key with policy id, we are not required to do any parsing since + // If the dictionary contains a key with policy id, we are not required to do any parsing since // the policy id should already be stored in the ObjectReplicationDestinationPolicy. - if (OrIds.Count == 0 || - (OrIds.Count > 0 && - (OrIds.First().Key == "policy-id"))) + if (OrIds.First().Key == "policy-id") { return default; } - IDictionary> OrProperties = new Dictionary>(); + List OrProperties = new List(); foreach (KeyValuePair status in OrIds) { string[] ParsedIds = status.Key.Split('_'); - if (OrProperties.ContainsKey(ParsedIds[0])) + int policyIndex = OrProperties.FindIndex(policy => policy.PolicyId == ParsedIds[0]); + if (policyIndex > -1) { - OrProperties[ParsedIds[0]].Add(ParsedIds[1], status.Value); + OrProperties[policyIndex].Rules.Add(new ObjectReplicationRule + { + RuleId = ParsedIds[1], + ReplicationStatus = (ObjectReplicationStatus) Enum.Parse(typeof(ObjectReplicationStatus), status.Value, true) + }); } else { - IDictionary NewRuleStatus = new Dictionary(); - NewRuleStatus.Add(ParsedIds[1], status.Value); - OrProperties.Add(ParsedIds[0], NewRuleStatus); + IList NewRuleStatus = new List(); + NewRuleStatus.Add(new ObjectReplicationRule + { + RuleId = ParsedIds[1], + ReplicationStatus = (ObjectReplicationStatus)Enum.Parse(typeof(ObjectReplicationStatus), status.Value, true) + }); + OrProperties.Add(new ObjectReplicationPolicy() + { + PolicyId = ParsedIds[0], + Rules = NewRuleStatus + }); } } return OrProperties; diff --git a/sdk/storage/Azure.Storage.Blobs/src/Models/BlobInfo.cs b/sdk/storage/Azure.Storage.Blobs/src/Models/BlobInfo.cs index fdbfb7ea559d..c8169c63b082 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/Models/BlobInfo.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/Models/BlobInfo.cs @@ -80,7 +80,10 @@ internal BlobDownloadInfo(FlattenedDownloadProperties flattened) _flattened = flattened; Details = new BlobDownloadDetails() { _flattened = flattened, - ObjectReplicationSourceProperties = BlobExtensions.ParseObjectReplicationIds(flattened.ObjectReplicationRules) + ObjectReplicationSourceProperties = + flattened.ObjectReplicationRules?.Count > 0 + ? BlobExtensions.ParseObjectReplicationIds(flattened.ObjectReplicationRules) + : null }; } @@ -244,7 +247,7 @@ public partial class BlobDownloadDetails /// /// x-ms-or /// - public IDictionary> ObjectReplicationSourceProperties { get; internal set; } + public IList ObjectReplicationSourceProperties { get; internal set; } /// /// Object Replication Policy Id. This value is only set when the policy id diff --git a/sdk/storage/Azure.Storage.Blobs/src/Models/BlobProperties.cs b/sdk/storage/Azure.Storage.Blobs/src/Models/BlobProperties.cs index e1dfce24c4f3..ea19b62855a8 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/Models/BlobProperties.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/Models/BlobProperties.cs @@ -37,7 +37,7 @@ public partial class BlobProperties /// /// Parsed Object Replication Policy Id, Rule Id(s) and status of the source blob. /// - public IDictionary> ObjectReplicationSourceProperties { get; internal set; } + public IList ObjectReplicationSourceProperties { get; internal set; } /// /// The blob's type. @@ -255,7 +255,7 @@ public partial class BlobProperties public BlobProperties() { Metadata = new Dictionary(System.StringComparer.OrdinalIgnoreCase); - ObjectReplicationSourceProperties = new Dictionary>(StringComparer.OrdinalIgnoreCase); + ObjectReplicationSourceProperties = new List(); } } } diff --git a/sdk/storage/Azure.Storage.Blobs/src/Models/BlobsModelFactory.cs b/sdk/storage/Azure.Storage.Blobs/src/Models/BlobsModelFactory.cs index e5fb84054009..04ef0f374478 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/Models/BlobsModelFactory.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/Models/BlobsModelFactory.cs @@ -163,7 +163,7 @@ public static BlobProperties BlobProperties( DateTimeOffset accessTierChangedOn, BlobType blobType, string versionId, - IDictionary> objectReplicationSourceProperties, + IList objectReplicationSourceProperties, bool isCurrentVersion, string objectReplicationDestinationPolicy, long tagCount, diff --git a/sdk/storage/Azure.Storage.Blobs/src/Models/ObjectReplicationPolicy.cs b/sdk/storage/Azure.Storage.Blobs/src/Models/ObjectReplicationPolicy.cs new file mode 100644 index 000000000000..c3b6f946698f --- /dev/null +++ b/sdk/storage/Azure.Storage.Blobs/src/Models/ObjectReplicationPolicy.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +using System; +using System.Collections.Generic; +using System.Text; + +namespace Azure.Storage.Blobs.Models +{ + /// + /// Contains Object Replication Policy ID and the respective list of + /// (s). This is used when retrieving the + /// Object Replication Properties on the source blob. The policy id for the + /// destination blob is set in ObjectReplicationDestinationPolicy of the respective + /// method responses. (e.g. , + /// ). + /// + public class ObjectReplicationPolicy + { + internal ObjectReplicationPolicy() { } + /// + /// The Object Replication Policy ID. + /// + public string PolicyId { get; internal set; } + /// + /// The Rule ID(s) and respective Replication Status(s) that are under + /// the Policy ID. + /// + public IList Rules { get; internal set; } + + } +} diff --git a/sdk/storage/Azure.Storage.Blobs/src/Models/ObjectReplicationRule.cs b/sdk/storage/Azure.Storage.Blobs/src/Models/ObjectReplicationRule.cs new file mode 100644 index 000000000000..0c584d39d47b --- /dev/null +++ b/sdk/storage/Azure.Storage.Blobs/src/Models/ObjectReplicationRule.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +using System; +using System.Collections.Generic; +using System.Text; + +namespace Azure.Storage.Blobs.Models +{ + /// + /// Contains the Object Replication Rule ID and Replication Status( + /// ) of a blob. + /// There can be more than one under a + /// . Object Replication Rule IDs + /// + public class ObjectReplicationRule + { + internal ObjectReplicationRule() { } + /// + /// The Object Replication Rule ID. + /// + public string RuleId { get; internal set; } + /// + /// The Replication Status. See . + /// + public ObjectReplicationStatus ReplicationStatus { get; internal set; } + } + + /// + /// Specifies the Replication Status of a blob. This is used when a storage account + /// has Object Replication Policy(s) applied. See + /// and . + /// + [Flags] + public enum ObjectReplicationStatus + { + /// + /// Object Replication to the + /// destination completed. + /// + Complete = 0, + + /// + /// Object Replication to the + /// destination container failed. + /// + Failed = 1 + } +} diff --git a/sdk/storage/Azure.Storage.Blobs/tests/SessionRecords/BlobBaseClientTests/DownloadAsync_ObjectReplication.json b/sdk/storage/Azure.Storage.Blobs/tests/SessionRecords/BlobBaseClientTests/DownloadAsync_ObjectReplication.json index 6d0a38a583fb..39232961bb16 100644 --- a/sdk/storage/Azure.Storage.Blobs/tests/SessionRecords/BlobBaseClientTests/DownloadAsync_ObjectReplication.json +++ b/sdk/storage/Azure.Storage.Blobs/tests/SessionRecords/BlobBaseClientTests/DownloadAsync_ObjectReplication.json @@ -5,12 +5,13 @@ "RequestMethod": "GET", "RequestHeaders": { "Authorization": "Sanitized", + "traceparent": "00-36eb6a8a899df345a3dad4c49af85c1d-b012c06b2097eb42-00", "User-Agent": [ - "azsdk-net-Storage.Blobs/12.5.0-dev.20200507.1", - "(.NET Core 4.6.28619.01; Microsoft Windows 10.0.18363 )" + "azsdk-net-Storage.Blobs/12.5.0-dev.20200612.1", + "(.NET Core 4.6.28928.01; Microsoft Windows 10.0.18363 )" ], "x-ms-client-request-id": "404d34b1-2c23-ee53-9c3b-399d77d9afec", - "x-ms-date": "Thu, 07 May 2020 17:45:49 GMT", + "x-ms-date": "Fri, 12 Jun 2020 16:35:49 GMT", "x-ms-return-client-request-id": "true", "x-ms-version": "2019-12-12" }, @@ -21,7 +22,7 @@ "Content-Length": "1024", "Content-MD5": "eyObQAWrMwC74Eh3CuRM2g==", "Content-Type": "application/octet-stream", - "Date": "Thu, 07 May 2020 17:45:49 GMT", + "Date": "Fri, 12 Jun 2020 16:35:49 GMT", "ETag": "\u00220x8D7E7D25C0F807B\u0022", "Last-Modified": "Thu, 23 Apr 2020 22:04:56 GMT", "Server": [ @@ -35,7 +36,7 @@ "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", "x-ms-or-fd2da1b9-56f5-45ff-9eb6-310e6dfc2c80_105f9aad-f39b-4064-8e47-ccd7937295ca": "complete", - "x-ms-request-id": "9cfd9617-601e-0086-6d97-248119000000", + "x-ms-request-id": "d41f20bb-e01e-006c-4fd7-40a637000000", "x-ms-server-encrypted": "true", "x-ms-version": "2019-12-12", "x-ms-version-id": "2020-04-23T22:04:56.9882747Z" @@ -47,12 +48,13 @@ "RequestMethod": "GET", "RequestHeaders": { "Authorization": "Sanitized", + "traceparent": "00-e2f7c68874252d4889b25c70760cb6bb-6d5d90580104dd44-00", "User-Agent": [ - "azsdk-net-Storage.Blobs/12.5.0-dev.20200507.1", - "(.NET Core 4.6.28619.01; Microsoft Windows 10.0.18363 )" + "azsdk-net-Storage.Blobs/12.5.0-dev.20200612.1", + "(.NET Core 4.6.28928.01; Microsoft Windows 10.0.18363 )" ], "x-ms-client-request-id": "555675da-5202-4f37-2c90-91c4a9b68490", - "x-ms-date": "Thu, 07 May 2020 17:45:50 GMT", + "x-ms-date": "Fri, 12 Jun 2020 16:35:50 GMT", "x-ms-return-client-request-id": "true", "x-ms-version": "2019-12-12" }, @@ -63,7 +65,7 @@ "Content-Length": "1024", "Content-MD5": "eyObQAWrMwC74Eh3CuRM2g==", "Content-Type": "application/octet-stream", - "Date": "Thu, 07 May 2020 17:45:50 GMT", + "Date": "Fri, 12 Jun 2020 16:35:49 GMT", "ETag": "\u00220x8D7E7D296E94236\u0022", "Last-Modified": "Thu, 23 Apr 2020 22:06:35 GMT", "Server": [ @@ -81,7 +83,7 @@ "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", "x-ms-or-policy-id": "fd2da1b9-56f5-45ff-9eb6-310e6dfc2c80", - "x-ms-request-id": "7c1fa976-201e-0033-8097-248569000000", + "x-ms-request-id": "00f75a41-001e-001b-12d7-40e4c1000000", "x-ms-server-encrypted": "true", "x-ms-version": "2019-12-12" }, @@ -90,7 +92,7 @@ ], "Variables": { "RandomSeed": "1145762468", - "Storage_TestConfigDefault": "ProductionTenant\nortestsaccountcbn1\nU2FuaXRpemVk\nhttps://ortestsaccountcbn1.blob.core.windows.net\nhttp://ortestsaccountcbn1.file.core.windows.net\nhttp://ortestsaccountcbn1.queue.core.windows.net\nhttp://ortestsaccountcbn1.table.core.windows.net\n\n\n\n\nhttp://ortestsaccountcbn1-secondary.blob.core.windows.net\nhttp://ortestsaccountcbn1-secondary.file.core.windows.net\nhttp://ortestsaccountcbn1-secondary.queue.core.windows.net\nhttp://ortestsaccountcbn1-secondary.table.core.windows.net\n\nSanitized\n\n\nCloud\nBlobEndpoint=https://ortestsaccountcbn1.blob.core.windows.net/;QueueEndpoint=http://ortestsaccountcbn1.queue.core.windows.net/;FileEndpoint=http://ortestsaccountcbn1.file.core.windows.net/;BlobSecondaryEndpoint=http://ortestsaccountcbn1-secondary.blob.core.windows.net/;QueueSecondaryEndpoint=http://ortestsaccountcbn1-secondary.queue.core.windows.net/;FileSecondaryEndpoint=http://ortestsaccountcbn1-secondary.file.core.windows.net/;AccountName=ortestsaccountcbn1;AccountKey=Sanitized\n", + "Storage_TestConfigDefault": "ProductionTenant\nortestsaccountcbn1\nU2FuaXRpemVk\nhttps://ortestsaccountcbn1.blob.core.windows.net\nhttps://ortestsaccountcbn1.file.core.windows.net\nhttps://ortestsaccountcbn1.queue.core.windows.net\nhttps://ortestsaccountcbn1.table.core.windows.net\n\n\n\n\nhttp://ortestsaccountcbn1-secondary.blob.core.windows.net\nhttp://ortestsaccountcbn1-secondary.file.core.windows.net\nhttp://ortestsaccountcbn1-secondary.queue.core.windows.net\nhttp://ortestsaccountcbn1-secondary.table.core.windows.net\n\nSanitized\n\n\nCloud\nBlobEndpoint=https://ortestsaccountcbn1.blob.core.windows.net/;QueueEndpoint=https://ortestsaccountcbn1.queue.core.windows.net/;FileEndpoint=https://ortestsaccountcbn1.file.core.windows.net/;BlobSecondaryEndpoint=http://ortestsaccountcbn1-secondary.blob.core.windows.net/;QueueSecondaryEndpoint=http://ortestsaccountcbn1-secondary.queue.core.windows.net/;FileSecondaryEndpoint=http://ortestsaccountcbn1-secondary.file.core.windows.net/;AccountName=ortestsaccountcbn1;AccountKey=Sanitized\n", "Storage_TestConfigSecondary": "SecondaryTenant\nvbalaorcentral1\nU2FuaXRpemVk\nhttps://vbalaorcentral1.blob.core.windows.net\nhttp://vbalaorcentral1.file.core.windows.net\nhttp://vbalaorcentral1.queue.core.windows.net\nhttp://vbalaorcentral1.table.core.windows.net\n\n\n\n\nhttp://vbalaorcentral1-secondary.blob.core.windows.net\nhttp://vbalaorcentral1-secondary.file.core.windows.net\nhttp://vbalaorcentral1-secondary.queue.core.windows.net\nhttp://vbalaorcentral1-secondary.table.core.windows.net\n\nSanitized\n\n\nCloud\nBlobEndpoint=https://vbalaorcentral1.blob.core.windows.net/;QueueEndpoint=http://vbalaorcentral1.queue.core.windows.net/;FileEndpoint=http://vbalaorcentral1.file.core.windows.net/;BlobSecondaryEndpoint=http://vbalaorcentral1-secondary.blob.core.windows.net/;QueueSecondaryEndpoint=http://vbalaorcentral1-secondary.queue.core.windows.net/;FileSecondaryEndpoint=http://vbalaorcentral1-secondary.file.core.windows.net/;AccountName=vbalaorcentral1;AccountKey=Sanitized\n" } } \ No newline at end of file diff --git a/sdk/storage/Azure.Storage.Blobs/tests/SessionRecords/BlobBaseClientTests/DownloadAsync_ObjectReplicationAsync.json b/sdk/storage/Azure.Storage.Blobs/tests/SessionRecords/BlobBaseClientTests/DownloadAsync_ObjectReplicationAsync.json index a18c98d40dc8..d375c7d73a40 100644 --- a/sdk/storage/Azure.Storage.Blobs/tests/SessionRecords/BlobBaseClientTests/DownloadAsync_ObjectReplicationAsync.json +++ b/sdk/storage/Azure.Storage.Blobs/tests/SessionRecords/BlobBaseClientTests/DownloadAsync_ObjectReplicationAsync.json @@ -5,12 +5,13 @@ "RequestMethod": "GET", "RequestHeaders": { "Authorization": "Sanitized", + "traceparent": "00-6cc6d72d4f8cf644a4e6bbbdd0b7c783-0a0b74a5cb2a6b40-00", "User-Agent": [ - "azsdk-net-Storage.Blobs/12.5.0-dev.20200507.1", - "(.NET Core 4.6.28619.01; Microsoft Windows 10.0.18363 )" + "azsdk-net-Storage.Blobs/12.5.0-dev.20200612.1", + "(.NET Core 4.6.28928.01; Microsoft Windows 10.0.18363 )" ], "x-ms-client-request-id": "4263e528-140d-3355-2d2a-8b044845d3b0", - "x-ms-date": "Thu, 07 May 2020 17:45:51 GMT", + "x-ms-date": "Fri, 12 Jun 2020 16:35:51 GMT", "x-ms-return-client-request-id": "true", "x-ms-version": "2019-12-12" }, @@ -21,7 +22,7 @@ "Content-Length": "1024", "Content-MD5": "eyObQAWrMwC74Eh3CuRM2g==", "Content-Type": "application/octet-stream", - "Date": "Thu, 07 May 2020 17:45:51 GMT", + "Date": "Fri, 12 Jun 2020 16:35:51 GMT", "ETag": "\u00220x8D7E7D25C0F807B\u0022", "Last-Modified": "Thu, 23 Apr 2020 22:04:56 GMT", "Server": [ @@ -35,7 +36,7 @@ "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", "x-ms-or-fd2da1b9-56f5-45ff-9eb6-310e6dfc2c80_105f9aad-f39b-4064-8e47-ccd7937295ca": "complete", - "x-ms-request-id": "29c73930-e01e-000e-7a97-246410000000", + "x-ms-request-id": "bc831149-b01e-002c-2bd7-40a10f000000", "x-ms-server-encrypted": "true", "x-ms-version": "2019-12-12", "x-ms-version-id": "2020-04-23T22:04:56.9882747Z" @@ -47,12 +48,13 @@ "RequestMethod": "GET", "RequestHeaders": { "Authorization": "Sanitized", + "traceparent": "00-8c1473f596676344837c7d919603c62f-a7750fb8b0bc5d48-00", "User-Agent": [ - "azsdk-net-Storage.Blobs/12.5.0-dev.20200507.1", - "(.NET Core 4.6.28619.01; Microsoft Windows 10.0.18363 )" + "azsdk-net-Storage.Blobs/12.5.0-dev.20200612.1", + "(.NET Core 4.6.28928.01; Microsoft Windows 10.0.18363 )" ], "x-ms-client-request-id": "9c4b0295-669d-c3c3-1165-209c1f2c42a1", - "x-ms-date": "Thu, 07 May 2020 17:45:52 GMT", + "x-ms-date": "Fri, 12 Jun 2020 16:35:51 GMT", "x-ms-return-client-request-id": "true", "x-ms-version": "2019-12-12" }, @@ -63,7 +65,7 @@ "Content-Length": "1024", "Content-MD5": "eyObQAWrMwC74Eh3CuRM2g==", "Content-Type": "application/octet-stream", - "Date": "Thu, 07 May 2020 17:45:51 GMT", + "Date": "Fri, 12 Jun 2020 16:35:50 GMT", "ETag": "\u00220x8D7E7D296E94236\u0022", "Last-Modified": "Thu, 23 Apr 2020 22:06:35 GMT", "Server": [ @@ -81,7 +83,7 @@ "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", "x-ms-or-policy-id": "fd2da1b9-56f5-45ff-9eb6-310e6dfc2c80", - "x-ms-request-id": "06f59857-601e-007f-2997-241559000000", + "x-ms-request-id": "d97609bb-301e-0096-12d7-40d313000000", "x-ms-server-encrypted": "true", "x-ms-version": "2019-12-12" }, @@ -90,7 +92,7 @@ ], "Variables": { "RandomSeed": "959552565", - "Storage_TestConfigDefault": "ProductionTenant\nortestsaccountcbn1\nU2FuaXRpemVk\nhttps://ortestsaccountcbn1.blob.core.windows.net\nhttp://ortestsaccountcbn1.file.core.windows.net\nhttp://ortestsaccountcbn1.queue.core.windows.net\nhttp://ortestsaccountcbn1.table.core.windows.net\n\n\n\n\nhttp://ortestsaccountcbn1-secondary.blob.core.windows.net\nhttp://ortestsaccountcbn1-secondary.file.core.windows.net\nhttp://ortestsaccountcbn1-secondary.queue.core.windows.net\nhttp://ortestsaccountcbn1-secondary.table.core.windows.net\n\nSanitized\n\n\nCloud\nBlobEndpoint=https://ortestsaccountcbn1.blob.core.windows.net/;QueueEndpoint=http://ortestsaccountcbn1.queue.core.windows.net/;FileEndpoint=http://ortestsaccountcbn1.file.core.windows.net/;BlobSecondaryEndpoint=http://ortestsaccountcbn1-secondary.blob.core.windows.net/;QueueSecondaryEndpoint=http://ortestsaccountcbn1-secondary.queue.core.windows.net/;FileSecondaryEndpoint=http://ortestsaccountcbn1-secondary.file.core.windows.net/;AccountName=ortestsaccountcbn1;AccountKey=Sanitized\n", + "Storage_TestConfigDefault": "ProductionTenant\nortestsaccountcbn1\nU2FuaXRpemVk\nhttps://ortestsaccountcbn1.blob.core.windows.net\nhttps://ortestsaccountcbn1.file.core.windows.net\nhttps://ortestsaccountcbn1.queue.core.windows.net\nhttps://ortestsaccountcbn1.table.core.windows.net\n\n\n\n\nhttp://ortestsaccountcbn1-secondary.blob.core.windows.net\nhttp://ortestsaccountcbn1-secondary.file.core.windows.net\nhttp://ortestsaccountcbn1-secondary.queue.core.windows.net\nhttp://ortestsaccountcbn1-secondary.table.core.windows.net\n\nSanitized\n\n\nCloud\nBlobEndpoint=https://ortestsaccountcbn1.blob.core.windows.net/;QueueEndpoint=https://ortestsaccountcbn1.queue.core.windows.net/;FileEndpoint=https://ortestsaccountcbn1.file.core.windows.net/;BlobSecondaryEndpoint=http://ortestsaccountcbn1-secondary.blob.core.windows.net/;QueueSecondaryEndpoint=http://ortestsaccountcbn1-secondary.queue.core.windows.net/;FileSecondaryEndpoint=http://ortestsaccountcbn1-secondary.file.core.windows.net/;AccountName=ortestsaccountcbn1;AccountKey=Sanitized\n", "Storage_TestConfigSecondary": "SecondaryTenant\nvbalaorcentral1\nU2FuaXRpemVk\nhttps://vbalaorcentral1.blob.core.windows.net\nhttp://vbalaorcentral1.file.core.windows.net\nhttp://vbalaorcentral1.queue.core.windows.net\nhttp://vbalaorcentral1.table.core.windows.net\n\n\n\n\nhttp://vbalaorcentral1-secondary.blob.core.windows.net\nhttp://vbalaorcentral1-secondary.file.core.windows.net\nhttp://vbalaorcentral1-secondary.queue.core.windows.net\nhttp://vbalaorcentral1-secondary.table.core.windows.net\n\nSanitized\n\n\nCloud\nBlobEndpoint=https://vbalaorcentral1.blob.core.windows.net/;QueueEndpoint=http://vbalaorcentral1.queue.core.windows.net/;FileEndpoint=http://vbalaorcentral1.file.core.windows.net/;BlobSecondaryEndpoint=http://vbalaorcentral1-secondary.blob.core.windows.net/;QueueSecondaryEndpoint=http://vbalaorcentral1-secondary.queue.core.windows.net/;FileSecondaryEndpoint=http://vbalaorcentral1-secondary.file.core.windows.net/;AccountName=vbalaorcentral1;AccountKey=Sanitized\n" } } \ No newline at end of file diff --git a/sdk/storage/Azure.Storage.Blobs/tests/SessionRecords/BlobBaseClientTests/GetPropertiesAsync_ObjectReplication.json b/sdk/storage/Azure.Storage.Blobs/tests/SessionRecords/BlobBaseClientTests/GetPropertiesAsync_ObjectReplication.json index 0d07dcd6ad86..dba3f9a17ea8 100644 --- a/sdk/storage/Azure.Storage.Blobs/tests/SessionRecords/BlobBaseClientTests/GetPropertiesAsync_ObjectReplication.json +++ b/sdk/storage/Azure.Storage.Blobs/tests/SessionRecords/BlobBaseClientTests/GetPropertiesAsync_ObjectReplication.json @@ -5,12 +5,13 @@ "RequestMethod": "HEAD", "RequestHeaders": { "Authorization": "Sanitized", + "traceparent": "00-dd154b1af2021949bb3e446e77228642-1b1054d0ca237b4a-00", "User-Agent": [ - "azsdk-net-Storage.Blobs/12.5.0-dev.20200507.1", - "(.NET Core 4.6.28619.01; Microsoft Windows 10.0.18363 )" + "azsdk-net-Storage.Blobs/12.5.0-dev.20200612.1", + "(.NET Core 4.6.28928.01; Microsoft Windows 10.0.18363 )" ], "x-ms-client-request-id": "47bee273-4e5d-3f07-3be2-f8773d9f4a25", - "x-ms-date": "Thu, 07 May 2020 17:45:50 GMT", + "x-ms-date": "Fri, 12 Jun 2020 16:35:50 GMT", "x-ms-return-client-request-id": "true", "x-ms-version": "2019-12-12" }, @@ -21,7 +22,7 @@ "Content-Length": "0", "Content-MD5": "eyObQAWrMwC74Eh3CuRM2g==", "Content-Type": "application/octet-stream", - "Date": "Thu, 07 May 2020 17:45:50 GMT", + "Date": "Fri, 12 Jun 2020 16:35:50 GMT", "ETag": "\u00220x8D7E7D25C0F807B\u0022", "Last-Modified": "Thu, 23 Apr 2020 22:04:56 GMT", "Server": [ @@ -37,7 +38,7 @@ "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", "x-ms-or-fd2da1b9-56f5-45ff-9eb6-310e6dfc2c80_105f9aad-f39b-4064-8e47-ccd7937295ca": "complete", - "x-ms-request-id": "d59c5cd7-501e-008d-1e97-247a72000000", + "x-ms-request-id": "61da097e-d01e-0093-78d7-4096aa000000", "x-ms-server-encrypted": "true", "x-ms-version": "2019-12-12", "x-ms-version-id": "2020-04-23T22:04:56.9882747Z" @@ -49,12 +50,13 @@ "RequestMethod": "HEAD", "RequestHeaders": { "Authorization": "Sanitized", + "traceparent": "00-974cfd877e963343899b6df5c6ab7e22-16b091e65869f246-00", "User-Agent": [ - "azsdk-net-Storage.Blobs/12.5.0-dev.20200507.1", - "(.NET Core 4.6.28619.01; Microsoft Windows 10.0.18363 )" + "azsdk-net-Storage.Blobs/12.5.0-dev.20200612.1", + "(.NET Core 4.6.28928.01; Microsoft Windows 10.0.18363 )" ], "x-ms-client-request-id": "8c5e78f1-ed2c-8c75-abd4-2eed412bc104", - "x-ms-date": "Thu, 07 May 2020 17:45:51 GMT", + "x-ms-date": "Fri, 12 Jun 2020 16:35:51 GMT", "x-ms-return-client-request-id": "true", "x-ms-version": "2019-12-12" }, @@ -65,7 +67,7 @@ "Content-Length": "0", "Content-MD5": "eyObQAWrMwC74Eh3CuRM2g==", "Content-Type": "application/octet-stream", - "Date": "Thu, 07 May 2020 17:45:51 GMT", + "Date": "Fri, 12 Jun 2020 16:35:50 GMT", "ETag": "\u00220x8D7E7D296E94236\u0022", "Last-Modified": "Thu, 23 Apr 2020 22:06:35 GMT", "Server": [ @@ -85,7 +87,7 @@ "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", "x-ms-or-policy-id": "fd2da1b9-56f5-45ff-9eb6-310e6dfc2c80", - "x-ms-request-id": "76b2445b-a01e-0060-4b97-24a65d000000", + "x-ms-request-id": "00f75a7b-001e-001b-3fd7-40e4c1000000", "x-ms-server-encrypted": "true", "x-ms-version": "2019-12-12" }, @@ -94,7 +96,7 @@ ], "Variables": { "RandomSeed": "1341141929", - "Storage_TestConfigDefault": "ProductionTenant\nortestsaccountcbn1\nU2FuaXRpemVk\nhttps://ortestsaccountcbn1.blob.core.windows.net\nhttp://ortestsaccountcbn1.file.core.windows.net\nhttp://ortestsaccountcbn1.queue.core.windows.net\nhttp://ortestsaccountcbn1.table.core.windows.net\n\n\n\n\nhttp://ortestsaccountcbn1-secondary.blob.core.windows.net\nhttp://ortestsaccountcbn1-secondary.file.core.windows.net\nhttp://ortestsaccountcbn1-secondary.queue.core.windows.net\nhttp://ortestsaccountcbn1-secondary.table.core.windows.net\n\nSanitized\n\n\nCloud\nBlobEndpoint=https://ortestsaccountcbn1.blob.core.windows.net/;QueueEndpoint=http://ortestsaccountcbn1.queue.core.windows.net/;FileEndpoint=http://ortestsaccountcbn1.file.core.windows.net/;BlobSecondaryEndpoint=http://ortestsaccountcbn1-secondary.blob.core.windows.net/;QueueSecondaryEndpoint=http://ortestsaccountcbn1-secondary.queue.core.windows.net/;FileSecondaryEndpoint=http://ortestsaccountcbn1-secondary.file.core.windows.net/;AccountName=ortestsaccountcbn1;AccountKey=Sanitized\n", + "Storage_TestConfigDefault": "ProductionTenant\nortestsaccountcbn1\nU2FuaXRpemVk\nhttps://ortestsaccountcbn1.blob.core.windows.net\nhttps://ortestsaccountcbn1.file.core.windows.net\nhttps://ortestsaccountcbn1.queue.core.windows.net\nhttps://ortestsaccountcbn1.table.core.windows.net\n\n\n\n\nhttp://ortestsaccountcbn1-secondary.blob.core.windows.net\nhttp://ortestsaccountcbn1-secondary.file.core.windows.net\nhttp://ortestsaccountcbn1-secondary.queue.core.windows.net\nhttp://ortestsaccountcbn1-secondary.table.core.windows.net\n\nSanitized\n\n\nCloud\nBlobEndpoint=https://ortestsaccountcbn1.blob.core.windows.net/;QueueEndpoint=https://ortestsaccountcbn1.queue.core.windows.net/;FileEndpoint=https://ortestsaccountcbn1.file.core.windows.net/;BlobSecondaryEndpoint=http://ortestsaccountcbn1-secondary.blob.core.windows.net/;QueueSecondaryEndpoint=http://ortestsaccountcbn1-secondary.queue.core.windows.net/;FileSecondaryEndpoint=http://ortestsaccountcbn1-secondary.file.core.windows.net/;AccountName=ortestsaccountcbn1;AccountKey=Sanitized\n", "Storage_TestConfigSecondary": "SecondaryTenant\nvbalaorcentral1\nU2FuaXRpemVk\nhttps://vbalaorcentral1.blob.core.windows.net\nhttp://vbalaorcentral1.file.core.windows.net\nhttp://vbalaorcentral1.queue.core.windows.net\nhttp://vbalaorcentral1.table.core.windows.net\n\n\n\n\nhttp://vbalaorcentral1-secondary.blob.core.windows.net\nhttp://vbalaorcentral1-secondary.file.core.windows.net\nhttp://vbalaorcentral1-secondary.queue.core.windows.net\nhttp://vbalaorcentral1-secondary.table.core.windows.net\n\nSanitized\n\n\nCloud\nBlobEndpoint=https://vbalaorcentral1.blob.core.windows.net/;QueueEndpoint=http://vbalaorcentral1.queue.core.windows.net/;FileEndpoint=http://vbalaorcentral1.file.core.windows.net/;BlobSecondaryEndpoint=http://vbalaorcentral1-secondary.blob.core.windows.net/;QueueSecondaryEndpoint=http://vbalaorcentral1-secondary.queue.core.windows.net/;FileSecondaryEndpoint=http://vbalaorcentral1-secondary.file.core.windows.net/;AccountName=vbalaorcentral1;AccountKey=Sanitized\n" } } \ No newline at end of file diff --git a/sdk/storage/Azure.Storage.Blobs/tests/SessionRecords/BlobBaseClientTests/GetPropertiesAsync_ObjectReplicationAsync.json b/sdk/storage/Azure.Storage.Blobs/tests/SessionRecords/BlobBaseClientTests/GetPropertiesAsync_ObjectReplicationAsync.json index 676a9ba7dd1c..0d0f9c0d335b 100644 --- a/sdk/storage/Azure.Storage.Blobs/tests/SessionRecords/BlobBaseClientTests/GetPropertiesAsync_ObjectReplicationAsync.json +++ b/sdk/storage/Azure.Storage.Blobs/tests/SessionRecords/BlobBaseClientTests/GetPropertiesAsync_ObjectReplicationAsync.json @@ -5,12 +5,13 @@ "RequestMethod": "HEAD", "RequestHeaders": { "Authorization": "Sanitized", + "traceparent": "00-e92bb5a3d32b894f828a3fa1481190e9-9f9915b44202ec45-00", "User-Agent": [ - "azsdk-net-Storage.Blobs/12.5.0-dev.20200507.1", - "(.NET Core 4.6.28619.01; Microsoft Windows 10.0.18363 )" + "azsdk-net-Storage.Blobs/12.5.0-dev.20200612.1", + "(.NET Core 4.6.28928.01; Microsoft Windows 10.0.18363 )" ], "x-ms-client-request-id": "75fbb017-25c1-97bb-d12a-ce61d9653ecd", - "x-ms-date": "Thu, 07 May 2020 17:45:52 GMT", + "x-ms-date": "Fri, 12 Jun 2020 16:35:51 GMT", "x-ms-return-client-request-id": "true", "x-ms-version": "2019-12-12" }, @@ -21,7 +22,7 @@ "Content-Length": "0", "Content-MD5": "eyObQAWrMwC74Eh3CuRM2g==", "Content-Type": "application/octet-stream", - "Date": "Thu, 07 May 2020 17:45:51 GMT", + "Date": "Fri, 12 Jun 2020 16:35:51 GMT", "ETag": "\u00220x8D7E7D25C0F807B\u0022", "Last-Modified": "Thu, 23 Apr 2020 22:04:56 GMT", "Server": [ @@ -37,7 +38,7 @@ "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", "x-ms-or-fd2da1b9-56f5-45ff-9eb6-310e6dfc2c80_105f9aad-f39b-4064-8e47-ccd7937295ca": "complete", - "x-ms-request-id": "57db5292-001e-004b-2097-24b1f3000000", + "x-ms-request-id": "1033a390-b01e-0003-41d7-40acc4000000", "x-ms-server-encrypted": "true", "x-ms-version": "2019-12-12", "x-ms-version-id": "2020-04-23T22:04:56.9882747Z" @@ -49,12 +50,13 @@ "RequestMethod": "HEAD", "RequestHeaders": { "Authorization": "Sanitized", + "traceparent": "00-505a70945a97e74eb4c64cdcefa26a60-558bbe3c5f026f4b-00", "User-Agent": [ - "azsdk-net-Storage.Blobs/12.5.0-dev.20200507.1", - "(.NET Core 4.6.28619.01; Microsoft Windows 10.0.18363 )" + "azsdk-net-Storage.Blobs/12.5.0-dev.20200612.1", + "(.NET Core 4.6.28928.01; Microsoft Windows 10.0.18363 )" ], "x-ms-client-request-id": "7461297f-6f92-7a49-fbdb-8f375ef83b58", - "x-ms-date": "Thu, 07 May 2020 17:45:52 GMT", + "x-ms-date": "Fri, 12 Jun 2020 16:35:52 GMT", "x-ms-return-client-request-id": "true", "x-ms-version": "2019-12-12" }, @@ -65,7 +67,7 @@ "Content-Length": "0", "Content-MD5": "eyObQAWrMwC74Eh3CuRM2g==", "Content-Type": "application/octet-stream", - "Date": "Thu, 07 May 2020 17:45:52 GMT", + "Date": "Fri, 12 Jun 2020 16:35:51 GMT", "ETag": "\u00220x8D7E7D296E94236\u0022", "Last-Modified": "Thu, 23 Apr 2020 22:06:35 GMT", "Server": [ @@ -85,7 +87,7 @@ "x-ms-lease-state": "available", "x-ms-lease-status": "unlocked", "x-ms-or-policy-id": "fd2da1b9-56f5-45ff-9eb6-310e6dfc2c80", - "x-ms-request-id": "a834cdf9-601e-006f-3d97-24d031000000", + "x-ms-request-id": "f3678ebb-601e-0040-02d7-40ddfa000000", "x-ms-server-encrypted": "true", "x-ms-version": "2019-12-12" }, @@ -94,7 +96,7 @@ ], "Variables": { "RandomSeed": "1381194872", - "Storage_TestConfigDefault": "ProductionTenant\nortestsaccountcbn1\nU2FuaXRpemVk\nhttps://ortestsaccountcbn1.blob.core.windows.net\nhttp://ortestsaccountcbn1.file.core.windows.net\nhttp://ortestsaccountcbn1.queue.core.windows.net\nhttp://ortestsaccountcbn1.table.core.windows.net\n\n\n\n\nhttp://ortestsaccountcbn1-secondary.blob.core.windows.net\nhttp://ortestsaccountcbn1-secondary.file.core.windows.net\nhttp://ortestsaccountcbn1-secondary.queue.core.windows.net\nhttp://ortestsaccountcbn1-secondary.table.core.windows.net\n\nSanitized\n\n\nCloud\nBlobEndpoint=https://ortestsaccountcbn1.blob.core.windows.net/;QueueEndpoint=http://ortestsaccountcbn1.queue.core.windows.net/;FileEndpoint=http://ortestsaccountcbn1.file.core.windows.net/;BlobSecondaryEndpoint=http://ortestsaccountcbn1-secondary.blob.core.windows.net/;QueueSecondaryEndpoint=http://ortestsaccountcbn1-secondary.queue.core.windows.net/;FileSecondaryEndpoint=http://ortestsaccountcbn1-secondary.file.core.windows.net/;AccountName=ortestsaccountcbn1;AccountKey=Sanitized\n", + "Storage_TestConfigDefault": "ProductionTenant\nortestsaccountcbn1\nU2FuaXRpemVk\nhttps://ortestsaccountcbn1.blob.core.windows.net\nhttps://ortestsaccountcbn1.file.core.windows.net\nhttps://ortestsaccountcbn1.queue.core.windows.net\nhttps://ortestsaccountcbn1.table.core.windows.net\n\n\n\n\nhttp://ortestsaccountcbn1-secondary.blob.core.windows.net\nhttp://ortestsaccountcbn1-secondary.file.core.windows.net\nhttp://ortestsaccountcbn1-secondary.queue.core.windows.net\nhttp://ortestsaccountcbn1-secondary.table.core.windows.net\n\nSanitized\n\n\nCloud\nBlobEndpoint=https://ortestsaccountcbn1.blob.core.windows.net/;QueueEndpoint=https://ortestsaccountcbn1.queue.core.windows.net/;FileEndpoint=https://ortestsaccountcbn1.file.core.windows.net/;BlobSecondaryEndpoint=http://ortestsaccountcbn1-secondary.blob.core.windows.net/;QueueSecondaryEndpoint=http://ortestsaccountcbn1-secondary.queue.core.windows.net/;FileSecondaryEndpoint=http://ortestsaccountcbn1-secondary.file.core.windows.net/;AccountName=ortestsaccountcbn1;AccountKey=Sanitized\n", "Storage_TestConfigSecondary": "SecondaryTenant\nvbalaorcentral1\nU2FuaXRpemVk\nhttps://vbalaorcentral1.blob.core.windows.net\nhttp://vbalaorcentral1.file.core.windows.net\nhttp://vbalaorcentral1.queue.core.windows.net\nhttp://vbalaorcentral1.table.core.windows.net\n\n\n\n\nhttp://vbalaorcentral1-secondary.blob.core.windows.net\nhttp://vbalaorcentral1-secondary.file.core.windows.net\nhttp://vbalaorcentral1-secondary.queue.core.windows.net\nhttp://vbalaorcentral1-secondary.table.core.windows.net\n\nSanitized\n\n\nCloud\nBlobEndpoint=https://vbalaorcentral1.blob.core.windows.net/;QueueEndpoint=http://vbalaorcentral1.queue.core.windows.net/;FileEndpoint=http://vbalaorcentral1.file.core.windows.net/;BlobSecondaryEndpoint=http://vbalaorcentral1-secondary.blob.core.windows.net/;QueueSecondaryEndpoint=http://vbalaorcentral1-secondary.queue.core.windows.net/;FileSecondaryEndpoint=http://vbalaorcentral1-secondary.file.core.windows.net/;AccountName=vbalaorcentral1;AccountKey=Sanitized\n" } } \ No newline at end of file From a588184cfe6ae56662bcbde43bbc5b8c5b5057a2 Mon Sep 17 00:00:00 2001 From: Amanda Nguyen Date: Fri, 12 Jun 2020 13:17:09 -0700 Subject: [PATCH 2/4] Adding ObjectReplicationPolicy and Rule to BlobsModelFactory --- .../api/Azure.Storage.Blobs.netstandard2.0.cs | 2 ++ .../src/Models/BlobsModelFactory.cs | 24 +++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.0.cs b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.0.cs index af16e7ddd9c2..a83592b3be6e 100644 --- a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.0.cs +++ b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.0.cs @@ -818,6 +818,8 @@ public static partial class BlobsModelFactory public static Azure.Storage.Blobs.Models.BlockList BlockList(System.Collections.Generic.IEnumerable committedBlocks = null, System.Collections.Generic.IEnumerable uncommittedBlocks = null) { throw null; } public static Azure.Storage.Blobs.Models.FilterBlobItem FilterBlobItem(string name, string containerName, string tagValue) { throw null; } public static Azure.Storage.Blobs.Models.FilterBlobSegment FilterBlobSegment(string serviceEndpoint, string where, System.Collections.Generic.IEnumerable blobs, string nextMarker = null) { throw null; } + public static Azure.Storage.Blobs.Models.ObjectReplicationPolicy ObjectReplicationPolicy(string policyId, System.Collections.Generic.IList rules) { throw null; } + public static Azure.Storage.Blobs.Models.ObjectReplicationRule ObjectReplicationRule(string ruleId, Azure.Storage.Blobs.Models.ObjectReplicationStatus replicationStatus) { throw null; } public static Azure.Storage.Blobs.Models.PageBlobInfo PageBlobInfo(Azure.ETag eTag, System.DateTimeOffset lastModified, long blobSequenceNumber) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Storage.Blobs.Models.PageInfo PageInfo(Azure.ETag eTag, System.DateTimeOffset lastModified, byte[] contentHash, byte[] contentCrc64, long blobSequenceNumber, string encryptionKeySha256) { throw null; } diff --git a/sdk/storage/Azure.Storage.Blobs/src/Models/BlobsModelFactory.cs b/sdk/storage/Azure.Storage.Blobs/src/Models/BlobsModelFactory.cs index 04ef0f374478..2c0ec4e7670c 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/Models/BlobsModelFactory.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/Models/BlobsModelFactory.cs @@ -510,5 +510,29 @@ public static BlobQueryError BlobQueryError( IsFatal = isFatal, Position = position }; + + /// + /// Creates a new ObjectReplicationPolicy instance for mocking. + /// + public static ObjectReplicationPolicy ObjectReplicationPolicy( + string policyId, + IList rules) + => new ObjectReplicationPolicy + { + PolicyId = policyId, + Rules = rules + }; + + /// + /// Creates a new ObjectReplicationRule instance for mocking. + /// + public static ObjectReplicationRule ObjectReplicationRule( + string ruleId, + ObjectReplicationStatus replicationStatus) + => new ObjectReplicationRule + { + RuleId = ruleId, + ReplicationStatus = replicationStatus + }; } } From 61391c60257b1faea40a6a9fe353437baf365df8 Mon Sep 17 00:00:00 2001 From: Amanda Nguyen Date: Fri, 12 Jun 2020 17:34:29 -0700 Subject: [PATCH 3/4] Adding blobdetails to blobfactory --- .../src/Models/BlobInfo.cs | 96 ++++++++++++------- .../src/Models/BlobsModelFactory.cs | 64 +++++++++++++ 2 files changed, 123 insertions(+), 37 deletions(-) diff --git a/sdk/storage/Azure.Storage.Blobs/src/Models/BlobInfo.cs b/sdk/storage/Azure.Storage.Blobs/src/Models/BlobInfo.cs index c8169c63b082..7f892084173b 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/Models/BlobInfo.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/Models/BlobInfo.cs @@ -79,11 +79,38 @@ internal BlobDownloadInfo(FlattenedDownloadProperties flattened) { _flattened = flattened; Details = new BlobDownloadDetails() { - _flattened = flattened, + LastModified = flattened.LastModified, + Metadata = flattened.Metadata, + ContentRange = flattened.ContentRange, + ETag = flattened.ETag, + ContentEncoding = flattened.ContentEncoding, + CacheControl = flattened.CacheControl, + ContentDisposition = flattened.ContentDisposition, + ContentLanguage = flattened.ContentLanguage, + BlobSequenceNumber = flattened.BlobSequenceNumber, + CopyCompletedOn = flattened.CopyCompletionTime, + CopyStatusDescription = flattened.CopyStatusDescription, + CopyId = flattened.CopyId, + CopyProgress = flattened.CopyProgress, + CopySource = flattened.CopySource, + CopyStatus = flattened.CopyStatus, + LeaseDuration = flattened.LeaseDuration, + LeaseState = flattened.LeaseState, + LeaseStatus = flattened.LeaseStatus, + AcceptRanges = flattened.AcceptRanges, + BlobCommittedBlockCount = flattened.BlobCommittedBlockCount, + IsServerEncrypted = flattened.IsServerEncrypted, + EncryptionKeySha256 = flattened.EncryptionKeySha256, + EncryptionScope = flattened.EncryptionScope, + BlobContentHash = flattened.BlobContentHash, + TagCount = flattened.TagCount, + VersionId = flattened.VersionId, + IsSealed = flattened.IsSealed, ObjectReplicationSourceProperties = - flattened.ObjectReplicationRules?.Count > 0 - ? BlobExtensions.ParseObjectReplicationIds(flattened.ObjectReplicationRules) - : null + flattened.ObjectReplicationRules?.Count > 0 + ? BlobExtensions.ParseObjectReplicationIds(flattened.ObjectReplicationRules) + : null, + ObjectReplicationDestinationPolicy = flattened.ObjectReplicationPolicyId }; } @@ -102,147 +129,142 @@ public void Dispose() /// public partial class BlobDownloadDetails { - /// - /// Internal flattened property representation - /// - internal FlattenedDownloadProperties _flattened; - /// /// Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob. /// - public DateTimeOffset LastModified => _flattened.LastModified; + public DateTimeOffset LastModified { get; internal set; } /// /// x-ms-meta /// - public IDictionary Metadata => _flattened.Metadata; + public IDictionary Metadata { get; internal set; } /// /// Indicates the range of bytes returned in the event that the client requested a subset of the blob by setting the 'Range' request header. /// - public string ContentRange => _flattened.ContentRange; + public string ContentRange { get; internal set; } /// /// The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes. /// - public ETag ETag => _flattened.ETag; + public ETag ETag { get; internal set; } /// /// This header returns the value that was specified for the Content-Encoding request header /// - public string ContentEncoding => _flattened.ContentEncoding; + public string ContentEncoding { get; internal set; } /// /// This header is returned if it was previously specified for the blob. /// - public string CacheControl => _flattened.CacheControl; + public string CacheControl { get; internal set; } /// /// This header returns the value that was specified for the 'x-ms-blob-content-disposition' header. The Content-Disposition response header field conveys additional information about how to process the response payload, and also can be used to attach additional metadata. For example, if set to attachment, it indicates that the user-agent should not display the response, but instead show a Save As dialog with a filename other than the blob name specified. /// - public string ContentDisposition => _flattened.ContentDisposition; + public string ContentDisposition { get; internal set; } /// /// This header returns the value that was specified for the Content-Language request header. /// - public string ContentLanguage => _flattened.ContentLanguage; + public string ContentLanguage { get; internal set; } /// /// The current sequence number for a page blob. This header is not returned for block blobs or append blobs /// - public long BlobSequenceNumber => _flattened.BlobSequenceNumber; + public long BlobSequenceNumber { get; internal set; } /// /// Conclusion time of the last attempted Copy Blob operation where this blob was the destination blob. This value can specify the time of a completed, aborted, or failed copy attempt. This header does not appear if a copy is pending, if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List. /// - public DateTimeOffset CopyCompletedOn => _flattened.CopyCompletionTime; + public DateTimeOffset CopyCompletedOn { get; internal set; } /// /// Only appears when x-ms-copy-status is failed or pending. Describes the cause of the last fatal or non-fatal copy operation failure. This header does not appear if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List /// - public string CopyStatusDescription => _flattened.CopyStatusDescription; + public string CopyStatusDescription { get; internal set; } /// /// String identifier for this copy operation. Use with Get Blob Properties to check the status of this copy operation, or pass to Abort Copy Blob to abort a pending copy. /// - public string CopyId => _flattened.CopyId; + public string CopyId { get; internal set; } /// /// Contains the number of bytes copied and the total bytes in the source in the last attempted Copy Blob operation where this blob was the destination blob. Can show between 0 and Content-Length bytes copied. This header does not appear if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List /// - public string CopyProgress => _flattened.CopyProgress; + public string CopyProgress { get; internal set; } /// /// URL up to 2 KB in length that specifies the source blob or file used in the last attempted Copy Blob operation where this blob was the destination blob. This header does not appear if this blob has never been the destination in a Copy Blob operation, or if this blob has been modified after a concluded Copy Blob operation using Set Blob Properties, Put Blob, or Put Block List. /// - public Uri CopySource => _flattened.CopySource; + public Uri CopySource { get; internal set; } /// /// State of the copy operation identified by x-ms-copy-id. /// - public CopyStatus CopyStatus => _flattened.CopyStatus; + public CopyStatus CopyStatus { get; internal set; } /// /// When a blob is leased, specifies whether the lease is of infinite or fixed duration. /// - public LeaseDurationType LeaseDuration => _flattened.LeaseDuration; + public LeaseDurationType LeaseDuration { get; internal set; } /// /// Lease state of the blob. /// - public LeaseState LeaseState => _flattened.LeaseState; + public LeaseState LeaseState { get; internal set; } /// /// The current lease status of the blob. /// - public LeaseStatus LeaseStatus => _flattened.LeaseStatus; + public LeaseStatus LeaseStatus { get; internal set; } /// /// Indicates that the service supports requests for partial blob content. /// - public string AcceptRanges => _flattened.AcceptRanges; + public string AcceptRanges { get; internal set; } /// /// The number of committed blocks present in the blob. This header is returned only for append blobs. /// - public int BlobCommittedBlockCount => _flattened.BlobCommittedBlockCount; + public int BlobCommittedBlockCount { get; internal set; } /// /// The value of this header is set to true if the blob data and application metadata are completely encrypted using the specified algorithm. Otherwise, the value is set to false (when the blob is unencrypted, or if only parts of the blob/application metadata are encrypted). /// - public bool IsServerEncrypted => _flattened.IsServerEncrypted; + public bool IsServerEncrypted { get; internal set; } /// /// The SHA-256 hash of the encryption key used to encrypt the blob. This header is only returned when the blob was encrypted with a customer-provided key. /// - public string EncryptionKeySha256 => _flattened.EncryptionKeySha256; + public string EncryptionKeySha256 { get; internal set; } /// /// The encryption scope used to encrypt the blob. /// - public string EncryptionScope => _flattened.EncryptionScope; + public string EncryptionScope { get; internal set; } /// /// If the blob has a MD5 hash, and if request contains range header (Range or x-ms-range), this response header is returned with the value of the whole blob's MD5 value. This value may or may not be equal to the value returned in Content-MD5 header, with the latter calculated from the requested range /// #pragma warning disable CA1819 // Properties should not return arrays - public byte[] BlobContentHash => _flattened.BlobContentHash; + public byte[] BlobContentHash { get; internal set; } #pragma warning restore CA1819 // Properties should not return arrays /// /// The number of tags associated with the blob. /// - public long TagCount => _flattened.TagCount; + public long TagCount { get; internal set; } /// /// A DateTime value returned by the service that uniquely identifies the blob. The value of this header indicates the blob version, and may be used in subsequent requests to access this version of the blob. /// - public string VersionId => _flattened.VersionId; + public string VersionId { get; internal set; } /// /// If this blob is sealed. /// - public bool IsSealed => _flattened.IsSealed; + public bool IsSealed { get; internal set; } /// /// x-ms-or @@ -252,7 +274,7 @@ public partial class BlobDownloadDetails /// /// Object Replication Policy Id. This value is only set when the policy id /// - public string ObjectReplicationDestinationPolicy => _flattened.ObjectReplicationPolicyId; + public string ObjectReplicationDestinationPolicy { get; internal set; } } /// diff --git a/sdk/storage/Azure.Storage.Blobs/src/Models/BlobsModelFactory.cs b/sdk/storage/Azure.Storage.Blobs/src/Models/BlobsModelFactory.cs index 2c0ec4e7670c..e6638c80fd51 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/Models/BlobsModelFactory.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/Models/BlobsModelFactory.cs @@ -534,5 +534,69 @@ public static ObjectReplicationRule ObjectReplicationRule( RuleId = ruleId, ReplicationStatus = replicationStatus }; + + /// + /// Creates a new BlobDownloadDetails instance for mocking. + /// + public static BlobDownloadDetails BlobDownloadDetails( + DateTimeOffset lastModified, + IDictionary metadata, + string contentRange, + string contentEncoding, + string cacheControl, + string contentDisposition, + string contentLanguage, + long blobSequenceNumber, + DateTimeOffset copyCompletedOn, + string copyStatusDescription, + string copyId, + string copyProgress, + Uri copySource, + CopyStatus copyStatus, + LeaseDurationType leaseDuration, + LeaseState leaseState, + LeaseStatus leaseStatus, + string acceptRanges, + int blobCommittedBlockCount, + bool isServerEncrypted, + string encryptionKeySha256, + string encryptionScope, + byte[] blobContentHash, + long tagCount, + string versionId, + bool isSealed, + IList objectReplicationSourceProperties, + string objectReplicationDestinationPolicy) + => new BlobDownloadDetails + { + LastModified = lastModified, + Metadata = metadata, + ContentRange = contentRange, + ContentEncoding = contentEncoding, + CacheControl = cacheControl, + ContentDisposition = contentDisposition, + ContentLanguage = contentLanguage, + BlobSequenceNumber = blobSequenceNumber, + CopyCompletedOn = copyCompletedOn, + CopyStatusDescription = copyStatusDescription, + CopyId = copyId, + CopyProgress = copyProgress, + CopySource = copySource, + CopyStatus = copyStatus, + LeaseDuration = leaseDuration, + LeaseState = leaseState, + LeaseStatus = leaseStatus, + AcceptRanges = acceptRanges, + BlobCommittedBlockCount = blobCommittedBlockCount, + IsServerEncrypted = isServerEncrypted, + EncryptionKeySha256 = encryptionKeySha256, + EncryptionScope = encryptionScope, + BlobContentHash = blobContentHash, + TagCount = tagCount, + VersionId = versionId, + IsSealed = isSealed, + ObjectReplicationSourceProperties = objectReplicationSourceProperties, + ObjectReplicationDestinationPolicy = objectReplicationDestinationPolicy + }; } } From 12724030f7d2e270d486e9fcf791ae94b85978dc Mon Sep 17 00:00:00 2001 From: Amanda Nguyen Date: Mon, 15 Jun 2020 10:58:44 -0700 Subject: [PATCH 4/4] Ran Export-APIs --- .../api/Azure.Storage.Blobs.netstandard2.0.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.0.cs b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.0.cs index a83592b3be6e..46cc5fe0e94e 100644 --- a/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.0.cs +++ b/sdk/storage/Azure.Storage.Blobs/api/Azure.Storage.Blobs.netstandard2.0.cs @@ -788,6 +788,7 @@ public static partial class BlobsModelFactory [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Storage.Blobs.Models.BlobCopyInfo BlobCopyInfo(Azure.ETag eTag, System.DateTimeOffset lastModified, string copyId, Azure.Storage.Blobs.Models.CopyStatus copyStatus) { throw null; } public static Azure.Storage.Blobs.Models.BlobCopyInfo BlobCopyInfo(Azure.ETag eTag, System.DateTimeOffset lastModified, string versionId, string copyId, Azure.Storage.Blobs.Models.CopyStatus copyStatus) { throw null; } + public static Azure.Storage.Blobs.Models.BlobDownloadDetails BlobDownloadDetails(System.DateTimeOffset lastModified, System.Collections.Generic.IDictionary metadata, string contentRange, string contentEncoding, string cacheControl, string contentDisposition, string contentLanguage, long blobSequenceNumber, System.DateTimeOffset copyCompletedOn, string copyStatusDescription, string copyId, string copyProgress, System.Uri copySource, Azure.Storage.Blobs.Models.CopyStatus copyStatus, Azure.Storage.Blobs.Models.LeaseDurationType leaseDuration, Azure.Storage.Blobs.Models.LeaseState leaseState, Azure.Storage.Blobs.Models.LeaseStatus leaseStatus, string acceptRanges, int blobCommittedBlockCount, bool isServerEncrypted, string encryptionKeySha256, string encryptionScope, byte[] blobContentHash, long tagCount, string versionId, bool isSealed, System.Collections.Generic.IList objectReplicationSourceProperties, string objectReplicationDestinationPolicy) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Storage.Blobs.Models.BlobDownloadInfo BlobDownloadInfo(System.DateTimeOffset lastModified, long blobSequenceNumber, Azure.Storage.Blobs.Models.BlobType blobType, byte[] contentCrc64, string contentLanguage, string copyStatusDescription, string copyId, string copyProgress, System.Uri copySource, Azure.Storage.Blobs.Models.CopyStatus copyStatus, string contentDisposition, Azure.Storage.Blobs.Models.LeaseDurationType leaseDuration, string cacheControl, Azure.Storage.Blobs.Models.LeaseState leaseState, string contentEncoding, Azure.Storage.Blobs.Models.LeaseStatus leaseStatus, byte[] contentHash, string acceptRanges, Azure.ETag eTag, int blobCommittedBlockCount, string contentRange, bool isServerEncrypted, string contentType, string encryptionKeySha256, long contentLength, byte[] blobContentHash, System.Collections.Generic.IDictionary metadata, System.IO.Stream content, System.DateTimeOffset copyCompletionTime) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]