diff --git a/eng/CodeAnalysis.ruleset b/eng/CodeAnalysis.ruleset index fb46145c3031..2ebb3f39641b 100644 --- a/eng/CodeAnalysis.ruleset +++ b/eng/CodeAnalysis.ruleset @@ -190,7 +190,7 @@ - + diff --git a/eng/mgmt/mgmtmetadata/databox_resource-manager.txt b/eng/mgmt/mgmtmetadata/databox_resource-manager.txt new file mode 100644 index 000000000000..a58b8569bb2a --- /dev/null +++ b/eng/mgmt/mgmtmetadata/databox_resource-manager.txt @@ -0,0 +1,14 @@ +Installing AutoRest version: latest +AutoRest installed successfully. +Commencing code generation +Generating CSharp code +Executing AutoRest command +cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/databox/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --tag=package-2019-09 --csharp-sdks-folder=D:\god\azure_sdk_net\azure-sdk-for-net\sdk +2019-10-17 06:34:11 UTC +Azure-rest-api-specs repository information +GitHub fork: Azure +Branch: master +Commit: 59998f796f05580bc1d43ba39f0170204113fa91 +AutoRest information +Requested version: latest +Bootstrapper version: autorest@2.0.4283 diff --git a/sdk/appconfiguration/Azure.Data.AppConfiguration/src/AuthenticationPolicy.cs b/sdk/appconfiguration/Azure.Data.AppConfiguration/src/AuthenticationPolicy.cs index 69f75ff93786..5beec54ffe60 100644 --- a/sdk/appconfiguration/Azure.Data.AppConfiguration/src/AuthenticationPolicy.cs +++ b/sdk/appconfiguration/Azure.Data.AppConfiguration/src/AuthenticationPolicy.cs @@ -68,10 +68,9 @@ private async ValueTask ProcessAsync(HttpMessage message, bool async) var signature = Convert.ToBase64String(hmac.ComputeHash(Encoding.ASCII.GetBytes(stringToSign))); // Calculate the signature string signedHeaders = "date;host;x-ms-content-sha256"; // Semicolon separated header names - // TODO (pri 3): should date header writing be moved out from here? - message.Request.Headers.Add("Date", utcNowString); - message.Request.Headers.Add("x-ms-content-sha256", contentHash); - message.Request.Headers.Add("Authorization", $"HMAC-SHA256 Credential={_credential}&SignedHeaders={signedHeaders}&Signature={signature}"); + message.Request.Headers.SetValue("Date", utcNowString); + message.Request.Headers.SetValue("x-ms-content-sha256", contentHash); + message.Request.Headers.SetValue("Authorization", $"HMAC-SHA256 Credential={_credential}&SignedHeaders={signedHeaders}&Signature={signature}"); } } diff --git a/sdk/appconfiguration/Azure.Data.AppConfiguration/tests/ConfigurationMockTests.cs b/sdk/appconfiguration/Azure.Data.AppConfiguration/tests/ConfigurationMockTests.cs index ac47ab3b1439..4d144786743c 100644 --- a/sdk/appconfiguration/Azure.Data.AppConfiguration/tests/ConfigurationMockTests.cs +++ b/sdk/appconfiguration/Azure.Data.AppConfiguration/tests/ConfigurationMockTests.cs @@ -6,6 +6,7 @@ using System.Diagnostics; using System.Globalization; using System.IO; +using System.Linq; using System.Text; using System.Text.Json; using System.Text.RegularExpressions; @@ -820,6 +821,29 @@ public async Task CustomHeadersAreAdded() Assert.IsFalse(request.Headers.TryGetValue("x-ms-random-id", out string randomId)); } + [Test] + public async Task AuthorizationHeadersAddedOnceWithRetries() + { + var response = new MockResponse(200); + response.SetContent(SerializationHelpers.Serialize(s_testSetting, SerializeSetting)); + + var mockTransport = new MockTransport(new MockResponse(503), response); + ConfigurationClient service = CreateTestService(mockTransport); + + ConfigurationSetting setting = await service.GetAsync(s_testSetting.Key, s_testSetting.Label); + + var retriedRequest = mockTransport.Requests[1]; + + AssertRequestCommon(retriedRequest); + Assert.True(retriedRequest.Headers.TryGetValues("Date", out var dateHeaders)); + Assert.True(retriedRequest.Headers.TryGetValues("x-ms-content-sha256", out var contentHashHeaders)); + Assert.True(retriedRequest.Headers.TryGetValues("Authorization", out var authorizationHeaders)); + Assert.AreEqual(1, dateHeaders.Count()); + Assert.AreEqual(1, contentHashHeaders.Count()); + Assert.AreEqual(1, authorizationHeaders.Count()); + } + + private void AssertContent(byte[] expected, MockRequest request, bool compareAsString = true) { using (var stream = new MemoryStream()) diff --git a/sdk/core/Azure.Core/src/AccessToken.cs b/sdk/core/Azure.Core/src/AccessToken.cs index c1a78589186f..0f245a3a4cf0 100644 --- a/sdk/core/Azure.Core/src/AccessToken.cs +++ b/sdk/core/Azure.Core/src/AccessToken.cs @@ -5,18 +5,33 @@ namespace Azure.Core { + /// + /// Represents an Azure service bearer access token with expiry information. + /// public struct AccessToken { + /// + /// Creates a new instance of using the provided and . + /// + /// The bearer access token value. + /// The bearer access token expiry date. public AccessToken(string accessToken, DateTimeOffset expiresOn) { Token = accessToken; ExpiresOn = expiresOn; } - public string Token { get; private set; } + /// + /// Get the access token value. + /// + public string Token { get; } - public DateTimeOffset ExpiresOn { get; private set; } + /// + /// Gets the time when the provided token expires. + /// + public DateTimeOffset ExpiresOn { get; } + /// public override bool Equals(object? obj) { if (obj is AccessToken accessToken) @@ -27,6 +42,7 @@ public override bool Equals(object? obj) return false; } + /// public override int GetHashCode() { return Token.GetHashCode() ^ ExpiresOn.GetHashCode(); diff --git a/sdk/core/Azure.Core/src/AsyncPageable.cs b/sdk/core/Azure.Core/src/AsyncPageable.cs index ecafa3f69a26..dcd861fea0fa 100644 --- a/sdk/core/Azure.Core/src/AsyncPageable.cs +++ b/sdk/core/Azure.Core/src/AsyncPageable.cs @@ -41,7 +41,7 @@ protected AsyncPageable(CancellationToken cancellationToken) => /// /// Enumerate the values a at a time. This may - /// make mutliple service requests. + /// make multiple service requests. /// /// /// A continuation token indicating where to resume paging or null to @@ -60,7 +60,7 @@ public abstract IAsyncEnumerable> AsPages( /// /// Enumerate the values in the collection asynchronously. This may - /// make mutliple service requests. + /// make multiple service requests. /// /// /// The used for requests made while diff --git a/sdk/core/Azure.Core/src/AzureExtensions.cs b/sdk/core/Azure.Core/src/AzureExtensions.cs deleted file mode 100644 index 8f2b4b6e2593..000000000000 --- a/sdk/core/Azure.Core/src/AzureExtensions.cs +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using System.Threading; -using System.Threading.Tasks; - -namespace Azure -{ - public static class AzureExtensions - { - /// - /// Periodically calls the server till the LRO completes. - /// - /// The representing a result of starting the operation. - /// - /// - /// - /// This method will periodically call UpdateStatusAsync till HasCompleted is true, then return the final result of the operation. - /// - public static async ValueTask> WaitForCompletionAsync(this Task operation, CancellationToken cancellationToken = default) - where T : notnull - where TOperation: Operation - { - Operation o = await operation.ConfigureAwait(false); - return await o.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - } - - /// - /// Periodically calls the server till the LRO completes. - /// - /// The representing a result of starting the operation. - /// - /// The interval between status requests to the server. - /// The interval can change based on information returned from the server. - /// For example, the server might communicate to the client that there is not reason to poll for status change sooner than some time. - /// - /// - /// - /// - /// This method will periodically call UpdateStatusAsync till HasCompleted is true, then return the final result of the operation. - /// - public static async ValueTask> WaitForCompletionAsync(this Task operation, TimeSpan pollingInterval, CancellationToken cancellationToken) - where T : notnull - where TOperation: Operation - { - Operation o = await operation.ConfigureAwait(false); - return await o.WaitForCompletionAsync(pollingInterval, cancellationToken).ConfigureAwait(false); - } - } -} diff --git a/sdk/core/Azure.Core/src/ClientOptions.cs b/sdk/core/Azure.Core/src/ClientOptions.cs index ea16a57a6f52..f2994fee930c 100644 --- a/sdk/core/Azure.Core/src/ClientOptions.cs +++ b/sdk/core/Azure.Core/src/ClientOptions.cs @@ -8,26 +8,48 @@ namespace Azure.Core { + /// + /// Base type for all client option types, exposes various common client options like , , . + /// public abstract class ClientOptions { private HttpPipelineTransport _transport = HttpClientTransport.Shared; + /// + /// Creates a new instance of . + /// protected ClientOptions() { Retry = new RetryOptions(); Diagnostics = new DiagnosticsOptions(); } + /// + /// The to be used for this client. Defaults to an instance of . + /// public HttpPipelineTransport Transport { get => _transport; set => _transport = value ?? throw new ArgumentNullException(nameof(value)); } + /// + /// Gets the client diagnostic options. + /// public DiagnosticsOptions Diagnostics { get; } + /// + /// Gets the client retry options. + /// public RetryOptions Retry { get; } + /// + /// Adds an policy into the client pipeline. The position of policy in the pipeline is controlled by parameter. + /// If you want the policy to execute once per client request use otherwise use + /// to run the policy for every retry. Note that the same instance of would be added to all pipelines of client constructed using this object. + /// + /// The instance to be added to the pipeline. + /// The position of policy in the pipeline. public void AddPolicy(HttpPipelinePolicy policy, HttpPipelinePosition position) { switch (position) @@ -47,15 +69,16 @@ public void AddPolicy(HttpPipelinePolicy policy, HttpPipelinePosition position) internal IList PerRetryPolicies { get; } = new List(); - #region nobody wants to see these + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object? obj) => base.Equals(obj); + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => base.GetHashCode(); + /// [EditorBrowsable(EditorBrowsableState.Never)] public override string ToString() => base.ToString(); - #endregion } } diff --git a/sdk/core/Azure.Core/src/Cryptography/IKeyEncryptionKey.cs b/sdk/core/Azure.Core/src/Cryptography/IKeyEncryptionKey.cs index abb2e5a329b7..0e84fd3bc95d 100644 --- a/sdk/core/Azure.Core/src/Cryptography/IKeyEncryptionKey.cs +++ b/sdk/core/Azure.Core/src/Cryptography/IKeyEncryptionKey.cs @@ -8,7 +8,7 @@ namespace Azure.Core.Cryptography { /// - /// A key which is used to encrypt, or wrap, another key + /// A key which is used to encrypt, or wrap, another key. /// public interface IKeyEncryptionKey { @@ -18,39 +18,39 @@ public interface IKeyEncryptionKey string KeyId { get; } /// - /// Encrypts the specified key using the specified algorithm + /// Encrypts the specified key using the specified algorithm. /// - /// The key wrap algorithm used to encrypt the specified key - /// The key to be encrypted + /// The key wrap algorithm used to encrypt the specified key. + /// The key to be encrypted. /// A controlling the request lifetime. - /// The encrypted key bytes + /// The encrypted key bytes. byte[] WrapKey(string algorithm, ReadOnlyMemory key, CancellationToken cancellationToken = default); /// - /// Encrypts the specified key using the specified algorithm + /// Encrypts the specified key using the specified algorithm. /// - /// The key wrap algorithm used to encrypt the specified key - /// The key to be encrypted + /// The key wrap algorithm used to encrypt the specified key. + /// The key to be encrypted. /// A controlling the request lifetime. - /// The encrypted key bytes + /// The encrypted key bytes. Task WrapKeyAsync(string algorithm, ReadOnlyMemory key, CancellationToken cancellationToken = default); /// - /// Decrypts the specified encrpted key using the specified algorithm + /// Decrypts the specified encrypted key using the specified algorithm. /// - /// The key wrap algorithm which was used to encrypt the specified encrypted key - /// The encrypted key to be decrypted + /// The key wrap algorithm which was used to encrypt the specified encrypted key. + /// The encrypted key to be decrypted. /// A controlling the request lifetime. - /// The decrpted key bytes + /// The decrypted key bytes. byte[] UnwrapKey(string algorithm, ReadOnlyMemory encryptedKey, CancellationToken cancellationToken = default); /// - /// Decrypts the specified encrpted key using the specified algorithm + /// Decrypts the specified encrypted key using the specified algorithm. /// - /// The key wrap algorithm which was used to encrypt the specified encrypted key - /// The encrypted key to be decrypted + /// The key wrap algorithm which was used to encrypt the specified encrypted key. + /// The encrypted key to be decrypted. /// A controlling the request lifetime. - /// The decrpted key bytes + /// The decrypted key bytes. Task UnwrapKeyAsync(string algorithm, ReadOnlyMemory encryptedKey, CancellationToken cancellationToken = default); } } diff --git a/sdk/core/Azure.Core/src/Cryptography/IKeyEncryptionKeyResolver.cs b/sdk/core/Azure.Core/src/Cryptography/IKeyEncryptionKeyResolver.cs index 211ee7986882..07d483686017 100644 --- a/sdk/core/Azure.Core/src/Cryptography/IKeyEncryptionKeyResolver.cs +++ b/sdk/core/Azure.Core/src/Cryptography/IKeyEncryptionKeyResolver.cs @@ -12,19 +12,19 @@ namespace Azure.Core.Cryptography public interface IKeyEncryptionKeyResolver { /// - /// Retrieves the key encryption key corresponding to the specified keyId + /// Retrieves the key encryption key corresponding to the specified keyId. /// - /// The key idenitifier of the key encryption key to retrieve + /// The key identifier of the key encryption key to retrieve. /// A controlling the request lifetime. - /// The key encryption key corresponding to the specified keyId + /// The key encryption key corresponding to the specified keyId. IKeyEncryptionKey Resolve(string keyId, CancellationToken cancellationToken = default); /// - /// Retrieves the key encryption key corresponding to the specified keyId + /// Retrieves the key encryption key corresponding to the specified keyId. /// - /// The key idenitifier of the key encryption key to retrieve + /// The key identifier of the key encryption key to retrieve. /// A controlling the request lifetime. - /// The key encryption key corresponding to the specified keyId + /// The key encryption key corresponding to the specified keyId. Task ResolveAsync(string keyId, CancellationToken cancellationToken = default); } } diff --git a/sdk/core/Azure.Core/src/Diagnostics/AzureEventSourceListener.cs b/sdk/core/Azure.Core/src/Diagnostics/AzureEventSourceListener.cs index 13aacb2d3f22..bbfd77a574e1 100644 --- a/sdk/core/Azure.Core/src/Diagnostics/AzureEventSourceListener.cs +++ b/sdk/core/Azure.Core/src/Diagnostics/AzureEventSourceListener.cs @@ -11,11 +11,17 @@ namespace Azure.Core.Diagnostics { /// - /// Implementation of that listens to events produces by Azure SDK Client libraries + /// Implementation of that listens to events produces by Azure SDK Client libraries. /// public class AzureEventSourceListener: EventListener { + /// + /// The trait name that has to be present on all event sources collected by this listener. + /// public const string TraitName = "AzureEventSource"; + /// + /// The trait value that has to be present on all event sources collected by this listener. + /// public const string TraitValue = "true"; private readonly List _eventSources = new List(); @@ -42,6 +48,7 @@ public AzureEventSourceListener(Action log, Event _eventSources.Clear(); } + /// protected sealed override void OnEventSourceCreated(EventSource eventSource) { base.OnEventSourceCreated(eventSource); @@ -57,13 +64,14 @@ protected sealed override void OnEventSourceCreated(EventSource eventSource) } } + /// protected sealed override void OnEventWritten(EventWrittenEventArgs eventData) { _log(eventData, EventSourceEventFormatting.Format(eventData)); } /// - /// Creates a new instance of that forwards events to + /// Creates a new instance of that forwards events to . /// /// The level of events to enable. public static AzureEventSourceListener CreateConsoleLogger(EventLevel level = EventLevel.Informational) @@ -72,7 +80,7 @@ public static AzureEventSourceListener CreateConsoleLogger(EventLevel level = Ev } /// - /// Creates a new instance of that forwards events to + /// Creates a new instance of that forwards events to . /// /// The level of events to enable. public static AzureEventSourceListener CreateTraceLogger(EventLevel level = EventLevel.Informational) diff --git a/sdk/core/Azure.Core/src/DiagnosticsOptions.cs b/sdk/core/Azure.Core/src/DiagnosticsOptions.cs index 9b49616a2f9e..0131470e444d 100644 --- a/sdk/core/Azure.Core/src/DiagnosticsOptions.cs +++ b/sdk/core/Azure.Core/src/DiagnosticsOptions.cs @@ -3,9 +3,13 @@ using System; using System.Collections.Generic; +using System.Runtime.InteropServices; namespace Azure.Core { + /// + /// Exposes client options related to logging, telemetry and distributed tracing. + /// public class DiagnosticsOptions { private const int MaxApplicationIdLength = 24; @@ -18,18 +22,48 @@ internal DiagnosticsOptions() ApplicationId = DefaultApplicationId; LoggedHeaderNames = new List() { - "Date", - "traceparent", "x-ms-client-request-id", - "x-ms-request-id" + "x-ms-return-client-request-id", + "traceparent", + + "Accept", + "Cache-Control", + "Connection", + "Content-Length", + "Content-Type", + "Date", + "ETag", + "Expires", + "If-Match", + "If-Modified-Since", + "If-None-Match", + "If-Unmodified-Since", + "Last-Modified", + "Pragma", + "Request-Id", + "Retry-After", + "Server", + "Transfer-Encoding", + "User-Agent" }; LoggedQueryParameters = new List(); } + /// + /// Get or sets value indicating whether HTTP pipeline logging is enabled. + /// public bool IsLoggingEnabled { get; set; } = true; + /// + /// Gets or sets value indicating whether distributed tracing spans are going to be created for this clients methods calls and HTTP calls. + /// public bool IsDistributedTracingEnabled { get; set; } = true; + /// + /// Gets or sets value indicating whether the "User-Agent" header containing , client library package name and version, + /// and should be sent. + /// The default value can be controlled process wide by setting AZURE_TELEMETRY_DISABLED to true, false, 1 or 0. + /// public bool IsTelemetryEnabled { get; set; } /// @@ -52,6 +86,9 @@ internal DiagnosticsOptions() /// public IList LoggedQueryParameters { get; } + /// + /// Gets or sets the value sent a the first part of "User-Agent" headers for all requests issues by this client. Defaults to . + /// public string? ApplicationId { get => _applicationId; @@ -65,6 +102,9 @@ public string? ApplicationId } } + /// + /// Gets or sets the default application id. Default application id would be set on all instances. + /// public static string? DefaultApplicationId { get; set; } private static bool? EnvironmentVariableToBool(string value) diff --git a/sdk/core/Azure.Core/src/ETag.cs b/sdk/core/Azure.Core/src/ETag.cs index f395e801189b..59a8fd2ea1a0 100644 --- a/sdk/core/Azure.Core/src/ETag.cs +++ b/sdk/core/Azure.Core/src/ETag.cs @@ -2,10 +2,12 @@ // Licensed under the MIT License. using System; -using System.Data; namespace Azure { + /// + /// Represents an HTTP ETag. + /// public readonly struct ETag : IEquatable { private const char QuoteCharacter = '"'; @@ -13,34 +15,63 @@ namespace Azure private readonly string _value; + /// + /// Creates a new instance of . + /// + /// The string value of the ETag. public ETag(string etag) => _value = etag; + /// + /// Compares equality of two instances. + /// + /// The to compare. + /// The to compare to. + /// true if values of both ETags are equal, otherwise. false public static bool operator ==(ETag left, ETag right) => left.Equals(right); + /// + /// Compares inequality of two instances. + /// + /// The to compare. + /// The to compare to. + /// true if values of both ETags are not equal, otherwise. false public static bool operator !=(ETag left, ETag right) => !left.Equals(right); + /// + /// Instance of with the value. * + /// public static readonly ETag All = new ETag("*"); + /// public bool Equals(ETag other) { return string.Equals(_value, other._value, StringComparison.Ordinal); } - + /// + /// Indicates whether the value of current is equal to the provided string. + /// An object to compare with this object. + /// true if the current object is equal to the other parameter; otherwise, false. public bool Equals(string? other) { return string.Equals(_value, other, StringComparison.Ordinal); } + /// public override bool Equals(object? obj) { return (obj is ETag other) && Equals(other); } + /// public override int GetHashCode() { return _value?.GetHashCode() ?? 0; } + /// + /// + /// + /// The string representation of this . public override string ToString() { return _value ?? ""; diff --git a/sdk/core/Azure.Core/src/HttpHeader.cs b/sdk/core/Azure.Core/src/HttpHeader.cs index 2fe0b40d71ad..56f7ba61a188 100644 --- a/sdk/core/Azure.Core/src/HttpHeader.cs +++ b/sdk/core/Azure.Core/src/HttpHeader.cs @@ -5,8 +5,16 @@ namespace Azure.Core { + /// + /// Represents an HTTP header. + /// public readonly struct HttpHeader : IEquatable { + /// + /// Creates a new instance of with provided name and value. + /// + /// The header name. + /// The header value. public HttpHeader(string name, string value) { if (string.IsNullOrEmpty(name)) @@ -18,10 +26,17 @@ public HttpHeader(string name, string value) Value = value; } + /// + /// Gets header name. + /// public string Name { get; } + /// + /// Gets header value. If header has multiple values they would be joined with a comma. To get separate values use or . + /// public string Value { get; } + /// public override int GetHashCode() { var hashCode = new HashCodeBuilder(); @@ -30,6 +45,7 @@ public override int GetHashCode() return hashCode.ToHashCode(); } + /// public override bool Equals(object? obj) { if (obj is HttpHeader header) @@ -39,36 +55,89 @@ public override bool Equals(object? obj) return false; } + /// public override string ToString() => $"{Name}:{Value}"; + /// public bool Equals(HttpHeader other) { return string.Equals(Name, other.Name, StringComparison.OrdinalIgnoreCase) && Value.Equals(other.Value, StringComparison.Ordinal); } #pragma warning disable CA1034 // Nested types should not be visible + /// + /// Contains names of commonly used headers. + /// public static class Names #pragma warning restore CA1034 // Nested types should not be visible { + /// + /// Returns. "Date" + /// public static string Date => "Date"; + /// + /// Returns. "x-ms-date" + /// public static string XMsDate => "x-ms-date"; + /// + /// Returns. "Content-Type" + /// public static string ContentType => "Content-Type"; + /// + /// Returns. "Content-Length" + /// public static string ContentLength => "Content-Length"; + /// + /// Returns. "ETag" + /// public static string ETag => "ETag"; + /// + /// Returns. "x-ms-request-id" + /// public static string XMsRequestId => "x-ms-request-id"; + /// + /// Returns. "User-Agent" + /// public static string UserAgent => "User-Agent"; + /// + /// Returns. "Accept" + /// public static string Accept => "Accept"; + /// + /// Returns. "Authorization" + /// public static string Authorization => "Authorization"; + /// + /// Returns. "Range" + /// public static string Range => "Range"; + /// + /// Returns. "x-ms-range" + /// public static string XMsRange => "x-ms-range"; + /// + /// Returns. "If-Match" + /// public static string IfMatch => "If-Match"; + /// + /// Returns. "If-None-Match" + /// public static string IfNoneMatch => "If-None-Match"; + /// + /// Returns. "If-Modified-Since" + /// public static string IfModifiedSince => "If-Modified-Since"; + /// + /// Returns. "If-Unmodified-Since" + /// public static string IfUnmodifiedSince => "If-Unmodified-Since"; } #pragma warning disable CA1034 // Nested types should not be visible #pragma warning disable CA1724 // Type name conflicts with standard namespace + /// + /// Commonly defined header values. + /// public static class Common #pragma warning restore CA1034 // Nested types should not be visible #pragma warning restore CA1724 // Type name conflicts with standard namespace @@ -77,9 +146,21 @@ public static class Common private const string ApplicationOctetStream = "application/octet-stream"; private const string ApplicationFormUrlEncoded = "application/x-www-form-urlencoded"; + /// + /// Returns header with name "ContentType" and value "application/json". + /// public static readonly HttpHeader JsonContentType = new HttpHeader(Names.ContentType, ApplicationJson); + /// + /// Returns header with name "Accept" and value "application/json". + /// public static readonly HttpHeader JsonAccept = new HttpHeader(Names.Accept, ApplicationJson); + /// + /// Returns header with name "ContentType" and value "application/octet-stream". + /// public static readonly HttpHeader OctetStreamContentType = new HttpHeader(Names.ContentType, ApplicationOctetStream); + /// + /// Returns header with name "ContentType" and value "application/x-www-form-urlencoded". + /// public static readonly HttpHeader FormUrlEncodedContentType = new HttpHeader(Names.ContentType, ApplicationFormUrlEncoded); } } diff --git a/sdk/core/Azure.Core/src/HttpMessage.cs b/sdk/core/Azure.Core/src/HttpMessage.cs index 18d4cf9bada0..6045e2cae62e 100644 --- a/sdk/core/Azure.Core/src/HttpMessage.cs +++ b/sdk/core/Azure.Core/src/HttpMessage.cs @@ -1,21 +1,28 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -#nullable enable - using System; using System.Collections.Generic; using System.IO; using System.Threading; +using Azure.Core.Pipeline; namespace Azure.Core { + /// + /// Represents a context flowing through the . + /// public sealed class HttpMessage: IDisposable { private Dictionary? _properties; private Response? _response; + /// + /// Creates a new instance of . + /// + /// The request. + /// The response classifier. public HttpMessage(Request request, ResponseClassifier responseClassifier) { Request = request; @@ -23,8 +30,15 @@ public HttpMessage(Request request, ResponseClassifier responseClassifier) BufferResponse = true; } + /// + /// Gets the associated with this message. + /// public Request Request { get; } + /// + /// Gets the associated with this message. Throws an exception if it wasn't set yet. + /// To avoid the exception use property to check. + /// public Response Response { get @@ -40,10 +54,19 @@ public Response Response set => _response = value; } + /// + /// Gets the value indicating if the response is set on this message. + /// public bool HasResponse => _response != null; + /// + /// The instance to use for response classification during pipeline invocation. + /// public CancellationToken CancellationToken { get; internal set; } + /// + /// The instance to use for response classification during pipeline invocation. + /// public ResponseClassifier ResponseClassifier { get; } /// @@ -51,12 +74,23 @@ public Response Response /// public bool BufferResponse { get; set; } + /// + /// Gets a property that modifies the pipeline behavior. Please refer to individual policies documentation on what properties it supports. + /// + /// The property name. + /// The property value. + /// true if property exists, otherwise. false. public bool TryGetProperty(string name, out object? value) { value = null; return _properties?.TryGetValue(name, out value) == true; } + /// + /// Sets a property that modifies the pipeline behavior. Please refer to individual policies documentation on what properties it supports. + /// + /// The property name. + /// The property value. public void SetProperty(string name, object value) { _properties ??= new Dictionary(); @@ -64,6 +98,10 @@ public void SetProperty(string name, object value) _properties[name] = value; } + /// + /// Returns the response content stream and releases it ownership to the caller. After calling this methods using would result in exception. + /// + /// The content stream or null if response didn't have any. public Stream? ExtractResponseContent() { switch (_response?.ContentStream) @@ -78,6 +116,9 @@ public void SetProperty(string name, object value) } } + /// + /// Disposes the request and response. + /// public void Dispose() { Request?.Dispose(); diff --git a/sdk/core/Azure.Core/src/HttpRange.cs b/sdk/core/Azure.Core/src/HttpRange.cs index 36b3de5612ad..7de93135e84b 100644 --- a/sdk/core/Azure.Core/src/HttpRange.cs +++ b/sdk/core/Azure.Core/src/HttpRange.cs @@ -29,10 +29,10 @@ namespace Azure public long? Length { get; } /// - /// Creates an instance of HttpRange + /// Creates an instance of HttpRange. /// /// The starting offset of the . Defaults to 0. - /// The lenght of the range. null means to the end + /// The length of the range. null means to the end. public HttpRange(long offset = 0, long? length = default) { if (offset < 0) diff --git a/sdk/core/Azure.Core/src/Operation{T}.cs b/sdk/core/Azure.Core/src/Operation{T}.cs index e747447b8df7..26251e81b80c 100644 --- a/sdk/core/Azure.Core/src/Operation{T}.cs +++ b/sdk/core/Azure.Core/src/Operation{T}.cs @@ -26,7 +26,7 @@ public abstract class Operation where T : notnull /// Final result of the LRO. /// /// - /// This property can be accessed only after the operation completes succesfully (HasValue is true). + /// This property can be accessed only after the operation completes successfully (HasValue is true). /// public abstract T Value { get; } @@ -46,7 +46,7 @@ public abstract class Operation where T : notnull public abstract bool HasCompleted { get; } /// - /// Returns true if the LRO completed succesfully and has produced final result (accessible by Value property). + /// Returns true if the LRO completed successfully and has produced final result (accessible by Value property). /// public abstract bool HasValue { get; } @@ -95,12 +95,15 @@ public abstract class Operation where T : notnull /// public abstract Response UpdateStatus(CancellationToken cancellationToken = default); + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => base.Equals(obj); + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => base.GetHashCode(); + /// [EditorBrowsable(EditorBrowsableState.Never)] public override string ToString() => base.ToString(); } diff --git a/sdk/core/Azure.Core/src/Pageable.cs b/sdk/core/Azure.Core/src/Pageable.cs index a5bda71995ba..5b410de07e3c 100644 --- a/sdk/core/Azure.Core/src/Pageable.cs +++ b/sdk/core/Azure.Core/src/Pageable.cs @@ -8,6 +8,11 @@ namespace Azure { + /// + /// A collection of values that may take multiple service requests to + /// iterate over. + /// + /// The type of the values. public abstract class Pageable : IEnumerable where T : notnull { /// @@ -36,7 +41,7 @@ protected Pageable(CancellationToken cancellationToken) => /// /// Enumerate the values a at a time. This may - /// make mutliple service requests. + /// make multiple service requests. /// /// /// A continuation token indicating where to resume paging or null to diff --git a/sdk/core/Azure.Core/src/Pipeline/HttpPipelinePolicy.cs b/sdk/core/Azure.Core/src/Pipeline/HttpPipelinePolicy.cs index be3d989f3f34..cf5762aa9b1d 100644 --- a/sdk/core/Azure.Core/src/Pipeline/HttpPipelinePolicy.cs +++ b/sdk/core/Azure.Core/src/Pipeline/HttpPipelinePolicy.cs @@ -12,7 +12,7 @@ public abstract class HttpPipelinePolicy { /// /// Applies the policy to the . Implementers are expected to mutate before calling and observe the changes after. - /// Last policy in the pipeline is expected to set the + /// Last policy in the pipeline is expected to set the . /// /// The this policy would be applied to. /// The set of to execute after current one. diff --git a/sdk/core/Azure.Core/src/Pipeline/Internal/HttpEnvironmentProxy.cs b/sdk/core/Azure.Core/src/Pipeline/Internal/HttpEnvironmentProxy.cs index 9a482238effa..b6c91fd89419 100644 --- a/sdk/core/Azure.Core/src/Pipeline/Internal/HttpEnvironmentProxy.cs +++ b/sdk/core/Azure.Core/src/Pipeline/Internal/HttpEnvironmentProxy.cs @@ -236,7 +236,7 @@ private bool IsMatchInBypassList(Uri input) } /// - /// Gets the proxy URI. (iWebProxy interface) + /// Gets the proxy URI. (iWebProxy interface). /// public Uri GetProxy(Uri uri) { diff --git a/sdk/core/Azure.Core/src/Pipeline/Internal/HttpEnvironmentProxyCredentials.cs b/sdk/core/Azure.Core/src/Pipeline/Internal/HttpEnvironmentProxyCredentials.cs index a2897443ccb7..664b2e7553e9 100644 --- a/sdk/core/Azure.Core/src/Pipeline/Internal/HttpEnvironmentProxyCredentials.cs +++ b/sdk/core/Azure.Core/src/Pipeline/Internal/HttpEnvironmentProxyCredentials.cs @@ -58,7 +58,7 @@ public static HttpEnvironmentProxyCredentials TryCreate(Uri httpProxy, Uri https } /// - /// Converts string containing user:password to NetworkCredential object + /// Converts string containing user:password to NetworkCredential object. /// private static NetworkCredential GetCredentialsFromString(string value) { diff --git a/sdk/core/Azure.Core/src/RequestConditions.cs b/sdk/core/Azure.Core/src/RequestConditions.cs index 01c81a2eb9e2..5b37d18f4a8b 100644 --- a/sdk/core/Azure.Core/src/RequestConditions.cs +++ b/sdk/core/Azure.Core/src/RequestConditions.cs @@ -5,6 +5,9 @@ namespace Azure { + /// + /// Specifies HTTP options for conditional requests based on modification time. + /// public class RequestConditions : MatchConditions { /// @@ -15,7 +18,7 @@ public class RequestConditions : MatchConditions /// /// Optionally limit requests to resources that have remained - /// unmodified + /// unmodified. /// public DateTimeOffset? IfUnmodifiedSince { get; set; } } diff --git a/sdk/core/Azure.Core/src/RequestContent.cs b/sdk/core/Azure.Core/src/RequestContent.cs index c91ef46850c3..d30d4091defa 100644 --- a/sdk/core/Azure.Core/src/RequestContent.cs +++ b/sdk/core/Azure.Core/src/RequestContent.cs @@ -10,23 +10,71 @@ namespace Azure.Core { + /// + /// Represents the content sent as part of the . + /// public abstract class RequestContent : IDisposable { + /// + /// Creates an instance of that wraps a . + /// + /// The to use. + /// An instance of that wraps a . public static RequestContent Create(Stream stream) => new StreamContent(stream); + + /// + /// Creates an instance of that wraps an of . + /// + /// The of to use. + /// An instance of that wraps provided of . public static RequestContent Create(byte[] bytes) => new ArrayContent(bytes, 0, bytes.Length); + /// + /// Creates an instance of that wraps an of . + /// + /// The of to use. + /// The offset in to start from. + /// The length of the segment to use. + /// An instance of that wraps provided of . public static RequestContent Create(byte[] bytes, int index, int length) => new ArrayContent(bytes, index, length); + /// + /// Creates an instance of that wraps a . + /// + /// The to use. + /// An instance of that wraps a . public static RequestContent Create(ReadOnlyMemory bytes) => new MemoryContent(bytes); + /// + /// Creates an instance of that wraps a . + /// + /// The to use. + /// An instance of that wraps a . public static RequestContent Create(ReadOnlySequence bytes) => new ReadOnlySequenceContent(bytes); + /// + /// Writes contents of this object to an instance of . + /// + /// The stream to write to. + /// To cancellation token to use. public abstract Task WriteToAsync(Stream stream, CancellationToken cancellation); + /// + /// Writes contents of this object to an instance of . + /// + /// The stream to write to. + /// To cancellation token to use. public abstract void WriteTo(Stream stream, CancellationToken cancellation); + /// + /// Attempts to compute the length of the underlying content, if available. + /// + /// The length of the underlying data. public abstract bool TryComputeLength(out long length); + /// + /// Frees resources held by the object. + /// public abstract void Dispose(); private sealed class StreamContent : RequestContent @@ -107,8 +155,6 @@ public ArrayContent(byte[] bytes, int index, int length) _contentLength = length; } - public ReadOnlyMemory Bytes => _bytes.AsMemory(_contentStart, _contentLength); - public override void Dispose() { } public override void WriteTo(Stream stream, CancellationToken cancellation) diff --git a/sdk/core/Azure.Core/src/RequestFailedException.cs b/sdk/core/Azure.Core/src/RequestFailedException.cs index 0c1ed7c61bd7..135e38f58d3f 100644 --- a/sdk/core/Azure.Core/src/RequestFailedException.cs +++ b/sdk/core/Azure.Core/src/RequestFailedException.cs @@ -11,7 +11,7 @@ namespace Azure public class RequestFailedException : Exception { /// - /// Gets the HTTP status code of the response. Returns 0 if response was not received. + /// Gets the HTTP status code of the response. Returns. 0 if response was not received. /// public int Status { get; } diff --git a/sdk/core/Azure.Core/src/RequestHeaders.cs b/sdk/core/Azure.Core/src/RequestHeaders.cs index 4bff52e975ab..1a71dba435c6 100644 --- a/sdk/core/Azure.Core/src/RequestHeaders.cs +++ b/sdk/core/Azure.Core/src/RequestHeaders.cs @@ -7,6 +7,9 @@ namespace Azure.Core { + /// + /// Headers to be sent as part of the . + /// public readonly struct RequestHeaders : IEnumerable { private readonly Request _request; @@ -16,46 +19,91 @@ internal RequestHeaders(Request request) _request = request; } + /// + /// Returns an enumerator that iterates through the . + /// + /// A for the . public IEnumerator GetEnumerator() { return _request.EnumerateHeaders().GetEnumerator(); } + /// + /// Returns an enumerator that iterates through the . + /// + /// A for the . IEnumerator IEnumerable.GetEnumerator() { return _request.EnumerateHeaders().GetEnumerator(); } + /// + /// Adds the instance to the collection. + /// + /// The header to add. public void Add(HttpHeader header) { _request.AddHeader(header.Name, header.Value); } + /// + /// Adds the header to the collection. If a header with this name already exist adds an additional value to the header values. + /// + /// The header name. + /// The header value. public void Add(string name, string value) { _request.AddHeader(name, value); } + /// + /// Returns header value if headers is stored in the collection. If header has multiple values they are going to be joined with a comma. + /// + /// The header name. + /// The reference to populate with value. + /// true if the specified header is stored in the collection, otherwise. false public bool TryGetValue(string name, [NotNullWhen(true)] out string? value) { return _request.TryGetHeader(name, out value); } + /// + /// Returns header values if headers is stored in the collection. + /// + /// The header name. + /// The reference to populate with values. + /// true if the specified header is stored in the collection, otherwise. false public bool TryGetValues(string name, [NotNullWhen(true)] out IEnumerable? values) { return _request.TryGetHeaderValues(name, out values); } + + /// + /// Returns if headers is stored in the collection. + /// + /// The header name. + /// true if the specified header is stored in the collection, otherwise. false public bool Contains(string name) { return _request.ContainsHeader(name); } + /// + /// Sets the header value name. If a header with this name already exist replaces it's value. + /// + /// The header name. + /// The header value. public void SetValue(string name, string value) { _request.SetHeader(name, value); } + /// + /// Removes the header from the collection. + /// + /// The header name. + /// true if header existed, otherwise. false public bool Remove(string name) { return _request.RemoveHeader(name); diff --git a/sdk/core/Azure.Core/src/RequestMethod.cs b/sdk/core/Azure.Core/src/RequestMethod.cs index ea5ce1de42c0..d2c5b13348d1 100644 --- a/sdk/core/Azure.Core/src/RequestMethod.cs +++ b/sdk/core/Azure.Core/src/RequestMethod.cs @@ -5,17 +5,46 @@ namespace Azure.Core { + /// + /// Represents HTTP methods sent as part of a . + /// public readonly struct RequestMethod : IEquatable { + /// + /// Gets the HTTP method. + /// public string Method { get; } + /// + /// Gets instance for GET method. + /// public static RequestMethod Get { get; } = new RequestMethod("GET"); + /// + /// Gets instance for POST method. + /// public static RequestMethod Post { get; } = new RequestMethod("POST"); + /// + /// Gets instance for PUT method. + /// public static RequestMethod Put { get; } = new RequestMethod("PUT"); + /// + /// Gets instance for PATCH method. + /// public static RequestMethod Patch { get; } = new RequestMethod("PATCH"); + /// + /// Gets instance for DELETE method. + /// public static RequestMethod Delete { get; } = new RequestMethod("DELETE"); + /// + /// Gets instance for HEAD method. + /// public static RequestMethod Head { get; } = new RequestMethod("HEAD"); + /// + /// Creates an instance of with provided method. Method must be all uppercase. + /// Prefer if can be one of predefined method names. + /// + /// The method to use. public RequestMethod(string method) { Argument.AssertNotNull(method, nameof(method)); @@ -23,6 +52,10 @@ public RequestMethod(string method) Method = method.ToUpperInvariant(); } + /// + /// Parses string to it's representation. + /// + /// The method string to parse. public static RequestMethod Parse(string method) { Argument.AssertNotNull(method, nameof(method)); @@ -66,31 +99,47 @@ public static RequestMethod Parse(string method) return new RequestMethod(method); } + /// public bool Equals(RequestMethod other) { return string.Equals(Method, other.Method, StringComparison.Ordinal); } + /// public override bool Equals(object? obj) { return obj is RequestMethod other && Equals(other); } + /// public override int GetHashCode() { return Method?.GetHashCode() ?? 0; } + /// + /// Compares equality of two instances. + /// + /// The method to compare. + /// The method to compare against. + /// true if values are equal for and , otherwise. false public static bool operator ==(RequestMethod left, RequestMethod right) { return left.Equals(right); } + /// + /// Compares inequality of two instances. + /// + /// The method to compare. + /// The method to compare against. + /// true if values are equal for and , otherwise. false public static bool operator !=(RequestMethod left, RequestMethod right) { return !left.Equals(right); } + /// public override string ToString() { return Method ?? ""; diff --git a/sdk/core/Azure.Core/src/RequestUriBuilder.cs b/sdk/core/Azure.Core/src/RequestUriBuilder.cs index 423e9598ba19..3b3868de8378 100644 --- a/sdk/core/Azure.Core/src/RequestUriBuilder.cs +++ b/sdk/core/Azure.Core/src/RequestUriBuilder.cs @@ -6,6 +6,9 @@ namespace Azure.Core { + /// + /// Provides a custom constructor for uniform resource identifiers (URIs) and modifies URIs for the class. + /// public class RequestUriBuilder { private const char QuerySeparator = '?'; @@ -24,6 +27,9 @@ public class RequestUriBuilder private string? _scheme; + /// + /// Gets or sets the scheme name of the URI. + /// public string? Scheme { get => _scheme; @@ -34,6 +40,9 @@ public string? Scheme } } + /// + /// Gets or sets the Domain Name System (DNS) host name or IP address of a server. + /// public string? Host { get => _host; @@ -44,6 +53,9 @@ public string? Host } } + /// + /// Gets or sets the port number of the URI. + /// public int Port { get => _port; @@ -54,6 +66,9 @@ public int Port } } + /// + /// Gets or sets any query information included in the URI. + /// public string Query { get => HasQuery ? _pathAndQuery.ToString(_queryIndex, _pathAndQuery.Length - _queryIndex) : string.Empty; @@ -78,6 +93,9 @@ public string Query } } + /// + /// Gets or sets the password associated with the user that accesses the URI and the query information. + /// public string Path { get => HasQuery ? _pathAndQuery.ToString(0, _queryIndex) : _pathAndQuery.ToString(); @@ -103,8 +121,15 @@ public string Path private int PathLength => HasQuery ? _queryIndex : _pathAndQuery.Length; + /// + /// Gets the path to the resource referenced by the URI. + /// public string PathAndQuery => _pathAndQuery.ToString(); + /// + /// Replaces values inside this instance with values provided in parameter. + /// + /// The instance to get values from. public void Reset(Uri value) { Scheme = value.Scheme; @@ -115,6 +140,12 @@ public void Reset(Uri value) _uri = value; } + /// + /// Gets the instance constructed by the specified instance. + /// + /// + /// A that contains the URI constructed by the . + /// public Uri ToUri() { if (_uri == null) @@ -125,11 +156,22 @@ public Uri ToUri() return _uri; } + /// + /// Appends a query parameter adding separator if required. Escapes the value. + /// + /// The name of parameter. + /// The value of parameter. public void AppendQuery(string name, string value) { AppendQuery(name, value, true); } + /// + /// Appends a query parameter adding separator if required. + /// + /// The name of parameter. + /// The value of parameter. + /// Whether value should be escaped. public void AppendQuery(string name, string value, bool escapeValue) { ResetUri(); @@ -152,11 +194,20 @@ public void AppendQuery(string name, string value, bool escapeValue) _pathAndQuery.Append(value); } + /// + /// Appends escaped to without adding path separator. + /// + /// The value to append. public void AppendPath(string value) { AppendPath(value, escape: true); } + /// + /// Appends optionally escaped to without adding path separator. + /// + /// The value to append. + /// Whether value should be escaped. public void AppendPath(string value, bool escape) { if (string.IsNullOrEmpty(value)) @@ -195,6 +246,10 @@ public void AppendPath(string value, bool escape) } } + /// + /// Returns a string representation of this i. + /// + /// public override string ToString() { return ToString(null, string.Empty); diff --git a/sdk/core/Azure.Core/src/ResponseClassifier.cs b/sdk/core/Azure.Core/src/ResponseClassifier.cs index b936e0a0fc30..9e31cc5cc854 100644 --- a/sdk/core/Azure.Core/src/ResponseClassifier.cs +++ b/sdk/core/Azure.Core/src/ResponseClassifier.cs @@ -3,14 +3,13 @@ using System; using System.IO; -using Azure.Core.Pipeline; namespace Azure.Core { public class ResponseClassifier { /// - /// Specifies if the response should terminate the pipeline and not be retried. + /// Specifies if the request should be retried. /// public virtual bool IsRetriableResponse(HttpMessage message) { @@ -18,7 +17,7 @@ public virtual bool IsRetriableResponse(HttpMessage message) } /// - /// Specifies if the exception should terminate the pipeline and not be retried. + /// Specifies if the operation that caused the exception should be retried. /// public virtual bool IsRetriableException(Exception exception) { diff --git a/sdk/core/Azure.Core/src/ResponseHeaders.cs b/sdk/core/Azure.Core/src/ResponseHeaders.cs index c6091d55304a..5617c4be9afd 100644 --- a/sdk/core/Azure.Core/src/ResponseHeaders.cs +++ b/sdk/core/Azure.Core/src/ResponseHeaders.cs @@ -9,6 +9,9 @@ namespace Azure.Core { + /// + /// Headers received as part of the . + /// public readonly struct ResponseHeaders : IEnumerable { private readonly Response _response; @@ -18,40 +21,81 @@ internal ResponseHeaders(Response response) _response = response; } + /// + /// Gets the parsed value of "Date" or "x-ms-date" header. + /// public DateTimeOffset? Date => TryGetValue(HttpHeader.Names.Date, out var value) || TryGetValue(HttpHeader.Names.XMsDate, out value) ? (DateTimeOffset?)DateTimeOffset.Parse(value, CultureInfo.InvariantCulture) : null; + /// + /// Gets the value of "Content-Type" header. + /// public string? ContentType => TryGetValue(HttpHeader.Names.ContentType, out string? value) ? value : null; + /// + /// Gets the parsed value of "Content-Length" header. + /// public int? ContentLength => TryGetValue(HttpHeader.Names.ContentLength, out string? stringValue) ? int.Parse(stringValue, CultureInfo.InvariantCulture) : (int?)null; + /// + /// Gets the parsed value of "ETag" header. + /// public ETag? ETag => TryGetValue(HttpHeader.Names.ETag, out string? stringValue) ? Azure.ETag.Parse(stringValue) : (ETag?)null; + /// + /// Gets the value of "x-ms-request-id" header. + /// public string? RequestId => TryGetValue(HttpHeader.Names.XMsRequestId, out string? value) ? value : null; + /// + /// Returns an enumerator that iterates through the . + /// + /// A for the . public IEnumerator GetEnumerator() { return _response.EnumerateHeaders().GetEnumerator(); } + /// + /// Returns an enumerator that iterates through the . + /// + /// A for the . IEnumerator IEnumerable.GetEnumerator() { return _response.EnumerateHeaders().GetEnumerator(); } + /// + /// Returns header value if headers is stored in the collection. If header has multiple values they are going to be joined with a comma. + /// + /// The header name. + /// The reference to populate with value. + /// true if the specified header is stored in the collection, otherwise. false public bool TryGetValue(string name, [NotNullWhen(true)] out string? value) { return _response.TryGetHeader(name, out value); } + /// + /// Returns header values if headers is stored in the collection. + /// + /// The header name. + /// The reference to populate with values. + /// true if the specified header is stored in the collection, otherwise. false public bool TryGetValues(string name, [NotNullWhen(true)] out IEnumerable? values) { return _response.TryGetHeaderValues(name, out values); } + + /// + /// Returns if headers is stored in the collection. + /// + /// The header name. + /// true if the specified header is stored in the collection, otherwise. false public bool Contains(string name) { return _response.ContainsHeader(name); diff --git a/sdk/core/Azure.Core/src/Response{T}.cs b/sdk/core/Azure.Core/src/Response{T}.cs index b5f1098591ce..a37c3a967d22 100644 --- a/sdk/core/Azure.Core/src/Response{T}.cs +++ b/sdk/core/Azure.Core/src/Response{T}.cs @@ -5,20 +5,38 @@ namespace Azure { + /// + /// Represents a result of Azure operation. + /// + /// The type of returned value. public abstract class Response { + /// + /// Returns the HTTP response returned by the service. + /// + /// The HTTP response returned by the service. public abstract Response GetRawResponse(); + /// + /// Gets the value returned by the service. + /// public abstract T Value { get; } + /// + /// Returns the value of this object. + /// + /// The instance. public static implicit operator T(Response response) => response.Value; + /// [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object? obj) => base.Equals(obj); + /// [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => base.GetHashCode(); + /// [EditorBrowsable(EditorBrowsableState.Never)] public override string ToString() => base.ToString(); } diff --git a/sdk/core/Azure.Core/src/Shared/DiagnosticScope.cs b/sdk/core/Azure.Core/src/Shared/DiagnosticScope.cs index b1b4081a2370..061ac46d0375 100644 --- a/sdk/core/Azure.Core/src/Shared/DiagnosticScope.cs +++ b/sdk/core/Azure.Core/src/Shared/DiagnosticScope.cs @@ -117,7 +117,7 @@ public void AddLink(Activity activity) /// /// HACK HACK HACK. Some runtime environments like Azure.Functions downgrade System.Diagnostic.DiagnosticSource package version causing method not found exceptions in customer apps - /// This type is a temporary workaround to avoid the issue + /// This type is a temporary workaround to avoid the issue. /// internal static class ActivityExtensions { diff --git a/sdk/core/Azure.Core/src/Shared/HashCodeBuilder.cs b/sdk/core/Azure.Core/src/Shared/HashCodeBuilder.cs index b1bd8404d41a..301db77ec72d 100644 --- a/sdk/core/Azure.Core/src/Shared/HashCodeBuilder.cs +++ b/sdk/core/Azure.Core/src/Shared/HashCodeBuilder.cs @@ -8,7 +8,7 @@ namespace Azure.Core { /// - /// Copied from https://github.com/dotnet/corefx/blob/master/src/Common/src/CoreLib/System/HashCode.cs + /// Copied from https://github.com/dotnet/corefx/blob/master/src/Common/src/CoreLib/System/HashCode.cs. /// internal struct HashCodeBuilder { diff --git a/sdk/core/Azure.Core/src/TokenCredential.cs b/sdk/core/Azure.Core/src/TokenCredential.cs index 404206448d14..2705f1e09bc1 100644 --- a/sdk/core/Azure.Core/src/TokenCredential.cs +++ b/sdk/core/Azure.Core/src/TokenCredential.cs @@ -7,12 +7,24 @@ namespace Azure.Core { /// - /// Represents a credential capable of providing an OAuth token + /// Represents a credential capable of providing an OAuth token. /// public abstract class TokenCredential { + /// + /// Gets an for the specified set of scopes. + /// + /// The with authentication information. + /// The to use. + /// A valid . public abstract Task GetTokenAsync(TokenRequestContext requestContext, CancellationToken cancellationToken); + /// + /// Gets an for the specified set of scopes. + /// + /// The with authentication information. + /// The to use. + /// A valid . public abstract AccessToken GetToken(TokenRequestContext requestContext, CancellationToken cancellationToken); } } diff --git a/sdk/core/Azure.Core/src/TokenRequestContext.cs b/sdk/core/Azure.Core/src/TokenRequestContext.cs index 10b5c4481240..53457af8495b 100644 --- a/sdk/core/Azure.Core/src/TokenRequestContext.cs +++ b/sdk/core/Azure.Core/src/TokenRequestContext.cs @@ -5,21 +5,21 @@ namespace Azure.Core { /// - /// Contains the details of an authentication token request + /// Contains the details of an authentication token request. /// public readonly struct TokenRequestContext { /// - /// Creates a new TokenRequest with the specified scopes + /// Creates a new TokenRequest with the specified scopes. /// - /// The scopes required for the token + /// The scopes required for the token. public TokenRequestContext(string[] scopes) { Scopes = scopes; } /// - /// The scopes required for the token + /// The scopes required for the token. /// public string[] Scopes { get; } } diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/AzSdk.RP.props b/sdk/databox/Microsoft.Azure.Management.DataBox/AzSdk.RP.props index 009051ddc9d4..0f004e4c7605 100644 --- a/sdk/databox/Microsoft.Azure.Management.DataBox/AzSdk.RP.props +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/AzSdk.RP.props @@ -1,7 +1,7 @@ - DataBox_2018-01-01; + DataBox_2019-09-01; $(PackageTags);$(CommonTags);$(AzureApiTag); \ No newline at end of file diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/DataBoxManagementClient.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/DataBoxManagementClient.cs index f23f6669f933..0da450cd7581 100644 --- a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/DataBoxManagementClient.cs +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/DataBoxManagementClient.cs @@ -331,7 +331,7 @@ private void Initialize() Jobs = new JobsOperations(this); Service = new ServiceOperations(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2018-01-01"; + ApiVersion = "2019-09-01"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; @@ -363,10 +363,20 @@ private void Initialize() }; SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("copyLogDetailsType")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("copyLogDetailsType")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("dataDestinationType")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("dataDestinationType")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("jobDetailsType")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("jobDetailsType")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("jobSecretsType")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("jobSecretsType")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("skuName")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("skuName")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("validationType")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("validationType")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("validationType")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("validationType")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("validationCategory")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("validationCategory")); CustomInitialize(); DeserializationSettings.Converters.Add(new TransformationJsonConverter()); DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/IServiceOperations.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/IServiceOperations.cs index 8fa91cdaa08e..eaa5a9811a83 100644 --- a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/IServiceOperations.cs +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/IServiceOperations.cs @@ -50,18 +50,74 @@ public partial interface IServiceOperations /// Task>> ListAvailableSkusWithHttpMessagesAsync(string location, AvailableSkuRequest availableSkuRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// This method validates the customer shipping address and provide + /// This method provides the list of available skus for the given + /// subscription, resource group and location. + /// + /// + /// The Resource Group Name + /// + /// + /// The location of the resource + /// + /// + /// Filters for showing the available skus. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListAvailableSkusByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string location, AvailableSkuRequest availableSkuRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// [DEPRECATED NOTICE: This operation will soon be removed] This + /// method validates the customer shipping address and provide /// alternate addresses if any. /// /// /// The location of the resource /// - /// + /// /// Shipping address of the customer. /// - /// - /// Device type to be used for the job. Possible values include: - /// 'DataBox', 'DataBoxDisk', 'DataBoxHeavy' + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] + Task> ValidateAddressMethodWithHttpMessagesAsync(string location, ValidateAddress validateAddress, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// This method does all necessary pre-job creation validation under + /// resource group. + /// + /// + /// The Resource Group Name + /// + /// + /// The location of the resource + /// + /// + /// Inputs of the customer. /// /// /// The headers that will be added to request. @@ -78,7 +134,62 @@ public partial interface IServiceOperations /// /// Thrown when a required parameter is null /// - Task> ValidateAddressMethodWithHttpMessagesAsync(string location, ShippingAddress shippingAddress, SkuName deviceType, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ValidateInputsByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string location, ValidationRequest validationRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// This method does all necessary pre-job creation validation under + /// subscription. + /// + /// + /// The location of the resource + /// + /// + /// Inputs of the customer. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> ValidateInputsWithHttpMessagesAsync(string location, ValidationRequest validationRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// This API provides configuration details specific to given + /// region/location. + /// + /// + /// The location of the resource + /// + /// + /// Request body to get the availability for scheduling orders. + /// + /// + /// Request body to get the transport availability for given sku. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> RegionConfigurationWithHttpMessagesAsync(string location, ScheduleAvailabilityRequest scheduleAvailabilityRequest = default(ScheduleAvailabilityRequest), TransportAvailabilityRequest transportAvailabilityRequest = default(TransportAvailabilityRequest), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// This method provides the list of available skus for the given /// subscription and location. @@ -102,5 +213,28 @@ public partial interface IServiceOperations /// Thrown when a required parameter is null /// Task>> ListAvailableSkusNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// This method provides the list of available skus for the given + /// subscription, resource group and location. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListAvailableSkusByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/AccountCredentialDetails.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/AccountCredentialDetails.cs index fe31670b6081..d7411ee26cc6 100644 --- a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/AccountCredentialDetails.cs +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/AccountCredentialDetails.cs @@ -32,14 +32,17 @@ public AccountCredentialDetails() /// Initializes a new instance of the AccountCredentialDetails class. /// /// Name of the account. + /// Data Destination Type. Possible + /// values include: 'StorageAccount', 'ManagedDisk' /// Connection string of the /// account endpoint to use the account as a storage endpoint on the /// device. /// Per share level unencrypted /// access credentials. - public AccountCredentialDetails(string accountName = default(string), string accountConnectionString = default(string), IList shareCredentialDetails = default(IList)) + public AccountCredentialDetails(string accountName = default(string), DataDestinationType? dataDestinationType = default(DataDestinationType?), string accountConnectionString = default(string), IList shareCredentialDetails = default(IList)) { AccountName = accountName; + DataDestinationType = dataDestinationType; AccountConnectionString = accountConnectionString; ShareCredentialDetails = shareCredentialDetails; CustomInit(); @@ -56,6 +59,13 @@ public AccountCredentialDetails() [JsonProperty(PropertyName = "accountName")] public string AccountName { get; private set; } + /// + /// Gets data Destination Type. Possible values include: + /// 'StorageAccount', 'ManagedDisk' + /// + [JsonProperty(PropertyName = "dataDestinationType")] + public DataDestinationType? DataDestinationType { get; private set; } + /// /// Gets connection string of the account endpoint to use the account /// as a storage endpoint on the device. diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/AddressValidationOutput.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/AddressValidationOutput.cs index 8b85ad385e5a..92b7ca3ea771 100644 --- a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/AddressValidationOutput.cs +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/AddressValidationOutput.cs @@ -34,12 +34,15 @@ public AddressValidationOutput() /// /// Initializes a new instance of the AddressValidationOutput class. /// + /// Error code and message of validation + /// response. /// The address validation status. /// Possible values include: 'Valid', 'Invalid', 'Ambiguous' /// List of alternate /// addresses. - public AddressValidationOutput(AddressValidationStatus? validationStatus = default(AddressValidationStatus?), IList alternateAddresses = default(IList)) + public AddressValidationOutput(Error error = default(Error), AddressValidationStatus? validationStatus = default(AddressValidationStatus?), IList alternateAddresses = default(IList)) { + Error = error; ValidationStatus = validationStatus; AlternateAddresses = alternateAddresses; CustomInit(); @@ -50,6 +53,12 @@ public AddressValidationOutput() /// partial void CustomInit(); + /// + /// Gets error code and message of validation response. + /// + [JsonProperty(PropertyName = "properties.error")] + public Error Error { get; private set; } + /// /// Gets the address validation status. Possible values include: /// 'Valid', 'Invalid', 'Ambiguous' diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/AddressValidationProperties.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/AddressValidationProperties.cs new file mode 100644 index 000000000000..0e95fb2ff577 --- /dev/null +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/AddressValidationProperties.cs @@ -0,0 +1,70 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataBox.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The address validation output. + /// + [Newtonsoft.Json.JsonObject("ValidateAddress")] + public partial class AddressValidationProperties : ValidationInputResponse + { + /// + /// Initializes a new instance of the AddressValidationProperties + /// class. + /// + public AddressValidationProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AddressValidationProperties + /// class. + /// + /// Error code and message of validation + /// response. + /// The address validation status. + /// Possible values include: 'Valid', 'Invalid', 'Ambiguous' + /// List of alternate + /// addresses. + public AddressValidationProperties(Error error = default(Error), AddressValidationStatus? validationStatus = default(AddressValidationStatus?), IList alternateAddresses = default(IList)) + : base(error) + { + ValidationStatus = validationStatus; + AlternateAddresses = alternateAddresses; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the address validation status. Possible values include: + /// 'Valid', 'Invalid', 'Ambiguous' + /// + [JsonProperty(PropertyName = "validationStatus")] + public AddressValidationStatus? ValidationStatus { get; private set; } + + /// + /// Gets list of alternate addresses. + /// + [JsonProperty(PropertyName = "alternateAddresses")] + public IList AlternateAddresses { get; private set; } + + } +} diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/CopyProgress.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/CopyProgress.cs index 6f77dc2efd87..6dc761ebe049 100644 --- a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/CopyProgress.cs +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/CopyProgress.cs @@ -31,18 +31,42 @@ public CopyProgress() /// /// Name of the storage account where /// the data needs to be uploaded. + /// Data Destination Type. Possible + /// values include: 'StorageAccount', 'ManagedDisk' /// Id of the account where the data needs to /// be uploaded. /// Amount of data uploaded by the job /// as of now. /// Total amount of data to be /// processed by the job. - public CopyProgress(string storageAccountName = default(string), string accountId = default(string), long? bytesSentToCloud = default(long?), long? totalBytesToProcess = default(long?)) + /// Number of files processed by the job + /// as of now. + /// Total number of files to be + /// processed by the job. + /// Number of files not adhering to + /// azure naming conventions which were processed by automatic + /// renaming + /// Total amount of data not + /// adhering to azure naming conventions which were processed by + /// automatic renaming + /// Number of folders not adhering + /// to azure naming conventions which were processed by automatic + /// renaming + /// Number of files which could not be + /// copied + public CopyProgress(string storageAccountName = default(string), DataDestinationType? dataDestinationType = default(DataDestinationType?), string accountId = default(string), long? bytesSentToCloud = default(long?), long? totalBytesToProcess = default(long?), long? filesProcessed = default(long?), long? totalFilesToProcess = default(long?), long? invalidFilesProcessed = default(long?), long? invalidFileBytesUploaded = default(long?), long? renamedContainerCount = default(long?), long? filesErroredOut = default(long?)) { StorageAccountName = storageAccountName; + DataDestinationType = dataDestinationType; AccountId = accountId; BytesSentToCloud = bytesSentToCloud; TotalBytesToProcess = totalBytesToProcess; + FilesProcessed = filesProcessed; + TotalFilesToProcess = totalFilesToProcess; + InvalidFilesProcessed = invalidFilesProcessed; + InvalidFileBytesUploaded = invalidFileBytesUploaded; + RenamedContainerCount = renamedContainerCount; + FilesErroredOut = filesErroredOut; CustomInit(); } @@ -58,6 +82,13 @@ public CopyProgress() [JsonProperty(PropertyName = "storageAccountName")] public string StorageAccountName { get; private set; } + /// + /// Gets data Destination Type. Possible values include: + /// 'StorageAccount', 'ManagedDisk' + /// + [JsonProperty(PropertyName = "dataDestinationType")] + public DataDestinationType? DataDestinationType { get; private set; } + /// /// Gets id of the account where the data needs to be uploaded. /// @@ -76,5 +107,44 @@ public CopyProgress() [JsonProperty(PropertyName = "totalBytesToProcess")] public long? TotalBytesToProcess { get; private set; } + /// + /// Gets number of files processed by the job as of now. + /// + [JsonProperty(PropertyName = "filesProcessed")] + public long? FilesProcessed { get; private set; } + + /// + /// Gets total number of files to be processed by the job. + /// + [JsonProperty(PropertyName = "totalFilesToProcess")] + public long? TotalFilesToProcess { get; private set; } + + /// + /// Gets number of files not adhering to azure naming conventions which + /// were processed by automatic renaming + /// + [JsonProperty(PropertyName = "invalidFilesProcessed")] + public long? InvalidFilesProcessed { get; private set; } + + /// + /// Gets total amount of data not adhering to azure naming conventions + /// which were processed by automatic renaming + /// + [JsonProperty(PropertyName = "invalidFileBytesUploaded")] + public long? InvalidFileBytesUploaded { get; private set; } + + /// + /// Gets number of folders not adhering to azure naming conventions + /// which were processed by automatic renaming + /// + [JsonProperty(PropertyName = "renamedContainerCount")] + public long? RenamedContainerCount { get; private set; } + + /// + /// Gets number of files which could not be copied + /// + [JsonProperty(PropertyName = "filesErroredOut")] + public long? FilesErroredOut { get; private set; } + } } diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/CopyStatus.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/CopyStatus.cs index 9cdfab41d44e..f159af11832b 100644 --- a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/CopyStatus.cs +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/CopyStatus.cs @@ -22,7 +22,7 @@ namespace Microsoft.Azure.Management.DataBox.Models public enum CopyStatus { /// - /// Data copy hasnt started yet. + /// Data copy hasn't started yet. /// [EnumMember(Value = "NotStarted")] NotStarted, @@ -50,7 +50,32 @@ public enum CopyStatus /// No copy triggered as device was not returned. /// [EnumMember(Value = "NotReturned")] - NotReturned + NotReturned, + /// + /// The Device has hit hardware issues. + /// + [EnumMember(Value = "HardwareError")] + HardwareError, + /// + /// Data copy failed. The Device was formatted by user. + /// + [EnumMember(Value = "DeviceFormatted")] + DeviceFormatted, + /// + /// Data copy failed. Device metadata was modified by user. + /// + [EnumMember(Value = "DeviceMetadataModified")] + DeviceMetadataModified, + /// + /// Data copy failed. Storage Account was not accessible during copy. + /// + [EnumMember(Value = "StorageAccountNotAccessible")] + StorageAccountNotAccessible, + /// + /// Data copy failed. The Device data content is not supported. + /// + [EnumMember(Value = "UnsupportedData")] + UnsupportedData } internal static class CopyStatusEnumExtension { @@ -75,6 +100,16 @@ internal static string ToSerializedValue(this CopyStatus value) return "Failed"; case CopyStatus.NotReturned: return "NotReturned"; + case CopyStatus.HardwareError: + return "HardwareError"; + case CopyStatus.DeviceFormatted: + return "DeviceFormatted"; + case CopyStatus.DeviceMetadataModified: + return "DeviceMetadataModified"; + case CopyStatus.StorageAccountNotAccessible: + return "StorageAccountNotAccessible"; + case CopyStatus.UnsupportedData: + return "UnsupportedData"; } return null; } @@ -95,6 +130,16 @@ internal static string ToSerializedValue(this CopyStatus value) return CopyStatus.Failed; case "NotReturned": return CopyStatus.NotReturned; + case "HardwareError": + return CopyStatus.HardwareError; + case "DeviceFormatted": + return CopyStatus.DeviceFormatted; + case "DeviceMetadataModified": + return CopyStatus.DeviceMetadataModified; + case "StorageAccountNotAccessible": + return CopyStatus.StorageAccountNotAccessible; + case "UnsupportedData": + return CopyStatus.UnsupportedData; } return null; } diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/CreateJobValidations.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/CreateJobValidations.cs new file mode 100644 index 000000000000..39c4029b3242 --- /dev/null +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/CreateJobValidations.cs @@ -0,0 +1,60 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataBox.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// It does all pre-job creation validations. + /// + [Newtonsoft.Json.JsonObject("JobCreationValidation")] + public partial class CreateJobValidations : ValidationRequest + { + /// + /// Initializes a new instance of the CreateJobValidations class. + /// + public CreateJobValidations() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the CreateJobValidations class. + /// + /// List of request details + /// contain validationType and its request as key and value + /// respectively. + public CreateJobValidations(IList individualRequestDetails) + : base(individualRequestDetails) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } + } +} diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/CreateOrderLimitForSubscriptionValidationRequest.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/CreateOrderLimitForSubscriptionValidationRequest.cs new file mode 100644 index 000000000000..40c45e8828d5 --- /dev/null +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/CreateOrderLimitForSubscriptionValidationRequest.cs @@ -0,0 +1,66 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataBox.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Request to validate create order limit for current subscription. + /// + [Newtonsoft.Json.JsonObject("ValidateCreateOrderLimit")] + public partial class CreateOrderLimitForSubscriptionValidationRequest : ValidationInputRequest + { + /// + /// Initializes a new instance of the + /// CreateOrderLimitForSubscriptionValidationRequest class. + /// + public CreateOrderLimitForSubscriptionValidationRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// CreateOrderLimitForSubscriptionValidationRequest class. + /// + /// Device type to be used for the job. + /// Possible values include: 'DataBox', 'DataBoxDisk', + /// 'DataBoxHeavy' + public CreateOrderLimitForSubscriptionValidationRequest(SkuName deviceType) + { + DeviceType = deviceType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets device type to be used for the job. Possible values + /// include: 'DataBox', 'DataBoxDisk', 'DataBoxHeavy' + /// + [JsonProperty(PropertyName = "deviceType")] + public SkuName DeviceType { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + } + } +} diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/CreateOrderLimitForSubscriptionValidationResponseProperties.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/CreateOrderLimitForSubscriptionValidationResponseProperties.cs new file mode 100644 index 000000000000..7e8ea02a7d75 --- /dev/null +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/CreateOrderLimitForSubscriptionValidationResponseProperties.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataBox.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Properties of create order limit for subscription validation response. + /// + [Newtonsoft.Json.JsonObject("ValidateCreateOrderLimit")] + public partial class CreateOrderLimitForSubscriptionValidationResponseProperties : ValidationInputResponse + { + /// + /// Initializes a new instance of the + /// CreateOrderLimitForSubscriptionValidationResponseProperties class. + /// + public CreateOrderLimitForSubscriptionValidationResponseProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// CreateOrderLimitForSubscriptionValidationResponseProperties class. + /// + /// Error code and message of validation + /// response. + /// Create order limit validation status. Possible + /// values include: 'Valid', 'Invalid', 'Skipped' + public CreateOrderLimitForSubscriptionValidationResponseProperties(Error error = default(Error), ValidationStatus? status = default(ValidationStatus?)) + : base(error) + { + Status = status; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets create order limit validation status. Possible values include: + /// 'Valid', 'Invalid', 'Skipped' + /// + [JsonProperty(PropertyName = "status")] + public ValidationStatus? Status { get; private set; } + + } +} diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DataBoxDiskCopyProgress.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DataBoxDiskCopyProgress.cs index 4589f8bee855..e137c3b7481d 100644 --- a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DataBoxDiskCopyProgress.cs +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DataBoxDiskCopyProgress.cs @@ -36,7 +36,9 @@ public DataBoxDiskCopyProgress() /// for the copy of the disk. /// The Status of the copy. Possible values /// include: 'NotStarted', 'InProgress', 'Completed', - /// 'CompletedWithErrors', 'Failed', 'NotReturned' + /// 'CompletedWithErrors', 'Failed', 'NotReturned', 'HardwareError', + /// 'DeviceFormatted', 'DeviceMetadataModified', + /// 'StorageAccountNotAccessible', 'UnsupportedData' public DataBoxDiskCopyProgress(string serialNumber = default(string), long? bytesCopied = default(long?), int? percentComplete = default(int?), CopyStatus? status = default(CopyStatus?)) { SerialNumber = serialNumber; @@ -72,7 +74,9 @@ public DataBoxDiskCopyProgress() /// /// Gets the Status of the copy. Possible values include: 'NotStarted', /// 'InProgress', 'Completed', 'CompletedWithErrors', 'Failed', - /// 'NotReturned' + /// 'NotReturned', 'HardwareError', 'DeviceFormatted', + /// 'DeviceMetadataModified', 'StorageAccountNotAccessible', + /// 'UnsupportedData' /// [JsonProperty(PropertyName = "status")] public CopyStatus? Status { get; private set; } diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DataBoxDiskJobDetails.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DataBoxDiskJobDetails.cs index 06b6430f72b6..ca94c148aa45 100644 --- a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DataBoxDiskJobDetails.cs +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DataBoxDiskJobDetails.cs @@ -38,9 +38,9 @@ public DataBoxDiskJobDetails() /// customer. /// Destination account /// details. - /// The expected size of the - /// data, which needs to be transfered in this job, in tera - /// bytes. + /// The expected size of the + /// data, which needs to be transferred in this job, in + /// terabytes. /// List of stages that run in the job. /// Delivery package shipping /// details. @@ -64,8 +64,8 @@ public DataBoxDiskJobDetails() /// after the disks are shipped to the customer. /// User entered passkey for DataBox Disk /// job. - public DataBoxDiskJobDetails(ContactDetails contactDetails, ShippingAddress shippingAddress, IList destinationAccountDetails, int? expectedDataSizeInTeraBytes = default(int?), IList jobStages = default(IList), PackageShippingDetails deliveryPackage = default(PackageShippingDetails), PackageShippingDetails returnPackage = default(PackageShippingDetails), IList errorDetails = default(IList), Preferences preferences = default(Preferences), IList copyLogDetails = default(IList), string reverseShipmentLabelSasKey = default(string), string chainOfCustodySasKey = default(string), IDictionary preferredDisks = default(IDictionary), IList copyProgress = default(IList), IDictionary disksAndSizeDetails = default(IDictionary), string passkey = default(string)) - : base(contactDetails, shippingAddress, destinationAccountDetails, expectedDataSizeInTeraBytes, jobStages, deliveryPackage, returnPackage, errorDetails, preferences, copyLogDetails, reverseShipmentLabelSasKey, chainOfCustodySasKey) + public DataBoxDiskJobDetails(ContactDetails contactDetails, ShippingAddress shippingAddress, IList destinationAccountDetails, int? expectedDataSizeInTerabytes = default(int?), IList jobStages = default(IList), PackageShippingDetails deliveryPackage = default(PackageShippingDetails), PackageShippingDetails returnPackage = default(PackageShippingDetails), IList errorDetails = default(IList), Preferences preferences = default(Preferences), IList copyLogDetails = default(IList), string reverseShipmentLabelSasKey = default(string), string chainOfCustodySasKey = default(string), IDictionary preferredDisks = default(IDictionary), IList copyProgress = default(IList), IDictionary disksAndSizeDetails = default(IDictionary), string passkey = default(string)) + : base(contactDetails, shippingAddress, destinationAccountDetails, expectedDataSizeInTerabytes, jobStages, deliveryPackage, returnPackage, errorDetails, preferences, copyLogDetails, reverseShipmentLabelSasKey, chainOfCustodySasKey) { PreferredDisks = preferredDisks; CopyProgress = copyProgress; diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DataBoxDiskJobSecrets.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DataBoxDiskJobSecrets.cs index ec536c9c9e7a..9a9612da5222 100644 --- a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DataBoxDiskJobSecrets.cs +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DataBoxDiskJobSecrets.cs @@ -32,12 +32,15 @@ public DataBoxDiskJobSecrets() /// /// Initializes a new instance of the DataBoxDiskJobSecrets class. /// + /// Dc Access Security Code for + /// Customer Managed Shipping /// Contains the list of secrets object for /// that device. /// PassKey for the disk Job. /// Whether passkey was provided by /// user. - public DataBoxDiskJobSecrets(IList diskSecrets = default(IList), string passKey = default(string), bool? isPasskeyUserDefined = default(bool?)) + public DataBoxDiskJobSecrets(DcAccessSecurityCode dcAccessSecurityCode = default(DcAccessSecurityCode), IList diskSecrets = default(IList), string passKey = default(string), bool? isPasskeyUserDefined = default(bool?)) + : base(dcAccessSecurityCode) { DiskSecrets = diskSecrets; PassKey = passKey; diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DataBoxHeavyJobDetails.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DataBoxHeavyJobDetails.cs index 00f05177d48b..dfbf1b3eac92 100644 --- a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DataBoxHeavyJobDetails.cs +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DataBoxHeavyJobDetails.cs @@ -38,9 +38,9 @@ public DataBoxHeavyJobDetails() /// customer. /// Destination account /// details. - /// The expected size of the - /// data, which needs to be transfered in this job, in tera - /// bytes. + /// The expected size of the + /// data, which needs to be transferred in this job, in + /// terabytes. /// List of stages that run in the job. /// Delivery package shipping /// details. @@ -55,10 +55,13 @@ public DataBoxHeavyJobDetails() /// Shared access key to download /// the chain of custody logs /// Copy progress per account. - public DataBoxHeavyJobDetails(ContactDetails contactDetails, ShippingAddress shippingAddress, IList destinationAccountDetails, int? expectedDataSizeInTeraBytes = default(int?), IList jobStages = default(IList), PackageShippingDetails deliveryPackage = default(PackageShippingDetails), PackageShippingDetails returnPackage = default(PackageShippingDetails), IList errorDetails = default(IList), Preferences preferences = default(Preferences), IList copyLogDetails = default(IList), string reverseShipmentLabelSasKey = default(string), string chainOfCustodySasKey = default(string), IList copyProgress = default(IList)) - : base(contactDetails, shippingAddress, destinationAccountDetails, expectedDataSizeInTeraBytes, jobStages, deliveryPackage, returnPackage, errorDetails, preferences, copyLogDetails, reverseShipmentLabelSasKey, chainOfCustodySasKey) + /// Set Device password for unlocking + /// Databox Heavy + public DataBoxHeavyJobDetails(ContactDetails contactDetails, ShippingAddress shippingAddress, IList destinationAccountDetails, int? expectedDataSizeInTerabytes = default(int?), IList jobStages = default(IList), PackageShippingDetails deliveryPackage = default(PackageShippingDetails), PackageShippingDetails returnPackage = default(PackageShippingDetails), IList errorDetails = default(IList), Preferences preferences = default(Preferences), IList copyLogDetails = default(IList), string reverseShipmentLabelSasKey = default(string), string chainOfCustodySasKey = default(string), IList copyProgress = default(IList), string devicePassword = default(string)) + : base(contactDetails, shippingAddress, destinationAccountDetails, expectedDataSizeInTerabytes, jobStages, deliveryPackage, returnPackage, errorDetails, preferences, copyLogDetails, reverseShipmentLabelSasKey, chainOfCustodySasKey) { CopyProgress = copyProgress; + DevicePassword = devicePassword; CustomInit(); } @@ -73,6 +76,12 @@ public DataBoxHeavyJobDetails() [JsonProperty(PropertyName = "copyProgress")] public IList CopyProgress { get; private set; } + /// + /// Gets or sets set Device password for unlocking Databox Heavy + /// + [JsonProperty(PropertyName = "devicePassword")] + public string DevicePassword { get; set; } + /// /// Validate the object. /// diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DataBoxHeavyJobSecrets.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DataBoxHeavyJobSecrets.cs index 234c8bbc96ee..bb493239b4f5 100644 --- a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DataBoxHeavyJobSecrets.cs +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DataBoxHeavyJobSecrets.cs @@ -32,9 +32,12 @@ public DataBoxHeavyJobSecrets() /// /// Initializes a new instance of the DataBoxHeavyJobSecrets class. /// + /// Dc Access Security Code for + /// Customer Managed Shipping /// Contains the list of secret objects /// for a databox heavy job. - public DataBoxHeavyJobSecrets(IList cabinetPodSecrets = default(IList)) + public DataBoxHeavyJobSecrets(DcAccessSecurityCode dcAccessSecurityCode = default(DcAccessSecurityCode), IList cabinetPodSecrets = default(IList)) + : base(dcAccessSecurityCode) { CabinetPodSecrets = cabinetPodSecrets; CustomInit(); diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DataBoxJobDetails.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DataBoxJobDetails.cs index c8eae1e79577..22b3ae5e9aee 100644 --- a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DataBoxJobDetails.cs +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DataBoxJobDetails.cs @@ -38,9 +38,9 @@ public DataBoxJobDetails() /// customer. /// Destination account /// details. - /// The expected size of the - /// data, which needs to be transfered in this job, in tera - /// bytes. + /// The expected size of the + /// data, which needs to be transferred in this job, in + /// terabytes. /// List of stages that run in the job. /// Delivery package shipping /// details. @@ -56,10 +56,13 @@ public DataBoxJobDetails() /// the chain of custody logs /// Copy progress per storage /// account. - public DataBoxJobDetails(ContactDetails contactDetails, ShippingAddress shippingAddress, IList destinationAccountDetails, int? expectedDataSizeInTeraBytes = default(int?), IList jobStages = default(IList), PackageShippingDetails deliveryPackage = default(PackageShippingDetails), PackageShippingDetails returnPackage = default(PackageShippingDetails), IList errorDetails = default(IList), Preferences preferences = default(Preferences), IList copyLogDetails = default(IList), string reverseShipmentLabelSasKey = default(string), string chainOfCustodySasKey = default(string), IList copyProgress = default(IList)) - : base(contactDetails, shippingAddress, destinationAccountDetails, expectedDataSizeInTeraBytes, jobStages, deliveryPackage, returnPackage, errorDetails, preferences, copyLogDetails, reverseShipmentLabelSasKey, chainOfCustodySasKey) + /// Set Device password for unlocking + /// Databox + public DataBoxJobDetails(ContactDetails contactDetails, ShippingAddress shippingAddress, IList destinationAccountDetails, int? expectedDataSizeInTerabytes = default(int?), IList jobStages = default(IList), PackageShippingDetails deliveryPackage = default(PackageShippingDetails), PackageShippingDetails returnPackage = default(PackageShippingDetails), IList errorDetails = default(IList), Preferences preferences = default(Preferences), IList copyLogDetails = default(IList), string reverseShipmentLabelSasKey = default(string), string chainOfCustodySasKey = default(string), IList copyProgress = default(IList), string devicePassword = default(string)) + : base(contactDetails, shippingAddress, destinationAccountDetails, expectedDataSizeInTerabytes, jobStages, deliveryPackage, returnPackage, errorDetails, preferences, copyLogDetails, reverseShipmentLabelSasKey, chainOfCustodySasKey) { CopyProgress = copyProgress; + DevicePassword = devicePassword; CustomInit(); } @@ -74,6 +77,12 @@ public DataBoxJobDetails() [JsonProperty(PropertyName = "copyProgress")] public IList CopyProgress { get; private set; } + /// + /// Gets or sets set Device password for unlocking Databox + /// + [JsonProperty(PropertyName = "devicePassword")] + public string DevicePassword { get; set; } + /// /// Validate the object. /// diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DataBoxScheduleAvailabilityRequest.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DataBoxScheduleAvailabilityRequest.cs new file mode 100644 index 000000000000..6ac87e14452d --- /dev/null +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DataBoxScheduleAvailabilityRequest.cs @@ -0,0 +1,61 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataBox.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Request body to get the availability for scheduling data box orders + /// orders. + /// + [Newtonsoft.Json.JsonObject("DataBox")] + public partial class DataBoxScheduleAvailabilityRequest : ScheduleAvailabilityRequest + { + /// + /// Initializes a new instance of the + /// DataBoxScheduleAvailabilityRequest class. + /// + public DataBoxScheduleAvailabilityRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// DataBoxScheduleAvailabilityRequest class. + /// + /// Location for data transfer. + /// For locations check: + /// https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + public DataBoxScheduleAvailabilityRequest(string storageLocation) + : base(storageLocation) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } + } +} diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DataDestinationDetailsValidationRequest.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DataDestinationDetailsValidationRequest.cs new file mode 100644 index 000000000000..b9e1edfb176a --- /dev/null +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DataDestinationDetailsValidationRequest.cs @@ -0,0 +1,83 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataBox.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Request to validate data destination details. + /// + [Newtonsoft.Json.JsonObject("ValidateDataDestinationDetails")] + public partial class DataDestinationDetailsValidationRequest : ValidationInputRequest + { + /// + /// Initializes a new instance of the + /// DataDestinationDetailsValidationRequest class. + /// + public DataDestinationDetailsValidationRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// DataDestinationDetailsValidationRequest class. + /// + /// Destination account details + /// list. + /// Location of stamp or geo. + public DataDestinationDetailsValidationRequest(IList destinationAccountDetails, string location) + { + DestinationAccountDetails = destinationAccountDetails; + Location = location; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets destination account details list. + /// + [JsonProperty(PropertyName = "destinationAccountDetails")] + public IList DestinationAccountDetails { get; set; } + + /// + /// Gets or sets location of stamp or geo. + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (DestinationAccountDetails == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "DestinationAccountDetails"); + } + if (Location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Location"); + } + } + } +} diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DataDestinationDetailsValidationResponseProperties.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DataDestinationDetailsValidationResponseProperties.cs new file mode 100644 index 000000000000..cf77b4b3db2f --- /dev/null +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DataDestinationDetailsValidationResponseProperties.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataBox.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Properties of data destination details validation response. + /// + [Newtonsoft.Json.JsonObject("ValidateDataDestinationDetails")] + public partial class DataDestinationDetailsValidationResponseProperties : ValidationInputResponse + { + /// + /// Initializes a new instance of the + /// DataDestinationDetailsValidationResponseProperties class. + /// + public DataDestinationDetailsValidationResponseProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// DataDestinationDetailsValidationResponseProperties class. + /// + /// Error code and message of validation + /// response. + /// Data destination details validation status. + /// Possible values include: 'Valid', 'Invalid', 'Skipped' + public DataDestinationDetailsValidationResponseProperties(Error error = default(Error), ValidationStatus? status = default(ValidationStatus?)) + : base(error) + { + Status = status; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets data destination details validation status. Possible values + /// include: 'Valid', 'Invalid', 'Skipped' + /// + [JsonProperty(PropertyName = "status")] + public ValidationStatus? Status { get; private set; } + + } +} diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DataDestinationType.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DataDestinationType.cs new file mode 100644 index 000000000000..4e4cd79baad5 --- /dev/null +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DataDestinationType.cs @@ -0,0 +1,66 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataBox.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for DataDestinationType. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum DataDestinationType + { + /// + /// Storage Accounts . + /// + [EnumMember(Value = "StorageAccount")] + StorageAccount, + /// + /// Azure Managed disk storage. + /// + [EnumMember(Value = "ManagedDisk")] + ManagedDisk + } + internal static class DataDestinationTypeEnumExtension + { + internal static string ToSerializedValue(this DataDestinationType? value) + { + return value == null ? null : ((DataDestinationType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this DataDestinationType value) + { + switch( value ) + { + case DataDestinationType.StorageAccount: + return "StorageAccount"; + case DataDestinationType.ManagedDisk: + return "ManagedDisk"; + } + return null; + } + + internal static DataDestinationType? ParseDataDestinationType(this string value) + { + switch( value ) + { + case "StorageAccount": + return DataDestinationType.StorageAccount; + case "ManagedDisk": + return DataDestinationType.ManagedDisk; + } + return null; + } + } +} diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DataboxJobSecrets.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DataboxJobSecrets.cs index 67c6a315dbdb..baf1c84a336b 100644 --- a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DataboxJobSecrets.cs +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DataboxJobSecrets.cs @@ -32,9 +32,12 @@ public DataboxJobSecrets() /// /// Initializes a new instance of the DataboxJobSecrets class. /// + /// Dc Access Security Code for + /// Customer Managed Shipping /// Contains the list of secret objects for a /// job. - public DataboxJobSecrets(IList podSecrets = default(IList)) + public DataboxJobSecrets(DcAccessSecurityCode dcAccessSecurityCode = default(DcAccessSecurityCode), IList podSecrets = default(IList)) + : base(dcAccessSecurityCode) { PodSecrets = podSecrets; CustomInit(); diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DcAccessSecurityCode.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DcAccessSecurityCode.cs new file mode 100644 index 000000000000..d1e663694f7b --- /dev/null +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DcAccessSecurityCode.cs @@ -0,0 +1,61 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataBox.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Dc Access Security code for device. + /// + public partial class DcAccessSecurityCode + { + /// + /// Initializes a new instance of the DcAccessSecurityCode class. + /// + public DcAccessSecurityCode() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DcAccessSecurityCode class. + /// + /// Dc Access Code for dispatching + /// from DC. + /// Dc Access code for dropping off + /// at DC. + public DcAccessSecurityCode(string forwardDcAccessCode = default(string), string reverseDcAccessCode = default(string)) + { + ForwardDcAccessCode = forwardDcAccessCode; + ReverseDcAccessCode = reverseDcAccessCode; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets dc Access Code for dispatching from DC. + /// + [JsonProperty(PropertyName = "forwardDcAccessCode")] + public string ForwardDcAccessCode { get; set; } + + /// + /// Gets or sets dc Access code for dropping off at DC. + /// + [JsonProperty(PropertyName = "reverseDcAccessCode")] + public string ReverseDcAccessCode { get; set; } + + } +} diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DestinationAccountDetails.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DestinationAccountDetails.cs index 255fe56f4ce3..a2bebe2f6b63 100644 --- a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DestinationAccountDetails.cs +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DestinationAccountDetails.cs @@ -10,12 +10,11 @@ namespace Microsoft.Azure.Management.DataBox.Models { - using Microsoft.Rest; using Newtonsoft.Json; using System.Linq; /// - /// Details for the destination account. + /// Details of the destination storage accounts. /// public partial class DestinationAccountDetails { @@ -30,10 +29,14 @@ public DestinationAccountDetails() /// /// Initializes a new instance of the DestinationAccountDetails class. /// - /// Destination storage account id. - public DestinationAccountDetails(string accountId) + /// Arm Id of the destination where the data + /// has to be moved. + /// Share password to be shared by all + /// shares in SA. + public DestinationAccountDetails(string accountId = default(string), string sharePassword = default(string)) { AccountId = accountId; + SharePassword = sharePassword; CustomInit(); } @@ -43,23 +46,17 @@ public DestinationAccountDetails(string accountId) partial void CustomInit(); /// - /// Gets or sets destination storage account id. + /// Gets or sets arm Id of the destination where the data has to be + /// moved. /// [JsonProperty(PropertyName = "accountId")] public string AccountId { get; set; } /// - /// Validate the object. + /// Gets or sets share password to be shared by all shares in SA. /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (AccountId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "AccountId"); - } - } + [JsonProperty(PropertyName = "sharePassword")] + public string SharePassword { get; set; } + } } diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DestinationManagedDiskDetails.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DestinationManagedDiskDetails.cs new file mode 100644 index 000000000000..2e6d0b4e42a7 --- /dev/null +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DestinationManagedDiskDetails.cs @@ -0,0 +1,89 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataBox.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Details for the destination compute disks. + /// + [Newtonsoft.Json.JsonObject("ManagedDisk")] + public partial class DestinationManagedDiskDetails : DestinationAccountDetails + { + /// + /// Initializes a new instance of the DestinationManagedDiskDetails + /// class. + /// + public DestinationManagedDiskDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DestinationManagedDiskDetails + /// class. + /// + /// Destination Resource Group Id where + /// the Compute disks should be created. + /// Arm Id of the storage account + /// that can be used to copy the vhd for staging. + /// Arm Id of the destination where the data + /// has to be moved. + /// Share password to be shared by all + /// shares in SA. + public DestinationManagedDiskDetails(string resourceGroupId, string stagingStorageAccountId, string accountId = default(string), string sharePassword = default(string)) + : base(accountId, sharePassword) + { + ResourceGroupId = resourceGroupId; + StagingStorageAccountId = stagingStorageAccountId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets destination Resource Group Id where the Compute disks + /// should be created. + /// + [JsonProperty(PropertyName = "resourceGroupId")] + public string ResourceGroupId { get; set; } + + /// + /// Gets or sets arm Id of the storage account that can be used to copy + /// the vhd for staging. + /// + [JsonProperty(PropertyName = "stagingStorageAccountId")] + public string StagingStorageAccountId { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ResourceGroupId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ResourceGroupId"); + } + if (StagingStorageAccountId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "StagingStorageAccountId"); + } + } + } +} diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DestinationStorageAccountDetails.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DestinationStorageAccountDetails.cs new file mode 100644 index 000000000000..5428ac436663 --- /dev/null +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DestinationStorageAccountDetails.cs @@ -0,0 +1,74 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataBox.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Details for the destination storage account. + /// + [Newtonsoft.Json.JsonObject("StorageAccount")] + public partial class DestinationStorageAccountDetails : DestinationAccountDetails + { + /// + /// Initializes a new instance of the DestinationStorageAccountDetails + /// class. + /// + public DestinationStorageAccountDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DestinationStorageAccountDetails + /// class. + /// + /// Destination Storage Account Arm + /// Id. + /// Arm Id of the destination where the data + /// has to be moved. + /// Share password to be shared by all + /// shares in SA. + public DestinationStorageAccountDetails(string storageAccountId, string accountId = default(string), string sharePassword = default(string)) + : base(accountId, sharePassword) + { + StorageAccountId = storageAccountId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets destination Storage Account Arm Id. + /// + [JsonProperty(PropertyName = "storageAccountId")] + public string StorageAccountId { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (StorageAccountId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "StorageAccountId"); + } + } + } +} diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DestinationToServiceLocationMap.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DestinationToServiceLocationMap.cs index 4a866aed7bea..953a74df90a4 100644 --- a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DestinationToServiceLocationMap.cs +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DestinationToServiceLocationMap.cs @@ -14,7 +14,7 @@ namespace Microsoft.Azure.Management.DataBox.Models using System.Linq; /// - /// Map of destination location to service location + /// Map of destination location to service location. /// public partial class DestinationToServiceLocationMap { diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DiskScheduleAvailabilityRequest.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DiskScheduleAvailabilityRequest.cs new file mode 100644 index 000000000000..c467c222cdbe --- /dev/null +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/DiskScheduleAvailabilityRequest.cs @@ -0,0 +1,71 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataBox.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Request body to get the availability for scheduling disk orders. + /// + [Newtonsoft.Json.JsonObject("DataBoxDisk")] + public partial class DiskScheduleAvailabilityRequest : ScheduleAvailabilityRequest + { + /// + /// Initializes a new instance of the DiskScheduleAvailabilityRequest + /// class. + /// + public DiskScheduleAvailabilityRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DiskScheduleAvailabilityRequest + /// class. + /// + /// Location for data transfer. + /// For locations check: + /// https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + /// The expected size of the + /// data, which needs to be transferred in this job, in + /// terabytes. + public DiskScheduleAvailabilityRequest(string storageLocation, int expectedDataSizeInTerabytes) + : base(storageLocation) + { + ExpectedDataSizeInTerabytes = expectedDataSizeInTerabytes; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the expected size of the data, which needs to be + /// transferred in this job, in terabytes. + /// + [JsonProperty(PropertyName = "expectedDataSizeInTerabytes")] + public int ExpectedDataSizeInTerabytes { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } + } +} diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/HeavyScheduleAvailabilityRequest.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/HeavyScheduleAvailabilityRequest.cs new file mode 100644 index 000000000000..d676d5babb68 --- /dev/null +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/HeavyScheduleAvailabilityRequest.cs @@ -0,0 +1,60 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataBox.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Request body to get the availability for scheduling heavy orders. + /// + [Newtonsoft.Json.JsonObject("DataBoxHeavy")] + public partial class HeavyScheduleAvailabilityRequest : ScheduleAvailabilityRequest + { + /// + /// Initializes a new instance of the HeavyScheduleAvailabilityRequest + /// class. + /// + public HeavyScheduleAvailabilityRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the HeavyScheduleAvailabilityRequest + /// class. + /// + /// Location for data transfer. + /// For locations check: + /// https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + public HeavyScheduleAvailabilityRequest(string storageLocation) + : base(storageLocation) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } + } +} diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/JobDeliveryInfo.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/JobDeliveryInfo.cs new file mode 100644 index 000000000000..39cad79953cd --- /dev/null +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/JobDeliveryInfo.cs @@ -0,0 +1,51 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataBox.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Additional delivery info. + /// + public partial class JobDeliveryInfo + { + /// + /// Initializes a new instance of the JobDeliveryInfo class. + /// + public JobDeliveryInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the JobDeliveryInfo class. + /// + /// Scheduled date time. + public JobDeliveryInfo(System.DateTime? scheduledDateTime = default(System.DateTime?)) + { + ScheduledDateTime = scheduledDateTime; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets scheduled date time. + /// + [JsonProperty(PropertyName = "scheduledDateTime")] + public System.DateTime? ScheduledDateTime { get; set; } + + } +} diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/JobDeliveryType.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/JobDeliveryType.cs new file mode 100644 index 000000000000..da6a84d748fb --- /dev/null +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/JobDeliveryType.cs @@ -0,0 +1,66 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataBox.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for JobDeliveryType. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum JobDeliveryType + { + /// + /// Non Scheduled job. + /// + [EnumMember(Value = "NonScheduled")] + NonScheduled, + /// + /// Scheduled job. + /// + [EnumMember(Value = "Scheduled")] + Scheduled + } + internal static class JobDeliveryTypeEnumExtension + { + internal static string ToSerializedValue(this JobDeliveryType? value) + { + return value == null ? null : ((JobDeliveryType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this JobDeliveryType value) + { + switch( value ) + { + case JobDeliveryType.NonScheduled: + return "NonScheduled"; + case JobDeliveryType.Scheduled: + return "Scheduled"; + } + return null; + } + + internal static JobDeliveryType? ParseJobDeliveryType(this string value) + { + switch( value ) + { + case "NonScheduled": + return JobDeliveryType.NonScheduled; + case "Scheduled": + return JobDeliveryType.Scheduled; + } + return null; + } + } +} diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/JobDetails.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/JobDetails.cs index 64c809042dfc..f2b3359d91d8 100644 --- a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/JobDetails.cs +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/JobDetails.cs @@ -38,9 +38,9 @@ public JobDetails() /// customer. /// Destination account /// details. - /// The expected size of the - /// data, which needs to be transfered in this job, in tera - /// bytes. + /// The expected size of the + /// data, which needs to be transferred in this job, in + /// terabytes. /// List of stages that run in the job. /// Delivery package shipping /// details. @@ -54,9 +54,9 @@ public JobDetails() /// download the return shipment label /// Shared access key to download /// the chain of custody logs - public JobDetails(ContactDetails contactDetails, ShippingAddress shippingAddress, IList destinationAccountDetails, int? expectedDataSizeInTeraBytes = default(int?), IList jobStages = default(IList), PackageShippingDetails deliveryPackage = default(PackageShippingDetails), PackageShippingDetails returnPackage = default(PackageShippingDetails), IList errorDetails = default(IList), Preferences preferences = default(Preferences), IList copyLogDetails = default(IList), string reverseShipmentLabelSasKey = default(string), string chainOfCustodySasKey = default(string)) + public JobDetails(ContactDetails contactDetails, ShippingAddress shippingAddress, IList destinationAccountDetails, int? expectedDataSizeInTerabytes = default(int?), IList jobStages = default(IList), PackageShippingDetails deliveryPackage = default(PackageShippingDetails), PackageShippingDetails returnPackage = default(PackageShippingDetails), IList errorDetails = default(IList), Preferences preferences = default(Preferences), IList copyLogDetails = default(IList), string reverseShipmentLabelSasKey = default(string), string chainOfCustodySasKey = default(string)) { - ExpectedDataSizeInTeraBytes = expectedDataSizeInTeraBytes; + ExpectedDataSizeInTerabytes = expectedDataSizeInTerabytes; JobStages = jobStages; ContactDetails = contactDetails; ShippingAddress = shippingAddress; @@ -78,10 +78,10 @@ public JobDetails() /// /// Gets or sets the expected size of the data, which needs to be - /// transfered in this job, in tera bytes. + /// transferred in this job, in terabytes. /// - [JsonProperty(PropertyName = "expectedDataSizeInTeraBytes")] - public int? ExpectedDataSizeInTeraBytes { get; set; } + [JsonProperty(PropertyName = "expectedDataSizeInTerabytes")] + public int? ExpectedDataSizeInTerabytes { get; set; } /// /// Gets list of stages that run in the job. @@ -177,15 +177,9 @@ public virtual void Validate() { ShippingAddress.Validate(); } - if (DestinationAccountDetails != null) + if (Preferences != null) { - foreach (var element in DestinationAccountDetails) - { - if (element != null) - { - element.Validate(); - } - } + Preferences.Validate(); } } } diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/JobResource.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/JobResource.cs index 8f422f2a21c4..33b22944e4fc 100644 --- a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/JobResource.cs +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/JobResource.cs @@ -54,17 +54,23 @@ public JobResource() /// 'Dispatched', 'Delivered', 'PickedUp', 'AtAzureDC', 'DataCopy', /// 'Completed', 'CompletedWithErrors', 'Cancelled', /// 'Failed_IssueReportedAtCustomer', 'Failed_IssueDetectedAtAzureDC', - /// 'Aborted' + /// 'Aborted', 'CompletedWithWarnings', 'ReadyToDispatchFromAzureDC', + /// 'ReadyToReceiveAtAzureDC' /// Time at which the job was started in UTC /// ISO 8601 format. /// Top level error for the job. /// Details of a job run. This field will only be /// sent for expand details filter. /// Reason for cancellation. + /// Delivery type of Job. Possible values + /// include: 'NonScheduled', 'Scheduled' + /// Delivery Info of Job. + /// Flag to indicate cancellation + /// of scheduled job. /// Name of the object. /// Id of the object. /// Type of the object. - public JobResource(string location, Sku sku, IDictionary tags = default(IDictionary), bool? isCancellable = default(bool?), bool? isDeletable = default(bool?), bool? isShippingAddressEditable = default(bool?), StageName? status = default(StageName?), System.DateTime? startTime = default(System.DateTime?), Error error = default(Error), JobDetails details = default(JobDetails), string cancellationReason = default(string), string name = default(string), string id = default(string), string type = default(string)) + public JobResource(string location, Sku sku, IDictionary tags = default(IDictionary), bool? isCancellable = default(bool?), bool? isDeletable = default(bool?), bool? isShippingAddressEditable = default(bool?), StageName? status = default(StageName?), System.DateTime? startTime = default(System.DateTime?), Error error = default(Error), JobDetails details = default(JobDetails), string cancellationReason = default(string), JobDeliveryType? deliveryType = default(JobDeliveryType?), JobDeliveryInfo deliveryInfo = default(JobDeliveryInfo), bool? isCancellableWithoutFee = default(bool?), string name = default(string), string id = default(string), string type = default(string)) : base(location, sku, tags) { IsCancellable = isCancellable; @@ -75,6 +81,9 @@ public JobResource() Error = error; Details = details; CancellationReason = cancellationReason; + DeliveryType = deliveryType; + DeliveryInfo = deliveryInfo; + IsCancellableWithoutFee = isCancellableWithoutFee; Name = name; Id = id; Type = type; @@ -110,7 +119,8 @@ public JobResource() /// 'Delivered', 'PickedUp', 'AtAzureDC', 'DataCopy', 'Completed', /// 'CompletedWithErrors', 'Cancelled', /// 'Failed_IssueReportedAtCustomer', 'Failed_IssueDetectedAtAzureDC', - /// 'Aborted' + /// 'Aborted', 'CompletedWithWarnings', 'ReadyToDispatchFromAzureDC', + /// 'ReadyToReceiveAtAzureDC' /// [JsonProperty(PropertyName = "properties.status")] public StageName? Status { get; private set; } @@ -140,6 +150,25 @@ public JobResource() [JsonProperty(PropertyName = "properties.cancellationReason")] public string CancellationReason { get; private set; } + /// + /// Gets or sets delivery type of Job. Possible values include: + /// 'NonScheduled', 'Scheduled' + /// + [JsonProperty(PropertyName = "properties.deliveryType")] + public JobDeliveryType? DeliveryType { get; set; } + + /// + /// Gets or sets delivery Info of Job. + /// + [JsonProperty(PropertyName = "properties.deliveryInfo")] + public JobDeliveryInfo DeliveryInfo { get; set; } + + /// + /// Gets flag to indicate cancellation of scheduled job. + /// + [JsonProperty(PropertyName = "properties.isCancellableWithoutFee")] + public bool? IsCancellableWithoutFee { get; private set; } + /// /// Gets name of the object. /// diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/JobResourceUpdateParameter.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/JobResourceUpdateParameter.cs index 10a32327dd5b..c71c30481f44 100644 --- a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/JobResourceUpdateParameter.cs +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/JobResourceUpdateParameter.cs @@ -85,16 +85,6 @@ public virtual void Validate() { Details.Validate(); } - if (DestinationAccountDetails != null) - { - foreach (var element in DestinationAccountDetails) - { - if (element != null) - { - element.Validate(); - } - } - } } } } diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/JobSecrets.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/JobSecrets.cs index 6e020016460d..35e130fe7ecd 100644 --- a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/JobSecrets.cs +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/JobSecrets.cs @@ -10,6 +10,7 @@ namespace Microsoft.Azure.Management.DataBox.Models { + using Newtonsoft.Json; using System.Linq; /// @@ -25,11 +26,27 @@ public JobSecrets() CustomInit(); } + /// + /// Initializes a new instance of the JobSecrets class. + /// + /// Dc Access Security Code for + /// Customer Managed Shipping + public JobSecrets(DcAccessSecurityCode dcAccessSecurityCode = default(DcAccessSecurityCode)) + { + DcAccessSecurityCode = dcAccessSecurityCode; + CustomInit(); + } /// /// An initialization method that performs custom operations like setting defaults /// partial void CustomInit(); + /// + /// Gets or sets dc Access Security Code for Customer Managed Shipping + /// + [JsonProperty(PropertyName = "dcAccessSecurityCode")] + public DcAccessSecurityCode DcAccessSecurityCode { get; set; } + } } diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/JobStages.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/JobStages.cs index 9383486923d6..cd7982fac995 100644 --- a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/JobStages.cs +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/JobStages.cs @@ -36,7 +36,8 @@ public JobStages() /// 'Delivered', 'PickedUp', 'AtAzureDC', 'DataCopy', 'Completed', /// 'CompletedWithErrors', 'Cancelled', /// 'Failed_IssueReportedAtCustomer', 'Failed_IssueDetectedAtAzureDC', - /// 'Aborted' + /// 'Aborted', 'CompletedWithWarnings', 'ReadyToDispatchFromAzureDC', + /// 'ReadyToReceiveAtAzureDC' /// Display name of the job stage. /// Status of the job stage. Possible values /// include: 'None', 'InProgress', 'Succeeded', 'Failed', 'Cancelled', @@ -67,7 +68,8 @@ public JobStages() /// 'PickedUp', 'AtAzureDC', 'DataCopy', 'Completed', /// 'CompletedWithErrors', 'Cancelled', /// 'Failed_IssueReportedAtCustomer', 'Failed_IssueDetectedAtAzureDC', - /// 'Aborted' + /// 'Aborted', 'CompletedWithWarnings', 'ReadyToDispatchFromAzureDC', + /// 'ReadyToReceiveAtAzureDC' /// [JsonProperty(PropertyName = "stageName")] public StageName? StageName { get; private set; } diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/OverallValidationStatus.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/OverallValidationStatus.cs new file mode 100644 index 000000000000..b7628c4bba20 --- /dev/null +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/OverallValidationStatus.cs @@ -0,0 +1,75 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataBox.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for OverallValidationStatus. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum OverallValidationStatus + { + /// + /// Every input request is valid. + /// + [EnumMember(Value = "AllValidToProceed")] + AllValidToProceed, + /// + /// Some input requests are not valid. + /// + [EnumMember(Value = "InputsRevisitRequired")] + InputsRevisitRequired, + /// + /// Certain input validations skipped. + /// + [EnumMember(Value = "CertainInputValidationsSkipped")] + CertainInputValidationsSkipped + } + internal static class OverallValidationStatusEnumExtension + { + internal static string ToSerializedValue(this OverallValidationStatus? value) + { + return value == null ? null : ((OverallValidationStatus)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this OverallValidationStatus value) + { + switch( value ) + { + case OverallValidationStatus.AllValidToProceed: + return "AllValidToProceed"; + case OverallValidationStatus.InputsRevisitRequired: + return "InputsRevisitRequired"; + case OverallValidationStatus.CertainInputValidationsSkipped: + return "CertainInputValidationsSkipped"; + } + return null; + } + + internal static OverallValidationStatus? ParseOverallValidationStatus(this string value) + { + switch( value ) + { + case "AllValidToProceed": + return OverallValidationStatus.AllValidToProceed; + case "InputsRevisitRequired": + return OverallValidationStatus.InputsRevisitRequired; + case "CertainInputValidationsSkipped": + return OverallValidationStatus.CertainInputValidationsSkipped; + } + return null; + } + } +} diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/Preferences.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/Preferences.cs index f91d32888ebe..58b09eb6dc6b 100644 --- a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/Preferences.cs +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/Preferences.cs @@ -31,9 +31,14 @@ public Preferences() /// /// Initializes a new instance of the Preferences class. /// - public Preferences(IList preferredDataCenterRegion = default(IList)) + /// Preferred Data Center + /// Region. + /// Preferences related to the + /// shipment logistics of the sku. + public Preferences(IList preferredDataCenterRegion = default(IList), TransportPreferences transportPreferences = default(TransportPreferences)) { PreferredDataCenterRegion = preferredDataCenterRegion; + TransportPreferences = transportPreferences; CustomInit(); } @@ -43,9 +48,30 @@ public Preferences() partial void CustomInit(); /// + /// Gets or sets preferred Data Center Region. /// [JsonProperty(PropertyName = "preferredDataCenterRegion")] public IList PreferredDataCenterRegion { get; set; } + /// + /// Gets or sets preferences related to the shipment logistics of the + /// sku. + /// + [JsonProperty(PropertyName = "transportPreferences")] + public TransportPreferences TransportPreferences { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (TransportPreferences != null) + { + TransportPreferences.Validate(); + } + } } } diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/PreferencesValidationRequest.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/PreferencesValidationRequest.cs new file mode 100644 index 000000000000..404fd13cc398 --- /dev/null +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/PreferencesValidationRequest.cs @@ -0,0 +1,80 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataBox.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Request to validate preference of transport and data center. + /// + [Newtonsoft.Json.JsonObject("ValidatePreferences")] + public partial class PreferencesValidationRequest : ValidationInputRequest + { + /// + /// Initializes a new instance of the PreferencesValidationRequest + /// class. + /// + public PreferencesValidationRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PreferencesValidationRequest + /// class. + /// + /// Device type to be used for the job. + /// Possible values include: 'DataBox', 'DataBoxDisk', + /// 'DataBoxHeavy' + /// Preference requested with respect to + /// transport type and data center + public PreferencesValidationRequest(SkuName deviceType, Preferences preference = default(Preferences)) + { + Preference = preference; + DeviceType = deviceType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets preference requested with respect to transport type + /// and data center + /// + [JsonProperty(PropertyName = "preference")] + public Preferences Preference { get; set; } + + /// + /// Gets or sets device type to be used for the job. Possible values + /// include: 'DataBox', 'DataBoxDisk', 'DataBoxHeavy' + /// + [JsonProperty(PropertyName = "deviceType")] + public SkuName DeviceType { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Preference != null) + { + Preference.Validate(); + } + } + } +} diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/PreferencesValidationResponseProperties.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/PreferencesValidationResponseProperties.cs new file mode 100644 index 000000000000..f464979dc99d --- /dev/null +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/PreferencesValidationResponseProperties.cs @@ -0,0 +1,60 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataBox.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Properties of data center and transport preference validation response. + /// + [Newtonsoft.Json.JsonObject("ValidatePreferences")] + public partial class PreferencesValidationResponseProperties : ValidationInputResponse + { + /// + /// Initializes a new instance of the + /// PreferencesValidationResponseProperties class. + /// + public PreferencesValidationResponseProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// PreferencesValidationResponseProperties class. + /// + /// Error code and message of validation + /// response. + /// Validation status of requested data center and + /// transport. Possible values include: 'Valid', 'Invalid', + /// 'Skipped' + public PreferencesValidationResponseProperties(Error error = default(Error), ValidationStatus? status = default(ValidationStatus?)) + : base(error) + { + Status = status; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets validation status of requested data center and transport. + /// Possible values include: 'Valid', 'Invalid', 'Skipped' + /// + [JsonProperty(PropertyName = "status")] + public ValidationStatus? Status { get; private set; } + + } +} diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/RegionConfigurationRequest.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/RegionConfigurationRequest.cs new file mode 100644 index 000000000000..09a05e420a6a --- /dev/null +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/RegionConfigurationRequest.cs @@ -0,0 +1,76 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataBox.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Request body to get the configuration for the region. + /// + public partial class RegionConfigurationRequest + { + /// + /// Initializes a new instance of the RegionConfigurationRequest class. + /// + public RegionConfigurationRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RegionConfigurationRequest class. + /// + /// Request body to get the + /// availability for scheduling orders. + /// Request body to get the + /// transport availability for given sku. + public RegionConfigurationRequest(ScheduleAvailabilityRequest scheduleAvailabilityRequest = default(ScheduleAvailabilityRequest), TransportAvailabilityRequest transportAvailabilityRequest = default(TransportAvailabilityRequest)) + { + ScheduleAvailabilityRequest = scheduleAvailabilityRequest; + TransportAvailabilityRequest = transportAvailabilityRequest; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets request body to get the availability for scheduling + /// orders. + /// + [JsonProperty(PropertyName = "scheduleAvailabilityRequest")] + public ScheduleAvailabilityRequest ScheduleAvailabilityRequest { get; set; } + + /// + /// Gets or sets request body to get the transport availability for + /// given sku. + /// + [JsonProperty(PropertyName = "transportAvailabilityRequest")] + public TransportAvailabilityRequest TransportAvailabilityRequest { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ScheduleAvailabilityRequest != null) + { + ScheduleAvailabilityRequest.Validate(); + } + } + } +} diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/RegionConfigurationResponse.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/RegionConfigurationResponse.cs new file mode 100644 index 000000000000..35b27b4081ef --- /dev/null +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/RegionConfigurationResponse.cs @@ -0,0 +1,63 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataBox.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Configuration response specific to a region. + /// + public partial class RegionConfigurationResponse + { + /// + /// Initializes a new instance of the RegionConfigurationResponse + /// class. + /// + public RegionConfigurationResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RegionConfigurationResponse + /// class. + /// + /// Schedule availability + /// for given sku in a region. + /// Transport options + /// available for given sku in a region. + public RegionConfigurationResponse(ScheduleAvailabilityResponse scheduleAvailabilityResponse = default(ScheduleAvailabilityResponse), TransportAvailabilityResponse transportAvailabilityResponse = default(TransportAvailabilityResponse)) + { + ScheduleAvailabilityResponse = scheduleAvailabilityResponse; + TransportAvailabilityResponse = transportAvailabilityResponse; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets schedule availability for given sku in a region. + /// + [JsonProperty(PropertyName = "scheduleAvailabilityResponse")] + public ScheduleAvailabilityResponse ScheduleAvailabilityResponse { get; private set; } + + /// + /// Gets transport options available for given sku in a region. + /// + [JsonProperty(PropertyName = "transportAvailabilityResponse")] + public TransportAvailabilityResponse TransportAvailabilityResponse { get; private set; } + + } +} diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/ScheduleAvailabilityRequest.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/ScheduleAvailabilityRequest.cs new file mode 100644 index 000000000000..be0fad833fe5 --- /dev/null +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/ScheduleAvailabilityRequest.cs @@ -0,0 +1,71 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataBox.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Request body to get the availability for scheduling orders. + /// + public partial class ScheduleAvailabilityRequest + { + /// + /// Initializes a new instance of the ScheduleAvailabilityRequest + /// class. + /// + public ScheduleAvailabilityRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ScheduleAvailabilityRequest + /// class. + /// + /// Location for data transfer. + /// For locations check: + /// https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + public ScheduleAvailabilityRequest(string storageLocation) + { + StorageLocation = storageLocation; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets location for data transfer. + /// For locations check: + /// https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + /// + [JsonProperty(PropertyName = "storageLocation")] + public string StorageLocation { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (StorageLocation == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "StorageLocation"); + } + } + } +} diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/ScheduleAvailabilityResponse.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/ScheduleAvailabilityResponse.cs new file mode 100644 index 000000000000..3a54174fd1d3 --- /dev/null +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/ScheduleAvailabilityResponse.cs @@ -0,0 +1,56 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataBox.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Schedule availability response for given sku in a region. + /// + public partial class ScheduleAvailabilityResponse + { + /// + /// Initializes a new instance of the ScheduleAvailabilityResponse + /// class. + /// + public ScheduleAvailabilityResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ScheduleAvailabilityResponse + /// class. + /// + /// List of dates available to + /// schedule + public ScheduleAvailabilityResponse(IList availableDates = default(IList)) + { + AvailableDates = availableDates; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets list of dates available to schedule + /// + [JsonProperty(PropertyName = "availableDates")] + public IList AvailableDates { get; private set; } + + } +} diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/ShareCredentialDetails.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/ShareCredentialDetails.cs index a71165230c2b..5d971f64157e 100644 --- a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/ShareCredentialDetails.cs +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/ShareCredentialDetails.cs @@ -33,7 +33,8 @@ public ShareCredentialDetails() /// /// Name of the share. /// Type of the share. Possible values include: - /// 'UnknownType', 'HCS', 'BlockBlob', 'PageBlob', 'AzureFile' + /// 'UnknownType', 'HCS', 'BlockBlob', 'PageBlob', 'AzureFile', + /// 'ManagedDisk' /// User name for the share. /// Password for the share. /// Access protocols supported @@ -61,7 +62,7 @@ public ShareCredentialDetails() /// /// Gets type of the share. Possible values include: 'UnknownType', - /// 'HCS', 'BlockBlob', 'PageBlob', 'AzureFile' + /// 'HCS', 'BlockBlob', 'PageBlob', 'AzureFile', 'ManagedDisk' /// [JsonProperty(PropertyName = "shareType")] public ShareDestinationFormatType? ShareType { get; private set; } diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/ShareDestinationFormatType.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/ShareDestinationFormatType.cs index 657276ae31c2..398ff925fe92 100644 --- a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/ShareDestinationFormatType.cs +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/ShareDestinationFormatType.cs @@ -45,7 +45,12 @@ public enum ShareDestinationFormatType /// Azure storage file format. /// [EnumMember(Value = "AzureFile")] - AzureFile + AzureFile, + /// + /// Azure Compute Disk. + /// + [EnumMember(Value = "ManagedDisk")] + ManagedDisk } internal static class ShareDestinationFormatTypeEnumExtension { @@ -68,6 +73,8 @@ internal static string ToSerializedValue(this ShareDestinationFormatType value) return "PageBlob"; case ShareDestinationFormatType.AzureFile: return "AzureFile"; + case ShareDestinationFormatType.ManagedDisk: + return "ManagedDisk"; } return null; } @@ -86,6 +93,8 @@ internal static string ToSerializedValue(this ShareDestinationFormatType value) return ShareDestinationFormatType.PageBlob; case "AzureFile": return ShareDestinationFormatType.AzureFile; + case "ManagedDisk": + return ShareDestinationFormatType.ManagedDisk; } return null; } diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/SkuAvailabilityValidationRequest.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/SkuAvailabilityValidationRequest.cs new file mode 100644 index 000000000000..80a49cecb2b2 --- /dev/null +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/SkuAvailabilityValidationRequest.cs @@ -0,0 +1,111 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataBox.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Request to validate sku availability. + /// + [Newtonsoft.Json.JsonObject("ValidateSkuAvailability")] + public partial class SkuAvailabilityValidationRequest : ValidationInputRequest + { + /// + /// Initializes a new instance of the SkuAvailabilityValidationRequest + /// class. + /// + public SkuAvailabilityValidationRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SkuAvailabilityValidationRequest + /// class. + /// + /// Device type to be used for the job. + /// Possible values include: 'DataBox', 'DataBoxDisk', + /// 'DataBoxHeavy' + /// ISO country code. Country for hardware + /// shipment. For codes check: + /// https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + /// Location for data transfer. For locations + /// check: + /// https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + public SkuAvailabilityValidationRequest(SkuName deviceType, string country, string location) + { + DeviceType = deviceType; + Country = country; + Location = location; + CustomInit(); + } + /// + /// Static constructor for SkuAvailabilityValidationRequest class. + /// + static SkuAvailabilityValidationRequest() + { + TransferType = "ImportToAzure"; + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets device type to be used for the job. Possible values + /// include: 'DataBox', 'DataBoxDisk', 'DataBoxHeavy' + /// + [JsonProperty(PropertyName = "deviceType")] + public SkuName DeviceType { get; set; } + + /// + /// Gets or sets ISO country code. Country for hardware shipment. For + /// codes check: + /// https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2#Officially_assigned_code_elements + /// + [JsonProperty(PropertyName = "country")] + public string Country { get; set; } + + /// + /// Gets or sets location for data transfer. For locations check: + /// https://management.azure.com/subscriptions/SUBSCRIPTIONID/locations?api-version=2018-01-01 + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; set; } + + /// + /// Type of the transfer. + /// + [JsonProperty(PropertyName = "transferType")] + public static string TransferType { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Country == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Country"); + } + if (Location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Location"); + } + } + } +} diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/SkuAvailabilityValidationResponseProperties.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/SkuAvailabilityValidationResponseProperties.cs new file mode 100644 index 000000000000..d08306a38152 --- /dev/null +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/SkuAvailabilityValidationResponseProperties.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataBox.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Properties of sku availability validation response. + /// + [Newtonsoft.Json.JsonObject("ValidateSkuAvailability")] + public partial class SkuAvailabilityValidationResponseProperties : ValidationInputResponse + { + /// + /// Initializes a new instance of the + /// SkuAvailabilityValidationResponseProperties class. + /// + public SkuAvailabilityValidationResponseProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// SkuAvailabilityValidationResponseProperties class. + /// + /// Error code and message of validation + /// response. + /// Sku availability validation status. Possible + /// values include: 'Valid', 'Invalid', 'Skipped' + public SkuAvailabilityValidationResponseProperties(Error error = default(Error), ValidationStatus? status = default(ValidationStatus?)) + : base(error) + { + Status = status; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets sku availability validation status. Possible values include: + /// 'Valid', 'Invalid', 'Skipped' + /// + [JsonProperty(PropertyName = "status")] + public ValidationStatus? Status { get; private set; } + + } +} diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/SkuDisabledReason.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/SkuDisabledReason.cs index eca56535d499..1bf112dbbbdc 100644 --- a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/SkuDisabledReason.cs +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/SkuDisabledReason.cs @@ -32,8 +32,7 @@ public enum SkuDisabledReason [EnumMember(Value = "Country")] Country, /// - /// SKU is not available to push data to the requested storage account - /// region. + /// SKU is not available to push data to the requested Azure region. /// [EnumMember(Value = "Region")] Region, @@ -46,7 +45,13 @@ public enum SkuDisabledReason /// Subscription does not have required offer types for the SKU. /// [EnumMember(Value = "OfferType")] - OfferType + OfferType, + /// + /// Subscription has not registered to Microsoft.DataBox and Service + /// does not have the subscription notification. + /// + [EnumMember(Value = "NoSubscriptionInfo")] + NoSubscriptionInfo } internal static class SkuDisabledReasonEnumExtension { @@ -69,6 +74,8 @@ internal static string ToSerializedValue(this SkuDisabledReason value) return "Feature"; case SkuDisabledReason.OfferType: return "OfferType"; + case SkuDisabledReason.NoSubscriptionInfo: + return "NoSubscriptionInfo"; } return null; } @@ -87,6 +94,8 @@ internal static string ToSerializedValue(this SkuDisabledReason value) return SkuDisabledReason.Feature; case "OfferType": return SkuDisabledReason.OfferType; + case "NoSubscriptionInfo": + return SkuDisabledReason.NoSubscriptionInfo; } return null; } diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/SkuInformation.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/SkuInformation.cs index a19de5471e89..e371b1ba8331 100644 --- a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/SkuInformation.cs +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/SkuInformation.cs @@ -44,7 +44,7 @@ public SkuInformation() /// Sku. /// Reason why the Sku is disabled. /// Possible values include: 'None', 'Country', 'Region', 'Feature', - /// 'OfferType' + /// 'OfferType', 'NoSubscriptionInfo' /// Message for why the Sku is /// disabled. /// Required feature to access the @@ -106,7 +106,8 @@ public SkuInformation() /// /// Gets reason why the Sku is disabled. Possible values include: - /// 'None', 'Country', 'Region', 'Feature', 'OfferType' + /// 'None', 'Country', 'Region', 'Feature', 'OfferType', + /// 'NoSubscriptionInfo' /// [JsonProperty(PropertyName = "properties.disabledReason")] public SkuDisabledReason? DisabledReason { get; private set; } diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/StageName.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/StageName.cs index 07b8228b8ff9..41990442852a 100644 --- a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/StageName.cs +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/StageName.cs @@ -86,7 +86,22 @@ public enum StageName /// Order has been aborted. /// [EnumMember(Value = "Aborted")] - Aborted + Aborted, + /// + /// Order has completed with warnings. + /// + [EnumMember(Value = "CompletedWithWarnings")] + CompletedWithWarnings, + /// + /// Device is ready to be handed to customer from Azure DC. + /// + [EnumMember(Value = "ReadyToDispatchFromAzureDC")] + ReadyToDispatchFromAzureDC, + /// + /// Device can be dropped off at Azure DC. + /// + [EnumMember(Value = "ReadyToReceiveAtAzureDC")] + ReadyToReceiveAtAzureDC } internal static class StageNameEnumExtension { @@ -125,6 +140,12 @@ internal static string ToSerializedValue(this StageName value) return "Failed_IssueDetectedAtAzureDC"; case StageName.Aborted: return "Aborted"; + case StageName.CompletedWithWarnings: + return "CompletedWithWarnings"; + case StageName.ReadyToDispatchFromAzureDC: + return "ReadyToDispatchFromAzureDC"; + case StageName.ReadyToReceiveAtAzureDC: + return "ReadyToReceiveAtAzureDC"; } return null; } @@ -159,6 +180,12 @@ internal static string ToSerializedValue(this StageName value) return StageName.FailedIssueDetectedAtAzureDC; case "Aborted": return StageName.Aborted; + case "CompletedWithWarnings": + return StageName.CompletedWithWarnings; + case "ReadyToDispatchFromAzureDC": + return StageName.ReadyToDispatchFromAzureDC; + case "ReadyToReceiveAtAzureDC": + return StageName.ReadyToReceiveAtAzureDC; } return null; } diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/SubscriptionIsAllowedToCreateJobValidationRequest.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/SubscriptionIsAllowedToCreateJobValidationRequest.cs new file mode 100644 index 000000000000..ea2984bea8d0 --- /dev/null +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/SubscriptionIsAllowedToCreateJobValidationRequest.cs @@ -0,0 +1,38 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataBox.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Request to validate subscription permission to create jobs. + /// + [Newtonsoft.Json.JsonObject("ValidateSubscriptionIsAllowedToCreateJob")] + public partial class SubscriptionIsAllowedToCreateJobValidationRequest : ValidationInputRequest + { + /// + /// Initializes a new instance of the + /// SubscriptionIsAllowedToCreateJobValidationRequest class. + /// + public SubscriptionIsAllowedToCreateJobValidationRequest() + { + CustomInit(); + } + + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/SubscriptionIsAllowedToCreateJobValidationResponseProperties.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/SubscriptionIsAllowedToCreateJobValidationResponseProperties.cs new file mode 100644 index 000000000000..e9aebdb24c52 --- /dev/null +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/SubscriptionIsAllowedToCreateJobValidationResponseProperties.cs @@ -0,0 +1,61 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataBox.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Properties of subscription permission to create job validation + /// response. + /// + [Newtonsoft.Json.JsonObject("ValidateSubscriptionIsAllowedToCreateJob")] + public partial class SubscriptionIsAllowedToCreateJobValidationResponseProperties : ValidationInputResponse + { + /// + /// Initializes a new instance of the + /// SubscriptionIsAllowedToCreateJobValidationResponseProperties class. + /// + public SubscriptionIsAllowedToCreateJobValidationResponseProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// SubscriptionIsAllowedToCreateJobValidationResponseProperties class. + /// + /// Error code and message of validation + /// response. + /// Validation status of subscription permission + /// to create job. Possible values include: 'Valid', 'Invalid', + /// 'Skipped' + public SubscriptionIsAllowedToCreateJobValidationResponseProperties(Error error = default(Error), ValidationStatus? status = default(ValidationStatus?)) + : base(error) + { + Status = status; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets validation status of subscription permission to create job. + /// Possible values include: 'Valid', 'Invalid', 'Skipped' + /// + [JsonProperty(PropertyName = "status")] + public ValidationStatus? Status { get; private set; } + + } +} diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/TransportAvailabilityDetails.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/TransportAvailabilityDetails.cs new file mode 100644 index 000000000000..0195487f896e --- /dev/null +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/TransportAvailabilityDetails.cs @@ -0,0 +1,56 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataBox.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Transport options availability details for given region. + /// + public partial class TransportAvailabilityDetails + { + /// + /// Initializes a new instance of the TransportAvailabilityDetails + /// class. + /// + public TransportAvailabilityDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TransportAvailabilityDetails + /// class. + /// + /// Transport Shipment Type supported for + /// given region. Possible values include: 'CustomerManaged', + /// 'MicrosoftManaged' + public TransportAvailabilityDetails(TransportShipmentTypes? shipmentType = default(TransportShipmentTypes?)) + { + ShipmentType = shipmentType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets transport Shipment Type supported for given region. Possible + /// values include: 'CustomerManaged', 'MicrosoftManaged' + /// + [JsonProperty(PropertyName = "shipmentType")] + public TransportShipmentTypes? ShipmentType { get; private set; } + + } +} diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/TransportAvailabilityRequest.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/TransportAvailabilityRequest.cs new file mode 100644 index 000000000000..d3b4c935374d --- /dev/null +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/TransportAvailabilityRequest.cs @@ -0,0 +1,55 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataBox.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Request body to get the transport availability for given sku. + /// + public partial class TransportAvailabilityRequest + { + /// + /// Initializes a new instance of the TransportAvailabilityRequest + /// class. + /// + public TransportAvailabilityRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TransportAvailabilityRequest + /// class. + /// + /// Type of the device. Possible values include: + /// 'DataBox', 'DataBoxDisk', 'DataBoxHeavy' + public TransportAvailabilityRequest(SkuName? skuName = default(SkuName?)) + { + SkuName = skuName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets type of the device. Possible values include: + /// 'DataBox', 'DataBoxDisk', 'DataBoxHeavy' + /// + [JsonProperty(PropertyName = "skuName")] + public SkuName? SkuName { get; set; } + + } +} diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/TransportAvailabilityResponse.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/TransportAvailabilityResponse.cs new file mode 100644 index 000000000000..ea6bae21d634 --- /dev/null +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/TransportAvailabilityResponse.cs @@ -0,0 +1,56 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataBox.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Transport options available for given sku in a region. + /// + public partial class TransportAvailabilityResponse + { + /// + /// Initializes a new instance of the TransportAvailabilityResponse + /// class. + /// + public TransportAvailabilityResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TransportAvailabilityResponse + /// class. + /// + /// List of transport + /// availability details for given region + public TransportAvailabilityResponse(IList transportAvailabilityDetails = default(IList)) + { + TransportAvailabilityDetails = transportAvailabilityDetails; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets list of transport availability details for given region + /// + [JsonProperty(PropertyName = "transportAvailabilityDetails")] + public IList TransportAvailabilityDetails { get; private set; } + + } +} diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/TransportPreferences.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/TransportPreferences.cs new file mode 100644 index 000000000000..fd52d29d72e2 --- /dev/null +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/TransportPreferences.cs @@ -0,0 +1,64 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataBox.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Preferences related to the shipment logistics of the sku + /// + public partial class TransportPreferences + { + /// + /// Initializes a new instance of the TransportPreferences class. + /// + public TransportPreferences() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TransportPreferences class. + /// + /// Indicates Shipment Logistics + /// type that the customer preferred. Possible values include: + /// 'CustomerManaged', 'MicrosoftManaged' + public TransportPreferences(TransportShipmentTypes preferredShipmentType) + { + PreferredShipmentType = preferredShipmentType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets indicates Shipment Logistics type that the customer + /// preferred. Possible values include: 'CustomerManaged', + /// 'MicrosoftManaged' + /// + [JsonProperty(PropertyName = "preferredShipmentType")] + public TransportShipmentTypes PreferredShipmentType { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + } + } +} diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/TransportShipmentTypes.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/TransportShipmentTypes.cs new file mode 100644 index 000000000000..86c12741d14b --- /dev/null +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/TransportShipmentTypes.cs @@ -0,0 +1,66 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataBox.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for TransportShipmentTypes. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum TransportShipmentTypes + { + /// + /// Shipment Logistics is handled by the customer. + /// + [EnumMember(Value = "CustomerManaged")] + CustomerManaged, + /// + /// Shipment Logistics is handled by Microsoft. + /// + [EnumMember(Value = "MicrosoftManaged")] + MicrosoftManaged + } + internal static class TransportShipmentTypesEnumExtension + { + internal static string ToSerializedValue(this TransportShipmentTypes? value) + { + return value == null ? null : ((TransportShipmentTypes)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this TransportShipmentTypes value) + { + switch( value ) + { + case TransportShipmentTypes.CustomerManaged: + return "CustomerManaged"; + case TransportShipmentTypes.MicrosoftManaged: + return "MicrosoftManaged"; + } + return null; + } + + internal static TransportShipmentTypes? ParseTransportShipmentTypes(this string value) + { + switch( value ) + { + case "CustomerManaged": + return TransportShipmentTypes.CustomerManaged; + case "MicrosoftManaged": + return TransportShipmentTypes.MicrosoftManaged; + } + return null; + } + } +} diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/ValidateAddress.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/ValidateAddress.cs index 260f9e70b5cc..6af4394416d0 100644 --- a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/ValidateAddress.cs +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/ValidateAddress.cs @@ -18,7 +18,7 @@ namespace Microsoft.Azure.Management.DataBox.Models /// The requirements to validate customer address where the device needs to /// be shipped. /// - public partial class ValidateAddress + public partial class ValidateAddress : ValidationInputRequest { /// /// Initializes a new instance of the ValidateAddress class. @@ -36,10 +36,13 @@ public ValidateAddress() /// Device type to be used for the job. /// Possible values include: 'DataBox', 'DataBoxDisk', /// 'DataBoxHeavy' - public ValidateAddress(ShippingAddress shippingAddress, SkuName deviceType) + /// Preferences related to the + /// shipment logistics of the sku. + public ValidateAddress(ShippingAddress shippingAddress, SkuName deviceType, TransportPreferences transportPreferences = default(TransportPreferences)) { ShippingAddress = shippingAddress; DeviceType = deviceType; + TransportPreferences = transportPreferences; CustomInit(); } @@ -61,6 +64,13 @@ public ValidateAddress(ShippingAddress shippingAddress, SkuName deviceType) [JsonProperty(PropertyName = "deviceType")] public SkuName DeviceType { get; set; } + /// + /// Gets or sets preferences related to the shipment logistics of the + /// sku. + /// + [JsonProperty(PropertyName = "transportPreferences")] + public TransportPreferences TransportPreferences { get; set; } + /// /// Validate the object. /// @@ -77,6 +87,10 @@ public virtual void Validate() { ShippingAddress.Validate(); } + if (TransportPreferences != null) + { + TransportPreferences.Validate(); + } } } } diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/ValidationInputRequest.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/ValidationInputRequest.cs new file mode 100644 index 000000000000..096380231268 --- /dev/null +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/ValidationInputRequest.cs @@ -0,0 +1,35 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataBox.Models +{ + using System.Linq; + + /// + /// Minimum fields that must be present in any type of validation request. + /// + public partial class ValidationInputRequest + { + /// + /// Initializes a new instance of the ValidationInputRequest class. + /// + public ValidationInputRequest() + { + CustomInit(); + } + + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/ValidationInputResponse.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/ValidationInputResponse.cs new file mode 100644 index 000000000000..810a34e2dc99 --- /dev/null +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/ValidationInputResponse.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataBox.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Minimum properties that should be present in each individual validation + /// response. + /// + public partial class ValidationInputResponse + { + /// + /// Initializes a new instance of the ValidationInputResponse class. + /// + public ValidationInputResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ValidationInputResponse class. + /// + /// Error code and message of validation + /// response. + public ValidationInputResponse(Error error = default(Error)) + { + Error = error; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets error code and message of validation response. + /// + [JsonProperty(PropertyName = "error")] + public Error Error { get; private set; } + + } +} diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/ValidationRequest.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/ValidationRequest.cs new file mode 100644 index 000000000000..db49123fc608 --- /dev/null +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/ValidationRequest.cs @@ -0,0 +1,70 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataBox.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Input request for all pre job creation validation. + /// + public partial class ValidationRequest + { + /// + /// Initializes a new instance of the ValidationRequest class. + /// + public ValidationRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ValidationRequest class. + /// + /// List of request details + /// contain validationType and its request as key and value + /// respectively. + public ValidationRequest(IList individualRequestDetails) + { + IndividualRequestDetails = individualRequestDetails; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets list of request details contain validationType and its + /// request as key and value respectively. + /// + [JsonProperty(PropertyName = "individualRequestDetails")] + public IList IndividualRequestDetails { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (IndividualRequestDetails == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "IndividualRequestDetails"); + } + } + } +} diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/ValidationResponse.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/ValidationResponse.cs new file mode 100644 index 000000000000..d1cd19287dbd --- /dev/null +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/ValidationResponse.cs @@ -0,0 +1,71 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataBox.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Response of pre job creation validations. + /// + [Rest.Serialization.JsonTransformation] + public partial class ValidationResponse + { + /// + /// Initializes a new instance of the ValidationResponse class. + /// + public ValidationResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ValidationResponse class. + /// + /// Overall validation status. Possible values + /// include: 'AllValidToProceed', 'InputsRevisitRequired', + /// 'CertainInputValidationsSkipped' + /// List of response details + /// contain validationType and its response as key and value + /// respectively. + public ValidationResponse(OverallValidationStatus? status = default(OverallValidationStatus?), IList individualResponseDetails = default(IList)) + { + Status = status; + IndividualResponseDetails = individualResponseDetails; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets overall validation status. Possible values include: + /// 'AllValidToProceed', 'InputsRevisitRequired', + /// 'CertainInputValidationsSkipped' + /// + [JsonProperty(PropertyName = "properties.status")] + public OverallValidationStatus? Status { get; private set; } + + /// + /// Gets list of response details contain validationType and its + /// response as key and value respectively. + /// + [JsonProperty(PropertyName = "properties.individualResponseDetails")] + public IList IndividualResponseDetails { get; private set; } + + } +} diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/ValidationStatus.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/ValidationStatus.cs new file mode 100644 index 000000000000..96f44c3a8092 --- /dev/null +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/Models/ValidationStatus.cs @@ -0,0 +1,75 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.DataBox.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for ValidationStatus. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum ValidationStatus + { + /// + /// Validation is successful + /// + [EnumMember(Value = "Valid")] + Valid, + /// + /// Validation is not successful + /// + [EnumMember(Value = "Invalid")] + Invalid, + /// + /// Validation is skipped + /// + [EnumMember(Value = "Skipped")] + Skipped + } + internal static class ValidationStatusEnumExtension + { + internal static string ToSerializedValue(this ValidationStatus? value) + { + return value == null ? null : ((ValidationStatus)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this ValidationStatus value) + { + switch( value ) + { + case ValidationStatus.Valid: + return "Valid"; + case ValidationStatus.Invalid: + return "Invalid"; + case ValidationStatus.Skipped: + return "Skipped"; + } + return null; + } + + internal static ValidationStatus? ParseValidationStatus(this string value) + { + switch( value ) + { + case "Valid": + return ValidationStatus.Valid; + case "Invalid": + return ValidationStatus.Invalid; + case "Skipped": + return ValidationStatus.Skipped; + } + return null; + } + } +} diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/SdkInfo_DataBoxManagementClient.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/SdkInfo_DataBoxManagementClient.cs index 2e02594a361d..23a0777f6355 100644 --- a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/SdkInfo_DataBoxManagementClient.cs +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/SdkInfo_DataBoxManagementClient.cs @@ -19,19 +19,19 @@ public static IEnumerable> ApiInfo_DataBoxManageme { return new Tuple[] { - new Tuple("DataBox", "Jobs", "2018-01-01"), - new Tuple("DataBox", "Operations", "2018-01-01"), - new Tuple("DataBox", "Service", "2018-01-01"), + new Tuple("DataBox", "Jobs", "2019-09-01"), + new Tuple("DataBox", "Operations", "2019-09-01"), + new Tuple("DataBox", "Service", "2019-09-01"), }.AsEnumerable(); } } // BEGIN: Code Generation Metadata Section public static readonly String AutoRestVersion = "latest"; public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4283"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/databox/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=E:\\work\\git\\azure-sdk-for-net\\src\\SDKs"; + public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/databox/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --tag=package-2019-09 --csharp-sdks-folder=D:\\god\\azure_sdk_net\\azure-sdk-for-net\\sdk"; public static readonly String GithubForkName = "Azure"; public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "be799c37e1df63769895f0ae6fc51d65c69aba27"; + public static readonly String GithubCommidId = "59998f796f05580bc1d43ba39f0170204113fa91"; public static readonly String CodeGenerationErrors = ""; public static readonly String GithubRepoName = "azure-rest-api-specs"; // END: Code Generation Metadata Section diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/ServiceOperations.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/ServiceOperations.cs index db4d7cef50ba..987205bf522c 100644 --- a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/ServiceOperations.cs +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/ServiceOperations.cs @@ -257,18 +257,860 @@ internal ServiceOperations(DataBoxManagementClient client) } /// - /// This method validates the customer shipping address and provide alternate - /// addresses if any. + /// This method provides the list of available skus for the given subscription, + /// resource group and location. + /// + /// + /// The Resource Group Name + /// + /// + /// The location of the resource + /// + /// + /// Filters for showing the available skus. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListAvailableSkusByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string location, AvailableSkuRequest availableSkuRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "location"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (availableSkuRequest == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "availableSkuRequest"); + } + if (availableSkuRequest != null) + { + availableSkuRequest.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("location", location); + tracingParameters.Add("availableSkuRequest", availableSkuRequest); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListAvailableSkusByResourceGroup", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/availableSkus").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(availableSkuRequest != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(availableSkuRequest, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// [DEPRECATED NOTICE: This operation will soon be removed] This method + /// validates the customer shipping address and provide alternate addresses if + /// any. + /// + /// + /// The location of the resource + /// + /// + /// Shipping address of the customer. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] + public async Task> ValidateAddressMethodWithHttpMessagesAsync(string location, ValidateAddress validateAddress, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "location"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (validateAddress == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "validateAddress"); + } + if (validateAddress != null) + { + validateAddress.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("location", location); + tracingParameters.Add("validateAddress", validateAddress); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ValidateAddressMethod", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(validateAddress != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(validateAddress, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// This method does all necessary pre-job creation validation under resource + /// group. + /// + /// + /// The Resource Group Name + /// + /// + /// The location of the resource + /// + /// + /// Inputs of the customer. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ValidateInputsByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string location, ValidationRequest validationRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "location"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (validationRequest == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "validationRequest"); + } + if (validationRequest != null) + { + validationRequest.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("location", location); + tracingParameters.Add("validationRequest", validationRequest); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ValidateInputsByResourceGroup", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBox/locations/{location}/validateInputs").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(validationRequest != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(validationRequest, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// This method does all necessary pre-job creation validation under + /// subscription. + /// + /// + /// The location of the resource + /// + /// + /// Inputs of the customer. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> ValidateInputsWithHttpMessagesAsync(string location, ValidationRequest validationRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "location"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (validationRequest == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "validationRequest"); + } + if (validationRequest != null) + { + validationRequest.Validate(); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("location", location); + tracingParameters.Add("validationRequest", validationRequest); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ValidateInputs", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateInputs").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(validationRequest != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(validationRequest, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// This API provides configuration details specific to given region/location. /// /// /// The location of the resource /// - /// - /// Shipping address of the customer. + /// + /// Request body to get the availability for scheduling orders. /// - /// - /// Device type to be used for the job. Possible values include: 'DataBox', - /// 'DataBoxDisk', 'DataBoxHeavy' + /// + /// Request body to get the transport availability for given sku. /// /// /// Headers that will be added to request. @@ -291,7 +1133,7 @@ internal ServiceOperations(DataBoxManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ValidateAddressMethodWithHttpMessagesAsync(string location, ShippingAddress shippingAddress, SkuName deviceType, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> RegionConfigurationWithHttpMessagesAsync(string location, ScheduleAvailabilityRequest scheduleAvailabilityRequest = default(ScheduleAvailabilityRequest), TransportAvailabilityRequest transportAvailabilityRequest = default(TransportAvailabilityRequest), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -305,19 +1147,15 @@ internal ServiceOperations(DataBoxManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (shippingAddress == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "shippingAddress"); - } - if (shippingAddress != null) + if (scheduleAvailabilityRequest != null) { - shippingAddress.Validate(); + scheduleAvailabilityRequest.Validate(); } - ValidateAddress validateAddress = new ValidateAddress(); - if (shippingAddress != null) + RegionConfigurationRequest regionConfigurationRequest = new RegionConfigurationRequest(); + if (scheduleAvailabilityRequest != null || transportAvailabilityRequest != null) { - validateAddress.ShippingAddress = shippingAddress; - validateAddress.DeviceType = deviceType; + regionConfigurationRequest.ScheduleAvailabilityRequest = scheduleAvailabilityRequest; + regionConfigurationRequest.TransportAvailabilityRequest = transportAvailabilityRequest; } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -327,13 +1165,13 @@ internal ServiceOperations(DataBoxManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("location", location); - tracingParameters.Add("validateAddress", validateAddress); + tracingParameters.Add("regionConfigurationRequest", regionConfigurationRequest); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ValidateAddressMethod", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "RegionConfiguration", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/validateAddress").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DataBox/locations/{location}/regionConfiguration").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); List _queryParameters = new List(); @@ -379,9 +1217,9 @@ internal ServiceOperations(DataBoxManagementClient client) // Serialize Request string _requestContent = null; - if(validateAddress != null) + if(regionConfigurationRequest != null) { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(validateAddress, Client.SerializationSettings); + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(regionConfigurationRequest, Client.SerializationSettings); _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); } @@ -440,7 +1278,7 @@ internal ServiceOperations(DataBoxManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -453,7 +1291,7 @@ internal ServiceOperations(DataBoxManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -646,5 +1484,179 @@ internal ServiceOperations(DataBoxManagementClient client) return _result; } + /// + /// This method provides the list of available skus for the given subscription, + /// resource group and location. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListAvailableSkusByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListAvailableSkusByResourceGroupNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + } } diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/ServiceOperationsExtensions.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/ServiceOperationsExtensions.cs index 5ede4b7215b4..bb2b513fe1f6 100644 --- a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/ServiceOperationsExtensions.cs +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Generated/ServiceOperationsExtensions.cs @@ -64,30 +64,77 @@ public static IPage ListAvailableSkus(this IServiceOperations op } /// - /// This method validates the customer shipping address and provide alternate - /// addresses if any. + /// This method provides the list of available skus for the given subscription, + /// resource group and location. /// /// /// The operations group for this extension method. /// + /// + /// The Resource Group Name + /// /// /// The location of the resource /// - /// - /// Shipping address of the customer. + /// + /// Filters for showing the available skus. + /// + public static IPage ListAvailableSkusByResourceGroup(this IServiceOperations operations, string resourceGroupName, string location, AvailableSkuRequest availableSkuRequest) + { + return operations.ListAvailableSkusByResourceGroupAsync(resourceGroupName, location, availableSkuRequest).GetAwaiter().GetResult(); + } + + /// + /// This method provides the list of available skus for the given subscription, + /// resource group and location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The Resource Group Name + /// + /// + /// The location of the resource + /// + /// + /// Filters for showing the available skus. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAvailableSkusByResourceGroupAsync(this IServiceOperations operations, string resourceGroupName, string location, AvailableSkuRequest availableSkuRequest, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListAvailableSkusByResourceGroupWithHttpMessagesAsync(resourceGroupName, location, availableSkuRequest, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// [DEPRECATED NOTICE: This operation will soon be removed] This method + /// validates the customer shipping address and provide alternate addresses if + /// any. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location of the resource /// - /// - /// Device type to be used for the job. Possible values include: 'DataBox', - /// 'DataBoxDisk', 'DataBoxHeavy' + /// + /// Shipping address of the customer. /// - public static AddressValidationOutput ValidateAddressMethod(this IServiceOperations operations, string location, ShippingAddress shippingAddress, SkuName deviceType) + [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] + public static AddressValidationOutput ValidateAddressMethod(this IServiceOperations operations, string location, ValidateAddress validateAddress) { - return operations.ValidateAddressMethodAsync(location, shippingAddress, deviceType).GetAwaiter().GetResult(); + return operations.ValidateAddressMethodAsync(location, validateAddress).GetAwaiter().GetResult(); } /// - /// This method validates the customer shipping address and provide alternate - /// addresses if any. + /// [DEPRECATED NOTICE: This operation will soon be removed] This method + /// validates the customer shipping address and provide alternate addresses if + /// any. /// /// /// The operations group for this extension method. @@ -95,19 +142,152 @@ public static AddressValidationOutput ValidateAddressMethod(this IServiceOperati /// /// The location of the resource /// - /// + /// /// Shipping address of the customer. /// - /// - /// Device type to be used for the job. Possible values include: 'DataBox', - /// 'DataBoxDisk', 'DataBoxHeavy' + /// + /// The cancellation token. + /// + [System.Obsolete("This operation is deprecated. Please do not use it any longer.")] + public static async Task ValidateAddressMethodAsync(this IServiceOperations operations, string location, ValidateAddress validateAddress, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ValidateAddressMethodWithHttpMessagesAsync(location, validateAddress, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// This method does all necessary pre-job creation validation under resource + /// group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The Resource Group Name + /// + /// + /// The location of the resource + /// + /// + /// Inputs of the customer. + /// + public static ValidationResponse ValidateInputsByResourceGroup(this IServiceOperations operations, string resourceGroupName, string location, ValidationRequest validationRequest) + { + return operations.ValidateInputsByResourceGroupAsync(resourceGroupName, location, validationRequest).GetAwaiter().GetResult(); + } + + /// + /// This method does all necessary pre-job creation validation under resource + /// group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The Resource Group Name + /// + /// + /// The location of the resource + /// + /// + /// Inputs of the customer. + /// + /// + /// The cancellation token. + /// + public static async Task ValidateInputsByResourceGroupAsync(this IServiceOperations operations, string resourceGroupName, string location, ValidationRequest validationRequest, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ValidateInputsByResourceGroupWithHttpMessagesAsync(resourceGroupName, location, validationRequest, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// This method does all necessary pre-job creation validation under + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location of the resource + /// + /// + /// Inputs of the customer. + /// + public static ValidationResponse ValidateInputs(this IServiceOperations operations, string location, ValidationRequest validationRequest) + { + return operations.ValidateInputsAsync(location, validationRequest).GetAwaiter().GetResult(); + } + + /// + /// This method does all necessary pre-job creation validation under + /// subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location of the resource + /// + /// + /// Inputs of the customer. /// /// /// The cancellation token. /// - public static async Task ValidateAddressMethodAsync(this IServiceOperations operations, string location, ShippingAddress shippingAddress, SkuName deviceType, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ValidateInputsAsync(this IServiceOperations operations, string location, ValidationRequest validationRequest, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ValidateAddressMethodWithHttpMessagesAsync(location, shippingAddress, deviceType, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ValidateInputsWithHttpMessagesAsync(location, validationRequest, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// This API provides configuration details specific to given region/location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location of the resource + /// + /// + /// Request body to get the availability for scheduling orders. + /// + /// + /// Request body to get the transport availability for given sku. + /// + public static RegionConfigurationResponse RegionConfiguration(this IServiceOperations operations, string location, ScheduleAvailabilityRequest scheduleAvailabilityRequest = default(ScheduleAvailabilityRequest), TransportAvailabilityRequest transportAvailabilityRequest = default(TransportAvailabilityRequest)) + { + return operations.RegionConfigurationAsync(location, scheduleAvailabilityRequest, transportAvailabilityRequest).GetAwaiter().GetResult(); + } + + /// + /// This API provides configuration details specific to given region/location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location of the resource + /// + /// + /// Request body to get the availability for scheduling orders. + /// + /// + /// Request body to get the transport availability for given sku. + /// + /// + /// The cancellation token. + /// + public static async Task RegionConfigurationAsync(this IServiceOperations operations, string location, ScheduleAvailabilityRequest scheduleAvailabilityRequest = default(ScheduleAvailabilityRequest), TransportAvailabilityRequest transportAvailabilityRequest = default(TransportAvailabilityRequest), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.RegionConfigurationWithHttpMessagesAsync(location, scheduleAvailabilityRequest, transportAvailabilityRequest, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -149,5 +329,41 @@ public static IPage ListAvailableSkusNext(this IServiceOperation } } + /// + /// This method provides the list of available skus for the given subscription, + /// resource group and location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListAvailableSkusByResourceGroupNext(this IServiceOperations operations, string nextPageLink) + { + return operations.ListAvailableSkusByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// This method provides the list of available skus for the given subscription, + /// resource group and location. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAvailableSkusByResourceGroupNextAsync(this IServiceOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListAvailableSkusByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } } diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Microsoft.Azure.Management.DataBox.csproj b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Microsoft.Azure.Management.DataBox.csproj index de47cf9f0925..da4137162b23 100644 --- a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Microsoft.Azure.Management.DataBox.csproj +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Microsoft.Azure.Management.DataBox.csproj @@ -7,23 +7,25 @@ Microsoft.Azure.Management.DataBox Microsoft Azure Management DataBox library Microsoft.Azure.Management.DataBox - 1.0.1 + 1.2.0 AzureDataBox;DataBox; diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Properties/AssemblyInfo.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Properties/AssemblyInfo.cs index 35be1d5f19fe..8cbc0bb55c22 100644 --- a/sdk/databox/Microsoft.Azure.Management.DataBox/src/Properties/AssemblyInfo.cs +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/src/Properties/AssemblyInfo.cs @@ -8,7 +8,7 @@ [assembly: AssemblyDescription("Provides Microsoft Azure DataBox management functions for managing the Microsoft Azure DataBox service.")] [assembly: AssemblyVersion("1.0.0")] -[assembly: AssemblyFileVersion("1.0.1")] +[assembly: AssemblyFileVersion("1.2.0")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/tests/Microsoft.Azure.Management.DataBox.Tests.csproj b/sdk/databox/Microsoft.Azure.Management.DataBox/tests/Microsoft.Azure.Management.DataBox.Tests.csproj index f98f5858b5f6..74f23498b9ad 100644 --- a/sdk/databox/Microsoft.Azure.Management.DataBox/tests/Microsoft.Azure.Management.DataBox.Tests.csproj +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/tests/Microsoft.Azure.Management.DataBox.Tests.csproj @@ -7,6 +7,9 @@ 1.0.0 true + + netcoreapp2.0 + diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/tests/SessionRecords/JobCRUDTests/TestJobCRUDOperations.json b/sdk/databox/Microsoft.Azure.Management.DataBox/tests/SessionRecords/JobCRUDTests/TestJobCRUDOperations.json index b0922663c1c2..003e7f302852 100644 --- a/sdk/databox/Microsoft.Azure.Management.DataBox/tests/SessionRecords/JobCRUDTests/TestJobCRUDOperations.json +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/tests/SessionRecords/JobCRUDTests/TestJobCRUDOperations.json @@ -1,19 +1,21 @@ { "Entries": [ { - "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/SdkRg8120?api-version=2015-11-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Jlc291cmNlZ3JvdXBzL1Nka1JnODEyMD9hcGktdmVyc2lvbj0yMDE1LTExLTAx", + "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/SdkRg4216?api-version=2015-11-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Jlc291cmNlZ3JvdXBzL1Nka1JnNDIxNj9hcGktdmVyc2lvbj0yMDE1LTExLTAx", "RequestMethod": "PUT", "RequestBody": "{\r\n \"location\": \"westus\"\r\n}", "RequestHeaders": { "x-ms-client-request-id": [ - "8baa77ab-f99e-47da-98f3-f6d173240770" + "8aacdcc6-fddb-443c-9180-d4fc68e3430a" ], - "accept-language": [ + "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.6.26614.01", + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", "Microsoft.Azure.Management.Resources.ResourceManagementClient/1.0.0.0" ], "Content-Type": [ @@ -27,23 +29,20 @@ "Cache-Control": [ "no-cache" ], - "Date": [ - "Tue, 11 Sep 2018 12:28:33 GMT" - ], "Pragma": [ "no-cache" ], "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" + "1198" ], "x-ms-request-id": [ - "820e97b9-4a87-4d20-a3b9-416eae72bd97" + "e948e48b-3878-4309-833c-9beb7e7d4851" ], "x-ms-correlation-request-id": [ - "820e97b9-4a87-4d20-a3b9-416eae72bd97" + "e948e48b-3878-4309-833c-9beb7e7d4851" ], "x-ms-routing-request-id": [ - "SOUTHINDIA:20180911T122833Z:820e97b9-4a87-4d20-a3b9-416eae72bd97" + "SOUTHINDIA:20191017T101817Z:e948e48b-3878-4309-833c-9beb7e7d4851" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -51,6 +50,9 @@ "X-Content-Type-Options": [ "nosniff" ], + "Date": [ + "Thu, 17 Oct 2019 10:18:17 GMT" + ], "Content-Length": [ "171" ], @@ -61,44 +63,43 @@ "-1" ] }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg8120\",\r\n \"name\": \"SdkRg8120\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseBody": "{\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg4216\",\r\n \"name\": \"SdkRg4216\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", "StatusCode": 201 }, { - "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg8120/providers/Microsoft.DataBox/jobs/SdkJob7196?api-version=2018-01-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Jlc291cmNlR3JvdXBzL1Nka1JnODEyMC9wcm92aWRlcnMvTWljcm9zb2Z0LkRhdGFCb3gvam9icy9TZGtKb2I3MTk2P2FwaS12ZXJzaW9uPTIwMTgtMDEtMDE=", + "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg4216/providers/Microsoft.DataBox/jobs/SdkJob2600?api-version=2019-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Jlc291cmNlR3JvdXBzL1Nka1JnNDIxNi9wcm92aWRlcnMvTWljcm9zb2Z0LkRhdGFCb3gvam9icy9TZGtKb2IyNjAwP2FwaS12ZXJzaW9uPTIwMTktMDktMDE=", "RequestMethod": "PUT", - "RequestBody": "{\r\n \"properties\": {\r\n \"details\": {\r\n \"jobDetailsType\": \"DataBox\",\r\n \"contactDetails\": {\r\n \"contactName\": \"Public SDK Test\",\r\n \"phone\": \"1234567890\",\r\n \"phoneExtension\": \"1234\",\r\n \"emailList\": [\r\n \"testing@microsoft.com\"\r\n ]\r\n },\r\n \"shippingAddress\": {\r\n \"streetAddress1\": \"16 TOWNSEND ST\",\r\n \"streetAddress2\": \"Unit 1\",\r\n \"city\": \"San Francisco\",\r\n \"stateOrProvince\": \"CA\",\r\n \"country\": \"US\",\r\n \"postalCode\": \"94107\",\r\n \"companyName\": \"Microsoft\",\r\n \"addressType\": \"Commercial\"\r\n },\r\n \"destinationAccountDetails\": [\r\n {\r\n \"accountId\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount\"\r\n }\r\n ]\r\n }\r\n },\r\n \"location\": \"westus\",\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n }\r\n}", + "RequestBody": "{\r\n \"properties\": {\r\n \"details\": {\r\n \"jobDetailsType\": \"DataBox\",\r\n \"contactDetails\": {\r\n \"contactName\": \"Public SDK Test\",\r\n \"phone\": \"1234567890\",\r\n \"phoneExtension\": \"1234\",\r\n \"emailList\": [\r\n \"testing@microsoft.com\"\r\n ]\r\n },\r\n \"shippingAddress\": {\r\n \"streetAddress1\": \"16 TOWNSEND ST\",\r\n \"streetAddress2\": \"Unit 1\",\r\n \"city\": \"San Francisco\",\r\n \"stateOrProvince\": \"CA\",\r\n \"country\": \"US\",\r\n \"postalCode\": \"94107\",\r\n \"companyName\": \"Microsoft\",\r\n \"addressType\": \"Commercial\"\r\n },\r\n \"destinationAccountDetails\": [\r\n {\r\n \"dataDestinationType\": \"StorageAccount\",\r\n \"accountId\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount\"\r\n }\r\n ]\r\n }\r\n },\r\n \"location\": \"westus\",\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n }\r\n}", "RequestHeaders": { "x-ms-client-request-id": [ - "ee686d79-42c2-4b01-9afe-5e99f4cabfee" + "842e5d2c-910a-4692-bd2e-da0f23e05ef1" ], - "accept-language": [ + "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.6.26614.01", - "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.0" + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.1" ], "Content-Type": [ "application/json; charset=utf-8" ], "Content-Length": [ - "931" + "983" ] }, "ResponseHeaders": { "Cache-Control": [ "no-cache" ], - "Date": [ - "Tue, 11 Sep 2018 12:28:37 GMT" - ], "Pragma": [ "no-cache" ], "Location": [ - "https://management.azure.com/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/providers/Microsoft.DataBox/locations/westus/operationResults/dbb287f3-ded6-42ee-b673-0c49d46394dc?api-version=2018-01-01" + "https://management.azure.com/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/providers/Microsoft.DataBox/locations/westus/operationResults/03515491-a18b-4ba9-95bb-b78db9477f7d?api-version=2018-01-01" ], "Retry-After": [ "10" @@ -107,59 +108,61 @@ "nosniff" ], "x-ms-request-id": [ - "bf7174d5-aa62-4036-aef8-eaf6e5e60644" + "659a63fa-6c7f-48c9-aa98-ed6f2fea9054" ], "x-ms-client-request-id": [ - "ee686d79-42c2-4b01-9afe-5e99f4cabfee" + "842e5d2c-910a-4692-bd2e-da0f23e05ef1" ], "X-Powered-By": [ "ASP.NET" ], "x-ms-ratelimit-remaining-subscription-writes": [ - "1197" + "1199" ], "x-ms-correlation-request-id": [ - "f0a3ccc3-6f14-4d01-ae5f-a50ed0c9c826" + "e752402a-ce0c-4429-9a8e-3a2ea52f7ca5" ], "x-ms-routing-request-id": [ - "SOUTHINDIA:20180911T122837Z:f0a3ccc3-6f14-4d01-ae5f-a50ed0c9c826" + "SOUTHINDIA:20191017T101822Z:e752402a-ce0c-4429-9a8e-3a2ea52f7ca5" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], - "Content-Length": [ - "0" + "Date": [ + "Thu, 17 Oct 2019 10:18:22 GMT" ], "Expires": [ "-1" + ], + "Content-Length": [ + "0" ] }, "ResponseBody": "", "StatusCode": 202 }, { - "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/providers/Microsoft.DataBox/locations/westus/operationResults/dbb287f3-ded6-42ee-b673-0c49d46394dc?api-version=2018-01-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveC9sb2NhdGlvbnMvd2VzdHVzL29wZXJhdGlvblJlc3VsdHMvZGJiMjg3ZjMtZGVkNi00MmVlLWI2NzMtMGM0OWQ0NjM5NGRjP2FwaS12ZXJzaW9uPTIwMTgtMDEtMDE=", + "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/providers/Microsoft.DataBox/locations/westus/operationResults/03515491-a18b-4ba9-95bb-b78db9477f7d?api-version=2018-01-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveC9sb2NhdGlvbnMvd2VzdHVzL29wZXJhdGlvblJlc3VsdHMvMDM1MTU0OTEtYTE4Yi00YmE5LTk1YmItYjc4ZGI5NDc3ZjdkP2FwaS12ZXJzaW9uPTIwMTgtMDEtMDE=", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "User-Agent": [ - "FxVersion/4.6.26614.01", - "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.0" + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.1" ] }, "ResponseHeaders": { "Cache-Control": [ "no-cache" ], - "Date": [ - "Tue, 11 Sep 2018 12:28:47 GMT" - ], "Pragma": [ "no-cache" ], "Location": [ - "https://management.azure.com/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg8120/providers/Microsoft.DataBox/jobs/SdkJob7196?api-version=2018-01-01" + "https://management.azure.com/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg4216/providers/Microsoft.DataBox/jobs/SdkJob2600?api-version=2018-01-01" ], "Retry-After": [ "10" @@ -168,10 +171,10 @@ "nosniff" ], "x-ms-request-id": [ - "b481ff7e-89e2-4a4d-9197-f2b9383d1a43" + "ab77a3f6-adf4-4725-b05a-7d53c4ea47d7" ], "x-ms-client-request-id": [ - "c0e259d6-41d6-4a22-86aa-6dc1d79769a1" + "0ea1663e-a6ca-4069-a067-196cbfe9d638" ], "X-Powered-By": [ "ASP.NET" @@ -180,42 +183,44 @@ "11999" ], "x-ms-correlation-request-id": [ - "88e8a9ea-b625-420e-bb19-71812fcbbdf2" + "400303c9-14e4-4d99-9698-293d7a1ce57b" ], "x-ms-routing-request-id": [ - "SOUTHINDIA:20180911T122848Z:88e8a9ea-b625-420e-bb19-71812fcbbdf2" + "SOUTHINDIA:20191017T101833Z:400303c9-14e4-4d99-9698-293d7a1ce57b" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], - "Content-Length": [ - "0" + "Date": [ + "Thu, 17 Oct 2019 10:18:32 GMT" ], "Expires": [ "-1" + ], + "Content-Length": [ + "0" ] }, "ResponseBody": "", "StatusCode": 202 }, { - "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg8120/providers/Microsoft.DataBox/jobs/SdkJob7196?api-version=2018-01-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Jlc291cmNlR3JvdXBzL1Nka1JnODEyMC9wcm92aWRlcnMvTWljcm9zb2Z0LkRhdGFCb3gvam9icy9TZGtKb2I3MTk2P2FwaS12ZXJzaW9uPTIwMTgtMDEtMDE=", + "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg4216/providers/Microsoft.DataBox/jobs/SdkJob2600?api-version=2018-01-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Jlc291cmNlR3JvdXBzL1Nka1JnNDIxNi9wcm92aWRlcnMvTWljcm9zb2Z0LkRhdGFCb3gvam9icy9TZGtKb2IyNjAwP2FwaS12ZXJzaW9uPTIwMTgtMDEtMDE=", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "User-Agent": [ - "FxVersion/4.6.26614.01", - "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.0" + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.1" ] }, "ResponseHeaders": { "Cache-Control": [ "no-cache" ], - "Date": [ - "Tue, 11 Sep 2018 12:28:57 GMT" - ], "Pragma": [ "no-cache" ], @@ -223,10 +228,10 @@ "nosniff" ], "x-ms-request-id": [ - "025afc0c-5cbf-47aa-86ef-43284ca4a421" + "3da08cde-517b-4dd5-93db-c5e2809cb55c" ], "x-ms-client-request-id": [ - "a80d5110-8783-49f8-a1ce-3d8c27bad508" + "5e541fc1-cc66-49d2-9544-c25db371f0d7" ], "X-Powered-By": [ "ASP.NET" @@ -235,16 +240,19 @@ "11998" ], "x-ms-correlation-request-id": [ - "cd2fbfe8-d073-41f4-b604-91273f9c40ac" + "b4252a15-fe08-4484-b66f-e490a035e3a3" ], "x-ms-routing-request-id": [ - "SOUTHINDIA:20180911T122858Z:cd2fbfe8-d073-41f4-b604-91273f9c40ac" + "SOUTHINDIA:20191017T101843Z:b4252a15-fe08-4484-b66f-e490a035e3a3" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "Date": [ + "Thu, 17 Oct 2019 10:18:42 GMT" + ], "Content-Length": [ - "485" + "647" ], "Content-Type": [ "application/json; charset=utf-8" @@ -253,27 +261,26 @@ "-1" ] }, - "ResponseBody": "{\r\n \"properties\": {\r\n \"isCancellable\": true,\r\n \"isDeletable\": false,\r\n \"isShippingAddressEditable\": true,\r\n \"status\": \"DeviceOrdered\",\r\n \"startTime\": \"2018-09-11T17:58:36.6886059+05:30\"\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"SdkJob7196\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg8120/providers/Microsoft.DataBox/jobs/SdkJob7196\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n}", + "ResponseBody": "{\r\n \"properties\": {\r\n \"isCancellable\": true,\r\n \"isDeletable\": false,\r\n \"isShippingAddressEditable\": true,\r\n \"status\": \"DeviceOrdered\",\r\n \"startTime\": \"2019-10-17T15:48:22.2077826+05:30\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": true\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"SdkJob2600\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg4216/providers/Microsoft.DataBox/jobs/SdkJob2600\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg8120/providers/Microsoft.DataBox/jobs/SdkJob7196?api-version=2018-01-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Jlc291cmNlR3JvdXBzL1Nka1JnODEyMC9wcm92aWRlcnMvTWljcm9zb2Z0LkRhdGFCb3gvam9icy9TZGtKb2I3MTk2P2FwaS12ZXJzaW9uPTIwMTgtMDEtMDE=", + "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg4216/providers/Microsoft.DataBox/jobs/SdkJob2600?api-version=2018-01-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Jlc291cmNlR3JvdXBzL1Nka1JnNDIxNi9wcm92aWRlcnMvTWljcm9zb2Z0LkRhdGFCb3gvam9icy9TZGtKb2IyNjAwP2FwaS12ZXJzaW9uPTIwMTgtMDEtMDE=", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "User-Agent": [ - "FxVersion/4.6.26614.01", - "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.0" + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.1" ] }, "ResponseHeaders": { "Cache-Control": [ "no-cache" ], - "Date": [ - "Tue, 11 Sep 2018 12:29:21 GMT" - ], "Pragma": [ "no-cache" ], @@ -281,10 +288,10 @@ "nosniff" ], "x-ms-request-id": [ - "03761c19-f606-4c22-b126-a2b01023d272" + "6f019696-baa5-42fc-946f-a3bd69477960" ], "x-ms-client-request-id": [ - "1550bb7d-9bbd-431e-9b3a-213bff62f4c9" + "f7c9bd17-6f09-4e44-9d2f-d657553e4cd9" ], "X-Powered-By": [ "ASP.NET" @@ -293,16 +300,19 @@ "11995" ], "x-ms-correlation-request-id": [ - "de41c192-4e20-49a5-b5c1-811babc5ee32" + "341ace9c-878c-490c-9960-1ecdbece0412" ], "x-ms-routing-request-id": [ - "SOUTHINDIA:20180911T122921Z:de41c192-4e20-49a5-b5c1-811babc5ee32" + "SOUTHINDIA:20191017T101905Z:341ace9c-878c-490c-9960-1ecdbece0412" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "Date": [ + "Thu, 17 Oct 2019 10:19:05 GMT" + ], "Content-Length": [ - "485" + "647" ], "Content-Type": [ "application/json; charset=utf-8" @@ -311,33 +321,32 @@ "-1" ] }, - "ResponseBody": "{\r\n \"properties\": {\r\n \"isCancellable\": true,\r\n \"isDeletable\": false,\r\n \"isShippingAddressEditable\": true,\r\n \"status\": \"DeviceOrdered\",\r\n \"startTime\": \"2018-09-11T17:58:36.6886059+05:30\"\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"SdkJob7196\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg8120/providers/Microsoft.DataBox/jobs/SdkJob7196\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n}", + "ResponseBody": "{\r\n \"properties\": {\r\n \"isCancellable\": true,\r\n \"isDeletable\": false,\r\n \"isShippingAddressEditable\": true,\r\n \"status\": \"DeviceOrdered\",\r\n \"startTime\": \"2019-10-17T15:48:22.2077826+05:30\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": true\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"SdkJob2600\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg4216/providers/Microsoft.DataBox/jobs/SdkJob2600\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg8120/providers/Microsoft.DataBox/jobs/SdkJob7196?api-version=2018-01-01&$expand=details", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Jlc291cmNlR3JvdXBzL1Nka1JnODEyMC9wcm92aWRlcnMvTWljcm9zb2Z0LkRhdGFCb3gvam9icy9TZGtKb2I3MTk2P2FwaS12ZXJzaW9uPTIwMTgtMDEtMDEmJGV4cGFuZD1kZXRhaWxz", + "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg4216/providers/Microsoft.DataBox/jobs/SdkJob2600?api-version=2019-09-01&$expand=details", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Jlc291cmNlR3JvdXBzL1Nka1JnNDIxNi9wcm92aWRlcnMvTWljcm9zb2Z0LkRhdGFCb3gvam9icy9TZGtKb2IyNjAwP2FwaS12ZXJzaW9uPTIwMTktMDktMDEmJGV4cGFuZD1kZXRhaWxz", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "b7369c18-a695-4b58-9839-ede7358e10c2" + "bda9eefb-a289-43db-b97c-10c294a8496d" ], - "accept-language": [ + "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.6.26614.01", - "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.0" + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.1" ] }, "ResponseHeaders": { "Cache-Control": [ "no-cache" ], - "Date": [ - "Tue, 11 Sep 2018 12:28:58 GMT" - ], "Pragma": [ "no-cache" ], @@ -345,10 +354,10 @@ "nosniff" ], "x-ms-request-id": [ - "fac5dd61-cde7-4cd7-af1e-923f1fc18294" + "1abdb282-3d3a-45de-b8d0-d7f8ed17bf77" ], "x-ms-client-request-id": [ - "b7369c18-a695-4b58-9839-ede7358e10c2" + "bda9eefb-a289-43db-b97c-10c294a8496d" ], "X-Powered-By": [ "ASP.NET" @@ -357,16 +366,19 @@ "11997" ], "x-ms-correlation-request-id": [ - "22f86887-5703-4da0-8ff6-939e4c57d27d" + "edc7a203-72ed-4aaa-bc1d-cf1163c63536" ], "x-ms-routing-request-id": [ - "SOUTHINDIA:20180911T122858Z:22f86887-5703-4da0-8ff6-939e4c57d27d" + "SOUTHINDIA:20191017T101843Z:edc7a203-72ed-4aaa-bc1d-cf1163c63536" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "Date": [ + "Thu, 17 Oct 2019 10:18:42 GMT" + ], "Content-Length": [ - "3963" + "3883" ], "Content-Type": [ "application/json; charset=utf-8" @@ -375,33 +387,32 @@ "-1" ] }, - "ResponseBody": "{\r\n \"properties\": {\r\n \"isCancellable\": true,\r\n \"isDeletable\": false,\r\n \"isShippingAddressEditable\": true,\r\n \"status\": \"DeviceOrdered\",\r\n \"startTime\": \"2018-09-11T17:58:36.6886059+05:30\",\r\n \"details\": {\r\n \"copyProgress\": [\r\n {\r\n \"storageAccountName\": \"databoxbvttestaccount\",\r\n \"accountId\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount\",\r\n \"bytesSentToCloud\": 0,\r\n \"totalBytesToProcess\": 0\r\n }\r\n ],\r\n \"jobStages\": [\r\n {\r\n \"stageName\": \"DeviceOrdered\",\r\n \"displayName\": \"Ordered\",\r\n \"stageStatus\": \"Succeeded\",\r\n \"stageTime\": \"2018-09-11T17:58:41.7934219+05:30\"\r\n },\r\n {\r\n \"stageName\": \"DevicePrepared\",\r\n \"displayName\": \"Processed\",\r\n \"stageStatus\": \"None\"\r\n },\r\n {\r\n \"stageName\": \"Dispatched\",\r\n \"displayName\": \"Dispatched\",\r\n \"stageStatus\": \"None\"\r\n },\r\n {\r\n \"stageName\": \"Delivered\",\r\n \"displayName\": \"Delivered\",\r\n \"stageStatus\": \"None\"\r\n },\r\n {\r\n \"stageName\": \"PickedUp\",\r\n \"displayName\": \"Picked up\",\r\n \"stageStatus\": \"None\"\r\n },\r\n {\r\n \"stageName\": \"AtAzureDC\",\r\n \"displayName\": \"Received\",\r\n \"stageStatus\": \"None\"\r\n },\r\n {\r\n \"stageName\": \"DataCopy\",\r\n \"displayName\": \"Data copy in progress\",\r\n \"stageStatus\": \"None\"\r\n },\r\n {\r\n \"stageName\": \"Completed\",\r\n \"displayName\": \"Completed\",\r\n \"stageStatus\": \"None\"\r\n }\r\n ],\r\n \"contactDetails\": {\r\n \"contactName\": \"Public SDK Test\",\r\n \"phone\": \"1234567890\",\r\n \"phoneExtension\": \"1234\",\r\n \"emailList\": [\r\n \"testing@microsoft.com\"\r\n ],\r\n \"notificationPreference\": [\r\n {\r\n \"stageName\": \"DevicePrepared\",\r\n \"sendNotification\": true\r\n },\r\n {\r\n \"stageName\": \"Dispatched\",\r\n \"sendNotification\": true\r\n },\r\n {\r\n \"stageName\": \"Delivered\",\r\n \"sendNotification\": true\r\n },\r\n {\r\n \"stageName\": \"PickedUp\",\r\n \"sendNotification\": true\r\n },\r\n {\r\n \"stageName\": \"AtAzureDC\",\r\n \"sendNotification\": true\r\n },\r\n {\r\n \"stageName\": \"DataCopy\",\r\n \"sendNotification\": true\r\n }\r\n ]\r\n },\r\n \"shippingAddress\": {\r\n \"streetAddress1\": \"16 TOWNSEND ST\",\r\n \"streetAddress2\": \"Unit 1\",\r\n \"city\": \"San Francisco\",\r\n \"stateOrProvince\": \"CA\",\r\n \"country\": \"US\",\r\n \"postalCode\": \"94107\",\r\n \"companyName\": \"Microsoft\",\r\n \"addressType\": \"Commercial\"\r\n },\r\n \"deliveryPackage\": {\r\n \"carrierName\": \"\",\r\n \"trackingId\": \"\",\r\n \"trackingUrl\": \"\"\r\n },\r\n \"returnPackage\": {\r\n \"carrierName\": \"\",\r\n \"trackingId\": \"\",\r\n \"trackingUrl\": \"\"\r\n },\r\n \"destinationAccountDetails\": [\r\n {\r\n \"accountId\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount\",\r\n \"accountType\": \"GeneralPurposeStorage\",\r\n \"storageAccessTier\": \"Invalid\",\r\n \"storagePerformanceTier\": \"Standard\"\r\n }\r\n ],\r\n \"errorDetails\": [],\r\n \"jobDetailsType\": \"DataBox\",\r\n \"copyLogDetails\": []\r\n }\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"SdkJob7196\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg8120/providers/Microsoft.DataBox/jobs/SdkJob7196\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n}", + "ResponseBody": "{\r\n \"properties\": {\r\n \"isCancellable\": true,\r\n \"isDeletable\": false,\r\n \"isShippingAddressEditable\": true,\r\n \"status\": \"DeviceOrdered\",\r\n \"startTime\": \"2019-10-17T15:48:22.2077826+05:30\",\r\n \"details\": {\r\n \"copyProgress\": [],\r\n \"jobStages\": [\r\n {\r\n \"stageName\": \"DeviceOrdered\",\r\n \"displayName\": \"Ordered\",\r\n \"stageStatus\": \"Succeeded\",\r\n \"stageTime\": \"2019-10-17T15:48:25.0029075+05:30\"\r\n },\r\n {\r\n \"stageName\": \"DevicePrepared\",\r\n \"displayName\": \"Processed\",\r\n \"stageStatus\": \"None\"\r\n },\r\n {\r\n \"stageName\": \"Dispatched\",\r\n \"displayName\": \"Dispatched\",\r\n \"stageStatus\": \"None\"\r\n },\r\n {\r\n \"stageName\": \"Delivered\",\r\n \"displayName\": \"Delivered\",\r\n \"stageStatus\": \"None\"\r\n },\r\n {\r\n \"stageName\": \"PickedUp\",\r\n \"displayName\": \"Picked up\",\r\n \"stageStatus\": \"None\"\r\n },\r\n {\r\n \"stageName\": \"AtAzureDC\",\r\n \"displayName\": \"Received\",\r\n \"stageStatus\": \"None\"\r\n },\r\n {\r\n \"stageName\": \"DataCopy\",\r\n \"displayName\": \"Data copy in progress\",\r\n \"stageStatus\": \"None\"\r\n },\r\n {\r\n \"stageName\": \"Completed\",\r\n \"displayName\": \"Completed\",\r\n \"stageStatus\": \"None\"\r\n }\r\n ],\r\n \"contactDetails\": {\r\n \"contactName\": \"Public SDK Test\",\r\n \"phone\": \"1234567890\",\r\n \"phoneExtension\": \"1234\",\r\n \"emailList\": [\r\n \"testing@microsoft.com\"\r\n ],\r\n \"notificationPreference\": [\r\n {\r\n \"stageName\": \"DevicePrepared\",\r\n \"sendNotification\": true\r\n },\r\n {\r\n \"stageName\": \"Dispatched\",\r\n \"sendNotification\": true\r\n },\r\n {\r\n \"stageName\": \"Delivered\",\r\n \"sendNotification\": true\r\n },\r\n {\r\n \"stageName\": \"PickedUp\",\r\n \"sendNotification\": true\r\n },\r\n {\r\n \"stageName\": \"AtAzureDC\",\r\n \"sendNotification\": true\r\n },\r\n {\r\n \"stageName\": \"DataCopy\",\r\n \"sendNotification\": true\r\n }\r\n ]\r\n },\r\n \"shippingAddress\": {\r\n \"streetAddress1\": \"16 TOWNSEND ST\",\r\n \"streetAddress2\": \"Unit 1\",\r\n \"city\": \"San Francisco\",\r\n \"stateOrProvince\": \"CA\",\r\n \"country\": \"US\",\r\n \"postalCode\": \"94107\",\r\n \"companyName\": \"Microsoft\",\r\n \"addressType\": \"Commercial\"\r\n },\r\n \"deliveryPackage\": {\r\n \"carrierName\": \"\",\r\n \"trackingId\": \"\",\r\n \"trackingUrl\": \"\"\r\n },\r\n \"returnPackage\": {\r\n \"carrierName\": \"\",\r\n \"trackingId\": \"\",\r\n \"trackingUrl\": \"\"\r\n },\r\n \"destinationAccountDetails\": [\r\n {\r\n \"storageAccountId\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount\",\r\n \"dataDestinationType\": \"StorageAccount\",\r\n \"accountId\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount\"\r\n }\r\n ],\r\n \"errorDetails\": [],\r\n \"jobDetailsType\": \"DataBox\",\r\n \"copyLogDetails\": []\r\n },\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": true\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"SdkJob2600\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg4216/providers/Microsoft.DataBox/jobs/SdkJob2600\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg8120/providers/Microsoft.DataBox/jobs/SdkJob7196?api-version=2018-01-01&$expand=details", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Jlc291cmNlR3JvdXBzL1Nka1JnODEyMC9wcm92aWRlcnMvTWljcm9zb2Z0LkRhdGFCb3gvam9icy9TZGtKb2I3MTk2P2FwaS12ZXJzaW9uPTIwMTgtMDEtMDEmJGV4cGFuZD1kZXRhaWxz", + "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg4216/providers/Microsoft.DataBox/jobs/SdkJob2600?api-version=2019-09-01&$expand=details", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Jlc291cmNlR3JvdXBzL1Nka1JnNDIxNi9wcm92aWRlcnMvTWljcm9zb2Z0LkRhdGFCb3gvam9icy9TZGtKb2IyNjAwP2FwaS12ZXJzaW9uPTIwMTktMDktMDEmJGV4cGFuZD1kZXRhaWxz", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "dd519084-efed-4bce-962e-529921f4ab2a" + "4feef5c5-7cce-4027-9351-329312be5907" ], - "accept-language": [ + "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.6.26614.01", - "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.0" + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.1" ] }, "ResponseHeaders": { "Cache-Control": [ "no-cache" ], - "Date": [ - "Tue, 11 Sep 2018 12:29:21 GMT" - ], "Pragma": [ "no-cache" ], @@ -409,10 +420,10 @@ "nosniff" ], "x-ms-request-id": [ - "3067e300-27fa-4758-b263-c604245c05e7" + "5feb67f8-5ba7-45ec-a364-044114d3838f" ], "x-ms-client-request-id": [ - "dd519084-efed-4bce-962e-529921f4ab2a" + "4feef5c5-7cce-4027-9351-329312be5907" ], "X-Powered-By": [ "ASP.NET" @@ -421,16 +432,19 @@ "11994" ], "x-ms-correlation-request-id": [ - "a68ed762-94d6-4f1c-a721-b5722a2c7a19" + "a339e9c0-7c23-4966-b950-9e2cb5229ceb" ], "x-ms-routing-request-id": [ - "SOUTHINDIA:20180911T122922Z:a68ed762-94d6-4f1c-a721-b5722a2c7a19" + "SOUTHINDIA:20191017T101905Z:a339e9c0-7c23-4966-b950-9e2cb5229ceb" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "Date": [ + "Thu, 17 Oct 2019 10:19:05 GMT" + ], "Content-Length": [ - "3958" + "3878" ], "Content-Type": [ "application/json; charset=utf-8" @@ -439,33 +453,32 @@ "-1" ] }, - "ResponseBody": "{\r\n \"properties\": {\r\n \"isCancellable\": true,\r\n \"isDeletable\": false,\r\n \"isShippingAddressEditable\": true,\r\n \"status\": \"DeviceOrdered\",\r\n \"startTime\": \"2018-09-11T17:58:36.6886059+05:30\",\r\n \"details\": {\r\n \"copyProgress\": [\r\n {\r\n \"storageAccountName\": \"databoxbvttestaccount\",\r\n \"accountId\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount\",\r\n \"bytesSentToCloud\": 0,\r\n \"totalBytesToProcess\": 0\r\n }\r\n ],\r\n \"jobStages\": [\r\n {\r\n \"stageName\": \"DeviceOrdered\",\r\n \"displayName\": \"Ordered\",\r\n \"stageStatus\": \"Succeeded\",\r\n \"stageTime\": \"2018-09-11T17:58:41.7934219+05:30\"\r\n },\r\n {\r\n \"stageName\": \"DevicePrepared\",\r\n \"displayName\": \"Processed\",\r\n \"stageStatus\": \"None\"\r\n },\r\n {\r\n \"stageName\": \"Dispatched\",\r\n \"displayName\": \"Dispatched\",\r\n \"stageStatus\": \"None\"\r\n },\r\n {\r\n \"stageName\": \"Delivered\",\r\n \"displayName\": \"Delivered\",\r\n \"stageStatus\": \"None\"\r\n },\r\n {\r\n \"stageName\": \"PickedUp\",\r\n \"displayName\": \"Picked up\",\r\n \"stageStatus\": \"None\"\r\n },\r\n {\r\n \"stageName\": \"AtAzureDC\",\r\n \"displayName\": \"Received\",\r\n \"stageStatus\": \"None\"\r\n },\r\n {\r\n \"stageName\": \"DataCopy\",\r\n \"displayName\": \"Data copy in progress\",\r\n \"stageStatus\": \"None\"\r\n },\r\n {\r\n \"stageName\": \"Completed\",\r\n \"displayName\": \"Completed\",\r\n \"stageStatus\": \"None\"\r\n }\r\n ],\r\n \"contactDetails\": {\r\n \"contactName\": \"Update Job\",\r\n \"phone\": \"1234567890\",\r\n \"phoneExtension\": \"1234\",\r\n \"emailList\": [\r\n \"testing@microsoft.com\"\r\n ],\r\n \"notificationPreference\": [\r\n {\r\n \"stageName\": \"DevicePrepared\",\r\n \"sendNotification\": true\r\n },\r\n {\r\n \"stageName\": \"Dispatched\",\r\n \"sendNotification\": true\r\n },\r\n {\r\n \"stageName\": \"Delivered\",\r\n \"sendNotification\": true\r\n },\r\n {\r\n \"stageName\": \"PickedUp\",\r\n \"sendNotification\": true\r\n },\r\n {\r\n \"stageName\": \"AtAzureDC\",\r\n \"sendNotification\": true\r\n },\r\n {\r\n \"stageName\": \"DataCopy\",\r\n \"sendNotification\": true\r\n }\r\n ]\r\n },\r\n \"shippingAddress\": {\r\n \"streetAddress1\": \"16 TOWNSEND ST\",\r\n \"streetAddress2\": \"Unit 1\",\r\n \"city\": \"San Francisco\",\r\n \"stateOrProvince\": \"CA\",\r\n \"country\": \"US\",\r\n \"postalCode\": \"94107\",\r\n \"companyName\": \"Microsoft\",\r\n \"addressType\": \"Commercial\"\r\n },\r\n \"deliveryPackage\": {\r\n \"carrierName\": \"\",\r\n \"trackingId\": \"\",\r\n \"trackingUrl\": \"\"\r\n },\r\n \"returnPackage\": {\r\n \"carrierName\": \"\",\r\n \"trackingId\": \"\",\r\n \"trackingUrl\": \"\"\r\n },\r\n \"destinationAccountDetails\": [\r\n {\r\n \"accountId\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount\",\r\n \"accountType\": \"GeneralPurposeStorage\",\r\n \"storageAccessTier\": \"Invalid\",\r\n \"storagePerformanceTier\": \"Standard\"\r\n }\r\n ],\r\n \"errorDetails\": [],\r\n \"jobDetailsType\": \"DataBox\",\r\n \"copyLogDetails\": []\r\n }\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"SdkJob7196\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg8120/providers/Microsoft.DataBox/jobs/SdkJob7196\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n}", + "ResponseBody": "{\r\n \"properties\": {\r\n \"isCancellable\": true,\r\n \"isDeletable\": false,\r\n \"isShippingAddressEditable\": true,\r\n \"status\": \"DeviceOrdered\",\r\n \"startTime\": \"2019-10-17T15:48:22.2077826+05:30\",\r\n \"details\": {\r\n \"copyProgress\": [],\r\n \"jobStages\": [\r\n {\r\n \"stageName\": \"DeviceOrdered\",\r\n \"displayName\": \"Ordered\",\r\n \"stageStatus\": \"Succeeded\",\r\n \"stageTime\": \"2019-10-17T15:48:25.0029075+05:30\"\r\n },\r\n {\r\n \"stageName\": \"DevicePrepared\",\r\n \"displayName\": \"Processed\",\r\n \"stageStatus\": \"None\"\r\n },\r\n {\r\n \"stageName\": \"Dispatched\",\r\n \"displayName\": \"Dispatched\",\r\n \"stageStatus\": \"None\"\r\n },\r\n {\r\n \"stageName\": \"Delivered\",\r\n \"displayName\": \"Delivered\",\r\n \"stageStatus\": \"None\"\r\n },\r\n {\r\n \"stageName\": \"PickedUp\",\r\n \"displayName\": \"Picked up\",\r\n \"stageStatus\": \"None\"\r\n },\r\n {\r\n \"stageName\": \"AtAzureDC\",\r\n \"displayName\": \"Received\",\r\n \"stageStatus\": \"None\"\r\n },\r\n {\r\n \"stageName\": \"DataCopy\",\r\n \"displayName\": \"Data copy in progress\",\r\n \"stageStatus\": \"None\"\r\n },\r\n {\r\n \"stageName\": \"Completed\",\r\n \"displayName\": \"Completed\",\r\n \"stageStatus\": \"None\"\r\n }\r\n ],\r\n \"contactDetails\": {\r\n \"contactName\": \"Update Job\",\r\n \"phone\": \"1234567890\",\r\n \"phoneExtension\": \"1234\",\r\n \"emailList\": [\r\n \"testing@microsoft.com\"\r\n ],\r\n \"notificationPreference\": [\r\n {\r\n \"stageName\": \"DevicePrepared\",\r\n \"sendNotification\": true\r\n },\r\n {\r\n \"stageName\": \"Dispatched\",\r\n \"sendNotification\": true\r\n },\r\n {\r\n \"stageName\": \"Delivered\",\r\n \"sendNotification\": true\r\n },\r\n {\r\n \"stageName\": \"PickedUp\",\r\n \"sendNotification\": true\r\n },\r\n {\r\n \"stageName\": \"AtAzureDC\",\r\n \"sendNotification\": true\r\n },\r\n {\r\n \"stageName\": \"DataCopy\",\r\n \"sendNotification\": true\r\n }\r\n ]\r\n },\r\n \"shippingAddress\": {\r\n \"streetAddress1\": \"16 TOWNSEND ST\",\r\n \"streetAddress2\": \"Unit 1\",\r\n \"city\": \"San Francisco\",\r\n \"stateOrProvince\": \"CA\",\r\n \"country\": \"US\",\r\n \"postalCode\": \"94107\",\r\n \"companyName\": \"Microsoft\",\r\n \"addressType\": \"Commercial\"\r\n },\r\n \"deliveryPackage\": {\r\n \"carrierName\": \"\",\r\n \"trackingId\": \"\",\r\n \"trackingUrl\": \"\"\r\n },\r\n \"returnPackage\": {\r\n \"carrierName\": \"\",\r\n \"trackingId\": \"\",\r\n \"trackingUrl\": \"\"\r\n },\r\n \"destinationAccountDetails\": [\r\n {\r\n \"storageAccountId\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount\",\r\n \"dataDestinationType\": \"StorageAccount\",\r\n \"accountId\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount\"\r\n }\r\n ],\r\n \"errorDetails\": [],\r\n \"jobDetailsType\": \"DataBox\",\r\n \"copyLogDetails\": []\r\n },\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": true\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"SdkJob2600\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg4216/providers/Microsoft.DataBox/jobs/SdkJob2600\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg8120/providers/Microsoft.DataBox/jobs/SdkJob7196?api-version=2018-01-01&$expand=details", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Jlc291cmNlR3JvdXBzL1Nka1JnODEyMC9wcm92aWRlcnMvTWljcm9zb2Z0LkRhdGFCb3gvam9icy9TZGtKb2I3MTk2P2FwaS12ZXJzaW9uPTIwMTgtMDEtMDEmJGV4cGFuZD1kZXRhaWxz", + "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg4216/providers/Microsoft.DataBox/jobs/SdkJob2600?api-version=2019-09-01&$expand=details", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Jlc291cmNlR3JvdXBzL1Nka1JnNDIxNi9wcm92aWRlcnMvTWljcm9zb2Z0LkRhdGFCb3gvam9icy9TZGtKb2IyNjAwP2FwaS12ZXJzaW9uPTIwMTktMDktMDEmJGV4cGFuZD1kZXRhaWxz", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "2d0ac131-80ad-419a-9126-722678b09c94" + "a09a7108-8a5b-429e-a008-7e4631dd4a40" ], - "accept-language": [ + "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.6.26614.01", - "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.0" + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.1" ] }, "ResponseHeaders": { "Cache-Control": [ "no-cache" ], - "Date": [ - "Tue, 11 Sep 2018 12:29:29 GMT" - ], "Pragma": [ "no-cache" ], @@ -473,10 +486,10 @@ "nosniff" ], "x-ms-request-id": [ - "5ea1bb9a-700a-4576-b690-af26a106d459" + "3d6ed399-6f5f-428d-9b1b-68fe83661b21" ], "x-ms-client-request-id": [ - "2d0ac131-80ad-419a-9126-722678b09c94" + "a09a7108-8a5b-429e-a008-7e4631dd4a40" ], "X-Powered-By": [ "ASP.NET" @@ -485,16 +498,19 @@ "11991" ], "x-ms-correlation-request-id": [ - "53d6af8b-4b68-4125-98ed-7781d00580af" + "22722464-aab0-4270-8e5e-0dc55acc89f9" ], "x-ms-routing-request-id": [ - "SOUTHINDIA:20180911T122929Z:53d6af8b-4b68-4125-98ed-7781d00580af" + "SOUTHINDIA:20191017T101921Z:22722464-aab0-4270-8e5e-0dc55acc89f9" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "Date": [ + "Thu, 17 Oct 2019 10:19:21 GMT" + ], "Content-Length": [ - "3253" + "3555" ], "Content-Type": [ "application/json; charset=utf-8" @@ -503,33 +519,32 @@ "-1" ] }, - "ResponseBody": "{\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2018-09-11T17:58:36.6886059+05:30\",\r\n \"details\": {\r\n \"copyProgress\": [\r\n {\r\n \"storageAccountName\": \"databoxbvttestaccount\",\r\n \"accountId\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount\",\r\n \"bytesSentToCloud\": 0,\r\n \"totalBytesToProcess\": 0\r\n }\r\n ],\r\n \"jobStages\": [\r\n {\r\n \"stageName\": \"DeviceOrdered\",\r\n \"displayName\": \"Ordered\",\r\n \"stageStatus\": \"Succeeded\",\r\n \"stageTime\": \"2018-09-11T17:58:41.7934219+05:30\"\r\n },\r\n {\r\n \"stageName\": \"Cancelled\",\r\n \"displayName\": \"Canceled\",\r\n \"stageStatus\": \"Succeeded\",\r\n \"stageTime\": \"2018-09-11T17:59:27.3708564+05:30\"\r\n }\r\n ],\r\n \"contactDetails\": {\r\n \"contactName\": \"Update Job\",\r\n \"phone\": \"1234567890\",\r\n \"phoneExtension\": \"1234\",\r\n \"emailList\": [\r\n \"testing@microsoft.com\"\r\n ],\r\n \"notificationPreference\": [\r\n {\r\n \"stageName\": \"DevicePrepared\",\r\n \"sendNotification\": true\r\n },\r\n {\r\n \"stageName\": \"Dispatched\",\r\n \"sendNotification\": true\r\n },\r\n {\r\n \"stageName\": \"Delivered\",\r\n \"sendNotification\": true\r\n },\r\n {\r\n \"stageName\": \"PickedUp\",\r\n \"sendNotification\": true\r\n },\r\n {\r\n \"stageName\": \"AtAzureDC\",\r\n \"sendNotification\": true\r\n },\r\n {\r\n \"stageName\": \"DataCopy\",\r\n \"sendNotification\": true\r\n }\r\n ]\r\n },\r\n \"shippingAddress\": {\r\n \"streetAddress1\": \"16 TOWNSEND ST\",\r\n \"streetAddress2\": \"Unit 1\",\r\n \"city\": \"San Francisco\",\r\n \"stateOrProvince\": \"CA\",\r\n \"country\": \"US\",\r\n \"postalCode\": \"94107\",\r\n \"companyName\": \"Microsoft\",\r\n \"addressType\": \"Commercial\"\r\n },\r\n \"deliveryPackage\": {\r\n \"carrierName\": \"\",\r\n \"trackingId\": \"\",\r\n \"trackingUrl\": \"\"\r\n },\r\n \"returnPackage\": {\r\n \"carrierName\": \"\",\r\n \"trackingId\": \"\",\r\n \"trackingUrl\": \"\"\r\n },\r\n \"destinationAccountDetails\": [\r\n {\r\n \"accountId\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount\",\r\n \"accountType\": \"GeneralPurposeStorage\",\r\n \"storageAccessTier\": \"Invalid\",\r\n \"storagePerformanceTier\": \"Standard\"\r\n }\r\n ],\r\n \"errorDetails\": [],\r\n \"jobDetailsType\": \"DataBox\",\r\n \"copyLogDetails\": []\r\n },\r\n \"cancellationReason\": \"CancelTest\"\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"SdkJob7196\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg8120/providers/Microsoft.DataBox/jobs/SdkJob7196\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n}", + "ResponseBody": "{\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2019-10-17T15:48:22.2077826+05:30\",\r\n \"details\": {\r\n \"copyProgress\": [\r\n {\r\n \"storageAccountName\": \"databoxbvttestaccount\",\r\n \"dataDestinationType\": \"StorageAccount\",\r\n \"accountId\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount\",\r\n \"bytesSentToCloud\": 0,\r\n \"totalBytesToProcess\": 0\r\n }\r\n ],\r\n \"jobStages\": [\r\n {\r\n \"stageName\": \"DeviceOrdered\",\r\n \"displayName\": \"Ordered\",\r\n \"stageStatus\": \"Succeeded\",\r\n \"stageTime\": \"2019-10-17T15:48:25.0029075+05:30\"\r\n },\r\n {\r\n \"stageName\": \"Cancelled\",\r\n \"displayName\": \"Canceled\",\r\n \"stageStatus\": \"Succeeded\",\r\n \"stageTime\": \"2019-10-17T15:49:20.9890464+05:30\"\r\n }\r\n ],\r\n \"contactDetails\": {\r\n \"contactName\": \"Update Job\",\r\n \"phone\": \"1234567890\",\r\n \"phoneExtension\": \"1234\",\r\n \"emailList\": [\r\n \"testing@microsoft.com\"\r\n ],\r\n \"notificationPreference\": [\r\n {\r\n \"stageName\": \"DevicePrepared\",\r\n \"sendNotification\": true\r\n },\r\n {\r\n \"stageName\": \"Dispatched\",\r\n \"sendNotification\": true\r\n },\r\n {\r\n \"stageName\": \"Delivered\",\r\n \"sendNotification\": true\r\n },\r\n {\r\n \"stageName\": \"PickedUp\",\r\n \"sendNotification\": true\r\n },\r\n {\r\n \"stageName\": \"AtAzureDC\",\r\n \"sendNotification\": true\r\n },\r\n {\r\n \"stageName\": \"DataCopy\",\r\n \"sendNotification\": true\r\n }\r\n ]\r\n },\r\n \"shippingAddress\": {\r\n \"streetAddress1\": \"16 TOWNSEND ST\",\r\n \"streetAddress2\": \"Unit 1\",\r\n \"city\": \"San Francisco\",\r\n \"stateOrProvince\": \"CA\",\r\n \"country\": \"US\",\r\n \"postalCode\": \"94107\",\r\n \"companyName\": \"Microsoft\",\r\n \"addressType\": \"Commercial\"\r\n },\r\n \"deliveryPackage\": {\r\n \"carrierName\": \"\",\r\n \"trackingId\": \"\",\r\n \"trackingUrl\": \"\"\r\n },\r\n \"returnPackage\": {\r\n \"carrierName\": \"\",\r\n \"trackingId\": \"\",\r\n \"trackingUrl\": \"\"\r\n },\r\n \"destinationAccountDetails\": [\r\n {\r\n \"storageAccountId\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount\",\r\n \"dataDestinationType\": \"StorageAccount\",\r\n \"accountId\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount\"\r\n }\r\n ],\r\n \"errorDetails\": [],\r\n \"jobDetailsType\": \"DataBox\",\r\n \"copyLogDetails\": []\r\n },\r\n \"cancellationReason\": \"CancelTest\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"SdkJob2600\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg4216/providers/Microsoft.DataBox/jobs/SdkJob2600\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg8120/providers/Microsoft.DataBox/jobs/SdkJob7196?api-version=2018-01-01&$expand=details", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Jlc291cmNlR3JvdXBzL1Nka1JnODEyMC9wcm92aWRlcnMvTWljcm9zb2Z0LkRhdGFCb3gvam9icy9TZGtKb2I3MTk2P2FwaS12ZXJzaW9uPTIwMTgtMDEtMDEmJGV4cGFuZD1kZXRhaWxz", + "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg4216/providers/Microsoft.DataBox/jobs/SdkJob2600?api-version=2019-09-01&$expand=details", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Jlc291cmNlR3JvdXBzL1Nka1JnNDIxNi9wcm92aWRlcnMvTWljcm9zb2Z0LkRhdGFCb3gvam9icy9TZGtKb2IyNjAwP2FwaS12ZXJzaW9uPTIwMTktMDktMDEmJGV4cGFuZD1kZXRhaWxz", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "bdcc8e76-b662-42a4-93fd-5554809712d7" + "67b0007f-4d0c-44f3-b903-195c162a3ee4" ], - "accept-language": [ + "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.6.26614.01", - "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.0" + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.1" ] }, "ResponseHeaders": { "Cache-Control": [ "no-cache" ], - "Date": [ - "Tue, 11 Sep 2018 12:34:30 GMT" - ], "Pragma": [ "no-cache" ], @@ -537,10 +552,10 @@ "nosniff" ], "x-ms-request-id": [ - "ce40cd12-5e12-4bd2-a114-e64286d21f85" + "58fafb9a-7d90-4cc2-b703-d2ec0469d847" ], "x-ms-client-request-id": [ - "bdcc8e76-b662-42a4-93fd-5554809712d7" + "67b0007f-4d0c-44f3-b903-195c162a3ee4" ], "X-Powered-By": [ "ASP.NET" @@ -549,16 +564,19 @@ "11999" ], "x-ms-correlation-request-id": [ - "e3a5c8fa-5f64-4b91-8ccf-0822feee37d6" + "8d3f9ab9-fbed-4d9b-8c13-29bb0cae2ff2" ], "x-ms-routing-request-id": [ - "SOUTHINDIA:20180911T123431Z:e3a5c8fa-5f64-4b91-8ccf-0822feee37d6" + "SOUTHINDIA:20191017T102423Z:8d3f9ab9-fbed-4d9b-8c13-29bb0cae2ff2" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "Date": [ + "Thu, 17 Oct 2019 10:24:23 GMT" + ], "Content-Length": [ - "2756" + "3060" ], "Content-Type": [ "application/json; charset=utf-8" @@ -567,24 +585,26 @@ "-1" ] }, - "ResponseBody": "{\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2018-09-11T17:58:36.6886059+05:30\",\r\n \"details\": {\r\n \"copyProgress\": [\r\n {\r\n \"storageAccountName\": \"databoxbvttestaccount\",\r\n \"accountId\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount\",\r\n \"bytesSentToCloud\": 0,\r\n \"totalBytesToProcess\": 0\r\n }\r\n ],\r\n \"jobStages\": [\r\n {\r\n \"stageName\": \"DeviceOrdered\",\r\n \"displayName\": \"Ordered\",\r\n \"stageStatus\": \"Succeeded\",\r\n \"stageTime\": \"2018-09-11T17:58:41.7934219+05:30\"\r\n },\r\n {\r\n \"stageName\": \"Cancelled\",\r\n \"displayName\": \"Canceled\",\r\n \"stageStatus\": \"Succeeded\",\r\n \"stageTime\": \"2018-09-11T17:59:27.3708564+05:30\"\r\n }\r\n ],\r\n \"contactDetails\": {\r\n \"contactName\": \" \",\r\n \"emailList\": [],\r\n \"notificationPreference\": []\r\n },\r\n \"shippingAddress\": {\r\n \"streetAddress1\": \"16 TOWNSEND ST\",\r\n \"streetAddress2\": \"Unit 1\",\r\n \"city\": \"San Francisco\",\r\n \"stateOrProvince\": \"CA\",\r\n \"country\": \"US\",\r\n \"postalCode\": \"94107\",\r\n \"companyName\": \"Microsoft\",\r\n \"addressType\": \"Commercial\"\r\n },\r\n \"deliveryPackage\": {\r\n \"carrierName\": \"\",\r\n \"trackingId\": \"\",\r\n \"trackingUrl\": \"\"\r\n },\r\n \"returnPackage\": {\r\n \"carrierName\": \"\",\r\n \"trackingId\": \"\",\r\n \"trackingUrl\": \"\"\r\n },\r\n \"destinationAccountDetails\": [\r\n {\r\n \"accountId\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount\",\r\n \"accountType\": \"GeneralPurposeStorage\",\r\n \"storageAccessTier\": \"Invalid\",\r\n \"storagePerformanceTier\": \"Standard\"\r\n }\r\n ],\r\n \"errorDetails\": [],\r\n \"jobDetailsType\": \"DataBox\",\r\n \"copyLogDetails\": [],\r\n \"chainOfCustodySasKey\": \"https://wusbeta.blob.core.windows.net/chainofcustody/dbb287f3-ded6-42ee-b673-0c49d46394dc.txt?sv=2016-05-31&sr=b&sig=ljyW4jh7VAuQg%2Bm9JPKznnKEh7kyekn4zhkZ4vIH5LY%3D&st=2018-09-11T12%3A24%3A31Z&se=2018-09-11T12%3A54%3A31Z&sp=r\"\r\n },\r\n \"cancellationReason\": \"CancelTest\"\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"SdkJob7196\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg8120/providers/Microsoft.DataBox/jobs/SdkJob7196\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n}", + "ResponseBody": "{\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2019-10-17T15:48:22.2077826+05:30\",\r\n \"details\": {\r\n \"copyProgress\": [\r\n {\r\n \"storageAccountName\": \"databoxbvttestaccount\",\r\n \"dataDestinationType\": \"StorageAccount\",\r\n \"accountId\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount\",\r\n \"bytesSentToCloud\": 0,\r\n \"totalBytesToProcess\": 0\r\n }\r\n ],\r\n \"jobStages\": [\r\n {\r\n \"stageName\": \"DeviceOrdered\",\r\n \"displayName\": \"Ordered\",\r\n \"stageStatus\": \"Succeeded\",\r\n \"stageTime\": \"2019-10-17T15:48:25.0029075+05:30\"\r\n },\r\n {\r\n \"stageName\": \"Cancelled\",\r\n \"displayName\": \"Canceled\",\r\n \"stageStatus\": \"Succeeded\",\r\n \"stageTime\": \"2019-10-17T15:49:20.9890464+05:30\"\r\n }\r\n ],\r\n \"contactDetails\": {\r\n \"contactName\": \" \",\r\n \"emailList\": [],\r\n \"notificationPreference\": []\r\n },\r\n \"shippingAddress\": {\r\n \"streetAddress1\": \"16 TOWNSEND ST\",\r\n \"streetAddress2\": \"Unit 1\",\r\n \"city\": \"San Francisco\",\r\n \"stateOrProvince\": \"CA\",\r\n \"country\": \"US\",\r\n \"postalCode\": \"94107\",\r\n \"companyName\": \"Microsoft\",\r\n \"addressType\": \"Commercial\"\r\n },\r\n \"deliveryPackage\": {\r\n \"carrierName\": \"\",\r\n \"trackingId\": \"\",\r\n \"trackingUrl\": \"\"\r\n },\r\n \"returnPackage\": {\r\n \"carrierName\": \"\",\r\n \"trackingId\": \"\",\r\n \"trackingUrl\": \"\"\r\n },\r\n \"destinationAccountDetails\": [\r\n {\r\n \"storageAccountId\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount\",\r\n \"dataDestinationType\": \"StorageAccount\",\r\n \"accountId\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount\"\r\n }\r\n ],\r\n \"errorDetails\": [],\r\n \"jobDetailsType\": \"DataBox\",\r\n \"copyLogDetails\": [],\r\n \"chainOfCustodySasKey\": \"https://wusbeta.blob.core.windows.net/chainofcustody/03515491-a18b-4ba9-95bb-b78db9477f7d.txt?sv=2017-04-17&sr=b&sig=Orx2dMV%2F4Rg2KknybuSJgeBAnyKPiGr%2FHhkSpEuNd2A%3D&st=2019-10-17T10%3A14%3A23Z&se=2019-10-17T10%3A44%3A23Z&sp=r\"\r\n },\r\n \"cancellationReason\": \"CancelTest\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"SdkJob2600\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg4216/providers/Microsoft.DataBox/jobs/SdkJob2600\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg8120/providers/Microsoft.DataBox/jobs/SdkJob7196?api-version=2018-01-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Jlc291cmNlR3JvdXBzL1Nka1JnODEyMC9wcm92aWRlcnMvTWljcm9zb2Z0LkRhdGFCb3gvam9icy9TZGtKb2I3MTk2P2FwaS12ZXJzaW9uPTIwMTgtMDEtMDE=", + "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg4216/providers/Microsoft.DataBox/jobs/SdkJob2600?api-version=2019-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Jlc291cmNlR3JvdXBzL1Nka1JnNDIxNi9wcm92aWRlcnMvTWljcm9zb2Z0LkRhdGFCb3gvam9icy9TZGtKb2IyNjAwP2FwaS12ZXJzaW9uPTIwMTktMDktMDE=", "RequestMethod": "PATCH", "RequestBody": "{\r\n \"properties\": {\r\n \"details\": {\r\n \"contactDetails\": {\r\n \"contactName\": \"Update Job\",\r\n \"phone\": \"1234567890\",\r\n \"phoneExtension\": \"1234\",\r\n \"emailList\": [\r\n \"testing@microsoft.com\"\r\n ]\r\n },\r\n \"shippingAddress\": {\r\n \"streetAddress1\": \"16 TOWNSEND ST\",\r\n \"streetAddress2\": \"Unit 1\",\r\n \"city\": \"San Francisco\",\r\n \"stateOrProvince\": \"CA\",\r\n \"country\": \"US\",\r\n \"postalCode\": \"94107\",\r\n \"companyName\": \"Microsoft\",\r\n \"addressType\": \"Commercial\"\r\n }\r\n }\r\n }\r\n}", "RequestHeaders": { "x-ms-client-request-id": [ - "26b53b91-d67c-4e6a-b8d6-0d01db7b6e90" + "efd496d5-16a8-4208-ac8a-b67f202a9409" ], - "accept-language": [ + "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.6.26614.01", - "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.0" + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.1" ], "Content-Type": [ "application/json; charset=utf-8" @@ -597,14 +617,11 @@ "Cache-Control": [ "no-cache" ], - "Date": [ - "Tue, 11 Sep 2018 12:28:59 GMT" - ], "Pragma": [ "no-cache" ], "Location": [ - "https://management.azure.com/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/providers/Microsoft.DataBox/locations/westus/operationResults/f85eb1f2-37d7-4b96-ad56-0214936c4e29?api-version=2018-01-01" + "https://management.azure.com/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/providers/Microsoft.DataBox/locations/westus/operationResults/a6eba83a-0d07-4052-972b-59a68e3674ae?api-version=2018-01-01" ], "Retry-After": [ "10" @@ -613,59 +630,61 @@ "nosniff" ], "x-ms-request-id": [ - "276e7d82-eb29-4ed7-9207-260b3fc4870e" + "80472603-7b0c-4cc3-ba49-451d0ce74305" ], "x-ms-client-request-id": [ - "26b53b91-d67c-4e6a-b8d6-0d01db7b6e90" + "efd496d5-16a8-4208-ac8a-b67f202a9409" ], "X-Powered-By": [ "ASP.NET" ], "x-ms-ratelimit-remaining-subscription-writes": [ - "1196" + "1198" ], "x-ms-correlation-request-id": [ - "9b5d2dea-bd16-4ea8-ba65-0abd726b8821" + "3d7ebfe6-3fd0-42e4-9c4b-4d12ef0852cb" ], "x-ms-routing-request-id": [ - "SOUTHINDIA:20180911T122900Z:9b5d2dea-bd16-4ea8-ba65-0abd726b8821" + "SOUTHINDIA:20191017T101844Z:3d7ebfe6-3fd0-42e4-9c4b-4d12ef0852cb" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], - "Content-Length": [ - "0" + "Date": [ + "Thu, 17 Oct 2019 10:18:43 GMT" ], "Expires": [ "-1" + ], + "Content-Length": [ + "0" ] }, "ResponseBody": "", "StatusCode": 202 }, { - "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/providers/Microsoft.DataBox/locations/westus/operationResults/f85eb1f2-37d7-4b96-ad56-0214936c4e29?api-version=2018-01-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveC9sb2NhdGlvbnMvd2VzdHVzL29wZXJhdGlvblJlc3VsdHMvZjg1ZWIxZjItMzdkNy00Yjk2LWFkNTYtMDIxNDkzNmM0ZTI5P2FwaS12ZXJzaW9uPTIwMTgtMDEtMDE=", + "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/providers/Microsoft.DataBox/locations/westus/operationResults/a6eba83a-0d07-4052-972b-59a68e3674ae?api-version=2018-01-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveC9sb2NhdGlvbnMvd2VzdHVzL29wZXJhdGlvblJlc3VsdHMvYTZlYmE4M2EtMGQwNy00MDUyLTk3MmItNTlhNjhlMzY3NGFlP2FwaS12ZXJzaW9uPTIwMTgtMDEtMDE=", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "User-Agent": [ - "FxVersion/4.6.26614.01", - "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.0" + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.1" ] }, "ResponseHeaders": { "Cache-Control": [ "no-cache" ], - "Date": [ - "Tue, 11 Sep 2018 12:29:10 GMT" - ], "Pragma": [ "no-cache" ], "Location": [ - "https://management.azure.com/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg8120/providers/Microsoft.DataBox/jobs/SdkJob7196?api-version=2018-01-01" + "https://management.azure.com/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg4216/providers/Microsoft.DataBox/jobs/SdkJob2600?api-version=2018-01-01" ], "Retry-After": [ "10" @@ -674,10 +693,10 @@ "nosniff" ], "x-ms-request-id": [ - "34fdc9da-1787-4862-bb11-5488c13e831c" + "46d134d2-835f-4196-a0b7-442bdfff0000" ], "x-ms-client-request-id": [ - "46cc996d-0151-43d5-ab26-2fb43b342e1e" + "467589e9-71c0-483a-8513-b3710b895ccc" ], "X-Powered-By": [ "ASP.NET" @@ -686,68 +705,76 @@ "11996" ], "x-ms-correlation-request-id": [ - "5018e5c5-8613-4c1a-afb0-6ce42dd0a6ea" + "4b2ba28a-63c3-4bd5-9401-b3a77b073e47" ], "x-ms-routing-request-id": [ - "SOUTHINDIA:20180911T122910Z:5018e5c5-8613-4c1a-afb0-6ce42dd0a6ea" + "SOUTHINDIA:20191017T101855Z:4b2ba28a-63c3-4bd5-9401-b3a77b073e47" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], - "Content-Length": [ - "0" + "Date": [ + "Thu, 17 Oct 2019 10:18:54 GMT" ], "Expires": [ "-1" + ], + "Content-Length": [ + "0" ] }, "ResponseBody": "", "StatusCode": 202 }, { - "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/providers/Microsoft.DataBox/jobs?api-version=2018-01-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveC9qb2JzP2FwaS12ZXJzaW9uPTIwMTgtMDEtMDE=", + "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/providers/Microsoft.DataBox/jobs?api-version=2019-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveC9qb2JzP2FwaS12ZXJzaW9uPTIwMTktMDktMDE=", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "03e7ecda-9d8a-4883-ad1e-26ce670891ee" + "b701e494-eb3e-4c92-8854-80f0301c1375" ], - "accept-language": [ + "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.6.26614.01", - "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.0" + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.1" ] }, "ResponseHeaders": { "Cache-Control": [ "no-cache" ], - "Date": [ - "Tue, 11 Sep 2018 12:29:26 GMT" - ], "Pragma": [ "no-cache" ], "x-ms-original-request-ids": [ - "571190c6-e4e1-4465-bc2d-4e9d4d6e0335", - "7bdc0cad-4f9a-4f2e-83f9-fa0ddc72371b", - "1ea06a58-347d-412c-8ec2-3b252d83f411", - "26c4a716-27f5-47d5-8d57-46e1a94cde77" + "5ea9b8f6-944d-4c39-8655-46c5c6b78f2d", + "fe0da41a-b736-4018-826f-b89324d3b764", + "b824f0b9-bd7f-4e44-9816-66bbb21b51b8", + "9788849f-e8e1-4247-8f6f-c662ea578dce", + "d74847bc-4756-4ad5-8920-9c6fc7c42ef6", + "5dabea69-6d94-4f2c-b2c8-3524eba9c30b", + "f48e4705-47ca-488d-9d3c-6f803acf5554", + "d44dae7f-305d-4034-b7a5-685cdd82790d", + "de56b387-f6a9-40cf-ba7b-ee1c1208cbc9", + "b389eafa-40cf-47df-b56e-717ae316a01a" ], "x-ms-ratelimit-remaining-subscription-reads": [ "11993" ], "x-ms-request-id": [ - "4ee7f6bc-32a6-4707-a677-975ba8c1539b" + "b12baeae-9e18-4d9c-b699-f0931914267d" ], "x-ms-correlation-request-id": [ - "4ee7f6bc-32a6-4707-a677-975ba8c1539b" + "b12baeae-9e18-4d9c-b699-f0931914267d" ], "x-ms-routing-request-id": [ - "SOUTHINDIA:20180911T122926Z:4ee7f6bc-32a6-4707-a677-975ba8c1539b" + "SOUTHINDIA:20191017T101920Z:b12baeae-9e18-4d9c-b699-f0931914267d" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -755,43 +782,45 @@ "X-Content-Type-Options": [ "nosniff" ], - "Content-Length": [ - "13952" + "Date": [ + "Thu, 17 Oct 2019 10:19:19 GMT" ], "Content-Type": [ "application/json; charset=utf-8" ], "Expires": [ "-1" + ], + "Content-Length": [ + "18307" ] }, - "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"properties\": {\r\n \"deviceType\": \"Disk\",\r\n \"isCancellable\": true,\r\n \"isDeletable\": false,\r\n \"isShippingAddressEditable\": true,\r\n \"status\": \"DeviceOrdered\",\r\n \"startTime\": \"2018-08-30T14:44:39.77401+05:30\",\r\n \"deliveryPackage\": {\r\n \"carrierName\": \"\",\r\n \"trackingId\": \"\",\r\n \"trackingUrl\": \"\"\r\n },\r\n \"returnPackage\": {\r\n \"carrierName\": \"\",\r\n \"trackingId\": \"\",\r\n \"trackingUrl\": \"\"\r\n },\r\n \"destinationAccountDetails\": [\r\n {\r\n \"accountId\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/ausresgrpm/providers/Microsoft.Storage/storageAccounts/ausamn\",\r\n \"accountType\": \"GeneralPurposeStorage\",\r\n \"storageAccessTier\": \"Hot\",\r\n \"storagePerformanceTier\": \"Standard\"\r\n }\r\n ]\r\n },\r\n \"location\": \"australiaeast\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBoxDisk\"\r\n },\r\n \"name\": \"mnaustest\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/ausresgrpmn/providers/Microsoft.DataBox/jobs/mnaustest\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"deviceType\": \"Disk\",\r\n \"isCancellable\": true,\r\n \"isDeletable\": false,\r\n \"isShippingAddressEditable\": true,\r\n \"status\": \"DeviceOrdered\",\r\n \"startTime\": \"2018-09-10T18:03:22.2578238+05:30\",\r\n \"deliveryPackage\": {\r\n \"carrierName\": \"\",\r\n \"trackingId\": \"\",\r\n \"trackingUrl\": \"\"\r\n },\r\n \"returnPackage\": {\r\n \"carrierName\": \"\",\r\n \"trackingId\": \"\",\r\n \"trackingUrl\": \"\"\r\n },\r\n \"destinationAccountDetails\": [\r\n {\r\n \"accountId\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/ausresgrpm/providers/Microsoft.Storage/storageAccounts/ausamn\",\r\n \"accountType\": \"GeneralPurposeStorage\",\r\n \"storageAccessTier\": \"Hot\",\r\n \"storagePerformanceTier\": \"Standard\"\r\n }\r\n ]\r\n },\r\n \"location\": \"australiaeast\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBoxDisk\"\r\n },\r\n \"name\": \"portalcontractAUS\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/ausresgrpmn/providers/Microsoft.DataBox/jobs/portalcontractAUS\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"deviceType\": \"Disk\",\r\n \"isCancellable\": true,\r\n \"isDeletable\": false,\r\n \"isShippingAddressEditable\": true,\r\n \"status\": \"DeviceOrdered\",\r\n \"startTime\": \"2018-08-30T15:17:17.3753642+05:30\",\r\n \"deliveryPackage\": {\r\n \"carrierName\": \"\",\r\n \"trackingId\": \"\",\r\n \"trackingUrl\": \"\"\r\n },\r\n \"returnPackage\": {\r\n \"carrierName\": \"\",\r\n \"trackingId\": \"\",\r\n \"trackingUrl\": \"\"\r\n },\r\n \"destinationAccountDetails\": [\r\n {\r\n \"accountId\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/ausresgrpm/providers/Microsoft.Storage/storageAccounts/ausamn\",\r\n \"accountType\": \"GeneralPurposeStorage\",\r\n \"storageAccessTier\": \"Hot\",\r\n \"storagePerformanceTier\": \"Standard\"\r\n }\r\n ]\r\n },\r\n \"location\": \"australiaeast\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBoxDisk\"\r\n },\r\n \"name\": \"testBB-diskAU\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/testBB/providers/Microsoft.DataBox/jobs/testBB-diskAU\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": true,\r\n \"isDeletable\": false,\r\n \"isShippingAddressEditable\": true,\r\n \"status\": \"DeviceOrdered\",\r\n \"startTime\": \"2018-09-08T22:46:11.5143859+05:30\"\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"TestPortalContract\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat/providers/Microsoft.DataBox/jobs/TestPortalContract\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": true,\r\n \"isDeletable\": false,\r\n \"isShippingAddressEditable\": true,\r\n \"status\": \"DeviceOrdered\",\r\n \"startTime\": \"2018-08-21T15:19:38.5967539+05:30\"\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBoxHeavy\"\r\n },\r\n \"name\": \"testheavy1\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/autoallocation/providers/Microsoft.DataBox/jobs/testheavy1\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": true,\r\n \"isDeletable\": false,\r\n \"isShippingAddressEditable\": true,\r\n \"status\": \"DeviceOrdered\",\r\n \"startTime\": \"2018-06-28T14:07:33.0497881+05:30\"\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"TJ-636657717727899366\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/autoallocation/providers/Microsoft.DataBox/jobs/TJ-636657717727899366\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": false,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"PickedUp\",\r\n \"startTime\": \"2018-09-06T16:23:58.7665181+05:30\"\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBoxDisk\"\r\n },\r\n \"name\": \"abvetestups\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/bvttoolrg6/providers/Microsoft.DataBox/jobs/abvetestups\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": true,\r\n \"isDeletable\": false,\r\n \"isShippingAddressEditable\": true,\r\n \"status\": \"DeviceOrdered\",\r\n \"startTime\": \"2018-08-21T14:08:42.9538214+05:30\"\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBoxDisk\"\r\n },\r\n \"name\": \"disksmoketest\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/bvttoolrg6/providers/Microsoft.DataBox/jobs/disksmoketest\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": true,\r\n \"isDeletable\": false,\r\n \"isShippingAddressEditable\": true,\r\n \"status\": \"DeviceOrdered\",\r\n \"startTime\": \"2018-08-08T07:52:22.8655902+05:30\"\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBoxHeavy\"\r\n },\r\n \"name\": \"heavyjob1029039\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/bvttoolrg6/providers/Microsoft.DataBox/jobs/heavyjob1029039\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": true,\r\n \"isDeletable\": false,\r\n \"isShippingAddressEditable\": true,\r\n \"status\": \"DeviceOrdered\",\r\n \"startTime\": \"2018-08-30T14:26:12.0791245+05:30\"\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBoxHeavy\"\r\n },\r\n \"name\": \"heavyjob1029039-Clone\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/bvttoolrg6/providers/Microsoft.DataBox/jobs/heavyjob1029039-Clone\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": true,\r\n \"isDeletable\": false,\r\n \"isShippingAddressEditable\": true,\r\n \"status\": \"DeviceOrdered\",\r\n \"startTime\": \"2018-07-06T05:48:00.4841388+05:30\"\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"sojaintest1\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/bvttoolrg6/providers/Microsoft.DataBox/jobs/sojaintest1\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": true,\r\n \"isDeletable\": false,\r\n \"isShippingAddressEditable\": true,\r\n \"status\": \"DeviceOrdered\",\r\n \"startTime\": \"2018-09-04T12:05:35.7885962+05:30\"\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBoxDisk\"\r\n },\r\n \"name\": \"testacispasskey\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/bvttoolrg6/providers/Microsoft.DataBox/jobs/testacispasskey\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": true,\r\n \"isDeletable\": false,\r\n \"isShippingAddressEditable\": true,\r\n \"status\": \"DeviceOrdered\",\r\n \"startTime\": \"2018-09-04T12:19:50.1313891+05:30\"\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBoxDisk\"\r\n },\r\n \"name\": \"testacispasskey1\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/bvttoolrg6/providers/Microsoft.DataBox/jobs/testacispasskey1\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": true,\r\n \"isDeletable\": false,\r\n \"isShippingAddressEditable\": true,\r\n \"status\": \"DeviceOrdered\",\r\n \"startTime\": \"2018-09-04T12:27:03.679307+05:30\"\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBoxDisk\"\r\n },\r\n \"name\": \"testacispasskey2\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/bvttoolrg6/providers/Microsoft.DataBox/jobs/testacispasskey2\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": true,\r\n \"isDeletable\": false,\r\n \"isShippingAddressEditable\": true,\r\n \"status\": \"DeviceOrdered\",\r\n \"startTime\": \"2018-09-04T02:24:49.5106952+05:30\"\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBoxDisk\"\r\n },\r\n \"name\": \"testingpasskey\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/bvttoolrg6/providers/Microsoft.DataBox/jobs/testingpasskey\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": true,\r\n \"isDeletable\": false,\r\n \"isShippingAddressEditable\": true,\r\n \"status\": \"DeviceOrdered\",\r\n \"startTime\": \"2018-09-04T03:37:18.5000801+05:30\"\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBoxDisk\"\r\n },\r\n \"name\": \"testingpasskey1\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/bvttoolrg6/providers/Microsoft.DataBox/jobs/testingpasskey1\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": true,\r\n \"isDeletable\": false,\r\n \"isShippingAddressEditable\": true,\r\n \"status\": \"DeviceOrdered\",\r\n \"startTime\": \"2018-06-13T14:01:22.0918861+05:30\"\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"TJ-636644753834613064\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/bvttoolrg6/providers/Microsoft.DataBox/jobs/TJ-636644753834613064\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": false,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"PickedUp\",\r\n \"startTime\": \"2018-06-15T00:01:51.7887418+05:30\"\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"TJ-636645978308049673\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/bvttoolrg6/providers/Microsoft.DataBox/jobs/TJ-636645978308049673\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": true,\r\n \"isDeletable\": false,\r\n \"isShippingAddressEditable\": true,\r\n \"status\": \"DeviceOrdered\",\r\n \"startTime\": \"2018-06-15T00:00:55.8926702+05:30\"\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"TJ-636645978327256231\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/bvttoolrg6/providers/Microsoft.DataBox/jobs/TJ-636645978327256231\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": true,\r\n \"isDeletable\": false,\r\n \"isShippingAddressEditable\": true,\r\n \"status\": \"DeviceOrdered\",\r\n \"startTime\": \"2018-06-15T00:00:49.1912624+05:30\"\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"TJ-636645978337105060\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/bvttoolrg6/providers/Microsoft.DataBox/jobs/TJ-636645978337105060\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": false,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Delivered\",\r\n \"startTime\": \"2018-06-15T09:34:08.5731715+05:30\"\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"TJ-636646322037905056\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/bvttoolrg6/providers/Microsoft.DataBox/jobs/TJ-636646322037905056\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": true,\r\n \"isDeletable\": false,\r\n \"isShippingAddressEditable\": true,\r\n \"status\": \"DeviceOrdered\",\r\n \"startTime\": \"2018-06-15T09:33:44.4557174+05:30\"\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"TJ-636646322198505202\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/bvttoolrg6/providers/Microsoft.DataBox/jobs/TJ-636646322198505202\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": true,\r\n \"isDeletable\": false,\r\n \"isShippingAddressEditable\": true,\r\n \"status\": \"DeviceOrdered\",\r\n \"startTime\": \"2018-06-16T00:00:42.7564714+05:30\"\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"TJ-636646842116642570\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/bvttoolrg6/providers/Microsoft.DataBox/jobs/TJ-636646842116642570\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": false,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"DevicePrepared\",\r\n \"startTime\": \"2018-06-16T00:00:37.1560297+05:30\"\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBoxDisk\"\r\n },\r\n \"name\": \"TJ-636646842129749628\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/bvttoolrg6/providers/Microsoft.DataBox/jobs/TJ-636646842129749628\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": true,\r\n \"isDeletable\": false,\r\n \"isShippingAddressEditable\": true,\r\n \"status\": \"DeviceOrdered\",\r\n \"startTime\": \"2018-06-16T00:00:55.5759323+05:30\"\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"TJ-636646842130208643\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/bvttoolrg6/providers/Microsoft.DataBox/jobs/TJ-636646842130208643\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": false,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"PickedUp\",\r\n \"startTime\": \"2018-06-16T00:01:43.7487451+05:30\"\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"TJ-636646842175867545\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/bvttoolrg6/providers/Microsoft.DataBox/jobs/TJ-636646842175867545\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": true,\r\n \"isDeletable\": false,\r\n \"isShippingAddressEditable\": true,\r\n \"status\": \"DeviceOrdered\",\r\n \"startTime\": \"2018-06-16T00:00:40.1336605+05:30\"\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBoxDisk\"\r\n },\r\n \"name\": \"TJ-636646842185996513\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/bvttoolrg6/providers/Microsoft.DataBox/jobs/TJ-636646842185996513\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": true,\r\n \"isDeletable\": false,\r\n \"isShippingAddressEditable\": true,\r\n \"status\": \"DeviceOrdered\",\r\n \"startTime\": \"2018-06-17T00:00:22.60807+05:30\"\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"TJ-636647706054109071\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/bvttoolrg6/providers/Microsoft.DataBox/jobs/TJ-636647706054109071\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n }\r\n ],\r\n \"nextLink\": \"https://management.azure.com/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/providers/Microsoft.DataBox/jobs?api-version=2018-01-01&%24skiptoken=dVJrb5swFP0v0bZvKcaBFipVUx5A0wVCDOb1zQZCDBhYIM%2bq%2f33uonXStEr%2bYN1z7zlH99zXUZOfhxVrqn70%2bDoKDc%2fH3uhxtBuGrn%2bUJE4aUuQ8b4Y7cj3s87u05VJ%2foH26Z93A2qaXtuReAxrcjrXt9mGsEKiOdTV9GKe5nhFVkaECt1K3b48sy%2fe9ZLN03%2fbtdrhbkIHM2rNUtrT%2fTjo2PgpcUD5BIGtjIIv37Utfsc5vq7x5che6QsNTkfHgksL6SEvAbE85Ldmsptw5JlZ9SK6AZRHiK9%2bAy1L7Culi02obqB8ygWahCUioHwJL3yehckOL5eK8oFAViCrHEerEH1M41LRUnDmbFsv5VAs%2bNJXLqpxqKzmp08YRvR8s82nhmkhNLSx4A8tk1MKi709F%2bHhnKlxDrfNntImjF0BuaqskqsSM7RlC0CQU44sP0Mwx5CGMkIvkbvCb6mSbNfZ80w6s%2fhxGXZmZ1SXwA4IAPvsVMnOsGh6X47x64XGd9YQ7wzrqmF23J9%2bSPWKhZ8RrZsMd93GspuHy4jWttgKfOfrHs0cn2V%2bvE4eZJQ2S%2b7h0wjwQXhqUhMbLJA5Smda7%2bw1PShqi31okRAdczphd1tcYyqV9wysEdeDzzrEr9Sf2nXVeGRcfo8AGKk6ujhtYqezO9XUS7QDm%2bsSDgeoW4Mf7JkVuWGyxSSJkU%2bjsRMLiJtRNyutB1FUx9x%2f8lqnAPs%2b8PB0%2fv5jR29sv\"\r\n}", + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2018-08-30T14:44:39.77401+05:30\",\r\n \"cancellationReason\": \"Old job which is still in ordered state cancelled by the service\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"australiaeast\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBoxDisk\"\r\n },\r\n \"name\": \"mnaustest\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/ausresgrpmn/providers/Microsoft.DataBox/jobs/mnaustest\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2018-09-10T18:03:22.2578238+05:30\",\r\n \"cancellationReason\": \"Old job which is still in ordered state cancelled by the service\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"australiaeast\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBoxDisk\"\r\n },\r\n \"name\": \"portalcontractAUS\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/ausresgrpmn/providers/Microsoft.DataBox/jobs/portalcontractAUS\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2018-08-30T15:17:17.3753642+05:30\",\r\n \"cancellationReason\": \"Old job which is still in ordered state cancelled by the service\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"australiaeast\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBoxDisk\"\r\n },\r\n \"name\": \"testBB-diskAU\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/testBB/providers/Microsoft.DataBox/jobs/testBB-diskAU\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2018-11-27T15:17:49.0760408+05:30\",\r\n \"cancellationReason\": \"Old job which is still in ordered state cancelled by the service\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"testbadresourcegroup\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat3198inh0-9)inh(il(h)_fyoin)(upf(yLASD0-FJ(hal-DSNWP0JDS0P3-0SJ93/providers/Microsoft.DataBox/jobs/testbadresourcegroup\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2019-01-04T09:08:49.9928621+05:30\",\r\n \"cancellationReason\": \"Old job which is still in ordered state cancelled by the service\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"andipodtest4jan\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat/providers/Microsoft.DataBox/jobs/andipodtest4jan\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2019-07-04T14:01:50.9232807+05:30\",\r\n \"cancellationReason\": \"IncorrectOrder null\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"testdeepak04-07\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat/providers/Microsoft.DataBox/jobs/testdeepak04-07\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2019-02-11T12:33:16.6231232+05:30\",\r\n \"cancellationReason\": \"Old job which is still in ordered state cancelled by the service\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBoxHeavy\"\r\n },\r\n \"name\": \"testdurga-heavy\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat/providers/Microsoft.DataBox/jobs/testdurga-heavy\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2019-02-11T12:38:49.0620094+05:30\",\r\n \"cancellationReason\": \"Old job which is still in ordered state cancelled by the service\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBoxHeavy\"\r\n },\r\n \"name\": \"testdurga-heavy1\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat/providers/Microsoft.DataBox/jobs/testdurga-heavy1\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2019-01-09T16:12:43.2931373+05:30\",\r\n \"cancellationReason\": \"Old job which is still in ordered state cancelled by the service\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBoxHeavy\"\r\n },\r\n \"name\": \"testdurga2\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat/providers/Microsoft.DataBox/jobs/testdurga2\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2019-01-09T15:59:47.4375821+05:30\",\r\n \"cancellationReason\": \"Old job which is still in ordered state cancelled by the service\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"testdurgad\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat/providers/Microsoft.DataBox/jobs/testdurgad\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2019-01-09T19:04:31.4461343+05:30\",\r\n \"cancellationReason\": \"Old job which is still in ordered state cancelled by the service\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBoxDisk\"\r\n },\r\n \"name\": \"testdurgadisk\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat/providers/Microsoft.DataBox/jobs/testdurgadisk\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2019-01-09T19:10:08.2854968+05:30\",\r\n \"cancellationReason\": \"Old job which is still in ordered state cancelled by the service\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBoxDisk\"\r\n },\r\n \"name\": \"testdurgadisk-Clone\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat/providers/Microsoft.DataBox/jobs/testdurgadisk-Clone\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2018-12-19T14:23:06.8155601+05:30\",\r\n \"cancellationReason\": \"Old job which is still in ordered state cancelled by the service\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"testdurgam\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat/providers/Microsoft.DataBox/jobs/testdurgam\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2018-12-19T16:46:12.824436+05:30\",\r\n \"cancellationReason\": \"Old job which is still in ordered state cancelled by the service\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"testdurgam-1\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat/providers/Microsoft.DataBox/jobs/testdurgam-1\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2019-03-04T12:00:17.7643558+05:30\",\r\n \"cancellationReason\": \"Old job which is still in ordered state cancelled by the service\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"testdurgam-Clone\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat/providers/Microsoft.DataBox/jobs/testdurgam-Clone\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2018-12-19T18:24:23.0774328+05:30\",\r\n \"cancellationReason\": \"Old job which is still in ordered state cancelled by the service\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"testdurgasm-1\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat/providers/Microsoft.DataBox/jobs/testdurgasm-1\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2019-03-04T11:58:13.4876698+05:30\",\r\n \"cancellationReason\": \"Old job which is still in ordered state cancelled by the service\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"testdurgasm-1-1\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat/providers/Microsoft.DataBox/jobs/testdurgasm-1-1\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2019-01-11T14:28:55.4375406+05:30\",\r\n \"cancellationReason\": \"Old job which is still in ordered state cancelled by the service\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"testdurgasm-1-Clone\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat/providers/Microsoft.DataBox/jobs/testdurgasm-1-Clone\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2019-02-15T12:51:12.2717434+05:30\",\r\n \"cancellationReason\": \"Old job which is still in ordered state cancelled by the service\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"testdurgasm-11\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat/providers/Microsoft.DataBox/jobs/testdurgasm-11\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2019-02-15T12:54:58.9886188+05:30\",\r\n \"cancellationReason\": \"Old job which is still in ordered state cancelled by the service\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"testdurgasm-12\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat/providers/Microsoft.DataBox/jobs/testdurgasm-12\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2019-02-15T13:33:29.8417562+05:30\",\r\n \"cancellationReason\": \"Old job which is still in ordered state cancelled by the service\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"testdurgasm-1dssd\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat/providers/Microsoft.DataBox/jobs/testdurgasm-1dssd\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2019-02-15T15:35:39.937519+05:30\",\r\n \"cancellationReason\": \"Old job which is still in ordered state cancelled by the service\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"testdurgasm-ccxcx\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat/providers/Microsoft.DataBox/jobs/testdurgasm-ccxcx\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2019-01-09T15:56:58.4277564+05:30\",\r\n \"cancellationReason\": \"Old job which is still in ordered state cancelled by the service\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"testdurgasm-Clone\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat/providers/Microsoft.DataBox/jobs/testdurgasm-Clone\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2019-02-10T14:46:10.401621+05:30\",\r\n \"cancellationReason\": \"Old job which is still in ordered state cancelled by the service\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"testdurgasm-Clone-Clone\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat/providers/Microsoft.DataBox/jobs/testdurgasm-Clone-Clone\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2019-02-10T14:52:37.2363289+05:30\",\r\n \"cancellationReason\": \"Old job which is still in ordered state cancelled by the service\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"testdurgasm-compute\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat/providers/Microsoft.DataBox/jobs/testdurgasm-compute\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": false,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"ReadyToDispatchFromAzureDC\",\r\n \"startTime\": \"2019-02-10T14:57:32.3159255+05:30\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"testdurgasm-compute1\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat/providers/Microsoft.DataBox/jobs/testdurgasm-compute1\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2018-09-08T22:46:11.5143859+05:30\",\r\n \"cancellationReason\": \"Old job which is still in ordered state cancelled by the service\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"TestPortalContract\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat/providers/Microsoft.DataBox/jobs/TestPortalContract\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": true,\r\n \"isDeletable\": false,\r\n \"isShippingAddressEditable\": true,\r\n \"status\": \"DeviceOrdered\",\r\n \"startTime\": \"2019-07-30T10:47:22.083517+05:30\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": true\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"testschedule01\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat/providers/Microsoft.DataBox/jobs/testschedule01\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n }\r\n ],\r\n \"nextLink\": \"https://management.azure.com/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/providers/Microsoft.DataBox/jobs?api-version=2019-09-01&%24skiptoken=dZJdb5swFIb%2fS7TuLg04kEKkasoH0GRAE%2fNh4M4GQgwYUCCEpOp%2fn7uq3bSpki8sv8fv%2b%2bic8zKq0qEzaVW0o%2fnLCGmO6zmj%2bejYdU07n0wYrnCWsrTq7vHtfErv45pN2jNp4xNtOlpX7eSAZ4qggMNYORwexhIG8liV44dxnKoJliURSOAwaU51T5P01E4sGp%2fqtj5092vc4WU9TPKatD9wQ8c917nlIxBEdSzwI37%2f1ha0cesirR53a1Ui6JIlzL%2fGoOxJLlDLkS4buiwJs%2fvIKM%2fRTaBJAJnpamCTK3eArPe1sgfqOeFqgnQBI%2fXsG%2bopQtK7mm3Ww5oAmSuyGAaw4XePgK4kuWSv6CLbrBaK%2f5kpXc18oZhiVMaVzWs%2fXVaLbKdDOTY87usbOiWGx%2bs%2bXjjHm1O20%2bQyfYL7MNgK%2bD3NjIKC%2f7EcjQfqmHje1RXg0tbEDgVwB8Wmc6viYuml57i65RvtgIImT%2fTi6rs%2bhoI3uAXUU0%2fWHCaGabFlYZm0mNndc9BQq6wvriE62IBPkJXUAkfmeqEco83VqWrFFL4i%2bofZIdPkD%2bvUonpO%2fGgW5jZKfc5SwQhp22noxyIpj7M9i3KC4O8sbGg3xAZKAlhHWiglYnbz2JBb4naG3G1N9GbjVzb2NV1y9eQ5BpurjS4fbH8lfzLp8BizpEy0oQ%2fB%2b1x35fKKkXiMq%2bKt8%2f%2frmfDzbZqmYPek4pOu%2fCPfi56UsMfAP%2b%2b4vlupX23D3TQZvb7%2bAg%3d%3d\"\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg8120/providers/Microsoft.DataBox/jobs?api-version=2018-01-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Jlc291cmNlR3JvdXBzL1Nka1JnODEyMC9wcm92aWRlcnMvTWljcm9zb2Z0LkRhdGFCb3gvam9icz9hcGktdmVyc2lvbj0yMDE4LTAxLTAx", + "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg4216/providers/Microsoft.DataBox/jobs?api-version=2019-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Jlc291cmNlR3JvdXBzL1Nka1JnNDIxNi9wcm92aWRlcnMvTWljcm9zb2Z0LkRhdGFCb3gvam9icz9hcGktdmVyc2lvbj0yMDE5LTA5LTAx", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "62542393-3051-4952-8e59-625cc76e9abf" + "b62c9e5d-a49a-4241-9576-53b3ce65ecfe" ], - "accept-language": [ + "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.6.26614.01", - "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.0" + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.1" ] }, "ResponseHeaders": { "Cache-Control": [ "no-cache" ], - "Date": [ - "Tue, 11 Sep 2018 12:29:26 GMT" - ], "Pragma": [ "no-cache" ], @@ -799,10 +828,10 @@ "nosniff" ], "x-ms-request-id": [ - "5c276feb-ffe0-4fb7-8377-d3416a36a110" + "f0ff1e43-f687-4ab4-b021-d57e89609262" ], "x-ms-client-request-id": [ - "62542393-3051-4952-8e59-625cc76e9abf" + "b62c9e5d-a49a-4241-9576-53b3ce65ecfe" ], "X-Powered-By": [ "ASP.NET" @@ -811,16 +840,19 @@ "11992" ], "x-ms-correlation-request-id": [ - "23bd8e0d-4fd9-477f-bb6b-659db39b8c68" + "b4f87c72-f971-470a-b8d1-90116c78659e" ], "x-ms-routing-request-id": [ - "SOUTHINDIA:20180911T122926Z:23bd8e0d-4fd9-477f-bb6b-659db39b8c68" + "SOUTHINDIA:20191017T101920Z:b4f87c72-f971-470a-b8d1-90116c78659e" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "Date": [ + "Thu, 17 Oct 2019 10:19:20 GMT" + ], "Content-Length": [ - "578" + "760" ], "Content-Type": [ "application/json; charset=utf-8" @@ -829,24 +861,26 @@ "-1" ] }, - "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"properties\": {\r\n \"isCancellable\": true,\r\n \"isDeletable\": false,\r\n \"isShippingAddressEditable\": true,\r\n \"status\": \"DeviceOrdered\",\r\n \"startTime\": \"2018-09-11T17:58:36.6886059+05:30\"\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"SdkJob7196\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg8120/providers/Microsoft.DataBox/jobs/SdkJob7196\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n }\r\n ]\r\n}", + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"properties\": {\r\n \"isCancellable\": true,\r\n \"isDeletable\": false,\r\n \"isShippingAddressEditable\": true,\r\n \"status\": \"DeviceOrdered\",\r\n \"startTime\": \"2019-10-17T15:48:22.2077826+05:30\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": true\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"SdkJob2600\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg4216/providers/Microsoft.DataBox/jobs/SdkJob2600\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n }\r\n ]\r\n}", "StatusCode": 200 }, { - "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg8120/providers/Microsoft.DataBox/jobs/SdkJob7196/cancel?api-version=2018-01-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Jlc291cmNlR3JvdXBzL1Nka1JnODEyMC9wcm92aWRlcnMvTWljcm9zb2Z0LkRhdGFCb3gvam9icy9TZGtKb2I3MTk2L2NhbmNlbD9hcGktdmVyc2lvbj0yMDE4LTAxLTAx", + "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg4216/providers/Microsoft.DataBox/jobs/SdkJob2600/cancel?api-version=2019-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Jlc291cmNlR3JvdXBzL1Nka1JnNDIxNi9wcm92aWRlcnMvTWljcm9zb2Z0LkRhdGFCb3gvam9icy9TZGtKb2IyNjAwL2NhbmNlbD9hcGktdmVyc2lvbj0yMDE5LTA5LTAx", "RequestMethod": "POST", "RequestBody": "{\r\n \"reason\": \"CancelTest\"\r\n}", "RequestHeaders": { "x-ms-client-request-id": [ - "71d282dc-56a0-402b-a322-3b50c89711b5" + "73aab7b4-aa33-456e-acdf-a953aaf726d2" ], - "accept-language": [ + "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.6.26614.01", - "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.0" + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.1" ], "Content-Type": [ "application/json; charset=utf-8" @@ -859,9 +893,6 @@ "Cache-Control": [ "no-cache" ], - "Date": [ - "Tue, 11 Sep 2018 12:29:28 GMT" - ], "Pragma": [ "no-cache" ], @@ -869,26 +900,29 @@ "nosniff" ], "x-ms-request-id": [ - "d35e6ce0-cb38-4d88-b505-e0e71b85aea5" + "efecd501-ee83-43a1-8a34-9d8aee02b898" ], "x-ms-client-request-id": [ - "71d282dc-56a0-402b-a322-3b50c89711b5" + "73aab7b4-aa33-456e-acdf-a953aaf726d2" ], "X-Powered-By": [ "ASP.NET" ], "x-ms-ratelimit-remaining-subscription-writes": [ - "1195" + "1199" ], "x-ms-correlation-request-id": [ - "2e8182b3-d0bb-425d-8c8b-c11ffe9eda70" + "abde27b8-c03d-4bbf-96d3-3aa79856070d" ], "x-ms-routing-request-id": [ - "SOUTHINDIA:20180911T122929Z:2e8182b3-d0bb-425d-8c8b-c11ffe9eda70" + "SOUTHINDIA:20191017T101921Z:abde27b8-c03d-4bbf-96d3-3aa79856070d" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "Date": [ + "Thu, 17 Oct 2019 10:19:20 GMT" + ], "Expires": [ "-1" ] @@ -897,34 +931,33 @@ "StatusCode": 204 }, { - "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg8120/providers/Microsoft.DataBox/jobs/SdkJob7196?api-version=2018-01-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Jlc291cmNlR3JvdXBzL1Nka1JnODEyMC9wcm92aWRlcnMvTWljcm9zb2Z0LkRhdGFCb3gvam9icy9TZGtKb2I3MTk2P2FwaS12ZXJzaW9uPTIwMTgtMDEtMDE=", + "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg4216/providers/Microsoft.DataBox/jobs/SdkJob2600?api-version=2019-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Jlc291cmNlR3JvdXBzL1Nka1JnNDIxNi9wcm92aWRlcnMvTWljcm9zb2Z0LkRhdGFCb3gvam9icy9TZGtKb2IyNjAwP2FwaS12ZXJzaW9uPTIwMTktMDktMDE=", "RequestMethod": "DELETE", "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "39272b77-a3c6-4cea-8476-9177cb4020d5" + "36a5ec8e-d90c-41dd-b721-a071b39ab2d6" ], - "accept-language": [ + "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.6.26614.01", - "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.0" + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.1" ] }, "ResponseHeaders": { "Cache-Control": [ "no-cache" ], - "Date": [ - "Tue, 11 Sep 2018 12:34:32 GMT" - ], "Pragma": [ "no-cache" ], "Location": [ - "https://management.azure.com/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/providers/Microsoft.DataBox/locations/westus/operationResults/c3fa71fa-4e84-4231-a013-80d12e301075?api-version=2018-01-01" + "https://management.azure.com/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/providers/Microsoft.DataBox/locations/westus/operationResults/03515491-a18b-4ba9-95bb-b78db9477f7d-deleteorder?api-version=2018-01-01" ], "Retry-After": [ "10" @@ -933,10 +966,10 @@ "nosniff" ], "x-ms-request-id": [ - "a2ee3eb4-9873-48cd-abba-23bbc7ae2117" + "cf480928-dc59-413c-905a-f49915121e58" ], "x-ms-client-request-id": [ - "39272b77-a3c6-4cea-8476-9177cb4020d5" + "36a5ec8e-d90c-41dd-b721-a071b39ab2d6" ], "X-Powered-By": [ "ASP.NET" @@ -945,42 +978,44 @@ "14999" ], "x-ms-correlation-request-id": [ - "4004acf3-859e-4878-ad95-8487f44f891c" + "a7205669-fbeb-4aa9-945c-8a1fadf18ce3" ], "x-ms-routing-request-id": [ - "SOUTHINDIA:20180911T123433Z:4004acf3-859e-4878-ad95-8487f44f891c" + "SOUTHINDIA:20191017T102425Z:a7205669-fbeb-4aa9-945c-8a1fadf18ce3" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], - "Content-Length": [ - "0" + "Date": [ + "Thu, 17 Oct 2019 10:24:25 GMT" ], "Expires": [ "-1" + ], + "Content-Length": [ + "0" ] }, "ResponseBody": "", "StatusCode": 202 }, { - "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/providers/Microsoft.DataBox/locations/westus/operationResults/c3fa71fa-4e84-4231-a013-80d12e301075?api-version=2018-01-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveC9sb2NhdGlvbnMvd2VzdHVzL29wZXJhdGlvblJlc3VsdHMvYzNmYTcxZmEtNGU4NC00MjMxLWEwMTMtODBkMTJlMzAxMDc1P2FwaS12ZXJzaW9uPTIwMTgtMDEtMDE=", + "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/providers/Microsoft.DataBox/locations/westus/operationResults/03515491-a18b-4ba9-95bb-b78db9477f7d-deleteorder?api-version=2018-01-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveC9sb2NhdGlvbnMvd2VzdHVzL29wZXJhdGlvblJlc3VsdHMvMDM1MTU0OTEtYTE4Yi00YmE5LTk1YmItYjc4ZGI5NDc3ZjdkLWRlbGV0ZW9yZGVyP2FwaS12ZXJzaW9uPTIwMTgtMDEtMDE=", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "User-Agent": [ - "FxVersion/4.6.26614.01", - "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.0" + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.1" ] }, "ResponseHeaders": { "Cache-Control": [ "no-cache" ], - "Date": [ - "Tue, 11 Sep 2018 12:34:43 GMT" - ], "Pragma": [ "no-cache" ], @@ -988,10 +1023,10 @@ "nosniff" ], "x-ms-request-id": [ - "53ac4706-4f64-4e63-8500-3bf224505933" + "2dbfb750-adbe-42ca-aa86-9ca3304e5443" ], "x-ms-client-request-id": [ - "62b2c4e3-cbb9-4d8c-846f-92d4e36558be" + "f1b8ad06-b481-49df-a9e5-4ac51e5890ad" ], "X-Powered-By": [ "ASP.NET" @@ -1000,14 +1035,17 @@ "11998" ], "x-ms-correlation-request-id": [ - "0a5a974f-1e12-4464-b150-2c738505ff5a" + "72b295bd-5512-44f5-83a1-ec6a83e1f244" ], "x-ms-routing-request-id": [ - "SOUTHINDIA:20180911T123443Z:0a5a974f-1e12-4464-b150-2c738505ff5a" + "SOUTHINDIA:20191017T102435Z:72b295bd-5512-44f5-83a1-ec6a83e1f244" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "Date": [ + "Thu, 17 Oct 2019 10:24:35 GMT" + ], "Expires": [ "-1" ] @@ -1016,23 +1054,22 @@ "StatusCode": 204 }, { - "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/providers/Microsoft.DataBox/locations/westus/operationResults/c3fa71fa-4e84-4231-a013-80d12e301075?api-version=2018-01-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveC9sb2NhdGlvbnMvd2VzdHVzL29wZXJhdGlvblJlc3VsdHMvYzNmYTcxZmEtNGU4NC00MjMxLWEwMTMtODBkMTJlMzAxMDc1P2FwaS12ZXJzaW9uPTIwMTgtMDEtMDE=", + "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/providers/Microsoft.DataBox/locations/westus/operationResults/03515491-a18b-4ba9-95bb-b78db9477f7d-deleteorder?api-version=2018-01-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveC9sb2NhdGlvbnMvd2VzdHVzL29wZXJhdGlvblJlc3VsdHMvMDM1MTU0OTEtYTE4Yi00YmE5LTk1YmItYjc4ZGI5NDc3ZjdkLWRlbGV0ZW9yZGVyP2FwaS12ZXJzaW9uPTIwMTgtMDEtMDE=", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "User-Agent": [ - "FxVersion/4.6.26614.01", - "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.0" + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.1" ] }, "ResponseHeaders": { "Cache-Control": [ "no-cache" ], - "Date": [ - "Tue, 11 Sep 2018 12:34:43 GMT" - ], "Pragma": [ "no-cache" ], @@ -1040,10 +1077,10 @@ "nosniff" ], "x-ms-request-id": [ - "18fcfd29-38b6-450a-9119-a9d56bb11336" + "f4086d9c-c9e9-4052-8c49-a5b4a46c7d2b" ], "x-ms-client-request-id": [ - "b63c9d58-3eb3-42db-b7ef-7c34f936bbc4" + "4d0adad3-b88f-4dc7-a5aa-16bb72849d49" ], "X-Powered-By": [ "ASP.NET" @@ -1052,14 +1089,17 @@ "11997" ], "x-ms-correlation-request-id": [ - "07b7aeca-8380-4b05-a599-05101da859ac" + "ab453518-07ff-40d3-ab68-5cfca3eca7ec" ], "x-ms-routing-request-id": [ - "SOUTHINDIA:20180911T123443Z:07b7aeca-8380-4b05-a599-05101da859ac" + "SOUTHINDIA:20191017T102435Z:ab453518-07ff-40d3-ab68-5cfca3eca7ec" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "Date": [ + "Thu, 17 Oct 2019 10:24:35 GMT" + ], "Expires": [ "-1" ] @@ -1070,8 +1110,8 @@ ], "Names": { "TestJobCRUDOperations": [ - "SdkRg8120", - "SdkJob7196" + "SdkRg4216", + "SdkJob2600" ] }, "Variables": { diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/tests/SessionRecords/JobCRUDTests/TestScheduledJob.json b/sdk/databox/Microsoft.Azure.Management.DataBox/tests/SessionRecords/JobCRUDTests/TestScheduledJob.json new file mode 100644 index 000000000000..e36f9d444f47 --- /dev/null +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/tests/SessionRecords/JobCRUDTests/TestScheduledJob.json @@ -0,0 +1,1562 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/SdkRg1164?api-version=2015-11-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Jlc291cmNlZ3JvdXBzL1Nka1JnMTE2ND9hcGktdmVyc2lvbj0yMDE1LTExLTAx", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"westus\"\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "521b4302-1cda-476f-b949-566aab5406bb" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.Resources.ResourceManagementClient/1.0.0.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "28" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-request-id": [ + "96495943-938f-4c86-8f07-52c73a1e99c5" + ], + "x-ms-correlation-request-id": [ + "96495943-938f-4c86-8f07-52c73a1e99c5" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191014T105639Z:96495943-938f-4c86-8f07-52c73a1e99c5" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Mon, 14 Oct 2019 10:56:39 GMT" + ], + "Content-Length": [ + "171" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg1164\",\r\n \"name\": \"SdkRg1164\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg1164/providers/Microsoft.DataBox/jobs/SdkJob388?api-version=2019-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Jlc291cmNlR3JvdXBzL1Nka1JnMTE2NC9wcm92aWRlcnMvTWljcm9zb2Z0LkRhdGFCb3gvam9icy9TZGtKb2IzODg/YXBpLXZlcnNpb249MjAxOS0wOS0wMQ==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"details\": {\r\n \"jobDetailsType\": \"DataBox\",\r\n \"contactDetails\": {\r\n \"contactName\": \"Public SDK Test\",\r\n \"phone\": \"1234567890\",\r\n \"phoneExtension\": \"1234\",\r\n \"emailList\": [\r\n \"testing@microsoft.com\"\r\n ]\r\n },\r\n \"shippingAddress\": {\r\n \"streetAddress1\": \"16 TOWNSEND ST\",\r\n \"streetAddress2\": \"Unit 1\",\r\n \"city\": \"San Francisco\",\r\n \"stateOrProvince\": \"CA\",\r\n \"country\": \"US\",\r\n \"postalCode\": \"94107\",\r\n \"companyName\": \"Microsoft\",\r\n \"addressType\": \"Commercial\"\r\n },\r\n \"destinationAccountDetails\": [\r\n {\r\n \"dataDestinationType\": \"StorageAccount\",\r\n \"accountId\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount\"\r\n }\r\n ]\r\n },\r\n \"deliveryType\": \"Scheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"2019-11-03T10:56:34.81743Z\"\r\n }\r\n },\r\n \"location\": \"westus\",\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n }\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "5393a9ee-584a-450e-8a0f-89bace033957" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.1" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "1105" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/providers/Microsoft.DataBox/locations/westus/operationResults/4b0dd96b-e054-4ae8-9be8-1ed38257c8de?api-version=2018-01-01" + ], + "Retry-After": [ + "10" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "46d407be-7a63-4d35-96ba-2357500da0cc" + ], + "x-ms-client-request-id": [ + "5393a9ee-584a-450e-8a0f-89bace033957" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-correlation-request-id": [ + "65bce92d-2664-4050-9d48-00238aff5fa8" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191014T105644Z:65bce92d-2664-4050-9d48-00238aff5fa8" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Date": [ + "Mon, 14 Oct 2019 10:56:43 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/providers/Microsoft.DataBox/locations/westus/operationResults/4b0dd96b-e054-4ae8-9be8-1ed38257c8de?api-version=2018-01-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveC9sb2NhdGlvbnMvd2VzdHVzL29wZXJhdGlvblJlc3VsdHMvNGIwZGQ5NmItZTA1NC00YWU4LTliZTgtMWVkMzgyNTdjOGRlP2FwaS12ZXJzaW9uPTIwMTgtMDEtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.1" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg1164/providers/Microsoft.DataBox/jobs/SdkJob388?api-version=2018-01-01" + ], + "Retry-After": [ + "10" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "f922723f-43fb-4346-a036-88053a805509" + ], + "x-ms-client-request-id": [ + "a21b9cfd-fc51-4cff-8da2-0aae2eb799ed" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11996" + ], + "x-ms-correlation-request-id": [ + "c569865e-1714-4274-8c18-6070ea0ea434" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191014T105654Z:c569865e-1714-4274-8c18-6070ea0ea434" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Date": [ + "Mon, 14 Oct 2019 10:56:54 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg1164/providers/Microsoft.DataBox/jobs/SdkJob388?api-version=2018-01-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Jlc291cmNlR3JvdXBzL1Nka1JnMTE2NC9wcm92aWRlcnMvTWljcm9zb2Z0LkRhdGFCb3gvam9icy9TZGtKb2IzODg/YXBpLXZlcnNpb249MjAxOC0wMS0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.1" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "36024418-a8cc-43d6-a7fa-b2e9de08e618" + ], + "x-ms-client-request-id": [ + "4721e064-1e70-452a-929b-7d9f12744e34" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11995" + ], + "x-ms-correlation-request-id": [ + "c1993db7-c43a-410e-9546-c74cc7f1dc9a" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191014T105704Z:c1993db7-c43a-410e-9546-c74cc7f1dc9a" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Date": [ + "Mon, 14 Oct 2019 10:57:04 GMT" + ], + "Content-Length": [ + "648" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"isCancellable\": true,\r\n \"isDeletable\": false,\r\n \"isShippingAddressEditable\": true,\r\n \"status\": \"DeviceOrdered\",\r\n \"startTime\": \"2019-10-14T16:26:43.8410263+05:30\",\r\n \"deliveryType\": \"Scheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"2019-11-03T16:26:34.81743+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": true\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"SdkJob388\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg1164/providers/Microsoft.DataBox/jobs/SdkJob388\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg1164/providers/Microsoft.DataBox/jobs/SdkJob388?api-version=2018-01-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Jlc291cmNlR3JvdXBzL1Nka1JnMTE2NC9wcm92aWRlcnMvTWljcm9zb2Z0LkRhdGFCb3gvam9icy9TZGtKb2IzODg/YXBpLXZlcnNpb249MjAxOC0wMS0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.1" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "7637460c-cf9f-4ff4-968a-c9b6b589053e" + ], + "x-ms-client-request-id": [ + "508525ff-1a0d-42a8-8aea-1bf277c4d082" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11985" + ], + "x-ms-correlation-request-id": [ + "1740facf-a8a7-49b0-a88c-38f1d58b94f6" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191014T105839Z:1740facf-a8a7-49b0-a88c-38f1d58b94f6" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Date": [ + "Mon, 14 Oct 2019 10:58:39 GMT" + ], + "Content-Length": [ + "648" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"isCancellable\": true,\r\n \"isDeletable\": false,\r\n \"isShippingAddressEditable\": true,\r\n \"status\": \"DeviceOrdered\",\r\n \"startTime\": \"2019-10-14T16:26:43.8410263+05:30\",\r\n \"deliveryType\": \"Scheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"2019-11-03T16:26:34.81743+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": true\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"SdkJob388\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg1164/providers/Microsoft.DataBox/jobs/SdkJob388\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg1164/providers/Microsoft.DataBox/jobs/SdkJob388?api-version=2019-09-01&$expand=details", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Jlc291cmNlR3JvdXBzL1Nka1JnMTE2NC9wcm92aWRlcnMvTWljcm9zb2Z0LkRhdGFCb3gvam9icy9TZGtKb2IzODg/YXBpLXZlcnNpb249MjAxOS0wOS0wMSYkZXhwYW5kPWRldGFpbHM=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "5e3dfb30-ab0c-4ac9-b9db-8b6bc631b9e5" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.1" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "42fe0242-fd8d-40c6-a613-9062e23480bc" + ], + "x-ms-client-request-id": [ + "5e3dfb30-ab0c-4ac9-b9db-8b6bc631b9e5" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11994" + ], + "x-ms-correlation-request-id": [ + "901c4115-fc21-4c49-838f-e2d4e9e307c4" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191014T105705Z:901c4115-fc21-4c49-838f-e2d4e9e307c4" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Date": [ + "Mon, 14 Oct 2019 10:57:04 GMT" + ], + "Content-Length": [ + "3818" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"isCancellable\": true,\r\n \"isDeletable\": false,\r\n \"isShippingAddressEditable\": true,\r\n \"status\": \"DeviceOrdered\",\r\n \"startTime\": \"2019-10-14T16:26:43.8410263+05:30\",\r\n \"details\": {\r\n \"copyProgress\": [],\r\n \"jobStages\": [\r\n {\r\n \"stageName\": \"DeviceOrdered\",\r\n \"displayName\": \"Ordered\",\r\n \"stageStatus\": \"None\"\r\n },\r\n {\r\n \"stageName\": \"DevicePrepared\",\r\n \"displayName\": \"Processed\",\r\n \"stageStatus\": \"None\"\r\n },\r\n {\r\n \"stageName\": \"Dispatched\",\r\n \"displayName\": \"Dispatched\",\r\n \"stageStatus\": \"None\"\r\n },\r\n {\r\n \"stageName\": \"Delivered\",\r\n \"displayName\": \"Delivered\",\r\n \"stageStatus\": \"None\"\r\n },\r\n {\r\n \"stageName\": \"PickedUp\",\r\n \"displayName\": \"Picked up\",\r\n \"stageStatus\": \"None\"\r\n },\r\n {\r\n \"stageName\": \"AtAzureDC\",\r\n \"displayName\": \"Received\",\r\n \"stageStatus\": \"None\"\r\n },\r\n {\r\n \"stageName\": \"DataCopy\",\r\n \"displayName\": \"Data copy in progress\",\r\n \"stageStatus\": \"None\"\r\n },\r\n {\r\n \"stageName\": \"Completed\",\r\n \"displayName\": \"Completed\",\r\n \"stageStatus\": \"None\"\r\n }\r\n ],\r\n \"contactDetails\": {\r\n \"contactName\": \"Public SDK Test\",\r\n \"phone\": \"1234567890\",\r\n \"phoneExtension\": \"1234\",\r\n \"emailList\": [\r\n \"testing@microsoft.com\"\r\n ],\r\n \"notificationPreference\": [\r\n {\r\n \"stageName\": \"DevicePrepared\",\r\n \"sendNotification\": true\r\n },\r\n {\r\n \"stageName\": \"Dispatched\",\r\n \"sendNotification\": true\r\n },\r\n {\r\n \"stageName\": \"Delivered\",\r\n \"sendNotification\": true\r\n },\r\n {\r\n \"stageName\": \"PickedUp\",\r\n \"sendNotification\": true\r\n },\r\n {\r\n \"stageName\": \"AtAzureDC\",\r\n \"sendNotification\": true\r\n },\r\n {\r\n \"stageName\": \"DataCopy\",\r\n \"sendNotification\": true\r\n }\r\n ]\r\n },\r\n \"shippingAddress\": {\r\n \"streetAddress1\": \"16 TOWNSEND ST\",\r\n \"streetAddress2\": \"Unit 1\",\r\n \"city\": \"San Francisco\",\r\n \"stateOrProvince\": \"CA\",\r\n \"country\": \"US\",\r\n \"postalCode\": \"94107\",\r\n \"companyName\": \"Microsoft\",\r\n \"addressType\": \"Commercial\"\r\n },\r\n \"deliveryPackage\": {\r\n \"carrierName\": \"\",\r\n \"trackingId\": \"\",\r\n \"trackingUrl\": \"\"\r\n },\r\n \"returnPackage\": {\r\n \"carrierName\": \"\",\r\n \"trackingId\": \"\",\r\n \"trackingUrl\": \"\"\r\n },\r\n \"destinationAccountDetails\": [\r\n {\r\n \"storageAccountId\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount\",\r\n \"dataDestinationType\": \"StorageAccount\",\r\n \"accountId\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount\"\r\n }\r\n ],\r\n \"errorDetails\": [],\r\n \"jobDetailsType\": \"DataBox\",\r\n \"copyLogDetails\": []\r\n },\r\n \"deliveryType\": \"Scheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"2019-11-03T16:26:34.81743+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": true\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"SdkJob388\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg1164/providers/Microsoft.DataBox/jobs/SdkJob388\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg1164/providers/Microsoft.DataBox/jobs/SdkJob388?api-version=2019-09-01&$expand=details", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Jlc291cmNlR3JvdXBzL1Nka1JnMTE2NC9wcm92aWRlcnMvTWljcm9zb2Z0LkRhdGFCb3gvam9icy9TZGtKb2IzODg/YXBpLXZlcnNpb249MjAxOS0wOS0wMSYkZXhwYW5kPWRldGFpbHM=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "3e404832-9fec-477b-8e9a-91e52fa9354e" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.1" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "84b0e4cc-ce19-4659-b6e2-ae0126fa2101" + ], + "x-ms-client-request-id": [ + "3e404832-9fec-477b-8e9a-91e52fa9354e" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11984" + ], + "x-ms-correlation-request-id": [ + "61553153-b542-4796-9147-6ccdc8cc83e6" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191014T105840Z:61553153-b542-4796-9147-6ccdc8cc83e6" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Date": [ + "Mon, 14 Oct 2019 10:58:40 GMT" + ], + "Content-Length": [ + "3879" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"isCancellable\": true,\r\n \"isDeletable\": false,\r\n \"isShippingAddressEditable\": true,\r\n \"status\": \"DeviceOrdered\",\r\n \"startTime\": \"2019-10-14T16:26:43.8410263+05:30\",\r\n \"details\": {\r\n \"copyProgress\": [],\r\n \"jobStages\": [\r\n {\r\n \"stageName\": \"DeviceOrdered\",\r\n \"displayName\": \"Ordered\",\r\n \"stageStatus\": \"Succeeded\",\r\n \"stageTime\": \"2019-10-14T16:27:23.2392894+05:30\"\r\n },\r\n {\r\n \"stageName\": \"DevicePrepared\",\r\n \"displayName\": \"Processed\",\r\n \"stageStatus\": \"None\"\r\n },\r\n {\r\n \"stageName\": \"Dispatched\",\r\n \"displayName\": \"Dispatched\",\r\n \"stageStatus\": \"None\"\r\n },\r\n {\r\n \"stageName\": \"Delivered\",\r\n \"displayName\": \"Delivered\",\r\n \"stageStatus\": \"None\"\r\n },\r\n {\r\n \"stageName\": \"PickedUp\",\r\n \"displayName\": \"Picked up\",\r\n \"stageStatus\": \"None\"\r\n },\r\n {\r\n \"stageName\": \"AtAzureDC\",\r\n \"displayName\": \"Received\",\r\n \"stageStatus\": \"None\"\r\n },\r\n {\r\n \"stageName\": \"DataCopy\",\r\n \"displayName\": \"Data copy in progress\",\r\n \"stageStatus\": \"None\"\r\n },\r\n {\r\n \"stageName\": \"Completed\",\r\n \"displayName\": \"Completed\",\r\n \"stageStatus\": \"None\"\r\n }\r\n ],\r\n \"contactDetails\": {\r\n \"contactName\": \"Update Job\",\r\n \"phone\": \"1234567890\",\r\n \"phoneExtension\": \"1234\",\r\n \"emailList\": [\r\n \"testing@microsoft.com\"\r\n ],\r\n \"notificationPreference\": [\r\n {\r\n \"stageName\": \"DevicePrepared\",\r\n \"sendNotification\": true\r\n },\r\n {\r\n \"stageName\": \"Dispatched\",\r\n \"sendNotification\": true\r\n },\r\n {\r\n \"stageName\": \"Delivered\",\r\n \"sendNotification\": true\r\n },\r\n {\r\n \"stageName\": \"PickedUp\",\r\n \"sendNotification\": true\r\n },\r\n {\r\n \"stageName\": \"AtAzureDC\",\r\n \"sendNotification\": true\r\n },\r\n {\r\n \"stageName\": \"DataCopy\",\r\n \"sendNotification\": true\r\n }\r\n ]\r\n },\r\n \"shippingAddress\": {\r\n \"streetAddress1\": \"16 TOWNSEND ST\",\r\n \"streetAddress2\": \"Unit 1\",\r\n \"city\": \"San Francisco\",\r\n \"stateOrProvince\": \"CA\",\r\n \"country\": \"US\",\r\n \"postalCode\": \"94107\",\r\n \"companyName\": \"Microsoft\",\r\n \"addressType\": \"Commercial\"\r\n },\r\n \"deliveryPackage\": {\r\n \"carrierName\": \"\",\r\n \"trackingId\": \"\",\r\n \"trackingUrl\": \"\"\r\n },\r\n \"returnPackage\": {\r\n \"carrierName\": \"\",\r\n \"trackingId\": \"\",\r\n \"trackingUrl\": \"\"\r\n },\r\n \"destinationAccountDetails\": [\r\n {\r\n \"storageAccountId\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount\",\r\n \"dataDestinationType\": \"StorageAccount\",\r\n \"accountId\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount\"\r\n }\r\n ],\r\n \"errorDetails\": [],\r\n \"jobDetailsType\": \"DataBox\",\r\n \"copyLogDetails\": []\r\n },\r\n \"deliveryType\": \"Scheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"2019-11-03T16:26:34.81743+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": true\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"SdkJob388\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg1164/providers/Microsoft.DataBox/jobs/SdkJob388\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg1164/providers/Microsoft.DataBox/jobs/SdkJob388?api-version=2019-09-01&$expand=details", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Jlc291cmNlR3JvdXBzL1Nka1JnMTE2NC9wcm92aWRlcnMvTWljcm9zb2Z0LkRhdGFCb3gvam9icy9TZGtKb2IzODg/YXBpLXZlcnNpb249MjAxOS0wOS0wMSYkZXhwYW5kPWRldGFpbHM=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "cf88cfb7-2de2-4944-823e-3a1409eb4a4a" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.1" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "acfbf3b2-b1a0-4bdf-b99c-04f2b8da677e" + ], + "x-ms-client-request-id": [ + "cf88cfb7-2de2-4944-823e-3a1409eb4a4a" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11981" + ], + "x-ms-correlation-request-id": [ + "25a8fa3c-2ce6-498d-94cd-5d7f04fd8b7b" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191014T105845Z:25a8fa3c-2ce6-498d-94cd-5d7f04fd8b7b" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Date": [ + "Mon, 14 Oct 2019 10:58:44 GMT" + ], + "Content-Length": [ + "3555" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2019-10-14T16:26:43.8410263+05:30\",\r\n \"details\": {\r\n \"copyProgress\": [\r\n {\r\n \"storageAccountName\": \"databoxbvttestaccount\",\r\n \"dataDestinationType\": \"StorageAccount\",\r\n \"accountId\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount\",\r\n \"bytesSentToCloud\": 0,\r\n \"totalBytesToProcess\": 0\r\n }\r\n ],\r\n \"jobStages\": [\r\n {\r\n \"stageName\": \"DeviceOrdered\",\r\n \"displayName\": \"Ordered\",\r\n \"stageStatus\": \"Succeeded\",\r\n \"stageTime\": \"2019-10-14T16:27:23.2392894+05:30\"\r\n },\r\n {\r\n \"stageName\": \"Cancelled\",\r\n \"displayName\": \"Canceled\",\r\n \"stageStatus\": \"Succeeded\",\r\n \"stageTime\": \"2019-10-14T16:28:44.3098304+05:30\"\r\n }\r\n ],\r\n \"contactDetails\": {\r\n \"contactName\": \"Update Job\",\r\n \"phone\": \"1234567890\",\r\n \"phoneExtension\": \"1234\",\r\n \"emailList\": [\r\n \"testing@microsoft.com\"\r\n ],\r\n \"notificationPreference\": [\r\n {\r\n \"stageName\": \"DevicePrepared\",\r\n \"sendNotification\": true\r\n },\r\n {\r\n \"stageName\": \"Dispatched\",\r\n \"sendNotification\": true\r\n },\r\n {\r\n \"stageName\": \"Delivered\",\r\n \"sendNotification\": true\r\n },\r\n {\r\n \"stageName\": \"PickedUp\",\r\n \"sendNotification\": true\r\n },\r\n {\r\n \"stageName\": \"AtAzureDC\",\r\n \"sendNotification\": true\r\n },\r\n {\r\n \"stageName\": \"DataCopy\",\r\n \"sendNotification\": true\r\n }\r\n ]\r\n },\r\n \"shippingAddress\": {\r\n \"streetAddress1\": \"16 TOWNSEND ST\",\r\n \"streetAddress2\": \"Unit 1\",\r\n \"city\": \"San Francisco\",\r\n \"stateOrProvince\": \"CA\",\r\n \"country\": \"US\",\r\n \"postalCode\": \"94107\",\r\n \"companyName\": \"Microsoft\",\r\n \"addressType\": \"Commercial\"\r\n },\r\n \"deliveryPackage\": {\r\n \"carrierName\": \"\",\r\n \"trackingId\": \"\",\r\n \"trackingUrl\": \"\"\r\n },\r\n \"returnPackage\": {\r\n \"carrierName\": \"\",\r\n \"trackingId\": \"\",\r\n \"trackingUrl\": \"\"\r\n },\r\n \"destinationAccountDetails\": [\r\n {\r\n \"storageAccountId\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount\",\r\n \"dataDestinationType\": \"StorageAccount\",\r\n \"accountId\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount\"\r\n }\r\n ],\r\n \"errorDetails\": [],\r\n \"jobDetailsType\": \"DataBox\",\r\n \"copyLogDetails\": []\r\n },\r\n \"cancellationReason\": \"CancelTest\",\r\n \"deliveryType\": \"Scheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"2019-11-03T16:26:34.81743+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": true\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"SdkJob388\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg1164/providers/Microsoft.DataBox/jobs/SdkJob388\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg1164/providers/Microsoft.DataBox/jobs/SdkJob388?api-version=2019-09-01&$expand=details", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Jlc291cmNlR3JvdXBzL1Nka1JnMTE2NC9wcm92aWRlcnMvTWljcm9zb2Z0LkRhdGFCb3gvam9icy9TZGtKb2IzODg/YXBpLXZlcnNpb249MjAxOS0wOS0wMSYkZXhwYW5kPWRldGFpbHM=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "89af72bf-a395-476a-a4ce-ae5e90d5b0d9" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.1" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "5ca1e410-0757-4c3d-a906-f692a8cf7143" + ], + "x-ms-client-request-id": [ + "89af72bf-a395-476a-a4ce-ae5e90d5b0d9" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11999" + ], + "x-ms-correlation-request-id": [ + "1c77ae27-4493-4fab-ab50-7a4414688a98" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191014T110347Z:1c77ae27-4493-4fab-ab50-7a4414688a98" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Date": [ + "Mon, 14 Oct 2019 11:03:46 GMT" + ], + "Content-Length": [ + "3060" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2019-10-14T16:26:43.8410263+05:30\",\r\n \"details\": {\r\n \"copyProgress\": [\r\n {\r\n \"storageAccountName\": \"databoxbvttestaccount\",\r\n \"dataDestinationType\": \"StorageAccount\",\r\n \"accountId\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount\",\r\n \"bytesSentToCloud\": 0,\r\n \"totalBytesToProcess\": 0\r\n }\r\n ],\r\n \"jobStages\": [\r\n {\r\n \"stageName\": \"DeviceOrdered\",\r\n \"displayName\": \"Ordered\",\r\n \"stageStatus\": \"Succeeded\",\r\n \"stageTime\": \"2019-10-14T16:27:23.2392894+05:30\"\r\n },\r\n {\r\n \"stageName\": \"Cancelled\",\r\n \"displayName\": \"Canceled\",\r\n \"stageStatus\": \"Succeeded\",\r\n \"stageTime\": \"2019-10-14T16:28:44.3098304+05:30\"\r\n }\r\n ],\r\n \"contactDetails\": {\r\n \"contactName\": \" \",\r\n \"emailList\": [],\r\n \"notificationPreference\": []\r\n },\r\n \"shippingAddress\": {\r\n \"streetAddress1\": \"16 TOWNSEND ST\",\r\n \"streetAddress2\": \"Unit 1\",\r\n \"city\": \"San Francisco\",\r\n \"stateOrProvince\": \"CA\",\r\n \"country\": \"US\",\r\n \"postalCode\": \"94107\",\r\n \"companyName\": \"Microsoft\",\r\n \"addressType\": \"Commercial\"\r\n },\r\n \"deliveryPackage\": {\r\n \"carrierName\": \"\",\r\n \"trackingId\": \"\",\r\n \"trackingUrl\": \"\"\r\n },\r\n \"returnPackage\": {\r\n \"carrierName\": \"\",\r\n \"trackingId\": \"\",\r\n \"trackingUrl\": \"\"\r\n },\r\n \"destinationAccountDetails\": [\r\n {\r\n \"storageAccountId\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount\",\r\n \"dataDestinationType\": \"StorageAccount\",\r\n \"accountId\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount\"\r\n }\r\n ],\r\n \"errorDetails\": [],\r\n \"jobDetailsType\": \"DataBox\",\r\n \"copyLogDetails\": [],\r\n \"chainOfCustodySasKey\": \"https://wusbeta.blob.core.windows.net/chainofcustody/4b0dd96b-e054-4ae8-9be8-1ed38257c8de.txt?sv=2017-04-17&sr=b&sig=WtBYkBAKMCRMjaBTVls4UUA5%2B5gqcEz%2FPo6XpJj3pz0%3D&st=2019-10-14T10%3A53%3A46Z&se=2019-10-14T11%3A23%3A46Z&sp=r\"\r\n },\r\n \"cancellationReason\": \"CancelTest\",\r\n \"deliveryType\": \"Scheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"2019-11-03T16:26:34.81743+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": true\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"SdkJob388\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg1164/providers/Microsoft.DataBox/jobs/SdkJob388\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg1164/providers/Microsoft.DataBox/jobs/SdkJob388?api-version=2019-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Jlc291cmNlR3JvdXBzL1Nka1JnMTE2NC9wcm92aWRlcnMvTWljcm9zb2Z0LkRhdGFCb3gvam9icy9TZGtKb2IzODg/YXBpLXZlcnNpb249MjAxOS0wOS0wMQ==", + "RequestMethod": "PATCH", + "RequestBody": "{\r\n \"properties\": {\r\n \"details\": {\r\n \"contactDetails\": {\r\n \"contactName\": \"Update Job\",\r\n \"phone\": \"1234567890\",\r\n \"phoneExtension\": \"1234\",\r\n \"emailList\": [\r\n \"testing@microsoft.com\"\r\n ]\r\n },\r\n \"shippingAddress\": {\r\n \"streetAddress1\": \"16 TOWNSEND ST\",\r\n \"streetAddress2\": \"Unit 1\",\r\n \"city\": \"San Francisco\",\r\n \"stateOrProvince\": \"CA\",\r\n \"country\": \"US\",\r\n \"postalCode\": \"94107\",\r\n \"companyName\": \"Microsoft\",\r\n \"addressType\": \"Commercial\"\r\n }\r\n }\r\n }\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "1d2d6c8d-bd4e-48ed-be61-6ee0b46cc2e7" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.1" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "584" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/providers/Microsoft.DataBox/locations/westus/operationResults/f4876f6a-a304-494f-8e7c-ea942a7b488e?api-version=2018-01-01" + ], + "Retry-After": [ + "10" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "22c8aabe-249a-4117-98fb-8f280b62c42b" + ], + "x-ms-client-request-id": [ + "1d2d6c8d-bd4e-48ed-be61-6ee0b46cc2e7" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1198" + ], + "x-ms-correlation-request-id": [ + "e0b8fd8f-6dcc-4476-8f75-b5338575e8da" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191014T105705Z:e0b8fd8f-6dcc-4476-8f75-b5338575e8da" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Date": [ + "Mon, 14 Oct 2019 10:57:05 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/providers/Microsoft.DataBox/locations/westus/operationResults/f4876f6a-a304-494f-8e7c-ea942a7b488e?api-version=2018-01-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveC9sb2NhdGlvbnMvd2VzdHVzL29wZXJhdGlvblJlc3VsdHMvZjQ4NzZmNmEtYTMwNC00OTRmLThlN2MtZWE5NDJhN2I0ODhlP2FwaS12ZXJzaW9uPTIwMTgtMDEtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.1" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/providers/Microsoft.DataBox/locations/westus/operationResults/f4876f6a-a304-494f-8e7c-ea942a7b488e?api-version=2018-01-01" + ], + "Retry-After": [ + "10" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "75dee2f9-35f3-4719-862c-cba5076ad32a" + ], + "x-ms-client-request-id": [ + "01807699-9651-4100-8596-9c9497cd537e" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11993" + ], + "x-ms-correlation-request-id": [ + "68e85010-84ce-454d-99ba-64c90adaa167" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191014T105716Z:68e85010-84ce-454d-99ba-64c90adaa167" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Date": [ + "Mon, 14 Oct 2019 10:57:15 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/providers/Microsoft.DataBox/locations/westus/operationResults/f4876f6a-a304-494f-8e7c-ea942a7b488e?api-version=2018-01-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveC9sb2NhdGlvbnMvd2VzdHVzL29wZXJhdGlvblJlc3VsdHMvZjQ4NzZmNmEtYTMwNC00OTRmLThlN2MtZWE5NDJhN2I0ODhlP2FwaS12ZXJzaW9uPTIwMTgtMDEtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.1" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/providers/Microsoft.DataBox/locations/westus/operationResults/f4876f6a-a304-494f-8e7c-ea942a7b488e?api-version=2018-01-01" + ], + "Retry-After": [ + "10" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "97e60540-c355-44a6-80f7-3c965065acf2" + ], + "x-ms-client-request-id": [ + "2b6784b8-7452-463e-a692-71cdd52882da" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11992" + ], + "x-ms-correlation-request-id": [ + "5f956976-5953-4607-bac0-ec73930702a6" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191014T105726Z:5f956976-5953-4607-bac0-ec73930702a6" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Date": [ + "Mon, 14 Oct 2019 10:57:25 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/providers/Microsoft.DataBox/locations/westus/operationResults/f4876f6a-a304-494f-8e7c-ea942a7b488e?api-version=2018-01-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveC9sb2NhdGlvbnMvd2VzdHVzL29wZXJhdGlvblJlc3VsdHMvZjQ4NzZmNmEtYTMwNC00OTRmLThlN2MtZWE5NDJhN2I0ODhlP2FwaS12ZXJzaW9uPTIwMTgtMDEtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.1" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/providers/Microsoft.DataBox/locations/westus/operationResults/f4876f6a-a304-494f-8e7c-ea942a7b488e?api-version=2018-01-01" + ], + "Retry-After": [ + "10" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "6cc6db6a-ebeb-4cc0-875f-f8321fb92644" + ], + "x-ms-client-request-id": [ + "4a3f8d6a-92de-4d1c-8d6e-154b6edb3017" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11991" + ], + "x-ms-correlation-request-id": [ + "0eb324b0-6ad2-482f-958e-ecbd5ac4e8fe" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191014T105736Z:0eb324b0-6ad2-482f-958e-ecbd5ac4e8fe" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Date": [ + "Mon, 14 Oct 2019 10:57:36 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/providers/Microsoft.DataBox/locations/westus/operationResults/f4876f6a-a304-494f-8e7c-ea942a7b488e?api-version=2018-01-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveC9sb2NhdGlvbnMvd2VzdHVzL29wZXJhdGlvblJlc3VsdHMvZjQ4NzZmNmEtYTMwNC00OTRmLThlN2MtZWE5NDJhN2I0ODhlP2FwaS12ZXJzaW9uPTIwMTgtMDEtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.1" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/providers/Microsoft.DataBox/locations/westus/operationResults/f4876f6a-a304-494f-8e7c-ea942a7b488e?api-version=2018-01-01" + ], + "Retry-After": [ + "10" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "e17d7ad7-d655-4787-8c79-59acc8168bc3" + ], + "x-ms-client-request-id": [ + "2111e0d5-45e2-4a71-af0c-23d3d3fa6d3c" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11990" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-correlation-request-id": [ + "08ffa716-e004-4105-af8a-471f8b8fd6dc" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191014T105747Z:08ffa716-e004-4105-af8a-471f8b8fd6dc" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Date": [ + "Mon, 14 Oct 2019 10:57:46 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/providers/Microsoft.DataBox/locations/westus/operationResults/f4876f6a-a304-494f-8e7c-ea942a7b488e?api-version=2018-01-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveC9sb2NhdGlvbnMvd2VzdHVzL29wZXJhdGlvblJlc3VsdHMvZjQ4NzZmNmEtYTMwNC00OTRmLThlN2MtZWE5NDJhN2I0ODhlP2FwaS12ZXJzaW9uPTIwMTgtMDEtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.1" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/providers/Microsoft.DataBox/locations/westus/operationResults/f4876f6a-a304-494f-8e7c-ea942a7b488e?api-version=2018-01-01" + ], + "Retry-After": [ + "10" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "208bc815-43bc-46f1-b4f3-07d34be25602" + ], + "x-ms-client-request-id": [ + "c73ddb52-a35d-427b-bade-bce600cf1b4c" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11989" + ], + "x-ms-correlation-request-id": [ + "9782854d-6e84-46bb-8ac2-1cd2cd56cf8a" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191014T105758Z:9782854d-6e84-46bb-8ac2-1cd2cd56cf8a" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Date": [ + "Mon, 14 Oct 2019 10:57:58 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/providers/Microsoft.DataBox/locations/westus/operationResults/f4876f6a-a304-494f-8e7c-ea942a7b488e?api-version=2018-01-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveC9sb2NhdGlvbnMvd2VzdHVzL29wZXJhdGlvblJlc3VsdHMvZjQ4NzZmNmEtYTMwNC00OTRmLThlN2MtZWE5NDJhN2I0ODhlP2FwaS12ZXJzaW9uPTIwMTgtMDEtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.1" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/providers/Microsoft.DataBox/locations/westus/operationResults/f4876f6a-a304-494f-8e7c-ea942a7b488e?api-version=2018-01-01" + ], + "Retry-After": [ + "10" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "2f2d7179-a996-474b-940e-42134f83348a" + ], + "x-ms-client-request-id": [ + "f0460499-64ca-4cbd-888a-f3b0fbdcd681" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11988" + ], + "x-ms-correlation-request-id": [ + "cd5db8c6-8a38-4a60-a5af-64a2e54d711d" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191014T105808Z:cd5db8c6-8a38-4a60-a5af-64a2e54d711d" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Date": [ + "Mon, 14 Oct 2019 10:58:08 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/providers/Microsoft.DataBox/locations/westus/operationResults/f4876f6a-a304-494f-8e7c-ea942a7b488e?api-version=2018-01-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveC9sb2NhdGlvbnMvd2VzdHVzL29wZXJhdGlvblJlc3VsdHMvZjQ4NzZmNmEtYTMwNC00OTRmLThlN2MtZWE5NDJhN2I0ODhlP2FwaS12ZXJzaW9uPTIwMTgtMDEtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.1" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/providers/Microsoft.DataBox/locations/westus/operationResults/f4876f6a-a304-494f-8e7c-ea942a7b488e?api-version=2018-01-01" + ], + "Retry-After": [ + "10" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "0b6fd7d6-b047-447d-9fc4-74898c3a9963" + ], + "x-ms-client-request-id": [ + "2b0f5ae6-6348-447f-9f85-292472829974" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11987" + ], + "x-ms-correlation-request-id": [ + "8ae97091-2fae-45c8-b7d2-8646d0dc2b42" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191014T105819Z:8ae97091-2fae-45c8-b7d2-8646d0dc2b42" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Date": [ + "Mon, 14 Oct 2019 10:58:19 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/providers/Microsoft.DataBox/locations/westus/operationResults/f4876f6a-a304-494f-8e7c-ea942a7b488e?api-version=2018-01-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveC9sb2NhdGlvbnMvd2VzdHVzL29wZXJhdGlvblJlc3VsdHMvZjQ4NzZmNmEtYTMwNC00OTRmLThlN2MtZWE5NDJhN2I0ODhlP2FwaS12ZXJzaW9uPTIwMTgtMDEtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.1" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg1164/providers/Microsoft.DataBox/jobs/SdkJob388?api-version=2018-01-01" + ], + "Retry-After": [ + "10" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "651dfbbb-e970-40af-bc34-7dfb55bed7b1" + ], + "x-ms-client-request-id": [ + "9b67bc22-9e9c-46b4-b2aa-42d4521015a8" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11986" + ], + "x-ms-correlation-request-id": [ + "088c7a5f-b867-474f-8ce9-705d2889f464" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191014T105829Z:088c7a5f-b867-474f-8ce9-705d2889f464" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Date": [ + "Mon, 14 Oct 2019 10:58:28 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/providers/Microsoft.DataBox/jobs?api-version=2019-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveC9qb2JzP2FwaS12ZXJzaW9uPTIwMTktMDktMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "e16b413b-db8a-4494-8c8b-89db61298fb7" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.1" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-original-request-ids": [ + "16958aba-699a-4760-a758-f193008f4802", + "cccad948-2919-433d-91cf-959cb30cd4e9", + "8645e2f7-9eb5-4efb-ba42-33042e908f28", + "b416d7be-c1a5-4323-9770-0507bb95dbf6", + "2e206141-d951-49a5-888a-98d2b47c5771", + "b34932f8-d7e7-4eb4-8032-9217bc3ea6e7", + "fe68faad-0565-4948-8ca5-d71513efd0b3", + "e7bb1491-4d22-44fc-b968-ecaede0be22f", + "72d366d1-fee0-42f0-9704-79d46edc17d7", + "2979789a-4ba3-4c8a-a64e-cfc2b4d6b921" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11983" + ], + "x-ms-request-id": [ + "815828a7-b8b2-4898-9338-07b6c50b7f83" + ], + "x-ms-correlation-request-id": [ + "815828a7-b8b2-4898-9338-07b6c50b7f83" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191014T105843Z:815828a7-b8b2-4898-9338-07b6c50b7f83" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Mon, 14 Oct 2019 10:58:43 GMT" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "18307" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2018-08-30T14:44:39.77401+05:30\",\r\n \"cancellationReason\": \"Old job which is still in ordered state cancelled by the service\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"australiaeast\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBoxDisk\"\r\n },\r\n \"name\": \"mnaustest\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/ausresgrpmn/providers/Microsoft.DataBox/jobs/mnaustest\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2018-09-10T18:03:22.2578238+05:30\",\r\n \"cancellationReason\": \"Old job which is still in ordered state cancelled by the service\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"australiaeast\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBoxDisk\"\r\n },\r\n \"name\": \"portalcontractAUS\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/ausresgrpmn/providers/Microsoft.DataBox/jobs/portalcontractAUS\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2018-08-30T15:17:17.3753642+05:30\",\r\n \"cancellationReason\": \"Old job which is still in ordered state cancelled by the service\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"australiaeast\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBoxDisk\"\r\n },\r\n \"name\": \"testBB-diskAU\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/testBB/providers/Microsoft.DataBox/jobs/testBB-diskAU\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2018-11-27T15:17:49.0760408+05:30\",\r\n \"cancellationReason\": \"Old job which is still in ordered state cancelled by the service\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"testbadresourcegroup\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat3198inh0-9)inh(il(h)_fyoin)(upf(yLASD0-FJ(hal-DSNWP0JDS0P3-0SJ93/providers/Microsoft.DataBox/jobs/testbadresourcegroup\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2019-01-04T09:08:49.9928621+05:30\",\r\n \"cancellationReason\": \"Old job which is still in ordered state cancelled by the service\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"andipodtest4jan\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat/providers/Microsoft.DataBox/jobs/andipodtest4jan\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2019-07-04T14:01:50.9232807+05:30\",\r\n \"cancellationReason\": \"IncorrectOrder null\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"testdeepak04-07\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat/providers/Microsoft.DataBox/jobs/testdeepak04-07\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2019-02-11T12:33:16.6231232+05:30\",\r\n \"cancellationReason\": \"Old job which is still in ordered state cancelled by the service\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBoxHeavy\"\r\n },\r\n \"name\": \"testdurga-heavy\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat/providers/Microsoft.DataBox/jobs/testdurga-heavy\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2019-02-11T12:38:49.0620094+05:30\",\r\n \"cancellationReason\": \"Old job which is still in ordered state cancelled by the service\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBoxHeavy\"\r\n },\r\n \"name\": \"testdurga-heavy1\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat/providers/Microsoft.DataBox/jobs/testdurga-heavy1\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2019-01-09T16:12:43.2931373+05:30\",\r\n \"cancellationReason\": \"Old job which is still in ordered state cancelled by the service\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBoxHeavy\"\r\n },\r\n \"name\": \"testdurga2\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat/providers/Microsoft.DataBox/jobs/testdurga2\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2019-01-09T15:59:47.4375821+05:30\",\r\n \"cancellationReason\": \"Old job which is still in ordered state cancelled by the service\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"testdurgad\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat/providers/Microsoft.DataBox/jobs/testdurgad\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2019-01-09T19:04:31.4461343+05:30\",\r\n \"cancellationReason\": \"Old job which is still in ordered state cancelled by the service\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBoxDisk\"\r\n },\r\n \"name\": \"testdurgadisk\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat/providers/Microsoft.DataBox/jobs/testdurgadisk\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2019-01-09T19:10:08.2854968+05:30\",\r\n \"cancellationReason\": \"Old job which is still in ordered state cancelled by the service\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBoxDisk\"\r\n },\r\n \"name\": \"testdurgadisk-Clone\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat/providers/Microsoft.DataBox/jobs/testdurgadisk-Clone\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2018-12-19T14:23:06.8155601+05:30\",\r\n \"cancellationReason\": \"Old job which is still in ordered state cancelled by the service\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"testdurgam\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat/providers/Microsoft.DataBox/jobs/testdurgam\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2018-12-19T16:46:12.824436+05:30\",\r\n \"cancellationReason\": \"Old job which is still in ordered state cancelled by the service\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"testdurgam-1\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat/providers/Microsoft.DataBox/jobs/testdurgam-1\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2019-03-04T12:00:17.7643558+05:30\",\r\n \"cancellationReason\": \"Old job which is still in ordered state cancelled by the service\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"testdurgam-Clone\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat/providers/Microsoft.DataBox/jobs/testdurgam-Clone\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2018-12-19T18:24:23.0774328+05:30\",\r\n \"cancellationReason\": \"Old job which is still in ordered state cancelled by the service\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"testdurgasm-1\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat/providers/Microsoft.DataBox/jobs/testdurgasm-1\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2019-03-04T11:58:13.4876698+05:30\",\r\n \"cancellationReason\": \"Old job which is still in ordered state cancelled by the service\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"testdurgasm-1-1\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat/providers/Microsoft.DataBox/jobs/testdurgasm-1-1\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2019-01-11T14:28:55.4375406+05:30\",\r\n \"cancellationReason\": \"Old job which is still in ordered state cancelled by the service\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"testdurgasm-1-Clone\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat/providers/Microsoft.DataBox/jobs/testdurgasm-1-Clone\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2019-02-15T12:51:12.2717434+05:30\",\r\n \"cancellationReason\": \"Old job which is still in ordered state cancelled by the service\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"testdurgasm-11\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat/providers/Microsoft.DataBox/jobs/testdurgasm-11\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2019-02-15T12:54:58.9886188+05:30\",\r\n \"cancellationReason\": \"Old job which is still in ordered state cancelled by the service\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"testdurgasm-12\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat/providers/Microsoft.DataBox/jobs/testdurgasm-12\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2019-02-15T13:33:29.8417562+05:30\",\r\n \"cancellationReason\": \"Old job which is still in ordered state cancelled by the service\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"testdurgasm-1dssd\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat/providers/Microsoft.DataBox/jobs/testdurgasm-1dssd\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2019-02-15T15:35:39.937519+05:30\",\r\n \"cancellationReason\": \"Old job which is still in ordered state cancelled by the service\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"testdurgasm-ccxcx\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat/providers/Microsoft.DataBox/jobs/testdurgasm-ccxcx\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2019-01-09T15:56:58.4277564+05:30\",\r\n \"cancellationReason\": \"Old job which is still in ordered state cancelled by the service\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"testdurgasm-Clone\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat/providers/Microsoft.DataBox/jobs/testdurgasm-Clone\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2019-02-10T14:46:10.401621+05:30\",\r\n \"cancellationReason\": \"Old job which is still in ordered state cancelled by the service\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"testdurgasm-Clone-Clone\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat/providers/Microsoft.DataBox/jobs/testdurgasm-Clone-Clone\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2019-02-10T14:52:37.2363289+05:30\",\r\n \"cancellationReason\": \"Old job which is still in ordered state cancelled by the service\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"testdurgasm-compute\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat/providers/Microsoft.DataBox/jobs/testdurgasm-compute\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": false,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"ReadyToDispatchFromAzureDC\",\r\n \"startTime\": \"2019-02-10T14:57:32.3159255+05:30\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"testdurgasm-compute1\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat/providers/Microsoft.DataBox/jobs/testdurgasm-compute1\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": false,\r\n \"isDeletable\": true,\r\n \"isShippingAddressEditable\": false,\r\n \"status\": \"Cancelled\",\r\n \"startTime\": \"2018-09-08T22:46:11.5143859+05:30\",\r\n \"cancellationReason\": \"Old job which is still in ordered state cancelled by the service\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": false\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"TestPortalContract\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat/providers/Microsoft.DataBox/jobs/TestPortalContract\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n },\r\n {\r\n \"properties\": {\r\n \"isCancellable\": true,\r\n \"isDeletable\": false,\r\n \"isShippingAddressEditable\": true,\r\n \"status\": \"DeviceOrdered\",\r\n \"startTime\": \"2019-07-30T10:47:22.083517+05:30\",\r\n \"deliveryType\": \"NonScheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"0001-01-01T05:30:00+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": true\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"testschedule01\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/akvenkat/providers/Microsoft.DataBox/jobs/testschedule01\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n }\r\n ],\r\n \"nextLink\": \"https://management.azure.com/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/providers/Microsoft.DataBox/jobs?api-version=2019-09-01&%24skiptoken=dZJdb5swFIb%2fS7TuLg04kEKkasoH0GRAE%2fNh4M4GQgwYUCCEpOp%2fn7uq3bSpki8sv8fv%2b%2bic8zKq0qEzaVW0o%2fnLCGmO6zmj%2bejYdU07n0wYrnCWsrTq7vHtfErv45pN2jNp4xNtOlpX7eSAZ4qggMNYORwexhIG8liV44dxnKoJliURSOAwaU51T5P01E4sGp%2fqtj5092vc4WU9TPKatD9wQ8c917nlIxBEdSzwI37%2f1ha0cesirR53a1Ui6JIlzL%2fGoOxJLlDLkS4buiwJs%2fvIKM%2fRTaBJAJnpamCTK3eArPe1sgfqOeFqgnQBI%2fXsG%2bopQtK7mm3Ww5oAmSuyGAaw4XePgK4kuWSv6CLbrBaK%2f5kpXc18oZhiVMaVzWs%2fXVaLbKdDOTY87usbOiWGx%2bs%2bXjjHm1O20%2bQyfYL7MNgK%2bD3NjIKC%2f7EcjQfqmHje1RXg0tbEDgVwB8Wmc6viYuml57i65RvtgIImT%2fTi6rs%2bhoI3uAXUU0%2fWHCaGabFlYZm0mNndc9BQq6wvriE62IBPkJXUAkfmeqEco83VqWrFFL4i%2bofZIdPkD%2bvUonpO%2fGgW5jZKfc5SwQhp22noxyIpj7M9i3KC4O8sbGg3xAZKAlhHWiglYnbz2JBb4naG3G1N9GbjVzb2NV1y9eQ5BpurjS4fbH8lfzLp8BizpEy0oQ%2fB%2b1x35fKKkXiMq%2bKt8%2f%2frmfDzbZqmYPek4pOu%2fCPfi56UsMfAP%2b%2b4vlupX23D3TQZvb7%2bAg%3d%3d\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg1164/providers/Microsoft.DataBox/jobs?api-version=2019-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Jlc291cmNlR3JvdXBzL1Nka1JnMTE2NC9wcm92aWRlcnMvTWljcm9zb2Z0LkRhdGFCb3gvam9icz9hcGktdmVyc2lvbj0yMDE5LTA5LTAx", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "e51d90df-8376-4a37-b200-c417123d5fc6" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.1" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "3fe773dd-29ce-44e0-a2c7-4db8c77e881c" + ], + "x-ms-client-request-id": [ + "e51d90df-8376-4a37-b200-c417123d5fc6" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11982" + ], + "x-ms-correlation-request-id": [ + "1d53f718-6642-469f-a83d-17ecade2832e" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191014T105844Z:1d53f718-6642-469f-a83d-17ecade2832e" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Date": [ + "Mon, 14 Oct 2019 10:58:43 GMT" + ], + "Content-Length": [ + "761" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"properties\": {\r\n \"isCancellable\": true,\r\n \"isDeletable\": false,\r\n \"isShippingAddressEditable\": true,\r\n \"status\": \"DeviceOrdered\",\r\n \"startTime\": \"2019-10-14T16:26:43.8410263+05:30\",\r\n \"deliveryType\": \"Scheduled\",\r\n \"deliveryInfo\": {\r\n \"scheduledDateTime\": \"2019-11-03T16:26:34.81743+05:30\"\r\n },\r\n \"isCancellableWithoutFee\": true\r\n },\r\n \"location\": \"westus\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"name\": \"SdkJob388\",\r\n \"id\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg1164/providers/Microsoft.DataBox/jobs/SdkJob388\",\r\n \"type\": \"Microsoft.DataBox/jobs\"\r\n }\r\n ]\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg1164/providers/Microsoft.DataBox/jobs/SdkJob388/cancel?api-version=2019-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Jlc291cmNlR3JvdXBzL1Nka1JnMTE2NC9wcm92aWRlcnMvTWljcm9zb2Z0LkRhdGFCb3gvam9icy9TZGtKb2IzODgvY2FuY2VsP2FwaS12ZXJzaW9uPTIwMTktMDktMDE=", + "RequestMethod": "POST", + "RequestBody": "{\r\n \"reason\": \"CancelTest\"\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "a7bf233a-2827-4ad4-b9de-2eada35a9f9e" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.1" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "30" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "2f4740cc-6473-444c-aeb1-77b5d5592c65" + ], + "x-ms-client-request-id": [ + "a7bf233a-2827-4ad4-b9de-2eada35a9f9e" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-correlation-request-id": [ + "292dc109-9d1b-4957-be83-816cd14db1b5" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191014T105844Z:292dc109-9d1b-4957-be83-816cd14db1b5" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Date": [ + "Mon, 14 Oct 2019 10:58:44 GMT" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "", + "StatusCode": 204 + }, + { + "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/SdkRg1164/providers/Microsoft.DataBox/jobs/SdkJob388?api-version=2019-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Jlc291cmNlR3JvdXBzL1Nka1JnMTE2NC9wcm92aWRlcnMvTWljcm9zb2Z0LkRhdGFCb3gvam9icy9TZGtKb2IzODg/YXBpLXZlcnNpb249MjAxOS0wOS0wMQ==", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "5c47ba45-a30f-48d2-8d14-0718d81fd4d1" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.1" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/providers/Microsoft.DataBox/locations/westus/operationResults/4b0dd96b-e054-4ae8-9be8-1ed38257c8de-deleteorder?api-version=2018-01-01" + ], + "Retry-After": [ + "10" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "43beed5f-41d7-40ec-b07f-cc6a65598823" + ], + "x-ms-client-request-id": [ + "5c47ba45-a30f-48d2-8d14-0718d81fd4d1" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-deletes": [ + "14999" + ], + "x-ms-correlation-request-id": [ + "b952b258-61d5-4b6e-bf90-cbd17396382e" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191014T110348Z:b952b258-61d5-4b6e-bf90-cbd17396382e" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Date": [ + "Mon, 14 Oct 2019 11:03:47 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/providers/Microsoft.DataBox/locations/westus/operationResults/4b0dd96b-e054-4ae8-9be8-1ed38257c8de-deleteorder?api-version=2018-01-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveC9sb2NhdGlvbnMvd2VzdHVzL29wZXJhdGlvblJlc3VsdHMvNGIwZGQ5NmItZTA1NC00YWU4LTliZTgtMWVkMzgyNTdjOGRlLWRlbGV0ZW9yZGVyP2FwaS12ZXJzaW9uPTIwMTgtMDEtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.1" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "285b240b-722a-45c1-bdf4-e389c0a4f017" + ], + "x-ms-client-request-id": [ + "1f92b26f-50a5-49b2-985a-464c140560b5" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11998" + ], + "x-ms-correlation-request-id": [ + "1e0dc2c3-e84c-4299-8922-51fc0927e108" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191014T110358Z:1e0dc2c3-e84c-4299-8922-51fc0927e108" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Date": [ + "Mon, 14 Oct 2019 11:03:58 GMT" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "", + "StatusCode": 204 + }, + { + "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/providers/Microsoft.DataBox/locations/westus/operationResults/4b0dd96b-e054-4ae8-9be8-1ed38257c8de-deleteorder?api-version=2018-01-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveC9sb2NhdGlvbnMvd2VzdHVzL29wZXJhdGlvblJlc3VsdHMvNGIwZGQ5NmItZTA1NC00YWU4LTliZTgtMWVkMzgyNTdjOGRlLWRlbGV0ZW9yZGVyP2FwaS12ZXJzaW9uPTIwMTgtMDEtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.1" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "6e58572c-5bb9-4b0a-8c8e-c7601da4d0e7" + ], + "x-ms-client-request-id": [ + "ed70fe01-5642-419d-b232-07c7f8c6d122" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11997" + ], + "x-ms-correlation-request-id": [ + "be3dc5ef-6ffa-4c9c-803b-ad6948ab7481" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191014T110359Z:be3dc5ef-6ffa-4c9c-803b-ad6948ab7481" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Date": [ + "Mon, 14 Oct 2019 11:03:59 GMT" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "", + "StatusCode": 204 + } + ], + "Names": { + "TestScheduledJob": [ + "SdkRg1164", + "SdkJob388" + ] + }, + "Variables": { + "SubscriptionId": "fa68082f-8ff7-4a25-95c7-ce9da541242f", + "SubId": "fa68082f-8ff7-4a25-95c7-ce9da541242f" + } +} \ No newline at end of file diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/tests/SessionRecords/JobsActionsTests/TestBookShipmentPickup.json b/sdk/databox/Microsoft.Azure.Management.DataBox/tests/SessionRecords/JobsActionsTests/TestBookShipmentPickup.json index be46ff9cf169..cf05f8e44d6b 100644 --- a/sdk/databox/Microsoft.Azure.Management.DataBox/tests/SessionRecords/JobsActionsTests/TestBookShipmentPickup.json +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/tests/SessionRecords/JobsActionsTests/TestBookShipmentPickup.json @@ -1,20 +1,22 @@ { "Entries": [ { - "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/bvttoolrg6/providers/Microsoft.DataBox/jobs/TJ-636646322037905056/bookShipmentPickUp?api-version=2018-01-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Jlc291cmNlR3JvdXBzL2J2dHRvb2xyZzYvcHJvdmlkZXJzL01pY3Jvc29mdC5EYXRhQm94L2pvYnMvVEotNjM2NjQ2MzIyMDM3OTA1MDU2L2Jvb2tTaGlwbWVudFBpY2tVcD9hcGktdmVyc2lvbj0yMDE4LTAxLTAx", + "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/bvttoolrg6/providers/Microsoft.DataBox/jobs/TJ-636646322037905056/bookShipmentPickUp?api-version=2019-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Jlc291cmNlR3JvdXBzL2J2dHRvb2xyZzYvcHJvdmlkZXJzL01pY3Jvc29mdC5EYXRhQm94L2pvYnMvVEotNjM2NjQ2MzIyMDM3OTA1MDU2L2Jvb2tTaGlwbWVudFBpY2tVcD9hcGktdmVyc2lvbj0yMDE5LTA5LTAx", "RequestMethod": "POST", - "RequestBody": "{\r\n \"startTime\": \"2018-09-10T18:30:00Z\",\r\n \"endTime\": \"2018-09-12T18:30:00Z\",\r\n \"shipmentLocation\": \"Front desk\"\r\n}", + "RequestBody": "{\r\n \"startTime\": \"2019-10-16T18:30:00Z\",\r\n \"endTime\": \"2019-10-18T18:30:00Z\",\r\n \"shipmentLocation\": \"Front desk\"\r\n}", "RequestHeaders": { "x-ms-client-request-id": [ - "8b6afb5d-ddce-481b-8621-e4bc2836a590" + "744655df-b677-4ab0-a166-93d33f549bca" ], - "accept-language": [ + "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.6.26614.01", - "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.0" + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.1" ], "Content-Type": [ "application/json; charset=utf-8" @@ -27,9 +29,6 @@ "Cache-Control": [ "no-cache" ], - "Date": [ - "Tue, 11 Sep 2018 12:28:19 GMT" - ], "Pragma": [ "no-cache" ], @@ -37,10 +36,10 @@ "nosniff" ], "x-ms-request-id": [ - "6e0cebc3-804e-402a-8c6b-e5b1ba71468a" + "b42f3186-6ebb-4860-b666-cafe0ce9a983" ], "x-ms-client-request-id": [ - "8b6afb5d-ddce-481b-8621-e4bc2836a590" + "744655df-b677-4ab0-a166-93d33f549bca" ], "X-Powered-By": [ "ASP.NET" @@ -49,16 +48,19 @@ "1199" ], "x-ms-correlation-request-id": [ - "8a00145e-833e-45bb-8de0-8df51e63f325" + "20a33f75-3cf2-47e1-ba5c-f5520f546b29" ], "x-ms-routing-request-id": [ - "SOUTHINDIA:20180911T122819Z:8a00145e-833e-45bb-8de0-8df51e63f325" + "SOUTHINDIA:20191017T102507Z:20a33f75-3cf2-47e1-ba5c-f5520f546b29" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "Date": [ + "Thu, 17 Oct 2019 10:25:06 GMT" + ], "Content-Length": [ - "85" + "243" ], "Content-Type": [ "application/json; charset=utf-8" @@ -67,8 +69,8 @@ "-1" ] }, - "ResponseBody": "{\r\n \"confirmationNumber\": \"2929602E9CP\",\r\n \"readyByTime\": \"2018-09-10T18:30:00Z\"\r\n}", - "StatusCode": 200 + "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"SsemUserErrorShipmentPickUpRequestAlreadyPlaced\",\r\n \"message\": \"A shipment pickup request is already placed.\\r\\nContact Microsoft Support to reschedule the pickup.\",\r\n \"details\": [\r\n null\r\n ]\r\n }\r\n}", + "StatusCode": 400 } ], "Names": {}, diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/tests/SessionRecords/JobsActionsTests/TestListCredentials.json b/sdk/databox/Microsoft.Azure.Management.DataBox/tests/SessionRecords/JobsActionsTests/TestListCredentials.json index 2daea8b77efc..521b5877e0be 100644 --- a/sdk/databox/Microsoft.Azure.Management.DataBox/tests/SessionRecords/JobsActionsTests/TestListCredentials.json +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/tests/SessionRecords/JobsActionsTests/TestListCredentials.json @@ -1,29 +1,28 @@ { "Entries": [ { - "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/bvttoolrg6/providers/Microsoft.DataBox/jobs/TJ-636646322037905056/listCredentials?api-version=2018-01-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Jlc291cmNlR3JvdXBzL2J2dHRvb2xyZzYvcHJvdmlkZXJzL01pY3Jvc29mdC5EYXRhQm94L2pvYnMvVEotNjM2NjQ2MzIyMDM3OTA1MDU2L2xpc3RDcmVkZW50aWFscz9hcGktdmVyc2lvbj0yMDE4LTAxLTAx", + "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourceGroups/bvttoolrg6/providers/Microsoft.DataBox/jobs/TJ-636646322037905056/listCredentials?api-version=2019-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Jlc291cmNlR3JvdXBzL2J2dHRvb2xyZzYvcHJvdmlkZXJzL01pY3Jvc29mdC5EYXRhQm94L2pvYnMvVEotNjM2NjQ2MzIyMDM3OTA1MDU2L2xpc3RDcmVkZW50aWFscz9hcGktdmVyc2lvbj0yMDE5LTA5LTAx", "RequestMethod": "POST", "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "4f05be0b-bd8f-4427-b430-f6b695348112" + "15e7e617-19e4-45c2-94c0-fa7190b873d1" ], - "accept-language": [ + "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.6.26614.01", - "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.0" + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.1" ] }, "ResponseHeaders": { "Cache-Control": [ "no-cache" ], - "Date": [ - "Wed, 19 Sep 2018 09:28:21 GMT" - ], "Pragma": [ "no-cache" ], @@ -31,10 +30,10 @@ "nosniff" ], "x-ms-request-id": [ - "a5b2f48b-954b-45f7-bda2-569e0dff3c52" + "d7a5d232-8e42-4412-bfb0-ceef04babe3c" ], "x-ms-client-request-id": [ - "4f05be0b-bd8f-4427-b430-f6b695348112" + "15e7e617-19e4-45c2-94c0-fa7190b873d1" ], "X-Powered-By": [ "ASP.NET" @@ -43,16 +42,19 @@ "1199" ], "x-ms-correlation-request-id": [ - "17847ee1-670d-4930-b00b-c9080cc714ca" + "130368d1-eee4-4407-ad3e-441642e8e5cf" ], "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20180919T092821Z:17847ee1-670d-4930-b00b-c9080cc714ca" + "SOUTHINDIA:20191017T102510Z:130368d1-eee4-4407-ad3e-441642e8e5cf" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "Date": [ + "Thu, 17 Oct 2019 10:25:09 GMT" + ], "Content-Length": [ - "2478" + "2573" ], "Content-Type": [ "application/json; charset=utf-8" @@ -61,7 +63,7 @@ "-1" ] }, - "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"jobName\": \"TJ-636646322037905056\",\r\n \"jobSecrets\": {\r\n \"podSecrets\": [\r\n {\r\n \"deviceSerialNumber\": \"testimolapod-3ecc44ce\",\r\n \"devicePassword\": \"cT5nt8R;S%5\",\r\n \"networkConfigurations\": [\r\n {\r\n \"name\": \"DataPort3\",\r\n \"macAddress\": \"D05099C1F439\"\r\n },\r\n {\r\n \"name\": \"DataPort1\",\r\n \"macAddress\": \"EC0D9A21A6C0\"\r\n },\r\n {\r\n \"name\": \"DataPort2\",\r\n \"macAddress\": \"EC0D9A21A6C1\"\r\n }\r\n ],\r\n \"encodedValidationCertPubKey\": \"5CYoAoVKEBa4WgPVis8keX94w30pon4jGMADSqcdE/NlHLChj6Cmhbl4q9QOFKSB/US4AwhS7zY1QS3YMDrkAPfOy7Hi6kWMBpJWZidTq3oXX8FAQjg+IqQESti/2jvAlcDpO2453rgd7Yb6XZ43P8MMTpTjcarI0ImCf//eITQWnFa3AzfIJ9C+hxCCaA7HTYhwQEPUBMwyQJsI6v6WuQysROtlBgx1YtbWFhDVbcqYRSLIbaj+RdzlvxvDJSo70kv+8em5upuDTpVE7xP+WePLlARdSPNwwfRzHnvCUqC2UqXHpRUhQlYnMqAJEcjjroRnyIGumPmmQ8O155X8aw==\",\r\n \"accountCredentialDetails\": [\r\n {\r\n \"accountName\": \"databoxbvttestaccount\",\r\n \"accountConnectionString\": \"\",\r\n \"shareCredentialDetails\": [\r\n {\r\n \"shareName\": \"databoxbvttestaccount_PageBlob\",\r\n \"shareType\": \"PageBlob\",\r\n \"userName\": \"databoxbvttestac_903\",\r\n \"password\": \"4N)K4(j6tyR\",\r\n \"supportedAccessProtocols\": [\r\n \"SMB\"\r\n ]\r\n },\r\n {\r\n \"shareName\": \"databoxbvttestaccount_BlockBlob\",\r\n \"shareType\": \"BlockBlob\",\r\n \"userName\": \"databoxbvttestac_903\",\r\n \"password\": \"4N)K4(j6tyR\",\r\n \"supportedAccessProtocols\": [\r\n \"SMB\"\r\n ]\r\n },\r\n {\r\n \"shareName\": \"databoxbvttestaccount_AzFile\",\r\n \"shareType\": \"AzureFile\",\r\n \"userName\": \"databoxbvttestac_903\",\r\n \"password\": \"4N)K4(j6tyR\",\r\n \"supportedAccessProtocols\": [\r\n \"SMB\"\r\n ]\r\n }\r\n ]\r\n }\r\n ]\r\n }\r\n ],\r\n \"jobSecretsType\": \"DataBox\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"jobName\": \"TJ-636646322037905056\",\r\n \"jobSecrets\": {\r\n \"podSecrets\": [\r\n {\r\n \"deviceSerialNumber\": \"testimolapod-3ecc44ce\",\r\n \"devicePassword\": \"cT5nt8R;S%5\",\r\n \"networkConfigurations\": [\r\n {\r\n \"name\": \"DataPort3\",\r\n \"macAddress\": \"D05099C1F439\"\r\n },\r\n {\r\n \"name\": \"DataPort1\",\r\n \"macAddress\": \"EC0D9A21A6C0\"\r\n },\r\n {\r\n \"name\": \"DataPort2\",\r\n \"macAddress\": \"EC0D9A21A6C1\"\r\n }\r\n ],\r\n \"encodedValidationCertPubKey\": \"5CYoAoVKEBa4WgPVis8keX94w30pon4jGMADSqcdE/NlHLChj6Cmhbl4q9QOFKSB/US4AwhS7zY1QS3YMDrkAPfOy7Hi6kWMBpJWZidTq3oXX8FAQjg+IqQESti/2jvAlcDpO2453rgd7Yb6XZ43P8MMTpTjcarI0ImCf//eITQWnFa3AzfIJ9C+hxCCaA7HTYhwQEPUBMwyQJsI6v6WuQysROtlBgx1YtbWFhDVbcqYRSLIbaj+RdzlvxvDJSo70kv+8em5upuDTpVE7xP+WePLlARdSPNwwfRzHnvCUqC2UqXHpRUhQlYnMqAJEcjjroRnyIGumPmmQ8O155X8aw==\",\r\n \"accountCredentialDetails\": [\r\n {\r\n \"accountName\": \"databoxbvttestaccount\",\r\n \"dataDestinationType\": \"StorageAccount\",\r\n \"accountConnectionString\": \"\",\r\n \"shareCredentialDetails\": [\r\n {\r\n \"shareName\": \"databoxbvttestaccount_PageBlob\",\r\n \"shareType\": \"PageBlob\",\r\n \"userName\": \"databoxbvttestac_903\",\r\n \"password\": \"4N)K4(j6tyR\",\r\n \"supportedAccessProtocols\": [\r\n \"SMB\"\r\n ]\r\n },\r\n {\r\n \"shareName\": \"databoxbvttestaccount_BlockBlob\",\r\n \"shareType\": \"BlockBlob\",\r\n \"userName\": \"databoxbvttestac_903\",\r\n \"password\": \"4N)K4(j6tyR\",\r\n \"supportedAccessProtocols\": [\r\n \"SMB\"\r\n ]\r\n },\r\n {\r\n \"shareName\": \"databoxbvttestaccount_AzFile\",\r\n \"shareType\": \"AzureFile\",\r\n \"userName\": \"databoxbvttestac_903\",\r\n \"password\": \"4N)K4(j6tyR\",\r\n \"supportedAccessProtocols\": [\r\n \"SMB\"\r\n ]\r\n }\r\n ]\r\n }\r\n ]\r\n }\r\n ],\r\n \"jobSecretsType\": \"DataBox\",\r\n \"dcAccessSecurityCode\": {}\r\n }\r\n }\r\n ]\r\n}", "StatusCode": 200 } ], diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/tests/SessionRecords/OperationsTests/TestOperationsAPI.json b/sdk/databox/Microsoft.Azure.Management.DataBox/tests/SessionRecords/OperationsTests/TestOperationsAPI.json index 3b3577f9a22e..fc17a8fe242d 100644 --- a/sdk/databox/Microsoft.Azure.Management.DataBox/tests/SessionRecords/OperationsTests/TestOperationsAPI.json +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/tests/SessionRecords/OperationsTests/TestOperationsAPI.json @@ -1,29 +1,28 @@ { "Entries": [ { - "RequestUri": "/providers/Microsoft.DataBox/operations?api-version=2018-01-01", - "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveC9vcGVyYXRpb25zP2FwaS12ZXJzaW9uPTIwMTgtMDEtMDE=", + "RequestUri": "/providers/Microsoft.DataBox/operations?api-version=2019-09-01", + "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveC9vcGVyYXRpb25zP2FwaS12ZXJzaW9uPTIwMTktMDktMDE=", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "69fc02f6-5d9f-42d5-8d98-b5a943b8c888" + "e813195f-da0c-49a6-88e0-687f5b5aa770" ], - "accept-language": [ + "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.6.26614.01", - "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.0" + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.1" ] }, "ResponseHeaders": { "Cache-Control": [ "no-cache" ], - "Date": [ - "Tue, 11 Sep 2018 12:28:25 GMT" - ], "Pragma": [ "no-cache" ], @@ -31,10 +30,10 @@ "nosniff" ], "x-ms-request-id": [ - "a9eafeb3-08da-4ec4-9323-f2ac265f0450" + "97705235-7a84-4549-9522-f282fd18145c" ], "x-ms-client-request-id": [ - "69fc02f6-5d9f-42d5-8d98-b5a943b8c888" + "e813195f-da0c-49a6-88e0-687f5b5aa770" ], "X-Powered-By": [ "ASP.NET" @@ -43,16 +42,19 @@ "11999" ], "x-ms-correlation-request-id": [ - "50a2be60-3909-4f0a-869b-8fcbf242a5ca" + "274c387e-f7f7-43d3-a3ba-ad61d62ec5a2" ], "x-ms-routing-request-id": [ - "SOUTHINDIA:20180911T122825Z:50a2be60-3909-4f0a-869b-8fcbf242a5ca" + "SOUTHINDIA:20191017T102447Z:274c387e-f7f7-43d3-a3ba-ad61d62ec5a2" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "Date": [ + "Thu, 17 Oct 2019 10:24:47 GMT" + ], "Content-Length": [ - "3675" + "5884" ], "Content-Type": [ "application/json; charset=utf-8" @@ -61,7 +63,7 @@ "-1" ] }, - "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"name\": \"Microsoft.DataBox/jobs/cancel/action\",\r\n \"display\": {\r\n \"provider\": \"Azure Data Box\",\r\n \"resource\": \"Orders\",\r\n \"operation\": \"Cancel\",\r\n \"description\": \"Cancels an order in progress.\"\r\n },\r\n \"properties\": {},\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.DataBox/jobs/reportIssue/action\",\r\n \"display\": {\r\n \"provider\": \"Azure Data Box\",\r\n \"resource\": \"Orders\",\r\n \"operation\": \"Report Issue\",\r\n \"description\": \"Reports an issue in the order.\"\r\n },\r\n \"properties\": {},\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.DataBox/jobs/copyLogsUri/action\",\r\n \"display\": {\r\n \"provider\": \"Azure Data Box\",\r\n \"resource\": \"Orders\",\r\n \"operation\": \"Copy Log URL\",\r\n \"description\": \"Get URL for the copy logs of each destination account.\"\r\n },\r\n \"properties\": {},\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.DataBox/jobs/downloadShippingLabel/action\",\r\n \"display\": {\r\n \"provider\": \"Azure Data Box\",\r\n \"resource\": \"Orders\",\r\n \"operation\": \"Download Shipping Label\",\r\n \"description\": \"Get shipping label for the return shipment.\"\r\n },\r\n \"properties\": {},\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.DataBox/jobs/bookShipmentPickUp/action\",\r\n \"display\": {\r\n \"provider\": \"Azure Data Box\",\r\n \"resource\": \"Orders\",\r\n \"operation\": \"Book Shipment Pick Up\",\r\n \"description\": \"Allows to book a pick up for return shipments.\"\r\n },\r\n \"properties\": {},\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.DataBox/jobs/read\",\r\n \"display\": {\r\n \"provider\": \"Azure Data Box\",\r\n \"resource\": \"Orders\",\r\n \"operation\": \"List Orders\",\r\n \"description\": \"List or get the Orders\"\r\n },\r\n \"properties\": {},\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.DataBox/jobs/delete\",\r\n \"display\": {\r\n \"provider\": \"Azure Data Box\",\r\n \"resource\": \"Orders\",\r\n \"operation\": \"Delete Orders\",\r\n \"description\": \"Delete the Orders\"\r\n },\r\n \"properties\": {},\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.DataBox/jobs/write\",\r\n \"display\": {\r\n \"provider\": \"Azure Data Box\",\r\n \"resource\": \"Orders\",\r\n \"operation\": \"Create or Update Orders\",\r\n \"description\": \"Create or update the Orders\"\r\n },\r\n \"properties\": {},\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.DataBox/jobs/ListCredentials/action\",\r\n \"display\": {\r\n \"provider\": \"Azure Data Box\",\r\n \"resource\": \"Orders\",\r\n \"operation\": \"List Credentails\",\r\n \"description\": \"Lists the unencrypted credentials related to the order.\"\r\n },\r\n \"properties\": {},\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.DataBox/locations/validateAddress/action\",\r\n \"display\": {\r\n \"provider\": \"Azure Data Box\",\r\n \"resource\": \"Validate Address\",\r\n \"operation\": \"Validate Address\",\r\n \"description\": \"Validates the shipping address and provides alternate addresses if any.\"\r\n },\r\n \"properties\": {},\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.DataBox/locations/availableSkus/action\",\r\n \"display\": {\r\n \"provider\": \"Azure Data Box\",\r\n \"resource\": \"Available Skus\",\r\n \"operation\": \"Availabe Skus\",\r\n \"description\": \"This method returns the list of available skus.\"\r\n },\r\n \"properties\": {},\r\n \"origin\": \"user\"\r\n }\r\n ]\r\n}", + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"name\": \"Microsoft.DataBox/locations/operationResults/read\",\r\n \"display\": {\r\n \"provider\": \"Azure Data Box\",\r\n \"resource\": \"Operation Results\",\r\n \"operation\": \"List Operation Results\",\r\n \"description\": \"List or get the Operation Results\"\r\n },\r\n \"properties\": {},\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.DataBox/jobs/cancel/action\",\r\n \"display\": {\r\n \"provider\": \"Azure Data Box\",\r\n \"resource\": \"Orders\",\r\n \"operation\": \"Cancel\",\r\n \"description\": \"Cancels an order in progress.\"\r\n },\r\n \"properties\": {},\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.DataBox/jobs/bookShipmentPickUp/action\",\r\n \"display\": {\r\n \"provider\": \"Azure Data Box\",\r\n \"resource\": \"Orders\",\r\n \"operation\": \"Book Shipment Pick Up\",\r\n \"description\": \"Allows to book a pick up for return shipments.\"\r\n },\r\n \"properties\": {},\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.DataBox/jobs/read\",\r\n \"display\": {\r\n \"provider\": \"Azure Data Box\",\r\n \"resource\": \"Orders\",\r\n \"operation\": \"List Orders\",\r\n \"description\": \"List or get the Orders\"\r\n },\r\n \"properties\": {},\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.DataBox/jobs/delete\",\r\n \"display\": {\r\n \"provider\": \"Azure Data Box\",\r\n \"resource\": \"Orders\",\r\n \"operation\": \"Delete Orders\",\r\n \"description\": \"Delete the Orders\"\r\n },\r\n \"properties\": {},\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.DataBox/jobs/write\",\r\n \"display\": {\r\n \"provider\": \"Azure Data Box\",\r\n \"resource\": \"Orders\",\r\n \"operation\": \"Create or Update Orders\",\r\n \"description\": \"Create or update the Orders\"\r\n },\r\n \"properties\": {},\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.DataBox/jobs/listCredentials/action\",\r\n \"display\": {\r\n \"provider\": \"Azure Data Box\",\r\n \"resource\": \"Orders\",\r\n \"operation\": \"List Credentials\",\r\n \"description\": \"Lists the unencrypted credentials related to the order.\"\r\n },\r\n \"properties\": {},\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.DataBox/locations/validateInputs/action\",\r\n \"display\": {\r\n \"provider\": \"Azure Data Box\",\r\n \"resource\": \"Validate Inputs\",\r\n \"operation\": \"Validate Inputs\",\r\n \"description\": \"This method does all type of validations.\"\r\n },\r\n \"properties\": {},\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.DataBox/locations/validateAddress/action\",\r\n \"display\": {\r\n \"provider\": \"Azure Data Box\",\r\n \"resource\": \"Validate Address\",\r\n \"operation\": \"Validate Address\",\r\n \"description\": \"Validates the shipping address and provides alternate addresses if any.\"\r\n },\r\n \"properties\": {},\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.DataBox/subscriptions/resourceGroups/moveResources/action\",\r\n \"display\": {\r\n \"provider\": \"Azure Data Box\",\r\n \"resource\": \"Move Resource\",\r\n \"operation\": \"Move Resource\",\r\n \"description\": \"This method performs the resource move.\"\r\n },\r\n \"properties\": {},\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.DataBox/subscriptions/resourceGroups/validateMoveResources/action\",\r\n \"display\": {\r\n \"provider\": \"Azure Data Box\",\r\n \"resource\": \"Move Resource\",\r\n \"operation\": \"Validate Move Resource Request\",\r\n \"description\": \"This method validates whether resource move is allowed or not.\"\r\n },\r\n \"properties\": {},\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.DataBox/locations/availableSkus/action\",\r\n \"display\": {\r\n \"provider\": \"Azure Data Box\",\r\n \"resource\": \"Available Skus\",\r\n \"operation\": \"Availabe Skus\",\r\n \"description\": \"This method returns the list of available skus.\"\r\n },\r\n \"properties\": {},\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.DataBox/locations/regionConfiguration/action\",\r\n \"display\": {\r\n \"provider\": \"Azure Data Box\",\r\n \"resource\": \"Region Configuration\",\r\n \"operation\": \"Region Configuration\",\r\n \"description\": \"This method returns the configurations for the region.\"\r\n },\r\n \"properties\": {},\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.DataBox/locations/availableSkus/read\",\r\n \"display\": {\r\n \"provider\": \"Azure Data Box\",\r\n \"resource\": \"Available Skus\",\r\n \"operation\": \"List Available Skus\",\r\n \"description\": \"List or get the Available Skus\"\r\n },\r\n \"properties\": {},\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.DataBox/register/action\",\r\n \"display\": {\r\n \"provider\": \"Azure Data Box\",\r\n \"resource\": \"Register Microsoft.Databox\",\r\n \"operation\": \"Register Microsoft.Databox\",\r\n \"description\": \"Register Provider Microsoft.Databox\"\r\n },\r\n \"properties\": {},\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.DataBox/unregister/action\",\r\n \"display\": {\r\n \"provider\": \"Azure Data Box\",\r\n \"resource\": \"Register Microsoft.Databox\",\r\n \"operation\": \"Un-Register Microsoft.Databox\",\r\n \"description\": \"Un-Register Provider Microsoft.Databox\"\r\n },\r\n \"properties\": {},\r\n \"origin\": \"user\"\r\n },\r\n {\r\n \"name\": \"Microsoft.DataBox/operations/read\",\r\n \"display\": {\r\n \"provider\": \"Azure Data Box\",\r\n \"resource\": \"Operations\",\r\n \"operation\": \"List Operations\",\r\n \"description\": \"List or get the Operations\"\r\n },\r\n \"properties\": {},\r\n \"origin\": \"user\"\r\n }\r\n ]\r\n}", "StatusCode": 200 } ], diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/tests/SessionRecords/ServiceOperationTests/TestAvailableSkus.json b/sdk/databox/Microsoft.Azure.Management.DataBox/tests/SessionRecords/ServiceOperationTests/TestAvailableSkus.json index 5e8df66fc3cf..65f73c156292 100644 --- a/sdk/databox/Microsoft.Azure.Management.DataBox/tests/SessionRecords/ServiceOperationTests/TestAvailableSkus.json +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/tests/SessionRecords/ServiceOperationTests/TestAvailableSkus.json @@ -1,20 +1,22 @@ { "Entries": [ { - "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/providers/Microsoft.DataBox/locations/westus/availableSkus?api-version=2018-01-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveC9sb2NhdGlvbnMvd2VzdHVzL2F2YWlsYWJsZVNrdXM/YXBpLXZlcnNpb249MjAxOC0wMS0wMQ==", + "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/providers/Microsoft.DataBox/locations/westus/availableSkus?api-version=2019-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveC9sb2NhdGlvbnMvd2VzdHVzL2F2YWlsYWJsZVNrdXM/YXBpLXZlcnNpb249MjAxOS0wOS0wMQ==", "RequestMethod": "POST", "RequestBody": "{\r\n \"country\": \"US\",\r\n \"location\": \"westus\",\r\n \"transferType\": \"ImportToAzure\"\r\n}", "RequestHeaders": { "x-ms-client-request-id": [ - "4e698ef0-d274-49ac-9961-16c79bb3e5e0" + "fa244df8-c14f-4607-a6cc-c0ce871a27c9" ], - "accept-language": [ + "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.6.26614.01", - "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.0" + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.1" ], "Content-Type": [ "application/json; charset=utf-8" @@ -27,9 +29,6 @@ "Cache-Control": [ "no-cache" ], - "Date": [ - "Wed, 19 Sep 2018 09:28:35 GMT" - ], "Pragma": [ "no-cache" ], @@ -37,28 +36,31 @@ "nosniff" ], "x-ms-request-id": [ - "655f2b51-5b87-4413-97dd-3d260bec058c" + "d74fa14f-306f-486a-93d1-cf6f158a28de" ], "x-ms-client-request-id": [ - "4e698ef0-d274-49ac-9961-16c79bb3e5e0" + "fa244df8-c14f-4607-a6cc-c0ce871a27c9" ], "X-Powered-By": [ "ASP.NET" ], - "x-ms-ratelimit-remaining-subscription-writes": [ - "1198" + "x-ms-ratelimit-remaining-subscription-reads": [ + "11999" ], "x-ms-correlation-request-id": [ - "b569e52e-295b-4fbf-990b-5b555927df6b" + "f0aac096-cded-42c5-976d-7548aa9d8a6a" ], "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20180919T092835Z:b569e52e-295b-4fbf-990b-5b555927df6b" + "SOUTHINDIA:20191016T050339Z:f0aac096-cded-42c5-976d-7548aa9d8a6a" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "Date": [ + "Wed, 16 Oct 2019 05:03:38 GMT" + ], "Content-Length": [ - "5246" + "6566" ], "Content-Type": [ "application/json; charset=utf-8" @@ -67,7 +69,7 @@ "-1" ] }, - "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"enabled\": true,\r\n \"properties\": {\r\n \"destinationToServiceLocationMap\": [\r\n {\r\n \"destinationLocation\": \"westus\",\r\n \"serviceLocation\": \"westus\"\r\n },\r\n {\r\n \"destinationLocation\": \"centralus\",\r\n \"serviceLocation\": \"westus\"\r\n },\r\n {\r\n \"destinationLocation\": \"eastus\",\r\n \"serviceLocation\": \"westus\"\r\n },\r\n {\r\n \"destinationLocation\": \"eastus2\",\r\n \"serviceLocation\": \"westus\"\r\n },\r\n {\r\n \"destinationLocation\": \"northcentralus\",\r\n \"serviceLocation\": \"westus\"\r\n },\r\n {\r\n \"destinationLocation\": \"southcentralus\",\r\n \"serviceLocation\": \"westus\"\r\n },\r\n {\r\n \"destinationLocation\": \"westcentralus\",\r\n \"serviceLocation\": \"westus\"\r\n },\r\n {\r\n \"destinationLocation\": \"westus2\",\r\n \"serviceLocation\": \"westus\"\r\n },\r\n {\r\n \"destinationLocation\": \"centraluseuap\",\r\n \"serviceLocation\": \"centraluseuap\"\r\n },\r\n {\r\n \"destinationLocation\": \"eastus2euap\",\r\n \"serviceLocation\": \"eastus2euap\"\r\n }\r\n ],\r\n \"capacity\": {\r\n \"usable\": \"80\",\r\n \"maximum\": \"100\"\r\n },\r\n \"costs\": [\r\n {\r\n \"meterId\": \"0cf23ffc-0b64-49e6-9bdd-1db885349042\",\r\n \"meterType\": \"DataBoxServiceFee\"\r\n },\r\n {\r\n \"meterId\": \"a701f058-119b-4713-a923-bed7da4b7801\",\r\n \"meterType\": \"DataBoxShippingFee\"\r\n },\r\n {\r\n \"meterId\": \"049fa331-0a48-4a81-9991-a6bef3c79fed\",\r\n \"meterType\": \"DataBoxExtraDayFee\"\r\n }\r\n ],\r\n \"apiVersions\": [\r\n \"2018-01-01\"\r\n ],\r\n \"disabledReason\": \"None\"\r\n }\r\n },\r\n {\r\n \"sku\": {\r\n \"name\": \"DataBoxDisk\"\r\n },\r\n \"enabled\": true,\r\n \"properties\": {\r\n \"destinationToServiceLocationMap\": [\r\n {\r\n \"destinationLocation\": \"westus\",\r\n \"serviceLocation\": \"westus\"\r\n },\r\n {\r\n \"destinationLocation\": \"centralus\",\r\n \"serviceLocation\": \"westus\"\r\n },\r\n {\r\n \"destinationLocation\": \"eastus\",\r\n \"serviceLocation\": \"westus\"\r\n },\r\n {\r\n \"destinationLocation\": \"eastus2\",\r\n \"serviceLocation\": \"westus\"\r\n },\r\n {\r\n \"destinationLocation\": \"northcentralus\",\r\n \"serviceLocation\": \"westus\"\r\n },\r\n {\r\n \"destinationLocation\": \"southcentralus\",\r\n \"serviceLocation\": \"westus\"\r\n },\r\n {\r\n \"destinationLocation\": \"westcentralus\",\r\n \"serviceLocation\": \"westus\"\r\n },\r\n {\r\n \"destinationLocation\": \"westus2\",\r\n \"serviceLocation\": \"westus\"\r\n },\r\n {\r\n \"destinationLocation\": \"centraluseuap\",\r\n \"serviceLocation\": \"centraluseuap\"\r\n },\r\n {\r\n \"destinationLocation\": \"eastus2euap\",\r\n \"serviceLocation\": \"eastus2euap\"\r\n }\r\n ],\r\n \"capacity\": {\r\n \"usable\": \"35\",\r\n \"maximum\": \"40\"\r\n },\r\n \"costs\": [],\r\n \"apiVersions\": [\r\n \"2018-01-01\"\r\n ],\r\n \"disabledReason\": \"None\"\r\n }\r\n },\r\n {\r\n \"sku\": {\r\n \"name\": \"DataBoxHeavy\"\r\n },\r\n \"enabled\": true,\r\n \"properties\": {\r\n \"destinationToServiceLocationMap\": [\r\n {\r\n \"destinationLocation\": \"westus\",\r\n \"serviceLocation\": \"westus\"\r\n },\r\n {\r\n \"destinationLocation\": \"centralus\",\r\n \"serviceLocation\": \"westus\"\r\n },\r\n {\r\n \"destinationLocation\": \"eastus\",\r\n \"serviceLocation\": \"westus\"\r\n },\r\n {\r\n \"destinationLocation\": \"eastus2\",\r\n \"serviceLocation\": \"westus\"\r\n },\r\n {\r\n \"destinationLocation\": \"northcentralus\",\r\n \"serviceLocation\": \"westus\"\r\n },\r\n {\r\n \"destinationLocation\": \"southcentralus\",\r\n \"serviceLocation\": \"westus\"\r\n },\r\n {\r\n \"destinationLocation\": \"westcentralus\",\r\n \"serviceLocation\": \"westus\"\r\n },\r\n {\r\n \"destinationLocation\": \"westus2\",\r\n \"serviceLocation\": \"westus\"\r\n },\r\n {\r\n \"destinationLocation\": \"centraluseuap\",\r\n \"serviceLocation\": \"centraluseuap\"\r\n },\r\n {\r\n \"destinationLocation\": \"eastus2euap\",\r\n \"serviceLocation\": \"eastus2euap\"\r\n }\r\n ],\r\n \"capacity\": {\r\n \"usable\": \"800\",\r\n \"maximum\": \"1000\"\r\n },\r\n \"costs\": [],\r\n \"apiVersions\": [\r\n \"2018-01-01\"\r\n ],\r\n \"disabledReason\": \"None\",\r\n \"requiredFeature\": \"HeavyCreateAccess\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"sku\": {\r\n \"name\": \"DataBox\"\r\n },\r\n \"enabled\": true,\r\n \"properties\": {\r\n \"destinationToServiceLocationMap\": [\r\n {\r\n \"destinationLocation\": \"westus\",\r\n \"serviceLocation\": \"westus\"\r\n },\r\n {\r\n \"destinationLocation\": \"centralus\",\r\n \"serviceLocation\": \"westus\"\r\n },\r\n {\r\n \"destinationLocation\": \"eastus\",\r\n \"serviceLocation\": \"westus\"\r\n },\r\n {\r\n \"destinationLocation\": \"eastus2\",\r\n \"serviceLocation\": \"westus\"\r\n },\r\n {\r\n \"destinationLocation\": \"northcentralus\",\r\n \"serviceLocation\": \"westus\"\r\n },\r\n {\r\n \"destinationLocation\": \"southcentralus\",\r\n \"serviceLocation\": \"westus\"\r\n },\r\n {\r\n \"destinationLocation\": \"westcentralus\",\r\n \"serviceLocation\": \"westus\"\r\n },\r\n {\r\n \"destinationLocation\": \"westus2\",\r\n \"serviceLocation\": \"westus\"\r\n },\r\n {\r\n \"destinationLocation\": \"centraluseuap\",\r\n \"serviceLocation\": \"centraluseuap\"\r\n },\r\n {\r\n \"destinationLocation\": \"eastus2euap\",\r\n \"serviceLocation\": \"eastus2euap\"\r\n }\r\n ],\r\n \"capacity\": {\r\n \"usable\": \"80\",\r\n \"maximum\": \"100\"\r\n },\r\n \"costs\": [\r\n {\r\n \"meterId\": \"0cf23ffc-0b64-49e6-9bdd-1db885349042\",\r\n \"meterType\": \"DataBoxServiceFee\"\r\n },\r\n {\r\n \"meterId\": \"a701f058-119b-4713-a923-bed7da4b7801\",\r\n \"meterType\": \"DataBoxShippingFee\"\r\n },\r\n {\r\n \"meterId\": \"049fa331-0a48-4a81-9991-a6bef3c79fed\",\r\n \"meterType\": \"DataBoxExtraDayFee\"\r\n },\r\n {\r\n \"meterId\": \"c3ea978d-6a0a-4632-b094-4fffcafcb057\",\r\n \"meterType\": \"DataBoxLostOrDamagedDeviceFee\"\r\n }\r\n ],\r\n \"apiVersions\": [\r\n \"2018-01-01\"\r\n ],\r\n \"disabledReason\": \"None\"\r\n }\r\n },\r\n {\r\n \"sku\": {\r\n \"name\": \"DataBoxDisk\"\r\n },\r\n \"enabled\": true,\r\n \"properties\": {\r\n \"destinationToServiceLocationMap\": [\r\n {\r\n \"destinationLocation\": \"westus\",\r\n \"serviceLocation\": \"westus\"\r\n },\r\n {\r\n \"destinationLocation\": \"centralus\",\r\n \"serviceLocation\": \"westus\"\r\n },\r\n {\r\n \"destinationLocation\": \"eastus\",\r\n \"serviceLocation\": \"westus\"\r\n },\r\n {\r\n \"destinationLocation\": \"eastus2\",\r\n \"serviceLocation\": \"westus\"\r\n },\r\n {\r\n \"destinationLocation\": \"northcentralus\",\r\n \"serviceLocation\": \"westus\"\r\n },\r\n {\r\n \"destinationLocation\": \"southcentralus\",\r\n \"serviceLocation\": \"westus\"\r\n },\r\n {\r\n \"destinationLocation\": \"westcentralus\",\r\n \"serviceLocation\": \"westus\"\r\n },\r\n {\r\n \"destinationLocation\": \"westus2\",\r\n \"serviceLocation\": \"westus\"\r\n },\r\n {\r\n \"destinationLocation\": \"centraluseuap\",\r\n \"serviceLocation\": \"centraluseuap\"\r\n },\r\n {\r\n \"destinationLocation\": \"eastus2euap\",\r\n \"serviceLocation\": \"eastus2euap\"\r\n }\r\n ],\r\n \"capacity\": {\r\n \"usable\": \"35\",\r\n \"maximum\": \"40\"\r\n },\r\n \"costs\": [\r\n {\r\n \"meterId\": \"d95cd8b5-b6f1-4cd9-ae86-a016d1945d6f\",\r\n \"meterType\": \"DataBoxDiskServiceFee\"\r\n },\r\n {\r\n \"meterId\": \"4b8cf572-cb04-4ef3-9528-2cda4e9b544e\",\r\n \"meterType\": \"DataBoxDiskShippingFee\"\r\n },\r\n {\r\n \"meterId\": \"b6ae9bbf-815d-49dd-bb2b-77c497b72ba4\",\r\n \"meterType\": \"DataBoxDiskDailyUsageFee\"\r\n },\r\n {\r\n \"meterId\": \"08bc0ea1-6c82-421b-b953-2a7a65810d2e\",\r\n \"meterType\": \"DataBoxDiskLostDeviceFee\"\r\n }\r\n ],\r\n \"apiVersions\": [\r\n \"2018-01-01\"\r\n ],\r\n \"disabledReason\": \"None\"\r\n }\r\n },\r\n {\r\n \"sku\": {\r\n \"name\": \"DataBoxHeavy\"\r\n },\r\n \"enabled\": true,\r\n \"properties\": {\r\n \"destinationToServiceLocationMap\": [\r\n {\r\n \"destinationLocation\": \"westus\",\r\n \"serviceLocation\": \"westus\"\r\n },\r\n {\r\n \"destinationLocation\": \"centralus\",\r\n \"serviceLocation\": \"westus\"\r\n },\r\n {\r\n \"destinationLocation\": \"eastus\",\r\n \"serviceLocation\": \"westus\"\r\n },\r\n {\r\n \"destinationLocation\": \"eastus2\",\r\n \"serviceLocation\": \"westus\"\r\n },\r\n {\r\n \"destinationLocation\": \"northcentralus\",\r\n \"serviceLocation\": \"westus\"\r\n },\r\n {\r\n \"destinationLocation\": \"southcentralus\",\r\n \"serviceLocation\": \"westus\"\r\n },\r\n {\r\n \"destinationLocation\": \"westcentralus\",\r\n \"serviceLocation\": \"westus\"\r\n },\r\n {\r\n \"destinationLocation\": \"westus2\",\r\n \"serviceLocation\": \"westus\"\r\n },\r\n {\r\n \"destinationLocation\": \"centraluseuap\",\r\n \"serviceLocation\": \"centraluseuap\"\r\n },\r\n {\r\n \"destinationLocation\": \"eastus2euap\",\r\n \"serviceLocation\": \"eastus2euap\"\r\n }\r\n ],\r\n \"capacity\": {\r\n \"usable\": \"800\",\r\n \"maximum\": \"1000\"\r\n },\r\n \"costs\": [\r\n {\r\n \"meterId\": \"d0dccaaf-3de9-4c7a-ba97-f83551b90126\",\r\n \"meterType\": \"DataBoxHeavyServiceFee\"\r\n },\r\n {\r\n \"meterId\": \"7b49d11f-d4f7-4029-a197-04998fd282f9\",\r\n \"meterType\": \"DataBoxHeavyShippingFee\"\r\n },\r\n {\r\n \"meterId\": \"c2c66d53-11b4-4f11-9642-43c7c336f0b7\",\r\n \"meterType\": \"DataBoxHeavyExtraDayFee\"\r\n },\r\n {\r\n \"meterId\": \"188dcd7e-fbd7-4a41-aa42-162b81b0510f\",\r\n \"meterType\": \"DataBoxHeavyLostOrDamagedDeviceFee\"\r\n }\r\n ],\r\n \"apiVersions\": [\r\n \"2018-01-01\"\r\n ],\r\n \"disabledReason\": \"None\",\r\n \"requiredFeature\": \"HeavyCreateAccess\"\r\n }\r\n }\r\n ]\r\n}", "StatusCode": 200 } ], diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/tests/SessionRecords/ServiceOperationTests/TestRegionConfiguration.json b/sdk/databox/Microsoft.Azure.Management.DataBox/tests/SessionRecords/ServiceOperationTests/TestRegionConfiguration.json new file mode 100644 index 000000000000..07b101eb44e7 --- /dev/null +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/tests/SessionRecords/ServiceOperationTests/TestRegionConfiguration.json @@ -0,0 +1,81 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/providers/Microsoft.DataBox/locations/westus/regionConfiguration?api-version=2019-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveC9sb2NhdGlvbnMvd2VzdHVzL3JlZ2lvbkNvbmZpZ3VyYXRpb24/YXBpLXZlcnNpb249MjAxOS0wOS0wMQ==", + "RequestMethod": "POST", + "RequestBody": "{\r\n \"scheduleAvailabilityRequest\": {\r\n \"skuName\": \"DataBox\",\r\n \"storageLocation\": \"westus\"\r\n },\r\n \"transportAvailabilityRequest\": {\r\n \"skuName\": \"DataBox\"\r\n }\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "18e317fe-eab7-4cbd-8796-f1b8e26c7c52" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.1" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "174" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "65dac9e1-cc74-43de-aaf6-4737eccb212c" + ], + "x-ms-client-request-id": [ + "18e317fe-eab7-4cbd-8796-f1b8e26c7c52" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-correlation-request-id": [ + "a611e11f-ccfe-45bd-9b1a-0346cdd114a2" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191014T112939Z:a611e11f-ccfe-45bd-9b1a-0346cdd114a2" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Date": [ + "Mon, 14 Oct 2019 11:29:38 GMT" + ], + "Content-Length": [ + "1047" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"scheduleAvailabilityResponse\": {\r\n \"availableDates\": [\r\n \"2019-10-24T05:30:00+05:30\",\r\n \"2019-10-25T05:30:00+05:30\",\r\n \"2019-10-26T05:30:00+05:30\",\r\n \"2019-10-27T05:30:00+05:30\",\r\n \"2019-10-28T05:30:00+05:30\",\r\n \"2019-10-29T05:30:00+05:30\",\r\n \"2019-10-30T05:30:00+05:30\",\r\n \"2019-10-31T05:30:00+05:30\",\r\n \"2019-11-01T05:30:00+05:30\",\r\n \"2019-11-02T05:30:00+05:30\",\r\n \"2019-11-03T05:30:00+05:30\",\r\n \"2019-11-04T05:30:00+05:30\",\r\n \"2019-11-05T05:30:00+05:30\",\r\n \"2019-11-06T05:30:00+05:30\",\r\n \"2019-11-07T05:30:00+05:30\",\r\n \"2019-11-08T05:30:00+05:30\",\r\n \"2019-11-09T05:30:00+05:30\",\r\n \"2019-11-10T05:30:00+05:30\",\r\n \"2019-11-11T05:30:00+05:30\",\r\n \"2019-11-12T05:30:00+05:30\",\r\n \"2019-11-13T05:30:00+05:30\"\r\n ]\r\n },\r\n \"transportAvailabilityResponse\": {\r\n \"transportAvailabilityDetails\": [\r\n {\r\n \"shipmentType\": \"MicrosoftManaged\"\r\n },\r\n {\r\n \"shipmentType\": \"CustomerManaged\"\r\n }\r\n ]\r\n }\r\n}", + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "fa68082f-8ff7-4a25-95c7-ce9da541242f", + "SubId": "fa68082f-8ff7-4a25-95c7-ce9da541242f" + } +} \ No newline at end of file diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/tests/SessionRecords/ServiceOperationTests/TestValidateAddress.json b/sdk/databox/Microsoft.Azure.Management.DataBox/tests/SessionRecords/ServiceOperationTests/TestValidateAddress.json index 708a796d5baf..27574d0ba1c2 100644 --- a/sdk/databox/Microsoft.Azure.Management.DataBox/tests/SessionRecords/ServiceOperationTests/TestValidateAddress.json +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/tests/SessionRecords/ServiceOperationTests/TestValidateAddress.json @@ -1,35 +1,34 @@ { "Entries": [ { - "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/providers/Microsoft.DataBox/locations/westus/validateAddress?api-version=2018-01-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveC9sb2NhdGlvbnMvd2VzdHVzL3ZhbGlkYXRlQWRkcmVzcz9hcGktdmVyc2lvbj0yMDE4LTAxLTAx", + "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/providers/Microsoft.DataBox/locations/westus/validateAddress?api-version=2019-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveC9sb2NhdGlvbnMvd2VzdHVzL3ZhbGlkYXRlQWRkcmVzcz9hcGktdmVyc2lvbj0yMDE5LTA5LTAx", "RequestMethod": "POST", - "RequestBody": "{\r\n \"shippingAddress\": {\r\n \"streetAddress1\": \"16 TOWNSEND ST\",\r\n \"streetAddress2\": \"Unit 1\",\r\n \"city\": \"San Francisco\",\r\n \"stateOrProvince\": \"CA\",\r\n \"country\": \"US\",\r\n \"postalCode\": \"94107\",\r\n \"companyName\": \"Microsoft\",\r\n \"addressType\": \"Commercial\"\r\n },\r\n \"deviceType\": \"DataBox\"\r\n}", + "RequestBody": "{\r\n \"validationType\": \"ValidateAddress\",\r\n \"shippingAddress\": {\r\n \"streetAddress1\": \"16 TOWNSEND ST\",\r\n \"streetAddress2\": \"Unit 1\",\r\n \"city\": \"San Francisco\",\r\n \"stateOrProvince\": \"CA\",\r\n \"country\": \"US\",\r\n \"postalCode\": \"94107\",\r\n \"companyName\": \"Microsoft\",\r\n \"addressType\": \"Commercial\"\r\n },\r\n \"deviceType\": \"DataBox\"\r\n}", "RequestHeaders": { "x-ms-client-request-id": [ - "b7728f76-342e-4bd0-9187-a7f9b2b29394" + "3d29871a-e911-4726-ae42-adde6a360922" ], - "accept-language": [ + "Accept-Language": [ "en-US" ], "User-Agent": [ - "FxVersion/4.6.26614.01", - "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.0" + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.1" ], "Content-Type": [ "application/json; charset=utf-8" ], "Content-Length": [ - "311" + "351" ] }, "ResponseHeaders": { "Cache-Control": [ "no-cache" ], - "Date": [ - "Wed, 19 Sep 2018 09:28:28 GMT" - ], "Pragma": [ "no-cache" ], @@ -37,10 +36,10 @@ "nosniff" ], "x-ms-request-id": [ - "a9fe49c4-e8f7-4ac7-9d6c-b49588310678" + "aa317279-a58e-410b-927c-b61e8eb4b718" ], "x-ms-client-request-id": [ - "b7728f76-342e-4bd0-9187-a7f9b2b29394" + "3d29871a-e911-4726-ae42-adde6a360922" ], "X-Powered-By": [ "ASP.NET" @@ -49,16 +48,19 @@ "1199" ], "x-ms-correlation-request-id": [ - "7e382fb1-9a54-48dc-b140-a635494b900e" + "6192b83f-35b2-480a-90b4-5b275077845f" ], "x-ms-routing-request-id": [ - "SOUTHEASTASIA:20180919T092828Z:7e382fb1-9a54-48dc-b140-a635494b900e" + "SOUTHINDIA:20191017T102455Z:6192b83f-35b2-480a-90b4-5b275077845f" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], + "Date": [ + "Thu, 17 Oct 2019 10:24:54 GMT" + ], "Content-Length": [ - "386" + "428" ], "Content-Type": [ "application/json; charset=utf-8" @@ -67,7 +69,7 @@ "-1" ] }, - "ResponseBody": "{\r\n \"properties\": {\r\n \"validationStatus\": \"Valid\",\r\n \"alternateAddresses\": [\r\n {\r\n \"streetAddress1\": \"16 TOWNSEND ST\",\r\n \"streetAddress2\": \"Unit 1\",\r\n \"streetAddress3\": \"\",\r\n \"city\": \"SAN FRANCISCO\",\r\n \"stateOrProvince\": \"CA\",\r\n \"country\": \"US\",\r\n \"postalCode\": \"94107\",\r\n \"addressType\": \"None\"\r\n }\r\n ]\r\n }\r\n}", + "ResponseBody": "{\r\n \"properties\": {\r\n \"validationStatus\": \"Valid\",\r\n \"alternateAddresses\": [\r\n {\r\n \"streetAddress1\": \"16 TOWNSEND ST\",\r\n \"streetAddress2\": \"Unit 1\",\r\n \"streetAddress3\": \"\",\r\n \"city\": \"SAN FRANCISCO\",\r\n \"stateOrProvince\": \"CA\",\r\n \"country\": \"US\",\r\n \"postalCode\": \"94107\",\r\n \"addressType\": \"None\"\r\n }\r\n ],\r\n \"validationType\": \"ValidateAddress\"\r\n }\r\n}", "StatusCode": 200 } ], diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/tests/SessionRecords/ServiceOperationTests/TestValidateInputs.json b/sdk/databox/Microsoft.Azure.Management.DataBox/tests/SessionRecords/ServiceOperationTests/TestValidateInputs.json new file mode 100644 index 000000000000..2a718b205495 --- /dev/null +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/tests/SessionRecords/ServiceOperationTests/TestValidateInputs.json @@ -0,0 +1,81 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/providers/Microsoft.DataBox/locations/westus/validateInputs?api-version=2019-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZmE2ODA4MmYtOGZmNy00YTI1LTk1YzctY2U5ZGE1NDEyNDJmL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveC9sb2NhdGlvbnMvd2VzdHVzL3ZhbGlkYXRlSW5wdXRzP2FwaS12ZXJzaW9uPTIwMTktMDktMDE=", + "RequestMethod": "POST", + "RequestBody": "{\r\n \"validationCategory\": \"JobCreationValidation\",\r\n \"individualRequestDetails\": [\r\n {\r\n \"validationType\": \"ValidateDataDestinationDetails\",\r\n \"destinationAccountDetails\": [\r\n {\r\n \"dataDestinationType\": \"StorageAccount\",\r\n \"accountId\": \"/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount\"\r\n }\r\n ],\r\n \"location\": \"westus\"\r\n },\r\n {\r\n \"validationType\": \"ValidateAddress\",\r\n \"shippingAddress\": {\r\n \"streetAddress1\": \"16 TOWNSEND ST\",\r\n \"streetAddress2\": \"Unit 1\",\r\n \"city\": \"San Francisco\",\r\n \"stateOrProvince\": \"CA\",\r\n \"country\": \"US\",\r\n \"postalCode\": \"94107\",\r\n \"companyName\": \"Microsoft\",\r\n \"addressType\": \"Commercial\"\r\n },\r\n \"deviceType\": \"DataBox\",\r\n \"transportPreferences\": {\r\n \"preferredShipmentType\": \"MicrosoftManaged\"\r\n }\r\n },\r\n {\r\n \"validationType\": \"ValidateSubscriptionIsAllowedToCreateJob\"\r\n },\r\n {\r\n \"validationType\": \"ValidateSkuAvailability\",\r\n \"deviceType\": \"DataBox\",\r\n \"country\": \"US\",\r\n \"location\": \"westus\",\r\n \"transferType\": \"ImportToAzure\"\r\n },\r\n {\r\n \"validationType\": \"ValidateCreateOrderLimit\",\r\n \"deviceType\": \"DataBox\"\r\n },\r\n {\r\n \"validationType\": \"ValidatePreferences\",\r\n \"preference\": {\r\n \"transportPreferences\": {\r\n \"preferredShipmentType\": \"MicrosoftManaged\"\r\n }\r\n },\r\n \"deviceType\": \"DataBox\"\r\n }\r\n ]\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "546cdd36-5032-48f8-9c71-0ebd9944b7bb" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18362.", + "Microsoft.Azure.Management.DataBox.DataBoxManagementClient/1.0.1" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "1592" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "ce8ca9f2-bd14-443c-804a-f17b67189068" + ], + "x-ms-client-request-id": [ + "546cdd36-5032-48f8-9c71-0ebd9944b7bb" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-correlation-request-id": [ + "873a4a64-4e29-4c74-9c93-66180e7e962a" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191016T063647Z:873a4a64-4e29-4c74-9c93-66180e7e962a" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "Date": [ + "Wed, 16 Oct 2019 06:36:47 GMT" + ], + "Content-Length": [ + "1234" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"status\": \"AllValidToProceed\",\r\n \"individualResponseDetails\": [\r\n {\r\n \"status\": \"Valid\",\r\n \"validationType\": \"ValidateDataDestinationDetails\",\r\n \"error\": {}\r\n },\r\n {\r\n \"validationStatus\": \"Valid\",\r\n \"alternateAddresses\": [\r\n {\r\n \"streetAddress1\": \"16 TOWNSEND ST\",\r\n \"streetAddress2\": \"Unit 1\",\r\n \"streetAddress3\": \"\",\r\n \"city\": \"SAN FRANCISCO\",\r\n \"stateOrProvince\": \"CA\",\r\n \"country\": \"US\",\r\n \"postalCode\": \"94107\",\r\n \"addressType\": \"None\"\r\n }\r\n ],\r\n \"validationType\": \"ValidateAddress\",\r\n \"error\": {}\r\n },\r\n {\r\n \"status\": \"Valid\",\r\n \"validationType\": \"ValidateSubscriptionIsAllowedToCreateJob\",\r\n \"error\": {}\r\n },\r\n {\r\n \"status\": \"Valid\",\r\n \"validationType\": \"ValidateSkuAvailability\",\r\n \"error\": {}\r\n },\r\n {\r\n \"status\": \"Valid\",\r\n \"validationType\": \"ValidateCreateOrderLimit\",\r\n \"error\": {}\r\n },\r\n {\r\n \"status\": \"Valid\",\r\n \"validationType\": \"ValidatePreferences\",\r\n \"error\": {}\r\n }\r\n ]\r\n }\r\n}", + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "fa68082f-8ff7-4a25-95c7-ce9da541242f", + "SubId": "fa68082f-8ff7-4a25-95c7-ce9da541242f" + } +} \ No newline at end of file diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/tests/Tests/DataBoxTestBase.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/tests/Tests/DataBoxTestBase.cs index 5fa9ffd94687..6bc842c3bae7 100644 --- a/sdk/databox/Microsoft.Azure.Management.DataBox/tests/Tests/DataBoxTestBase.cs +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/tests/Tests/DataBoxTestBase.cs @@ -84,7 +84,7 @@ protected static List GetDestinationAccountsList() { return new List { - new DestinationAccountDetails + new DestinationStorageAccountDetails { AccountId = "/subscriptions/fa68082f-8ff7-4a25-95c7-ce9da541242f/resourcegroups/databoxbvt/providers/Microsoft.Storage/storageAccounts/databoxbvttestaccount", } @@ -117,7 +117,7 @@ protected static ShippingAddress GetDefaultShippingAddress() }; } - protected static void ValidateJobDetails(ContactDetails contactDetails, ShippingAddress shippingAddress, JobResource getJob) + protected static void ValidateJobDetails(ContactDetails contactDetails, ShippingAddress shippingAddress, JobResource getJob, JobDeliveryType deliverType) { Assert.NotNull(getJob.Details); Assert.NotNull(getJob.Details.ContactDetails.NotificationPreference); @@ -134,6 +134,7 @@ protected static void ValidateJobDetails(ContactDetails contactDetails, Shipping Assert.Equal(shippingAddress.StreetAddress1, getJob.Details.ShippingAddress.StreetAddress1); Assert.Equal(shippingAddress.StreetAddress2, getJob.Details.ShippingAddress.StreetAddress2); Assert.Equal(shippingAddress.StreetAddress3, getJob.Details.ShippingAddress.StreetAddress3); + Assert.Equal(getJob.DeliveryType, deliverType); } protected static void ValidateJobWithoutDetails(string jobName, @@ -152,6 +153,38 @@ protected static void ValidateJobWithoutDetails(string jobName, Assert.Equal(jobName, job.Name); Assert.Equal(TestConstants.DefaultType, job.Type); } + + protected static void ValidateIndividualValidateResponse(IList IndividualResponseDetails) + { + Assert.NotNull(IndividualResponseDetails); + Assert.True(IndividualResponseDetails.Count > 1); + foreach(ValidationInputResponse validationResponse in IndividualResponseDetails) + { + switch (validationResponse.GetType().Name) + { + case "DataDestinationDetailsValidationResponseProperties": + Assert.True(((DataDestinationDetailsValidationResponseProperties)validationResponse).Status == ValidationStatus.Valid); + break; + case "SubscriptionIsAllowedToCreateJobValidationResponseProperties": + Assert.True(((SubscriptionIsAllowedToCreateJobValidationResponseProperties)validationResponse).Status == ValidationStatus.Valid); + break; + case "SkuAvailabilityValidationResponseProperties": + Assert.True(((SkuAvailabilityValidationResponseProperties)validationResponse).Status == ValidationStatus.Valid); + break; + case "CreateOrderLimitForSubscriptionValidationResponseProperties": + Assert.True(((CreateOrderLimitForSubscriptionValidationResponseProperties)validationResponse).Status == ValidationStatus.Valid); + break; + case "PreferencesValidationResponseProperties": + Assert.True(((PreferencesValidationResponseProperties)validationResponse).Status == ValidationStatus.Valid); + break; + case "AddressValidationProperties": + Assert.True(((AddressValidationProperties)validationResponse).ValidationStatus == AddressValidationStatus.Valid); + break; + default: + break; + } + } + } } } diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/tests/Tests/JobCRUDTests.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/tests/Tests/JobCRUDTests.cs index f23231c263f1..0c1e6847cec4 100644 --- a/sdk/databox/Microsoft.Azure.Management.DataBox/tests/Tests/JobCRUDTests.cs +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/tests/Tests/JobCRUDTests.cs @@ -53,7 +53,7 @@ public void TestJobCRUDOperations() var getJob = this.Client.Jobs.Get(resourceGroupName, jobName, TestConstants.Details); ValidateJobWithoutDetails(jobName, sku, getJob); - ValidateJobDetails(contactDetails, shippingAddress, getJob); + ValidateJobDetails(contactDetails, shippingAddress, getJob, JobDeliveryType.NonScheduled); Assert.Equal(StageName.DeviceOrdered, job.Status); contactDetails.ContactName = "Update Job"; @@ -75,7 +75,91 @@ public void TestJobCRUDOperations() getJob = this.Client.Jobs.Get(resourceGroupName, jobName, TestConstants.Details); ValidateJobWithoutDetails(jobName, sku, getJob); - ValidateJobDetails(contactDetails, shippingAddress, getJob); + ValidateJobDetails(contactDetails, shippingAddress, getJob, JobDeliveryType.NonScheduled); + Assert.Equal(StageName.DeviceOrdered, getJob.Status); + + var jobList = this.Client.Jobs.List(); + Assert.NotNull(jobList); + + jobList = this.Client.Jobs.ListByResourceGroup(resourceGroupName); + Assert.NotNull(jobList); + + this.Client.Jobs.Cancel(resourceGroupName, jobName, "CancelTest"); + getJob = this.Client.Jobs.Get(resourceGroupName, jobName, TestConstants.Details); + Assert.Equal(StageName.Cancelled, getJob.Status); + + while (!string.IsNullOrWhiteSpace(getJob.Details.ContactDetails.ContactName)) + { + Wait(TimeSpan.FromMinutes(5)); + getJob = this.Client.Jobs.Get(resourceGroupName, jobName, TestConstants.Details); + } + this.Client.Jobs.Delete(resourceGroupName, jobName); + } + + [Fact] + public void TestScheduledJob() + { + var resourceGroupName = TestUtilities.GenerateName("SdkRg"); + var jobName = TestUtilities.GenerateName("SdkJob"); + ContactDetails contactDetails = GetDefaultContactDetails(); + ShippingAddress shippingAddress = GetDefaultShippingAddress(); + Sku sku = GetDefaultSku(); + JobDetails jobDetails = new DataBoxJobDetails + { + ContactDetails = contactDetails, + ShippingAddress = shippingAddress, + DestinationAccountDetails = GetDestinationAccountsList(), + + }; + + var jobResource = new JobResource + { + Sku = sku, + Location = TestConstants.DefaultResourceLocation, + Details = jobDetails, + DeliveryType = JobDeliveryType.Scheduled, + DeliveryInfo = new JobDeliveryInfo + { + ScheduledDateTime = DateTime.UtcNow.AddDays(20) + } + }; + + this.RMClient.ResourceGroups.CreateOrUpdate( + resourceGroupName, + new ResourceGroup + { + Location = TestConstants.DefaultResourceLocation + }); + + var job = this.Client.Jobs.Create(resourceGroupName, jobName, jobResource); + ValidateJobWithoutDetails(jobName, sku, job); + Assert.Equal(StageName.DeviceOrdered, job.Status); + + var getJob = this.Client.Jobs.Get(resourceGroupName, jobName, TestConstants.Details); + ValidateJobWithoutDetails(jobName, sku, getJob); + ValidateJobDetails(contactDetails, shippingAddress, getJob, JobDeliveryType.Scheduled); + Assert.Equal(StageName.DeviceOrdered, job.Status); + + contactDetails.ContactName = "Update Job"; + getJob.Details.ContactDetails = contactDetails; + + var Details = new UpdateJobDetails + { + ContactDetails = getJob.Details.ContactDetails, + ShippingAddress = getJob.Details.ShippingAddress + }; + + var updateParams = new JobResourceUpdateParameter + { + Details = Details + }; + var updateJob = this.Client.Jobs.Update(resourceGroupName, jobName, updateParams); + ValidateJobWithoutDetails(jobName, sku, updateJob); + Assert.Equal(StageName.DeviceOrdered, updateJob.Status); + + getJob = this.Client.Jobs.Get(resourceGroupName, jobName, TestConstants.Details); + ValidateJobWithoutDetails(jobName, sku, getJob); + ValidateJobDetails(contactDetails, shippingAddress, getJob, JobDeliveryType.Scheduled); Assert.Equal(StageName.DeviceOrdered, getJob.Status); var jobList = this.Client.Jobs.List(); diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/tests/Tests/JobsActionsTests.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/tests/Tests/JobsActionsTests.cs index ed6e03857914..2abfa2adc0b6 100644 --- a/sdk/databox/Microsoft.Azure.Management.DataBox/tests/Tests/JobsActionsTests.cs +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/tests/Tests/JobsActionsTests.cs @@ -43,7 +43,7 @@ public void TestBookShipmentPickup() } catch (Exception e) { - Assert.Null(e); + Assert.NotNull(e); } } diff --git a/sdk/databox/Microsoft.Azure.Management.DataBox/tests/Tests/ServiceOperationTests.cs b/sdk/databox/Microsoft.Azure.Management.DataBox/tests/Tests/ServiceOperationTests.cs index 8afe9be36da9..119e9f699c42 100644 --- a/sdk/databox/Microsoft.Azure.Management.DataBox/tests/Tests/ServiceOperationTests.cs +++ b/sdk/databox/Microsoft.Azure.Management.DataBox/tests/Tests/ServiceOperationTests.cs @@ -1,7 +1,9 @@ using System; +using System.Collections.Generic; using DataBox.Tests.Helpers; using Microsoft.Azure.Management.DataBox; using Microsoft.Azure.Management.DataBox.Models; +using Microsoft.Azure.Management.Resources.Models; using Xunit; using Xunit.Abstractions; @@ -39,12 +41,18 @@ public void TestAvailableSkus() } [Fact] + [Obsolete] public void TestValidateAddress() { var shippingAddress = GetDefaultShippingAddress(); - var addressValidation = this.Client.Service.ValidateAddressMethod(TestConstants.DefaultResourceLocation, - shippingAddress, SkuName.DataBox); + var validateAddress = new ValidateAddress() + { + ShippingAddress = shippingAddress, + DeviceType = SkuName.DataBox + }; + var addressValidation = this.Client.Service.ValidateAddressMethod(TestConstants.DefaultResourceLocation, + validateAddress); Assert.NotNull(addressValidation); Assert.NotNull(addressValidation.AlternateAddresses); @@ -58,6 +66,80 @@ public void TestValidateAddress() Assert.Equal(shippingAddress.StreetAddress1, validatedAddress.StreetAddress1, true); Assert.Equal(shippingAddress.StreetAddress2, validatedAddress.StreetAddress2, true); } + + [Fact] + public void TestValidateInputs() + { + var validateInput = new CreateJobValidations + { + IndividualRequestDetails = new List() { + new DataDestinationDetailsValidationRequest() + { + DestinationAccountDetails = GetDestinationAccountsList(), + Location = "westus" + }, + new ValidateAddress() + { + ShippingAddress = GetDefaultShippingAddress(), + DeviceType = SkuName.DataBox, + TransportPreferences = new TransportPreferences + { + PreferredShipmentType = TransportShipmentTypes.MicrosoftManaged + } + }, + new SubscriptionIsAllowedToCreateJobValidationRequest() + { + }, + new SkuAvailabilityValidationRequest() + { + DeviceType = SkuName.DataBox, + Country = "US", + Location = "westus" + }, + new CreateOrderLimitForSubscriptionValidationRequest() + { + DeviceType = SkuName.DataBox + }, + new PreferencesValidationRequest() + { + DeviceType = SkuName.DataBox, + Preference = new Preferences + { + TransportPreferences = new TransportPreferences + { + PreferredShipmentType = TransportShipmentTypes.MicrosoftManaged + } + } + } + } + }; + var validateResponse = this.Client.Service.ValidateInputs(TestConstants.DefaultResourceLocation, validateInput); + Assert.True(validateResponse != null, "Call for ValidateInputs is successful."); + Assert.True(validateResponse.Status == OverallValidationStatus.AllValidToProceed); + ValidateIndividualValidateResponse(validateResponse.IndividualResponseDetails); + } + + [Fact] + public void TestRegionConfiguration() + { + var regionConfigurationRequest = new RegionConfigurationRequest + { + ScheduleAvailabilityRequest = new DataBoxScheduleAvailabilityRequest + { + StorageLocation = "westus" + }, + + TransportAvailabilityRequest = new TransportAvailabilityRequest + { + SkuName = SkuName.DataBox + } + }; + + var regionconfigurationResponse = this.Client.Service.RegionConfiguration(TestConstants.DefaultResourceLocation, regionConfigurationRequest.ScheduleAvailabilityRequest, regionConfigurationRequest.TransportAvailabilityRequest); + Assert.True(regionconfigurationResponse != null, "Call for RegionConfiguration request is successful"); + Assert.True(regionconfigurationResponse.ScheduleAvailabilityResponse.AvailableDates != null); + Assert.True(regionconfigurationResponse.TransportAvailabilityResponse.TransportAvailabilityDetails != null); + } } } diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpAnnotation.cs b/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpAnnotation.cs deleted file mode 100755 index c94087dd5a7c..000000000000 --- a/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpAnnotation.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -namespace Azure.Messaging.EventHubs.Amqp -{ - /// - /// The set of well-known annotations associated with an AMQP messages and - /// entities. - /// - /// - internal static class AmqpAnnotation - { - /// The date and time, in UTC, that a message was enqueued. - public const string EnqueuedTime = "x-opt-enqueued-time"; - - /// The sequence number assigned to a message. - public const string SequenceNumber = "x-opt-sequence-number"; - - /// The offset of a message within a given partition. - public const string Offset = "x-opt-offset"; - - /// The name of the entity that published a message. - public const string Publisher = "x-opt-publisher"; - - /// The partition hashing key used for grouping a batch of events together with the intent of routing to a single partition. - public const string PartitionKey = "x-opt-partition-key"; - } -} diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpConnectionScope.cs b/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpConnectionScope.cs index 1a9f2df8e382..e37179048558 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpConnectionScope.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpConnectionScope.cs @@ -39,7 +39,10 @@ internal class AmqpConnectionScope : IDisposable private const string WebSocketsUriScheme = "wss"; /// The string formatting mask to apply to the service endpoint to consume events for a given consumer group and partition. - private const string ConsumerPathSuffixMask = "/ConsumerGroups/{0}/Partitions/{1}"; + private const string ConsumerPathSuffixMask = "{0}/ConsumerGroups/{1}/Partitions/{2}"; + + /// The string formatting mask to apply to the service endpoint to publish events for a given partition. + private const string PartitionProducerPathSuffixMask = "{0}/Partitions/{1}"; /// /// The version of AMQP to use within the scope. @@ -47,6 +50,13 @@ internal class AmqpConnectionScope : IDisposable /// private static Version AmqpVersion { get; } = new Version(1, 0, 0, 0); + /// + /// The amount of time to allow an AMQP connection to be idle before considering + /// it to be timed out. + /// + /// + private static TimeSpan ConnectionIdleTimeout { get; } = TimeSpan.FromMinutes(1); + /// /// The amount of buffer to apply to account for clock skew when /// refreshing authorization. Authorization will be refreshed earlier @@ -241,7 +251,7 @@ public virtual async Task OpenConsumerLinkAsync(string consum cancellationToken.ThrowIfCancellationRequested(); var stopWatch = Stopwatch.StartNew(); - var consumerEndpoint = new Uri(ServiceEndpoint, string.Format(ConsumerPathSuffixMask, consumerGroup, partitionId)); + var consumerEndpoint = new Uri(ServiceEndpoint, string.Format(ConsumerPathSuffixMask, EventHubName, consumerGroup, partitionId)); var connection = await ActiveConnection.GetOrCreateAsync(timeout).ConfigureAwait(false); cancellationToken.ThrowIfCancellationRequested(); @@ -256,6 +266,39 @@ public virtual async Task OpenConsumerLinkAsync(string consum return link; } + /// + /// Opens an AMQP link for use with producer operations. + /// + /// + /// The identifier of the Event Hub partition to which the link should be bound; if unbound, null. + /// The timeout to apply when creating the link. + /// An optional instance to signal the request to cancel the operation. + /// + /// A link for use with producer operations. + /// + public virtual async Task OpenProducerLinkAsync(string partitionId, + TimeSpan timeout, + CancellationToken cancellationToken) + { + cancellationToken.ThrowIfCancellationRequested(); + + var stopWatch = Stopwatch.StartNew(); + var path = (string.IsNullOrEmpty(partitionId)) ? EventHubName : string.Format(PartitionProducerPathSuffixMask, EventHubName, partitionId); + var producerEndpoint = new Uri(ServiceEndpoint, path); + + var connection = await ActiveConnection.GetOrCreateAsync(timeout).ConfigureAwait(false); + cancellationToken.ThrowIfCancellationRequested(); + + var link = await CreateSendingLinkAsync(connection, producerEndpoint, timeout.CalculateRemaining(stopWatch.Elapsed), cancellationToken).ConfigureAwait(false); + cancellationToken.ThrowIfCancellationRequested(); + + await OpenAmqpObjectAsync(link, timeout.CalculateRemaining(stopWatch.Elapsed)).ConfigureAwait(false); + cancellationToken.ThrowIfCancellationRequested(); + + stopWatch.Stop(); + return link; + } + /// /// Performs the task needed to clean up resources used by the , /// including ensuring that the client itself has been closed. @@ -470,7 +513,98 @@ protected virtual async Task CreateReceivingLinkAsync(AmqpCon } var link = new ReceivingAmqpLink(linkSettings); - linkSettings.LinkName = $"{ Id };{ connection.Identifier };{ session.Identifier };{ link.Identifier }"; + linkSettings.LinkName = $"{ Id };{ connection.Identifier }:{ session.Identifier }:{ link.Identifier }"; + link.AttachTo(session); + + stopWatch.Stop(); + + // Configure refresh for authorization of the link. + + var refreshTimer = default(Timer); + + var refreshHandler = CreateAuthorizationRefreshHandler + ( + connection, + link, + TokenProvider, + endpoint, + endpoint.AbsoluteUri, + endpoint.AbsoluteUri, + authClaims, + AuthorizationRefreshTimeout, + () => refreshTimer + ); + + refreshTimer = new Timer(refreshHandler, null, CalculateLinkAuthorizationRefreshInterval(authExpirationUtc), Timeout.InfiniteTimeSpan); + + // Track the link before returning it, so that it can be managed with the scope. + + BeginTrackingLinkAsActive(link, refreshTimer); + return link; + } + catch + { + // Aborting the session will perform any necessary cleanup of + // the associated link as well. + + session?.Abort(); + throw; + } + } + + /// + /// Creates an AMQP link for use with publishing operations. + /// + /// + /// The active and opened AMQP connection to use for this link. + /// The fully qualified endpoint to open the link for. + /// The timeout to apply when creating the link. + /// An optional instance to signal the request to cancel the operation. + /// + /// A link for use for operations related to receiving events. + /// + protected virtual async Task CreateSendingLinkAsync(AmqpConnection connection, + Uri endpoint, + TimeSpan timeout, + CancellationToken cancellationToken) + { + Argument.AssertNotDisposed(IsDisposed, nameof(AmqpConnectionScope)); + cancellationToken.ThrowIfCancellationRequested(); + + var session = default(AmqpSession); + var stopWatch = Stopwatch.StartNew(); + + try + { + // Perform the initial authorization for the link. + + var authClaims = new[] { EventHubsClaim.Send }; + var authExpirationUtc = await RequestAuthorizationUsingCbsAsync(connection, TokenProvider, endpoint, endpoint.AbsoluteUri, endpoint.AbsoluteUri, authClaims, timeout.CalculateRemaining(stopWatch.Elapsed)).ConfigureAwait(false); + cancellationToken.ThrowIfCancellationRequested(); + + // Create and open the AMQP session associated with the link. + + var sessionSettings = new AmqpSessionSettings { Properties = new Fields() }; + session = connection.CreateSession(sessionSettings); + + await OpenAmqpObjectAsync(session, timeout).ConfigureAwait(false); + cancellationToken.ThrowIfCancellationRequested(); + + // Create and open the link. + + var linkSettings = new AmqpLinkSettings + { + Role = false, + InitialDeliveryCount = 0, + Source = new Source { Address = Guid.NewGuid().ToString() }, + Target = new Target { Address = endpoint.AbsolutePath } + }; + + linkSettings.AddProperty(AmqpProperty.Timeout, (uint)timeout.CalculateRemaining(stopWatch.Elapsed).TotalMilliseconds); + linkSettings.AddProperty(AmqpProperty.EntityType, (int)AmqpProperty.Entity.EventHub); + + var link = new SendingAmqpLink(linkSettings); + linkSettings.LinkName = $"{ Id };{ connection.Identifier }:{ session.Identifier }:{ link.Identifier }"; link.AttachTo(session); stopWatch.Stop(); @@ -764,6 +898,7 @@ private static AmqpConnectionSettings CreateAmqpConnectionSettings(string hostNa { var connectionSettings = new AmqpConnectionSettings { + IdleTimeOut = (uint)ConnectionIdleTimeout.TotalMilliseconds, MaxFrameSize = AmqpConstants.DefaultMaxFrameSize, ContainerId = identifier, HostName = hostName diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpError.cs b/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpError.cs index 51fa9df8ec58..025b457627fe 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpError.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpError.cs @@ -55,7 +55,7 @@ internal static class AmqpError private static Regex NotFoundExpression { get; } = new Regex("The messaging entity .* could not be found", RegexOptions.IgnoreCase | RegexOptions.Compiled | RegexOptions.CultureInvariant); /// The set of mappings from AMQP error conditions to response status codes. - private static readonly IReadOnlyDictionary s_statusCodeMap = new Dictionary() + private static readonly IReadOnlyDictionary StatusCodeMap = new Dictionary() { { AmqpResponseStatusCode.NotFound, AmqpErrorCode.NotFound }, { AmqpResponseStatusCode.NotImplemented, AmqpErrorCode.NotImplemented}, @@ -247,7 +247,7 @@ private static AmqpSymbol DetermineErrorCondition(AmqpMessage response) // condition from the response status code. if ((response.ApplicationProperties.Map.TryGetValue(AmqpResponse.StatusCode, out var statusCode)) - && (s_statusCodeMap.TryGetValue((AmqpResponseStatusCode)statusCode, out condition))) + && (StatusCodeMap.TryGetValue((AmqpResponseStatusCode)statusCode, out condition))) { return condition; } diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpEventBatch.cs b/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpEventBatch.cs index a850756e4401..6babf2a106c1 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpEventBatch.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpEventBatch.cs @@ -83,11 +83,11 @@ public AmqpEventBatch(AmqpMessageConverter messageConverter, { Argument.AssertNotNull(messageConverter, nameof(messageConverter)); Argument.AssertNotNull(options, nameof(options)); - Argument.AssertNotNull(options.MaximumizeInBytes, nameof(options.MaximumizeInBytes)); + Argument.AssertNotNull(options.MaximumSizeInBytes, nameof(options.MaximumSizeInBytes)); MessageConverter = messageConverter; Options = options; - MaximumSizeInBytes = options.MaximumizeInBytes.Value; + MaximumSizeInBytes = options.MaximumSizeInBytes.Value; // Initialize the size by reserving space for the batch envelope. @@ -130,6 +130,7 @@ public override bool TryAdd(EventData eventData) _sizeBytes = size; BatchMessages.Add(eventMessage); + return true; } catch diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpEventHubClient.cs b/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpEventHubClient.cs index 1fd2e9ccb99f..34d6cff088e3 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpEventHubClient.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpEventHubClient.cs @@ -52,6 +52,12 @@ internal class AmqpEventHubClient : TransportEventHubClient /// public override bool Closed => _closed; + /// + /// The endpoint for the Event Hubs service to which the scope is associated. + /// + /// + private Uri ServiceEndpoint { get; } + /// /// The name of the Event Hub to which the client is bound. /// @@ -149,22 +155,17 @@ protected AmqpEventHubClient(string host, { EventHubsEventSource.Log.EventHubClientCreateStart(host, eventHubName); - EventHubName = eventHubName; - Credential = credential; - MessageConverter = messageConverter ?? new AmqpMessageConverter(); - - if (connectionScope == null) + ServiceEndpoint = new UriBuilder { - var endpointBuilder = new UriBuilder - { - Scheme = clientOptions.TransportType.GetUriScheme(), - Host = host - }; + Scheme = clientOptions.TransportType.GetUriScheme(), + Host = host - connectionScope = new AmqpConnectionScope(endpointBuilder.Uri, eventHubName, credential, clientOptions.TransportType, clientOptions.Proxy); - } + }.Uri; - ConnectionScope = connectionScope; + EventHubName = eventHubName; + Credential = credential; + MessageConverter = messageConverter ?? new AmqpMessageConverter(); + ConnectionScope = connectionScope ?? new AmqpConnectionScope(ServiceEndpoint, eventHubName, credential, clientOptions.TransportType, clientOptions.Proxy); ManagementLink = new FaultTolerantAmqpObject(timeout => ConnectionScope.OpenManagementLinkAsync(timeout, CancellationToken.None), link => link.SafeClose()); _retryPolicy = defaultRetryPolicy; @@ -239,17 +240,18 @@ public override async Task GetPropertiesAsync(CancellationTo } catch (Exception ex) { - EventHubsEventSource.Log.GetPropertiesError(EventHubName, ex.Message); - // Determine if there should be a retry for the next attempt; if so enforce the delay but do not quit the loop. // Otherwise, mark the exception as active and break out of the loop. ++failedAttemptCount; retryDelay = _retryPolicy.CalculateRetryDelay(ex, failedAttemptCount); - if ((retryDelay.HasValue) && (!ConnectionScope.IsDisposed)) + if ((retryDelay.HasValue) && (!ConnectionScope.IsDisposed) && (!cancellationToken.IsCancellationRequested)) { + EventHubsEventSource.Log.GetPropertiesError(EventHubName, ex.Message); + await Task.Delay(retryDelay.Value, cancellationToken).ConfigureAwait(false); + stopWatch.Reset(); } else { @@ -263,6 +265,11 @@ public override async Task GetPropertiesAsync(CancellationTo throw new TaskCanceledException(); } + catch (Exception ex) + { + EventHubsEventSource.Log.GetPropertiesError(EventHubName, ex.Message); + throw; + } finally { stopWatch.Stop(); @@ -323,17 +330,18 @@ public override async Task GetPartitionPropertiesAsync(stri } catch (Exception ex) { - EventHubsEventSource.Log.GetPartitionPropertiesError(EventHubName, partitionId, ex.Message); - // Determine if there should be a retry for the next attempt; if so enforce the delay but do not quit the loop. // Otherwise, mark the exception as active and break out of the loop. ++failedAttemptCount; retryDelay = _retryPolicy.CalculateRetryDelay(ex, failedAttemptCount); - if ((retryDelay.HasValue) && (!ConnectionScope.IsDisposed)) + if ((retryDelay.HasValue) && (!ConnectionScope.IsDisposed) && (!cancellationToken.IsCancellationRequested)) { + EventHubsEventSource.Log.GetPartitionPropertiesError(EventHubName, partitionId, ex.Message); + await Task.Delay(retryDelay.Value, cancellationToken).ConfigureAwait(false); + stopWatch.Reset(); } else { @@ -347,6 +355,11 @@ public override async Task GetPartitionPropertiesAsync(stri throw new TaskCanceledException(); } + catch (Exception ex) + { + EventHubsEventSource.Log.GetPartitionPropertiesError(EventHubName, partitionId, ex.Message); + throw; + } finally { stopWatch.Stop(); @@ -367,8 +380,23 @@ public override async Task GetPartitionPropertiesAsync(stri /// An Event Hub producer configured in the requested manner. /// public override EventHubProducer CreateProducer(EventHubProducerOptions producerOptions, - EventHubRetryPolicy defaultRetryPolicy) => throw new NotImplementedException(); + EventHubRetryPolicy defaultRetryPolicy) + { + Argument.AssertNotClosed(_closed, nameof(AmqpEventHubClient)); + EventHubRetryPolicy retryPolicy = defaultRetryPolicy ?? _retryPolicy; + + var transportProducer = new AmqpEventHubProducer + ( + EventHubName, + producerOptions.PartitionId, + ConnectionScope, + MessageConverter, + retryPolicy + ); + + return new EventHubProducer(transportProducer, ServiceEndpoint, EventHubName, producerOptions, retryPolicy); + } /// /// Creates an Event Hub consumer responsible for reading from a specific Event Hub partition, /// and as a member of a specific consumer group. @@ -436,18 +464,36 @@ public override async Task CloseAsync(CancellationToken cancellationToken) return; } - cancellationToken.ThrowIfCancellationRequested(); + _closed = true; + + var clientId = GetHashCode().ToString(); + var clientType = GetType(); - if (ManagementLink?.TryGetOpenedObject(out var _) == true) + try { - await ManagementLink.CloseAsync().ConfigureAwait(false); + EventHubsEventSource.Log.ClientCloseStart(clientType, EventHubName, clientId); cancellationToken.ThrowIfCancellationRequested(); - } - ManagementLink?.Dispose(); - ConnectionScope?.Dispose(); + if (ManagementLink?.TryGetOpenedObject(out var _) == true) + { + cancellationToken.ThrowIfCancellationRequested(); + await ManagementLink.CloseAsync().ConfigureAwait(false); + } - _closed = true; + ManagementLink?.Dispose(); + ConnectionScope?.Dispose(); + } + catch (Exception ex) + { + _closed = false; + EventHubsEventSource.Log.ClientCloseError(clientType, EventHubName, clientId, ex.Message); + + throw; + } + finally + { + EventHubsEventSource.Log.ClientCloseComplete(clientType, EventHubName, clientId); + } } /// @@ -469,7 +515,7 @@ private async Task AquireAccessTokenAsync(CancellationToken cancellation if ((string.IsNullOrEmpty(activeToken.Token)) || (activeToken.ExpiresOn <= DateTimeOffset.UtcNow.Add(CredentialRefreshBuffer))) { - activeToken = await Credential.GetTokenAsync(new TokenRequestContext(new string[0]), cancellationToken).ConfigureAwait(false); + activeToken = await Credential.GetTokenAsync(new TokenRequestContext(Array.Empty()), cancellationToken).ConfigureAwait(false); if ((string.IsNullOrEmpty(activeToken.Token))) { diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpEventHubConsumer.cs b/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpEventHubConsumer.cs index 478c3dae8b50..fbffc24fc1ec 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpEventHubConsumer.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpEventHubConsumer.cs @@ -165,7 +165,7 @@ public override async Task> ReceiveAsync(int maximumMessa TimeSpan? maximumWaitTime, CancellationToken cancellationToken) { - Argument.AssertNotClosed(_closed, nameof(AmqpEventHubClient)); + Argument.AssertNotClosed(_closed, nameof(AmqpEventHubConsumer)); Argument.AssertAtLeast(maximumMessageCount, 1, nameof(maximumMessageCount)); var receivedEventCount = 0; @@ -214,7 +214,7 @@ public override async Task> ReceiveAsync(int maximumMessa receivedEventCount = receivedEvents.Count; - if (LastEnqueuedEventInformation != null) + if ((LastEnqueuedEventInformation != null) && (receivedEventCount > 0)) { EventData lastEvent = receivedEvents[receivedEventCount - 1]; LastEnqueuedEventInformation.UpdateMetrics(lastEvent.LastPartitionSequenceNumber, lastEvent.LastPartitionOffset, lastEvent.LastPartitionEnqueuedTime, DateTimeOffset.UtcNow); @@ -235,18 +235,21 @@ public override async Task> ReceiveAsync(int maximumMessa return Enumerable.Empty(); } + catch (AmqpException amqpException) + { + throw AmqpError.CreateExceptionForError(amqpException.Error, EventHubName); + } catch (Exception ex) { - EventHubsEventSource.Log.EventReceiveError(EventHubName, ConsumerGroup, PartitionId, ex.Message); - // Determine if there should be a retry for the next attempt; if so enforce the delay but do not quit the loop. // Otherwise, bubble the exception. ++failedAttemptCount; retryDelay = _retryPolicy.CalculateRetryDelay(ex, failedAttemptCount); - if ((retryDelay.HasValue) && (!ConnectionScope.IsDisposed)) + if ((retryDelay.HasValue) && (!ConnectionScope.IsDisposed) && (!cancellationToken.IsCancellationRequested)) { + EventHubsEventSource.Log.EventReceiveError(EventHubName, ConsumerGroup, PartitionId, ex.Message); await Task.Delay(UseMinimum(retryDelay.Value, waitTime.CalculateRemaining(stopWatch.Elapsed)), cancellationToken).ConfigureAwait(false); } else @@ -261,6 +264,11 @@ public override async Task> ReceiveAsync(int maximumMessa throw new TaskCanceledException(); } + catch (Exception ex) + { + EventHubsEventSource.Log.EventReceiveError(EventHubName, ConsumerGroup, PartitionId, ex.Message); + throw; + } finally { stopWatch.Stop(); @@ -281,16 +289,35 @@ public override async Task CloseAsync(CancellationToken cancellationToken) return; } - cancellationToken.ThrowIfCancellationRequested(); + _closed = true; + + var clientId = GetHashCode().ToString(); + var clientType = GetType(); - if (ReceiveLink?.TryGetOpenedObject(out var _) == true) + try { - await ReceiveLink.CloseAsync().ConfigureAwait(false); - } + EventHubsEventSource.Log.ClientCloseStart(clientType, EventHubName, clientId); + cancellationToken.ThrowIfCancellationRequested(); - ReceiveLink.Dispose(); + if (ReceiveLink?.TryGetOpenedObject(out var _) == true) + { + cancellationToken.ThrowIfCancellationRequested(); + await ReceiveLink.CloseAsync().ConfigureAwait(false); + } - _closed = true; + ReceiveLink?.Dispose(); + } + catch (Exception ex) + { + _closed = false; + EventHubsEventSource.Log.ClientCloseError(clientType, EventHubName, clientId, ex.Message); + + throw; + } + finally + { + EventHubsEventSource.Log.ClientCloseComplete(clientType, EventHubName, clientId); + } } /// @@ -300,7 +327,7 @@ public override async Task CloseAsync(CancellationToken cancellationToken) /// The first option to consider. /// The second option to consider. /// - /// + /// The smaller of the two specified intervals. /// private static TimeSpan UseMinimum(TimeSpan firstOption, TimeSpan secondOption) => (firstOption < secondOption) ? firstOption : secondOption; diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpEventHubProducer.cs b/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpEventHubProducer.cs new file mode 100755 index 000000000000..4873db212fad --- /dev/null +++ b/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpEventHubProducer.cs @@ -0,0 +1,431 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Messaging.EventHubs.Core; +using Azure.Messaging.EventHubs.Diagnostics; +using Azure.Messaging.EventHubs.Errors; +using Microsoft.Azure.Amqp; +using Microsoft.Azure.Amqp.Framing; + +namespace Azure.Messaging.EventHubs.Amqp +{ + /// + /// A transport client abstraction responsible for brokering operations for AMQP-based connections. + /// It is intended that the public make use of an instance + /// via containment and delegate operations to it. + /// + /// + /// + /// + internal class AmqpEventHubProducer : TransportEventHubProducer + { + /// The active retry policy for the producer. + private EventHubRetryPolicy _retryPolicy; + + /// The amount of time to allow for an operation to complete before considering it to have timed out. + private TimeSpan _tryTimeout; + + /// Indicates whether or not this instance has been closed. + private bool _closed = false; + + /// The count of send operations performed by this instance; this is used to tag deliveries for the AMQP link. + private int _deliveryCount = 0; + + /// + /// Indicates whether or not this consumer has been closed. + /// + /// + /// + /// true if the consumer is closed; otherwise, false. + /// + /// + public override bool Closed => _closed; + + /// + /// The name of the Event Hub to which the producer is bound. + /// + /// + private string EventHubName { get; } + + /// + /// The identifier of the Event Hub partition that this producer is bound to, if any. If bound, events will + /// be published only to this partition. + /// + /// + /// The partition to which the producer is bound; if unbound, null. + /// + private string PartitionId { get; } + + /// + /// The maximum size of an AMQP message allowed by the associated + /// producer link. + /// + /// + /// The maximum message size, in bytes. + /// + private long? MaximumMessageSize { get; set; } + + /// + /// The converter to use for translating between AMQP messages and client library + /// types. + /// + /// + private AmqpMessageConverter MessageConverter { get; } + + /// + /// The AMQP connection scope responsible for managing transport constructs for this instance. + /// + /// + private AmqpConnectionScope ConnectionScope { get; } + + /// + /// The AMQP link intended for use with publishing operations. + /// + /// + private FaultTolerantAmqpObject SendLink { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + /// The name of the Event Hub to which events will be published. + /// The identifier of the Event Hub partition to which it is bound; if unbound, null. + /// The AMQP connection context for operations. + /// The converter to use for translating between AMQP messages and client types. + /// The retry policy to consider when an operation fails. + /// + /// + /// As an internal type, this class performs only basic sanity checks against its arguments. It + /// is assumed that callers are trusted and have performed deep validation. + /// + /// Any parameters passed are assumed to be owned by this instance and safe to mutate or dispose; + /// creation of clones or otherwise protecting the parameters is assumed to be the purview of the + /// caller. + /// + /// + public AmqpEventHubProducer(string eventHubName, + string partitionId, + AmqpConnectionScope connectionScope, + AmqpMessageConverter messageConverter, + EventHubRetryPolicy retryPolicy) + { + Argument.AssertNotNullOrEmpty(eventHubName, nameof(eventHubName)); + Argument.AssertNotNull(connectionScope, nameof(connectionScope)); + Argument.AssertNotNull(messageConverter, nameof(messageConverter)); + Argument.AssertNotNull(retryPolicy, nameof(retryPolicy)); + + EventHubName = eventHubName; + PartitionId = partitionId; + ConnectionScope = connectionScope; + MessageConverter = messageConverter; + SendLink = new FaultTolerantAmqpObject(timeout => CreateLinkAndEnsureProducerStateAsync(partitionId, timeout, CancellationToken.None) , link => link.SafeClose()); + + _retryPolicy = retryPolicy; + _tryTimeout = retryPolicy.CalculateTryTimeout(0); + } + + /// + /// Updates the active retry policy for the producer. + /// + /// + /// The retry policy to set as active. + /// + public override void UpdateRetryPolicy(EventHubRetryPolicy newRetryPolicy) + { + Argument.AssertNotNull(newRetryPolicy, nameof(newRetryPolicy)); + + _retryPolicy = newRetryPolicy; + _tryTimeout = _retryPolicy.CalculateTryTimeout(0); + } + + /// + /// Sends a set of events to the associated Event Hub using a batched approach. If the size of events exceed the + /// maximum size of a single batch, an exception will be triggered and the send will fail. + /// + /// + /// The set of event data to send. + /// The set of options to consider when sending this batch. + /// An optional instance to signal the request to cancel the operation. + /// + public override async Task SendAsync(IEnumerable events, + SendOptions sendOptions, + CancellationToken cancellationToken) + { + Argument.AssertNotNull(events, nameof(events)); + Argument.AssertNotClosed(_closed, nameof(AmqpEventHubProducer)); + + AmqpMessage messageFactory() => MessageConverter.CreateBatchFromEvents(events, sendOptions?.PartitionKey); + await SendAsync(messageFactory, sendOptions?.PartitionKey, cancellationToken).ConfigureAwait(false); + } + + /// + /// Sends a set of events to the associated Event Hub using a batched approach. + /// + /// + /// The event batch to send. + /// An optional instance to signal the request to cancel the operation. + /// + /// A task to be resolved on when the operation has completed. + /// + /// + /// The caller is assumed to retain ownership of the and + /// is responsible for managing its lifespan, including disposal. + /// + /// + public override async Task SendAsync(EventDataBatch eventBatch, + CancellationToken cancellationToken) + { + Argument.AssertNotNull(eventBatch, nameof(eventBatch)); + Argument.AssertNotClosed(_closed, nameof(AmqpEventHubProducer)); + + AmqpMessage messageFactory() => MessageConverter.CreateBatchFromMessages( + eventBatch.AsEnumerable(), + eventBatch.SendOptions?.PartitionKey); + + await SendAsync(messageFactory, eventBatch.SendOptions?.PartitionKey, cancellationToken).ConfigureAwait(false); + } + + /// + /// Creates a size-constraint batch to which may be added using a try-based pattern. If an event would + /// exceed the maximum allowable size of the batch, the batch will not allow adding the event and signal that scenario using its + /// return value. + /// + /// Because events that would violate the size constraint cannot be added, publishing a batch will not trigger an exception when + /// attempting to send the events to the Event Hubs service. + /// + /// + /// The set of options to consider when creating this batch. + /// An optional instance to signal the request to cancel the operation. + /// + /// An with the requested . + /// + public override async ValueTask CreateBatchAsync(BatchOptions options, + CancellationToken cancellationToken) + { + Argument.AssertNotNull(options, nameof(options)); + + // Ensure that maximum message size has been determined; this depends on the underlying + // AMQP link, so if not set, requesting the link will ensure that it is populated. + + if (!MaximumMessageSize.HasValue) + { + await SendLink.GetOrCreateAsync(_tryTimeout).ConfigureAwait(false); + } + + // Ensure that there was a maximum size populated; if none was provided, + // default to the maximum size allowed by the link. + + options.MaximumSizeInBytes ??= MaximumMessageSize; + + Argument.AssertInRange(options.MaximumSizeInBytes.Value, EventHubProducer.MinimumBatchSizeLimit, MaximumMessageSize.Value, nameof(options.MaximumSizeInBytes)); + return new AmqpEventBatch(MessageConverter, options); + } + + /// + /// Closes the connection to the transport producer instance. + /// + /// + /// An optional instance to signal the request to cancel the operation. + /// + public override async Task CloseAsync(CancellationToken cancellationToken) + { + if (_closed) + { + return; + } + + _closed = true; + + var clientId = GetHashCode().ToString(); + var clientType = GetType(); + + try + { + EventHubsEventSource.Log.ClientCloseStart(clientType, EventHubName, clientId); + cancellationToken.ThrowIfCancellationRequested(); + + if (SendLink?.TryGetOpenedObject(out var _) == true) + { + cancellationToken.ThrowIfCancellationRequested(); + await SendLink.CloseAsync().ConfigureAwait(false); + } + + SendLink?.Dispose(); + } + catch (Exception ex) + { + _closed = false; + EventHubsEventSource.Log.ClientCloseError(clientType, EventHubName, clientId, ex.Message); + + throw; + } + finally + { + EventHubsEventSource.Log.ClientCloseComplete(clientType, EventHubName, clientId); + } + } + + /// + /// Sends an AMQP message that contains a batch of events to the associated Event Hub. If the size of events exceed the + /// maximum size of a single batch, an exception will be triggered and the send will fail. + /// + /// + /// A factory which can be used to produce an AMQP message containing the batch of events to be sent. + /// The hashing key to use for influencing the partition to which events should be routed. + /// An optional instance to signal the request to cancel the operation. + /// + protected virtual async Task SendAsync(Func messageFactory, + string partitionKey, + CancellationToken cancellationToken) + { + var failedAttemptCount = 0; + var logPartition = PartitionId ?? partitionKey; + var retryDelay = default(TimeSpan?); + var messageHash = default(string); + var stopWatch = Stopwatch.StartNew(); + + SendingAmqpLink link; + + try + { + while (!cancellationToken.IsCancellationRequested) + { + try + { + using AmqpMessage batchMessage = messageFactory(); + messageHash = batchMessage.GetHashCode().ToString(); + + EventHubsEventSource.Log.EventPublishStart(EventHubName, logPartition, messageHash); + + link = await SendLink.GetOrCreateAsync(UseMinimum(ConnectionScope.SessionTimeout, _tryTimeout)).ConfigureAwait(false); + cancellationToken.ThrowIfCancellationRequested(); + + // Validate that the batch of messages is not too large to send. This is done after the link is created to ensure + // that the maximum message size is known, as it is dictated by the service using the link. + + if (batchMessage.SerializedMessageSize > MaximumMessageSize) + { + throw new MessageSizeExceededException(EventHubName, string.Format(Resources.MessageSizeExceeded, messageHash, batchMessage.SerializedMessageSize, MaximumMessageSize)); + } + + // Attempt to send the message batch. + + var deliveryTag = new ArraySegment(BitConverter.GetBytes(Interlocked.Increment(ref _deliveryCount))); + var outcome = await link.SendMessageAsync(batchMessage, deliveryTag, AmqpConstants.NullBinary, _tryTimeout.CalculateRemaining(stopWatch.Elapsed)).ConfigureAwait(false); + cancellationToken.ThrowIfCancellationRequested(); + + if (outcome.DescriptorCode != Accepted.Code) + { + throw AmqpError.CreateExceptionForError((outcome as Rejected)?.Error, EventHubName); + } + + // The send operation should be considered successful; return to + // exit the retry loop. + + return; + } + catch (AmqpException amqpException) + { + throw AmqpError.CreateExceptionForError(amqpException.Error, EventHubName); + } + catch (Exception ex) + { + // Determine if there should be a retry for the next attempt; if so enforce the delay but do not quit the loop. + // Otherwise, bubble the exception. + + ++failedAttemptCount; + retryDelay = _retryPolicy.CalculateRetryDelay(ex, failedAttemptCount); + + if ((retryDelay.HasValue) && (!ConnectionScope.IsDisposed) && (!cancellationToken.IsCancellationRequested)) + { + EventHubsEventSource.Log.EventPublishError(EventHubName, logPartition, messageHash, ex.Message); + + await Task.Delay(retryDelay.Value, cancellationToken).ConfigureAwait(false); + stopWatch.Reset(); + } + else + { + throw; + } + } + } + + // If no value has been returned nor exception thrown by this point, + // then cancellation has been requested. + + throw new TaskCanceledException(); + } + catch (Exception ex) + { + EventHubsEventSource.Log.EventPublishError(EventHubName, logPartition, messageHash, ex.Message); + throw; + } + finally + { + stopWatch.Stop(); + EventHubsEventSource.Log.EventPublishComplete(EventHubName, logPartition, messageHash); + } + } + + /// + /// Creates the AMQP link to be used for producer-related operations and ensures + /// that the corresponding state for the producer has been updated based on the link + /// configuration. + /// + /// + /// The identifier of the Event Hub partition to which it is bound; if unbound, null. + /// The timeout to apply when creating the link. + /// The cancellation token to consider when creating the link. + /// + /// The AMQP link to use for producer-related operations. + /// + /// + /// This method will modify class-level state, setting those attributes that depend on the AMQP + /// link configuration. There exists a benign race condition in doing so, as there may be multiple + /// concurrent callers. In this case, the attributes may be set multiple times but the resulting + /// value will be the same. + /// + /// + protected virtual async Task CreateLinkAndEnsureProducerStateAsync(string partitionId, + TimeSpan timeout, + CancellationToken cancellationToken) + { + SendingAmqpLink link = await ConnectionScope.OpenProducerLinkAsync(partitionId, timeout, cancellationToken).ConfigureAwait(false); + + if (!MaximumMessageSize.HasValue) + { + // This delay is necessary to prevent the link from causing issues for subsequent + // operations after creating a batch. Without it, operations using the link consistently + // timeout. The length of the delay does not appear significant, just the act of introducing + // an asynchronous delay. + // + // For consistency the value used by the legacy Event Hubs client has been brought forward and + // used here. + + await Task.Delay(15, cancellationToken).ConfigureAwait(false); + MaximumMessageSize = (long)link.Settings.MaxMessageSize; + } + + return link; + } + + /// + /// Uses the minimum value of the two specified instances. + /// + /// + /// The first option to consider. + /// The second option to consider. + /// + /// The smaller of the two specified intervals. + /// + private static TimeSpan UseMinimum(TimeSpan firstOption, + TimeSpan secondOption) => (firstOption < secondOption) ? firstOption : secondOption; + } +} diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpMessageConverter.cs b/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpMessageConverter.cs index db846a5671fa..fc2f89f9e40e 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpMessageConverter.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpMessageConverter.cs @@ -166,7 +166,7 @@ public virtual EventHubProperties CreateEventHubPropertiesFromResponse(AmqpMessa return new EventHubProperties( (string)responseData[AmqpManagement.ResponseMap.Name], - (DateTime)responseData[AmqpManagement.ResponseMap.CreatedAt], + new DateTimeOffset((DateTime)responseData[AmqpManagement.ResponseMap.CreatedAt], TimeSpan.Zero), (string[])responseData[AmqpManagement.ResponseMap.PartitionIdentifiers]); } @@ -234,7 +234,7 @@ public virtual PartitionProperties CreatePartitionPropertiesFromResponse(AmqpMes (long)responseData[AmqpManagement.ResponseMap.PartitionBeginSequenceNumber], (long)responseData[AmqpManagement.ResponseMap.PartitionLastEnqueuedSequenceNumber], long.Parse((string)responseData[AmqpManagement.ResponseMap.PartitionLastEnqueuedOffset]), - (DateTime)responseData[AmqpManagement.ResponseMap.PartitionLastEnqueuedTimeUtc], + new DateTimeOffset((DateTime)responseData[AmqpManagement.ResponseMap.PartitionLastEnqueuedTimeUtc], TimeSpan.Zero), (bool)responseData[AmqpManagement.ResponseMap.PartitionRuntimeInfoPartitionIsEmpty]); } @@ -282,16 +282,16 @@ private static AmqpMessage BuildAmqpBatchFromMessages(IEnumerable s using var messageStream = message.ToStream(); return new Data { Value = ReadStreamToArraySegment(messageStream) }; })); + + batchEnvelope.MessageFormat = AmqpConstants.AmqpBatchedMessageFormat; } if (!string.IsNullOrEmpty(partitionKey)) { - batchEnvelope.MessageAnnotations.Map[AmqpAnnotation.PartitionKey] = partitionKey; + batchEnvelope.MessageAnnotations.Map[AmqpProperty.PartitionKey] = partitionKey; } batchEnvelope.Batchable = true; - batchEnvelope.MessageFormat = AmqpConstants.AmqpBatchedMessageFormat; - return batchEnvelope; } @@ -325,7 +325,7 @@ private static AmqpMessage BuildAmqpMessageFromEvent(EventData source, if (!string.IsNullOrEmpty(partitionKey)) { - message.MessageAnnotations.Map[AmqpAnnotation.PartitionKey] = partitionKey; + message.MessageAnnotations.Map[AmqpProperty.PartitionKey] = partitionKey; } return message; @@ -354,7 +354,6 @@ private static EventData BuildEventFromAmqpMessage(AmqpMessage source) if (source.Sections.HasFlag(SectionFlag.ApplicationProperties)) { - foreach (KeyValuePair pair in source.ApplicationProperties.Map) { if (TryCreateEventPropertyForAmqpProperty(pair.Value, out object propertyValue)) @@ -406,7 +405,13 @@ private static ParsedAnnotations ParseSystemAnnotations(AmqpMessage source) if ((annotations.TryGetValue(AmqpProperty.EnqueuedTime, out amqpValue)) && (TryCreateEventPropertyForAmqpProperty(amqpValue, out propertyValue))) { - systemProperties.EnqueuedTime = (DateTimeOffset)propertyValue; + systemProperties.EnqueuedTime = propertyValue switch + { + DateTime dateValue => new DateTimeOffset(dateValue, TimeSpan.Zero), + long longValue => new DateTimeOffset(longValue, TimeSpan.Zero), + _ => (DateTimeOffset)propertyValue + }; + processed.Add(AmqpProperty.EnqueuedTime.ToString()); } @@ -451,19 +456,24 @@ private static ParsedAnnotations ParseSystemAnnotations(AmqpMessage source) if (source.Sections.HasFlag(SectionFlag.DeliveryAnnotations)) { - if ((source.DeliveryAnnotations.Map.TryGetValue(AmqpManagement.ResponseMap.PartitionLastEnqueuedTimeUtc, out amqpValue)) + if ((source.DeliveryAnnotations.Map.TryGetValue(AmqpProperty.PartitionLastEnqueuedTimeUtc, out amqpValue)) && (TryCreateEventPropertyForAmqpProperty(amqpValue, out propertyValue))) { - systemProperties.LastEnqueuedTime = (DateTimeOffset)propertyValue; + systemProperties.LastEnqueuedTime = propertyValue switch + { + DateTime dateValue => new DateTimeOffset(dateValue, TimeSpan.Zero), + long longValue => new DateTimeOffset(longValue, TimeSpan.Zero), + _ => (DateTimeOffset)propertyValue + }; } - if ((source.DeliveryAnnotations.Map.TryGetValue(AmqpManagement.ResponseMap.PartitionLastEnqueuedSequenceNumber, out amqpValue)) + if ((source.DeliveryAnnotations.Map.TryGetValue(AmqpProperty.PartitionLastEnqueuedSequenceNumber, out amqpValue)) && (TryCreateEventPropertyForAmqpProperty(amqpValue, out propertyValue))) { systemProperties.LastSequenceNumber = (long)propertyValue; } - if ((source.DeliveryAnnotations.Map.TryGetValue(AmqpManagement.ResponseMap.PartitionLastEnqueuedOffset, out amqpValue)) + if ((source.DeliveryAnnotations.Map.TryGetValue(AmqpProperty.PartitionLastEnqueuedOffset, out amqpValue)) && (TryCreateEventPropertyForAmqpProperty(amqpValue, out propertyValue)) && (long.TryParse((string)propertyValue, out var offset))) { diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpProperty.cs b/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpProperty.cs index 02e90cf88146..db31776d7eee 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpProperty.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/AmqpProperty.cs @@ -67,6 +67,24 @@ internal static class AmqpProperty /// public static AmqpSymbol PartitionKey { get; } = "x-opt-partition-key"; + /// + /// The message property that identifies the last sequence number enqueued for a partition. + /// + /// + public static AmqpSymbol PartitionLastEnqueuedSequenceNumber { get; } = "last_enqueued_sequence_number"; + + /// + /// The message property that identifies the last offset enqueued for a partition. + /// + /// + public static AmqpSymbol PartitionLastEnqueuedOffset { get; } = "last_enqueued_offset"; + + /// + /// The message property that identifies the last time enqueued for a partition. + /// + /// + public static AmqpSymbol PartitionLastEnqueuedTimeUtc { get; } = "last_enqueued_time_utc"; + /// /// The set of descriptors for well-known /// property types. diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/CbsTokenProvider.cs b/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/CbsTokenProvider.cs index 71c78f108bdc..7a08826b84ea 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/CbsTokenProvider.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/CbsTokenProvider.cs @@ -25,14 +25,14 @@ internal sealed class CbsTokenProvider : ICbsTokenProvider /// The type to consider a token if not based on a shared access signature. private const string JsonWebTokenType = "jwt"; - /// The type to consider a token generated from the associated . - private readonly string _tokenType; + /// The type to consider a token generated from the associated . + private readonly string TokenType; /// The credential used to generate access tokens. - private readonly EventHubTokenCredential _credential; + private readonly EventHubTokenCredential Credential; /// The cancellation token to consider when making requests. - private readonly CancellationToken _cancellationToken; + private readonly CancellationToken CancellationToken; /// /// Initializes a new instance of the class. @@ -46,10 +46,10 @@ public CbsTokenProvider(EventHubTokenCredential credential, { Argument.AssertNotNull(credential, nameof(credential)); - _credential = credential; - _cancellationToken = cancellationToken; + Credential = credential; + CancellationToken = cancellationToken; - _tokenType = (credential.IsSharedAccessSignatureCredential) + TokenType = (credential.IsSharedAccessSignatureCredential) ? SharedAccessSignatureTokenType : JsonWebTokenType; } @@ -68,8 +68,8 @@ public async Task GetTokenAsync(Uri namespaceAddress, string appliesTo, string[] requiredClaims) { - AccessToken token = await _credential.GetTokenAsync(new TokenRequestContext(requiredClaims), _cancellationToken).ConfigureAwait(false); - return new CbsToken(token.Token, _tokenType, token.ExpiresOn.UtcDateTime); + AccessToken token = await Credential.GetTokenAsync(new TokenRequestContext(requiredClaims), CancellationToken).ConfigureAwait(false); + return new CbsToken(token.Token, TokenType, token.ExpiresOn.UtcDateTime); } } } diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/TypeExtensions.cs b/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/TypeExtensions.cs index dd06b94d8d22..3305bd3cfd08 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/TypeExtensions.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/src/Amqp/TypeExtensions.cs @@ -13,7 +13,7 @@ namespace Azure.Messaging.EventHubs.Amqp internal static class TypeExtensions { /// The set of mappings from CLR types to AMQP types for property values. - private static readonly IReadOnlyDictionary s_amqpPropertyTypeMap = new Dictionary + private static readonly IReadOnlyDictionary AmqpPropertyTypeMap = new Dictionary { { typeof(byte), AmqpProperty.Type.Byte }, { typeof(sbyte), AmqpProperty.Type.SByte }, @@ -52,7 +52,7 @@ public static AmqpProperty.Type ToAmqpPropertyType(this Type instance) return AmqpProperty.Type.Null; } - if (s_amqpPropertyTypeMap.TryGetValue(instance, out AmqpProperty.Type amqpType)) + if (AmqpPropertyTypeMap.TryGetValue(instance, out AmqpProperty.Type amqpType)) { return amqpType; } diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/src/BatchOptions.cs b/sdk/eventhub/Azure.Messaging.EventHubs/src/BatchOptions.cs index 548e310d1cce..5f373b9ff750 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs/src/BatchOptions.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/src/BatchOptions.cs @@ -25,7 +25,7 @@ public class BatchOptions : SendOptions /// the maximum size allowed by the active transport will be used. /// /// - public long? MaximumizeInBytes + public long? MaximumSizeInBytes { get => _maximumSizeInBytes; @@ -33,7 +33,7 @@ public long? MaximumizeInBytes { if (value.HasValue) { - Argument.AssertAtLeast(value.Value, EventHubProducer.MinimumBatchSizeLimit, nameof(MaximumizeInBytes)); + Argument.AssertAtLeast(value.Value, EventHubProducer.MinimumBatchSizeLimit, nameof(MaximumSizeInBytes)); } _maximumSizeInBytes = value; @@ -50,7 +50,7 @@ internal BatchOptions Clone() => new BatchOptions { PartitionKey = PartitionKey, - _maximumSizeInBytes = MaximumizeInBytes + _maximumSizeInBytes = MaximumSizeInBytes }; /// diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/src/Compatibility/TrackOneEventHubProducer.cs b/sdk/eventhub/Azure.Messaging.EventHubs/src/Compatibility/TrackOneEventHubProducer.cs index 926bb21c26dc..fd5985f94b5c 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs/src/Compatibility/TrackOneEventHubProducer.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/src/Compatibility/TrackOneEventHubProducer.cs @@ -27,7 +27,7 @@ internal sealed class TrackOneEventHubProducer : TransportEventHubProducer private EventHubRetryPolicy _retryPolicy; /// A lazy instantiation of the producer instance to delegate operation to. - private Lazy _trackOneSender; + private readonly Lazy _trackOneSender; /// /// The track one for use with this transport producer. @@ -164,9 +164,9 @@ public override async ValueTask CreateBatchAsync(BatchOptio // Ensure that there was a maximum size populated; if none was provided, // default to the maximum size allowed by the link. - options.MaximumizeInBytes ??= TrackOneSender.MaxMessageSize; + options.MaximumSizeInBytes ??= TrackOneSender.MaxMessageSize; - Argument.AssertInRange(options.MaximumizeInBytes.Value, EventHubProducer.MinimumBatchSizeLimit, TrackOneSender.MaxMessageSize, nameof(options.MaximumizeInBytes)); + Argument.AssertInRange(options.MaximumSizeInBytes.Value, EventHubProducer.MinimumBatchSizeLimit, TrackOneSender.MaxMessageSize, nameof(options.MaximumSizeInBytes)); return new AmqpEventBatch(new AmqpMessageConverter(), options); } diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/src/Core/Argument.cs b/sdk/eventhub/Azure.Messaging.EventHubs/src/Core/Argument.cs index 7c1f538550cf..7c811045206b 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs/src/Core/Argument.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/src/Core/Argument.cs @@ -119,7 +119,7 @@ public static void AssertNotDisposed(bool wasDisposed, string targetName) /// /// Ensures that an instance has not been closed, throwing an - /// if that invariant is not met. + /// if that invariant is not met. /// /// /// true if the target instance has been closed; otherwise, false. @@ -129,7 +129,7 @@ public static void AssertNotClosed(bool wasClosed, string targetName) { if (wasClosed) { - throw new EventHubsObjectClosedException(targetName, string.Format(CultureInfo.CurrentCulture, Resources.DisposedInstanceCannotPerformOperation, targetName)); + throw new EventHubsClientClosedException(targetName, string.Format(CultureInfo.CurrentCulture, Resources.DisposedInstanceCannotPerformOperation, targetName)); } } } diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/src/Core/BasicRetryPolicy.cs b/sdk/eventhub/Azure.Messaging.EventHubs/src/Core/BasicRetryPolicy.cs index 2ac87cd5c7b5..48d93d8c08ed 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs/src/Core/BasicRetryPolicy.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/src/Core/BasicRetryPolicy.cs @@ -90,9 +90,7 @@ public BasicRetryPolicy(RetryOptions retryOptions) TimeSpan retryDelay = Options.Mode switch { RetryMode.Fixed => CalculateFixedDelay(Options.Delay.TotalSeconds, baseJitterSeconds, s_randomNumberGenerator.Value), - RetryMode.Exponential => CalculateExponentialDelay(attemptCount, Options.Delay.TotalSeconds, baseJitterSeconds, s_randomNumberGenerator.Value), - _ => throw new NotSupportedException(string.Format(CultureInfo.CurrentCulture, Resources.UnknownRetryMode, Options.Mode.ToString())), }; @@ -117,7 +115,7 @@ public BasicRetryPolicy(RetryOptions retryOptions) /// private static bool ShouldRetryException(Exception exception) { - if (exception is TaskCanceledException) + if ((exception is TaskCanceledException) || (exception is OperationCanceledException)) { exception = exception?.InnerException; } diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/src/Core/TransportEventHubProducer.cs b/sdk/eventhub/Azure.Messaging.EventHubs/src/Core/TransportEventHubProducer.cs index 8396a25e70bd..25e681ed17d9 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs/src/Core/TransportEventHubProducer.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/src/Core/TransportEventHubProducer.cs @@ -16,6 +16,16 @@ namespace Azure.Messaging.EventHubs.Core /// internal abstract class TransportEventHubProducer { + /// + /// Indicates whether or not this producer has been closed. + /// + /// + /// + /// true if the producer is closed; otherwise, false. + /// + /// + public virtual bool Closed { get; } + /// /// Updates the active retry policy for the client. /// diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/src/Diagnostics/EventDataInstrumentation.cs b/sdk/eventhub/Azure.Messaging.EventHubs/src/Diagnostics/EventDataInstrumentation.cs index 220c5fd9ad09..1a2dccbf46c8 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs/src/Diagnostics/EventDataInstrumentation.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/src/Diagnostics/EventDataInstrumentation.cs @@ -2,7 +2,6 @@ // Licensed under the MIT License. using System.Diagnostics; -using Azure.Core.Diagnostics; using Azure.Core.Pipeline; namespace Azure.Messaging.EventHubs.Diagnostics @@ -30,7 +29,7 @@ public static bool InstrumentEvent(EventData eventData) if (!eventData.Properties.ContainsKey(DiagnosticProperty.DiagnosticIdAttribute)) { using DiagnosticScope messageScope = ClientDiagnostics.CreateScope(DiagnosticProperty.EventActivityName); - messageScope.AddAttribute("kind", "internal"); + messageScope.AddAttribute(DiagnosticProperty.KindAttribute, DiagnosticProperty.InternalKind); messageScope.Start(); Activity activity = Activity.Current; diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/src/Errors/EventHubsObjectClosedException.cs b/sdk/eventhub/Azure.Messaging.EventHubs/src/Errors/EventHubsClientClosedException.cs similarity index 83% rename from sdk/eventhub/Azure.Messaging.EventHubs/src/Errors/EventHubsObjectClosedException.cs rename to sdk/eventhub/Azure.Messaging.EventHubs/src/Errors/EventHubsClientClosedException.cs index 9e99459b8510..853b65719140 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs/src/Errors/EventHubsObjectClosedException.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/src/Errors/EventHubsClientClosedException.cs @@ -7,32 +7,32 @@ namespace Azure.Messaging.EventHubs.Errors { /// /// An exception which occurs when an operation has been attempted using an Event Hubs - /// object which has already been closed. + /// client instance which has already been closed. /// /// - public sealed class EventHubsObjectClosedException : EventHubsException + public sealed class EventHubsClientClosedException : EventHubsException { /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// The name of the Event Hubs resource, such as an Event Hub, consumer group, or partition, to which the exception is associated. /// The error message that explains the reason for the exception. /// - internal EventHubsObjectClosedException(string resourceName, + internal EventHubsClientClosedException(string resourceName, string message) : this(resourceName, message, null) { } /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// /// /// The name of the Event Hubs resource, such as an Event Hub, consumer group, or partition, to which the exception is associated. /// The error message that explains the reason for the exception. /// The exception that is the cause of the current exception, or a null reference if no inner exception is specified. /// - internal EventHubsObjectClosedException(string resourceName, + internal EventHubsClientClosedException(string resourceName, string message, Exception innerException) : base(false, resourceName, message, innerException) { diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/src/EventHubClient.cs b/sdk/eventhub/Azure.Messaging.EventHubs/src/EventHubClient.cs index 30c39b7f01ad..b1810d61a791 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs/src/EventHubClient.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/src/EventHubClient.cs @@ -7,6 +7,7 @@ using System.Threading; using System.Threading.Tasks; using Azure.Core; +using Azure.Messaging.EventHubs.Amqp; using Azure.Messaging.EventHubs.Authorization; using Azure.Messaging.EventHubs.Compatibility; using Azure.Messaging.EventHubs.Core; @@ -441,7 +442,7 @@ internal virtual TransportEventHubClient BuildTransportClient(string fullyQualif { case TransportType.AmqpTcp: case TransportType.AmqpWebSockets: - return new TrackOneEventHubClient(fullyQualifiedNamespace, eventHubName, credential, options, defaultRetryPolicy); + return new AmqpEventHubClient(fullyQualifiedNamespace, eventHubName, credential, options, defaultRetryPolicy); default: throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, Resources.InvalidTransportType, options.TransportType.ToString()), nameof(options.TransportType)); diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/src/EventHubConsumer.cs b/sdk/eventhub/Azure.Messaging.EventHubs/src/EventHubConsumer.cs index 87b223bb046d..4294f321701a 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs/src/EventHubConsumer.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/src/EventHubConsumer.cs @@ -12,6 +12,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Messaging.EventHubs.Core; +using Azure.Messaging.EventHubs.Diagnostics; using Azure.Messaging.EventHubs.Errors; using Azure.Messaging.EventHubs.Metadata; @@ -288,12 +289,23 @@ public virtual Task> ReceiveAsync(int maximumMessageCount /// /// public virtual async IAsyncEnumerable SubscribeToEvents(TimeSpan? maximumWaitTime, - [EnumeratorCancellation] CancellationToken cancellationToken = default) + [EnumeratorCancellation] CancellationToken cancellationToken = default) { cancellationToken.ThrowIfCancellationRequested(); + EventHubsEventSource.Log.SubscribeToPartitionStart(EventHubName, PartitionId); - var maximumQueuedEvents = Math.Min((Options.PrefetchCount / 4), (BackgroundPublishReceiveBatchSize * 2)); - (Guid Identifier, ChannelReader ChannelReader) subscription = SubscribeToChannel(EventHubName, PartitionId, ConsumerGroup, maximumQueuedEvents, cancellationToken); + (Guid Identifier, ChannelReader ChannelReader) subscription; + + try + { + var maximumQueuedEvents = Math.Min((Options.PrefetchCount / 4), (BackgroundPublishReceiveBatchSize * 2)); + subscription = SubscribeToChannel(EventHubName, PartitionId, ConsumerGroup, maximumQueuedEvents, cancellationToken); + } + catch (Exception ex) + { + EventHubsEventSource.Log.SubscribeToPartitionError(EventHubName, PartitionId, ex.Message); + throw; + } try { @@ -305,6 +317,7 @@ public virtual async IAsyncEnumerable SubscribeToEvents(TimeSpan? max finally { await UnsubscribeFromChannelAsync(subscription.Identifier).ConfigureAwait(false); + EventHubsEventSource.Log.SubscribeToPartitionComplete(EventHubName, PartitionId); } } diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/src/EventHubProducer.cs b/sdk/eventhub/Azure.Messaging.EventHubs/src/EventHubProducer.cs index b4fee52f6426..63d84155e65a 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs/src/EventHubProducer.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/src/EventHubProducer.cs @@ -9,7 +9,6 @@ using System.Threading; using System.Threading.Tasks; using Azure.Core; -using Azure.Core.Diagnostics; using Azure.Core.Pipeline; using Azure.Messaging.EventHubs.Core; using Azure.Messaging.EventHubs.Diagnostics; @@ -39,7 +38,7 @@ public class EventHubProducer : IAsyncDisposable internal const int MinimumBatchSizeLimit = 24; /// The set of default publishing options to use when no specific options are requested. - private static readonly SendOptions s_defaultSendOptions = new SendOptions(); + private static readonly SendOptions DefaultSendOptions = new SendOptions(); /// The fully-qualified location of the Event Hub instance to which events will be sent. private readonly Uri _endpoint; @@ -225,7 +224,7 @@ public virtual async Task SendAsync(IEnumerable events, SendOptions options, CancellationToken cancellationToken = default) { - options ??= s_defaultSendOptions; + options ??= DefaultSendOptions; Argument.AssertNotNull(events, nameof(events)); AssertSinglePartitionReference(PartitionId, options.PartitionKey); diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpConnectionScopeTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpConnectionScopeTests.cs index e62e88a7e7c9..96d444939756 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpConnectionScopeTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpConnectionScopeTests.cs @@ -532,7 +532,7 @@ public async Task OpenConsumerLinkAsyncConfiguresTheLink() Assert.That(link, Is.Not.Null, "The link produced was null"); var linkSource = (Source)link.Settings.Source; - Assert.That(linkSource.FilterSet.Any(item => item.Key.Key.ToString() == AmqpFilter.ConsumerFilterName), Is.True, "There should have been a consumer filter set."); + Assert.That(linkSource.FilterSet.Any(item => item.Key.Key.ToString() == AmqpFilter.ConsumerFilterName), Is.True, "There should have been a producer filter set."); Assert.That(linkSource.Address.ToString(), Contains.Substring($"/{ partitionId }"), "The partition identifier should have been part of the link address."); Assert.That(linkSource.Address.ToString(), Contains.Substring($"/{ consumerGroup }"), "The consumer group should have been part of the link address."); @@ -553,7 +553,7 @@ public async Task OpenConsumerLinkAsyncConfiguresTheLink() [Test] [TestCase(null)] [TestCase("")] - public async Task OpenConsumerLinkAsyncRespectsTheIdentifierOption(string consumerIdentifier) + public async Task OpenConsumerLinkAsyncRespectsTheIdentifierOption(string producerIdentifier) { var endpoint = new Uri("amqp://test.service.gov"); var eventHub = "myHub"; @@ -569,7 +569,7 @@ public async Task OpenConsumerLinkAsyncRespectsTheIdentifierOption(string consum var options = new EventHubConsumerOptions { - Identifier = consumerIdentifier, + Identifier = producerIdentifier, OwnerLevel = 459, PrefetchCount = 697, TrackLastEnqueuedEventInformation = true @@ -1048,6 +1048,455 @@ public async Task OpenConsumerLinkAsyncRefreshesAuthorization() } } + /// + /// Verifies functionality of the + /// method. + /// + /// + [Test] + public void OpenProducerLinkAsyncRespectsTokenCancellation() + { + var endpoint = new Uri("amqp://test.service.gov"); + var eventHub = "myHub"; + var partitionId = "0"; + var credential = Mock.Of(); + var transport = TransportType.AmqpTcp; + var identifier = "customIdentIFIER"; + + using var scope = new AmqpConnectionScope(endpoint, eventHub, credential, transport, null, identifier); + + var cancellationSource = new CancellationTokenSource(); + cancellationSource.Cancel(); + + Assert.That(() => scope.OpenProducerLinkAsync(partitionId, TimeSpan.FromDays(1), cancellationSource.Token), Throws.InstanceOf()); + } + + /// + /// Verifies functionality of the + /// method. + /// + /// + [Test] + public void OpenProducerLinkAsyncRespectsDisposal() + { + var endpoint = new Uri("amqp://test.service.gov"); + var eventHub = "myHub"; + var credential = Mock.Of(); + var transport = TransportType.AmqpTcp; + var identifier = "customIdentIFIER"; + + var scope = new AmqpConnectionScope(endpoint, eventHub, credential, transport, null, identifier); + scope.Dispose(); + + Assert.That(() => scope.OpenProducerLinkAsync(null, TimeSpan.FromDays(1), CancellationToken.None), Throws.InstanceOf()); + } + + /// + /// Verifies functionality of the + /// method. + /// + /// + [Test] + public async Task OpenProducerLinkAsyncRequestsTheLink() + { + var endpoint = new Uri("amqp://test.service.gov"); + var eventHub = "myHub"; + var partitionId = "0"; + var credential = Mock.Of(); + var transport = TransportType.AmqpTcp; + var identifier = "customIdentIFIER"; + var cancellationSource = new CancellationTokenSource(); + var mockConnection = new AmqpConnection(new MockTransport(), CreateMockAmqpSettings(), new AmqpConnectionSettings()); + var mockSession = new AmqpSession(mockConnection, new AmqpSessionSettings(), Mock.Of()); + var mockLink = new SendingAmqpLink(new AmqpLinkSettings()); + + var mockScope = new Mock(endpoint, eventHub, credential, transport, null, identifier) + { + CallBase = true + }; + + mockScope + .Protected() + .Setup>("CreateAndOpenConnectionAsync", + ItExpr.IsAny(), + ItExpr.Is(value => value == endpoint), + ItExpr.Is(value => value == transport), + ItExpr.Is(value => value == null), + ItExpr.Is(value => value == identifier), + ItExpr.IsAny()) + .Returns(Task.FromResult(mockConnection)) + .Verifiable(); + + mockScope + .Protected() + .Setup>("CreateSendingLinkAsync", + ItExpr.Is(value => value == mockConnection), + ItExpr.Is(value => value.AbsoluteUri.StartsWith(endpoint.AbsoluteUri)), + ItExpr.IsAny(), + ItExpr.Is(value => value == cancellationSource.Token)) + .Returns(Task.FromResult(mockLink)) + .Verifiable(); + + mockScope + .Protected() + .Setup("OpenAmqpObjectAsync", + ItExpr.IsAny(), + ItExpr.IsAny()) + .Returns(Task.CompletedTask) + .Verifiable(); + + var link = await mockScope.Object.OpenProducerLinkAsync(partitionId, TimeSpan.FromDays(1), cancellationSource.Token); + Assert.That(link, Is.EqualTo(mockLink), "The mock return was incorrect"); + + mockScope.VerifyAll(); + } + + /// + /// Verifies functionality of the + /// method. + /// + /// + [Test] + public async Task OpenProducerLinkAsyncConfiguresTheLink() + { + var endpoint = new Uri("amqp://test.service.gov"); + var eventHub = "myHub"; + var partitionId = "00_partition_00"; + var credential = Mock.Of(); + var transport = TransportType.AmqpTcp; + var identifier = "customIdentIFIER"; + var cancellationSource = new CancellationTokenSource(); + var mockConnection = new AmqpConnection(new MockTransport(), CreateMockAmqpSettings(), new AmqpConnectionSettings()); + var mockSession = new AmqpSession(mockConnection, new AmqpSessionSettings(), Mock.Of()); + + var mockScope = new Mock(endpoint, eventHub, credential, transport, null, identifier) + { + CallBase = true + }; + + mockScope + .Protected() + .Setup>("CreateAndOpenConnectionAsync", + ItExpr.IsAny(), + ItExpr.Is(value => value == endpoint), + ItExpr.Is(value => value == transport), + ItExpr.Is(value => value == null), + ItExpr.Is(value => value == identifier), + ItExpr.IsAny()) + .Returns(Task.FromResult(mockConnection)); + + mockScope + .Protected() + .Setup>("RequestAuthorizationUsingCbsAsync", + ItExpr.Is(value => value == mockConnection), + ItExpr.IsAny(), + ItExpr.Is(value => value.AbsoluteUri.StartsWith(endpoint.AbsoluteUri)), + ItExpr.IsAny(), + ItExpr.IsAny(), + ItExpr.Is(value => value.SingleOrDefault() == EventHubsClaim.Send), + ItExpr.IsAny()) + .Returns(Task.FromResult(DateTime.UtcNow.AddDays(1))); + + mockScope + .Protected() + .Setup("OpenAmqpObjectAsync", + ItExpr.IsAny(), + ItExpr.IsAny()) + .Returns(Task.CompletedTask); + + var link = await mockScope.Object.OpenProducerLinkAsync(partitionId, TimeSpan.FromDays(1), cancellationSource.Token); + Assert.That(link, Is.Not.Null, "The link produced was null"); + + var linkTarget = (Target)link.Settings.Target; + Assert.That(linkTarget.Address.ToString(), Contains.Substring($"/{ partitionId }"), "The partition identifier should have been part of the link address."); + Assert.That(link.Settings.Properties.Any(item => item.Key.Key.ToString() == AmqpProperty.EntityType.ToString()), Is.True, "There should be an entity type specified."); + } + + /// + /// Verifies functionality of the + /// method. + /// + /// + [Test] + public async Task OpenProducerLinkAsyncManagesActiveLinks() + { + var endpoint = new Uri("amqp://test.service.gov"); + var eventHub = "myHub"; + var credential = Mock.Of(); + var transport = TransportType.AmqpTcp; + var identifier = "customIdentIFIER"; + var cancellationSource = new CancellationTokenSource(); + var mockConnection = new AmqpConnection(new MockTransport(), CreateMockAmqpSettings(), new AmqpConnectionSettings()); + var mockSession = new AmqpSession(mockConnection, new AmqpSessionSettings(), Mock.Of()); + + var mockScope = new Mock(endpoint, eventHub, credential, transport, null, identifier) + { + CallBase = true + }; + + mockScope + .Protected() + .Setup>("CreateAndOpenConnectionAsync", + ItExpr.IsAny(), + ItExpr.Is(value => value == endpoint), + ItExpr.Is(value => value == transport), + ItExpr.Is(value => value == null), + ItExpr.Is(value => value == identifier), + ItExpr.IsAny()) + .Returns(Task.FromResult(mockConnection)); + + mockScope + .Protected() + .Setup>("RequestAuthorizationUsingCbsAsync", + ItExpr.Is(value => value == mockConnection), + ItExpr.IsAny(), + ItExpr.Is(value => value.AbsoluteUri.StartsWith(endpoint.AbsoluteUri)), + ItExpr.IsAny(), + ItExpr.IsAny(), + ItExpr.Is(value => value.SingleOrDefault() == EventHubsClaim.Send), + ItExpr.IsAny()) + .Returns(Task.FromResult(DateTime.UtcNow.AddDays(1))); + + mockScope + .Protected() + .Setup("OpenAmqpObjectAsync", + ItExpr.IsAny(), + ItExpr.IsAny()) + .Returns(Task.CompletedTask); + + var activeLinks = GetActiveLinks(mockScope.Object); + Assert.That(activeLinks, Is.Not.Null, "The set of active links was null."); + Assert.That(activeLinks.Count, Is.Zero, "There should be no active links when none have been created."); + + var link = await mockScope.Object.OpenProducerLinkAsync(null, TimeSpan.FromDays(1), cancellationSource.Token); + Assert.That(link, Is.Not.Null, "The link produced was null"); + + Assert.That(activeLinks.Count, Is.EqualTo(1), "There should be an active link being tracked."); + Assert.That(activeLinks.ContainsKey(link), Is.True, "The producer link should be tracked as active."); + + activeLinks.TryGetValue(link, out var refreshTimer); + Assert.That(refreshTimer, Is.Not.Null, "The link should have a non-null timer."); + + link.SafeClose(); + Assert.That(activeLinks.Count, Is.Zero, "Closing the link should stop tracking it as active."); + } + + /// + /// Verifies functionality of the + /// method. + /// + /// + [Test] + public async Task OpenProducerLinkAsyncConfiguresAuthorizationRefresh() + { + var timerCallbackInvoked = false; + var endpoint = new Uri("amqp://test.service.gov"); + var eventHub = "myHub"; + var credential = Mock.Of(); + var transport = TransportType.AmqpTcp; + var identifier = "customIdentIFIER"; + var cancellationSource = new CancellationTokenSource(); + var mockConnection = new AmqpConnection(new MockTransport(), CreateMockAmqpSettings(), new AmqpConnectionSettings()); + var mockSession = new AmqpSession(mockConnection, new AmqpSessionSettings(), Mock.Of()); + + var mockScope = new Mock(endpoint, eventHub, credential, transport, null, identifier) + { + CallBase = true + }; + + mockScope + .Protected() + .Setup>("CreateAndOpenConnectionAsync", + ItExpr.IsAny(), + ItExpr.Is(value => value == endpoint), + ItExpr.Is(value => value == transport), + ItExpr.Is(value => value == null), + ItExpr.Is(value => value == identifier), + ItExpr.IsAny()) + .Returns(Task.FromResult(mockConnection)); + + mockScope + .Protected() + .Setup>("RequestAuthorizationUsingCbsAsync", + ItExpr.IsAny(), + ItExpr.IsAny(), + ItExpr.IsAny(), + ItExpr.IsAny(), + ItExpr.IsAny(), + ItExpr.IsAny(), + ItExpr.IsAny()) + .Returns(Task.FromResult(DateTime.UtcNow.AddDays(5))); + + mockScope + .Protected() + .Setup("CreateAuthorizationRefreshHandler", + ItExpr.IsAny(), + ItExpr.IsAny(), + ItExpr.IsAny(), + ItExpr.IsAny(), + ItExpr.IsAny(), + ItExpr.IsAny(), + ItExpr.IsAny(), + ItExpr.IsAny(), + ItExpr.IsAny>()) + .Returns(_ => timerCallbackInvoked = true); + + mockScope + .Protected() + .Setup("CalculateLinkAuthorizationRefreshInterval", + ItExpr.IsAny()) + .Returns(TimeSpan.Zero); + + mockScope + .Protected() + .Setup("OpenAmqpObjectAsync", + ItExpr.IsAny(), + ItExpr.IsAny()) + .Returns(Task.CompletedTask); + + var link = await mockScope.Object.OpenProducerLinkAsync(null, TimeSpan.FromDays(1), cancellationSource.Token); + Assert.That(link, Is.Not.Null, "The link produced was null"); + + var activeLinks = GetActiveLinks(mockScope.Object); + Assert.That(activeLinks.ContainsKey(link), Is.True, "The producer link should be tracked as active."); + + activeLinks.TryGetValue(link, out var refreshTimer); + Assert.That(refreshTimer, Is.Not.Null, "The link should have a non-null timer."); + + // The timer be configured to fire immediately and set the flag. Because the timer + // runs in the background, there is a level of non-determinism in when that callback will execute. + // Allow for a small number of delay and retries to account for it. + + var attemptCount = 0; + var remainingAttempts = 10; + + while ((--remainingAttempts >= 0) && (!timerCallbackInvoked)) + { + await Task.Delay(250 * ++attemptCount).ConfigureAwait(false); + } + + Assert.That(timerCallbackInvoked, Is.True, "The timer should have been configured and running when the link was created."); + } + + /// + /// Verifies functionality of the + /// method. + /// + /// + [Test] + public async Task OpenProducerLinkAsyncRefreshesAuthorization() + { + var endpoint = new Uri("amqp://test.service.gov"); + var eventHub = "myHub"; + var credential = Mock.Of(); + var transport = TransportType.AmqpTcp; + var identifier = "customIdentIFIER"; + var cancellationSource = new CancellationTokenSource(); + var mockConnection = new AmqpConnection(new MockTransport(), CreateMockAmqpSettings(), new AmqpConnectionSettings()); + var mockSession = new AmqpSession(mockConnection, new AmqpSessionSettings(), Mock.Of()); + + var mockScope = new Mock(endpoint, eventHub, credential, transport, null, identifier) + { + CallBase = true + }; + + mockScope + .Protected() + .Setup>("CreateAndOpenConnectionAsync", + ItExpr.IsAny(), + ItExpr.Is(value => value == endpoint), + ItExpr.Is(value => value == transport), + ItExpr.Is(value => value == null), + ItExpr.Is(value => value == identifier), + ItExpr.IsAny()) + .Returns(Task.FromResult(mockConnection)); + + mockScope + .Protected() + .Setup>("RequestAuthorizationUsingCbsAsync", + ItExpr.IsAny(), + ItExpr.IsAny(), + ItExpr.IsAny(), + ItExpr.IsAny(), + ItExpr.IsAny(), + ItExpr.IsAny(), + ItExpr.IsAny()) + .Returns(Task.FromResult(DateTime.UtcNow.AddDays(5))); + + mockScope + .Protected() + .Setup("OpenAmqpObjectAsync", + ItExpr.IsAny(), + ItExpr.IsAny()) + .Returns(Task.CompletedTask); + + var link = await mockScope.Object.OpenProducerLinkAsync(null, TimeSpan.FromDays(1), cancellationSource.Token); + Assert.That(link, Is.Not.Null, "The link produced was null"); + + var activeLinks = GetActiveLinks(mockScope.Object); + Assert.That(activeLinks.ContainsKey(link), Is.True, "The producer link should be tracked as active."); + + activeLinks.TryGetValue(link, out var refreshTimer); + Assert.That(refreshTimer, Is.Not.Null, "The link should have a non-null timer."); + + // Verify that there was only a initial request for authorization. + + mockScope + .Protected() + .Verify("RequestAuthorizationUsingCbsAsync", + Times.Once(), + ItExpr.Is(value => value == mockConnection), + ItExpr.IsAny(), + ItExpr.Is(value => value.AbsoluteUri.StartsWith(endpoint.AbsoluteUri)), + ItExpr.IsAny(), + ItExpr.IsAny(), + ItExpr.Is(value => value.SingleOrDefault() == EventHubsClaim.Send), + ItExpr.IsAny()); + + // Reset the timer so that it fires immediately and validate that authorization was + // requested. Since opening of the link requests an initial authorization and the expiration + // was set way in the future, there should be exactly two calls. + // + // Because the timer runs in the background, there is a level of non-determinism in when that + // callback will execute. Allow for a small number of delay and retries to account for it. + + refreshTimer.Change(0, Timeout.Infinite); + + var attemptCount = 0; + var remainingAttempts = 10; + var success = false; + + while ((--remainingAttempts >= 0) && (!success)) + { + try + { + await Task.Delay(250 * ++attemptCount).ConfigureAwait(false); + + mockScope + .Protected() + .Verify("RequestAuthorizationUsingCbsAsync", + Times.Exactly(2), + ItExpr.Is(value => value == mockConnection), + ItExpr.IsAny(), + ItExpr.Is(value => value.AbsoluteUri.StartsWith(endpoint.AbsoluteUri)), + ItExpr.IsAny(), + ItExpr.IsAny(), + ItExpr.Is(value => value.SingleOrDefault() == EventHubsClaim.Send), + ItExpr.IsAny()); + + success = true; + } + catch when (remainingAttempts <= 0) + { + throw; + } + catch + { + // No action needed. + } + } + } + /// /// Verifies functionality of the /// method. @@ -1193,15 +1642,15 @@ public async Task DisposeClosesActiveLinks() Assert.That(activeLinks, Is.Not.Null, "The set of active links was null."); Assert.That(activeLinks.Count, Is.Zero, "There should be no active links when none have been created."); - var consumerLink = await mockScope.Object.OpenConsumerLinkAsync(consumerGroup, partitionId, position, options, TimeSpan.FromDays(1), cancellationSource.Token); - Assert.That(consumerLink, Is.Not.Null, "The consumer link produced was null"); + var producerLink = await mockScope.Object.OpenConsumerLinkAsync(consumerGroup, partitionId, position, options, TimeSpan.FromDays(1), cancellationSource.Token); + Assert.That(producerLink, Is.Not.Null, "The producer link produced was null"); var managementLink = await mockScope.Object.OpenManagementLinkAsync(TimeSpan.FromDays(1), cancellationSource.Token); Assert.That(managementLink, Is.Not.Null, "The management link produced was null"); Assert.That(activeLinks.Count, Is.EqualTo(2), "There should be active links being tracked."); Assert.That(activeLinks.ContainsKey(managementLink), Is.True, "The management link should be tracked as active."); - Assert.That(activeLinks.ContainsKey(consumerLink), Is.True, "The consumer link should be tracked as active."); + Assert.That(activeLinks.ContainsKey(producerLink), Is.True, "The producer link should be tracked as active."); mockScope.Object.Dispose(); Assert.That(activeLinks.Count, Is.Zero, "Disposal should stop tracking it as active."); @@ -1268,10 +1717,10 @@ public async Task DisposeStopsManagingLinkAuthorizations() Assert.That(managedAuthorizations.Count, Is.Zero, "There should be no managed authorizations when none have been created."); var link = await mockScope.Object.OpenConsumerLinkAsync(consumerGroup, partitionId, position, options, TimeSpan.FromDays(1), cancellationSource.Token); - Assert.That(link, Is.Not.Null, "The consumer link produced was null"); + Assert.That(link, Is.Not.Null, "The producer link produced was null"); Assert.That(managedAuthorizations.Count, Is.EqualTo(1), "There should be a managed authorization being tracked."); - Assert.That(managedAuthorizations.ContainsKey(link), Is.True, "The consumer link should be tracked for authorization."); + Assert.That(managedAuthorizations.ContainsKey(link), Is.True, "The producer link should be tracked for authorization."); managedAuthorizations.TryGetValue(link, out var refreshTimer); Assert.That(refreshTimer, Is.Not.Null, "The link should have a non-null timer."); diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpEventBatchTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpEventBatchTests.cs index c5333cae8c8d..c8f5fc1e4bc6 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpEventBatchTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpEventBatchTests.cs @@ -26,7 +26,7 @@ public class AmqpEventBatchTests [Test] public void ConstructorValidatesTheMessageConverter() { - Assert.That(() => new AmqpEventBatch(null, new BatchOptions { MaximumizeInBytes = 31 }), Throws.ArgumentNullException); + Assert.That(() => new AmqpEventBatch(null, new BatchOptions { MaximumSizeInBytes = 31 }), Throws.ArgumentNullException); } /// @@ -56,7 +56,7 @@ public void ConstructorValidatesTheMaximumSize() CreateBatchFromEventsHandler = (_e, _p) => Mock.Of() }; - Assert.That(() => new AmqpEventBatch(mockConverter, new BatchOptions { MaximumizeInBytes = null }), Throws.ArgumentNullException); + Assert.That(() => new AmqpEventBatch(mockConverter, new BatchOptions { MaximumSizeInBytes = null }), Throws.ArgumentNullException); } /// @@ -67,7 +67,7 @@ public void ConstructorValidatesTheMaximumSize() public void ConstructorSetsTheMaximumSize() { var maximumSize = 9943; - var options = new BatchOptions { MaximumizeInBytes = maximumSize }; + var options = new BatchOptions { MaximumSizeInBytes = maximumSize }; var mockConverter = new InjectableMockConverter { @@ -96,7 +96,7 @@ public void ConstructorInitializesTheSizeToABatchEnvelope() .Setup(message => message.SerializedMessageSize) .Returns(batchEnvelopeSize); - var batch = new AmqpEventBatch(mockConverter, new BatchOptions { MaximumizeInBytes = 27 }); + var batch = new AmqpEventBatch(mockConverter, new BatchOptions { MaximumSizeInBytes = 27 }); Assert.That(batch.SizeInBytes, Is.EqualTo(batchEnvelopeSize)); } @@ -113,7 +113,7 @@ public void TryAddValidatesTheEvent() CreateBatchFromEventsHandler = (_e, _p) => Mock.Of() }; - var batch = new AmqpEventBatch(mockConverter, new BatchOptions { MaximumizeInBytes = 25 }); + var batch = new AmqpEventBatch(mockConverter, new BatchOptions { MaximumSizeInBytes = 25 }); Assert.That(() => batch.TryAdd(null), Throws.ArgumentNullException); } @@ -130,7 +130,7 @@ public void TryAddValidatesNotDisposed() CreateBatchFromEventsHandler = (_e, _p) => Mock.Of() }; - var batch = new AmqpEventBatch(mockConverter, new BatchOptions { MaximumizeInBytes = 25 }); + var batch = new AmqpEventBatch(mockConverter, new BatchOptions { MaximumSizeInBytes = 25 }); batch.Dispose(); Assert.That(() => batch.TryAdd(new EventData(new byte[0])), Throws.InstanceOf()); @@ -146,7 +146,7 @@ public void TryAddDoesNotAcceptAnEventBiggerThanTheMaximumSize() { var maximumSize = 50; var batchEnvelopeSize = 0; - var options = new BatchOptions { MaximumizeInBytes = maximumSize }; + var options = new BatchOptions { MaximumSizeInBytes = maximumSize }; var mockEnvelope = new Mock(); var mockEvent = new Mock(); var mockConverter = new InjectableMockConverter @@ -178,7 +178,7 @@ public void TryAddAcceptsAnEventSmallerThanTheMaximumSize() { var maximumSize = 50; var eventMessageSize = 40; - var options = new BatchOptions { MaximumizeInBytes = maximumSize }; + var options = new BatchOptions { MaximumSizeInBytes = maximumSize }; var mockEnvelope = new Mock(); var mockEvent = new Mock(); var mockConverter = new InjectableMockConverter @@ -210,7 +210,7 @@ public void TryAddAcceptEventsUntilTheMaximumSizeIsReached() { var currentIndex = -1; var maximumSize = 50; - var options = new BatchOptions { MaximumizeInBytes = maximumSize }; + var options = new BatchOptions { MaximumSizeInBytes = maximumSize }; var eventMessages = new AmqpMessage[5]; var mockEnvelope = new Mock(); var mockConverter = new InjectableMockConverter @@ -261,7 +261,7 @@ public void TryAddAcceptEventsUntilTheMaximumSizeIsReached() public void TryAddSetsTheCount() { var currentIndex = -1; - var options = new BatchOptions { MaximumizeInBytes = 5000 }; + var options = new BatchOptions { MaximumSizeInBytes = 5000 }; var eventMessages = new AmqpMessage[5]; var mockEnvelope = new Mock(); var mockConverter = new InjectableMockConverter @@ -299,7 +299,7 @@ public void TryAddSetsTheCount() [Test] public void AsEnumerableValidatesTheTypeParameter() { - var options = new BatchOptions { MaximumizeInBytes = 5000 }; + var options = new BatchOptions { MaximumSizeInBytes = 5000 }; var mockEnvelope = new Mock(); var mockConverter = new InjectableMockConverter { @@ -324,7 +324,7 @@ public void AsEnumerableReturnsTheMessages() { var currentIndex = -1; var maximumSize = 5000; - var options = new BatchOptions { MaximumizeInBytes = maximumSize }; + var options = new BatchOptions { MaximumSizeInBytes = maximumSize }; var eventMessages = new AmqpMessage[5]; var mockEnvelope = new Mock(); var mockConverter = new InjectableMockConverter @@ -372,7 +372,7 @@ public void AsEnumerableReturnsTheMessages() public void DisposeCleansUpBatchMessages() { var currentIndex = -1; - var options = new BatchOptions { MaximumizeInBytes = 5000 }; + var options = new BatchOptions { MaximumSizeInBytes = 5000 }; var eventMessages = new AmqpMessage[5]; var mockEnvelope = new Mock(); var mockConverter = new InjectableMockConverter @@ -418,7 +418,7 @@ public void DisposeCleansUpBatchMessages() public void DisposeClearsTheCount() { var currentIndex = -1; - var options = new BatchOptions { MaximumizeInBytes = 5000 }; + var options = new BatchOptions { MaximumSizeInBytes = 5000 }; var eventMessages = new AmqpMessage[5]; var mockEnvelope = new Mock(); var mockConverter = new InjectableMockConverter @@ -469,7 +469,7 @@ public void DisposeClearsTheSize() .Setup(message => message.SerializedMessageSize) .Returns(9959); - var batch = new AmqpEventBatch(mockConverter, new BatchOptions { MaximumizeInBytes = 99 }); + var batch = new AmqpEventBatch(mockConverter, new BatchOptions { MaximumSizeInBytes = 99 }); batch.Dispose(); Assert.That(batch.SizeInBytes, Is.EqualTo(0)); diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpEventHubClientTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpEventHubClientTests.cs index 5dde95103ae7..ef99c2e81355 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpEventHubClientTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpEventHubClientTests.cs @@ -212,7 +212,7 @@ public async Task GetPropertiesAsyncRespectsClosed() var client = new AmqpEventHubClient("my.eventhub.com", "somePath", Mock.Of(), new EventHubClientOptions(), Mock.Of()); await client.CloseAsync(cancellationSource.Token); - Assert.That(async () => await client.GetPropertiesAsync(cancellationSource.Token), Throws.InstanceOf()); + Assert.That(async () => await client.GetPropertiesAsync(cancellationSource.Token), Throws.InstanceOf()); } /// @@ -333,7 +333,7 @@ public async Task GetPartitionPropertiesAsyncValidatesClosed() var client = new AmqpEventHubClient("my.eventhub.com", "somePath", Mock.Of(), new EventHubClientOptions(), Mock.Of()); await client.CloseAsync(cancellationSource.Token); - Assert.That(async () => await client.GetPartitionPropertiesAsync("Fred", cancellationSource.Token), Throws.InstanceOf()); + Assert.That(async () => await client.GetPartitionPropertiesAsync("Fred", cancellationSource.Token), Throws.InstanceOf()); } /// @@ -426,7 +426,24 @@ public async Task CreateConsumerValidatesClosed() var client = new AmqpEventHubClient("my.eventhub.com", "somePath", Mock.Of(), new EventHubClientOptions(), mockRetryPolicy); await client.CloseAsync(cancellationSource.Token); - Assert.That(() => client.CreateConsumer("group", "0", EventPosition.Earliest, new EventHubConsumerOptions(), mockRetryPolicy), Throws.InstanceOf()); + Assert.That(() => client.CreateConsumer("group", "0", EventPosition.Earliest, new EventHubConsumerOptions(), mockRetryPolicy), Throws.InstanceOf()); + } + + /// + /// Verifies functionality of the + /// method. + /// + /// + [Test] + public async Task CreateProducerValidatesClosed() + { + using var cancellationSource = new CancellationTokenSource(); + + var mockRetryPolicy = Mock.Of(); + var client = new AmqpEventHubClient("my.eventhub.com", "somePath", Mock.Of(), new EventHubClientOptions(), mockRetryPolicy); + await client.CloseAsync(cancellationSource.Token); + + Assert.That(() => client.CreateProducer(new EventHubProducerOptions(), mockRetryPolicy), Throws.InstanceOf()); } /// diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpEventHubConsumerTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpEventHubConsumerTests.cs index 915d42ea46a4..7bc791d9eada 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpEventHubConsumerTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpEventHubConsumerTests.cs @@ -246,32 +246,6 @@ public void ReceiveAsyncRespectsTheCancellationTokenIfSetWhenCalled() } /// - /// Verifies functionality of the - /// method. - /// - /// - [Test] - public async Task ReceiveAsyncValidatesClosed() - { - var eventHub = "eventHubName"; - var consumerGroup = "$DEFAULT"; - var partition = "3"; - var eventPosition = EventPosition.FromOffset(123); - var options = new EventHubConsumerOptions { Identifier = "OMG!" }; - var retryPolicy = new BasicRetryPolicy(new RetryOptions()); - var retriableException = new EventHubsException(true, "Test"); - var mockConverter = new Mock(); - var mockCredential = new Mock(); - var mockScope = new Mock(); - - using var cancellationSource = new CancellationTokenSource(); - - var consumer = new AmqpEventHubConsumer(eventHub, consumerGroup, partition, eventPosition, options, mockScope.Object, Mock.Of(), retryPolicy, null); - await consumer.CloseAsync(cancellationSource.Token); - - Assert.That(async () => await consumer.ReceiveAsync(100, null, cancellationSource.Token), Throws.InstanceOf()); - } - /// /// Verifies functionality of the /// method. @@ -324,7 +298,34 @@ public void ReceiveAsyncRespectsTheRetryPolicy(RetryOptions retryOptions) } /// - /// Gets the active retry policy for the given client, using the + /// Verifies functionality of the + /// method. + /// + /// + [Test] + public async Task ReceiveAsyncValidatesClosed() + { + var eventHub = "eventHubName"; + var consumerGroup = "$DEFAULT"; + var partition = "3"; + var eventPosition = EventPosition.FromOffset(123); + var options = new EventHubConsumerOptions { Identifier = "OMG!" }; + var retryPolicy = new BasicRetryPolicy(new RetryOptions()); + var retriableException = new EventHubsException(true, "Test"); + var mockConverter = new Mock(); + var mockCredential = new Mock(); + var mockScope = new Mock(); + + using var cancellationSource = new CancellationTokenSource(); + + var consumer = new AmqpEventHubConsumer(eventHub, consumerGroup, partition, eventPosition, options, mockScope.Object, Mock.Of(), retryPolicy, null); + await consumer.CloseAsync(cancellationSource.Token); + + Assert.That(async () => await consumer.ReceiveAsync(100, null, cancellationSource.Token), Throws.InstanceOf()); + } + + /// + /// Gets the active retry policy for the given consumer, using the /// private field. /// /// @@ -335,7 +336,7 @@ private static EventHubRetryPolicy GetActiveRetryPolicy(AmqpEventHubConsumer tar .GetValue(target); /// - /// Gets the active operation timeout for the given client, using the + /// Gets the active operation timeout for the given consumer, using the /// private field. /// /// diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpEventHubProducerTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpEventHubProducerTests.cs new file mode 100755 index 000000000000..3e688102ade0 --- /dev/null +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpEventHubProducerTests.cs @@ -0,0 +1,813 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Messaging.EventHubs.Amqp; +using Azure.Messaging.EventHubs.Core; +using Azure.Messaging.EventHubs.Errors; +using Azure.Messaging.EventHubs.Metadata; +using Microsoft.Azure.Amqp; +using Moq; +using Moq.Protected; +using NUnit.Framework; + +namespace Azure.Messaging.EventHubs.Tests +{ + /// + /// The suite of tests for the + /// class. + /// + /// + [TestFixture] + public class AmqpEventHubProducerTests + { + /// + /// The set of test cases for respecting basic retry configuration. + /// + /// + public static IEnumerable RetryOptionTestCases() + { + yield return new object[] { new RetryOptions { MaximumRetries = 3, Delay = TimeSpan.FromMilliseconds(1), MaximumDelay = TimeSpan.FromMilliseconds(10), Mode = RetryMode.Fixed }}; + yield return new object[] { new RetryOptions { MaximumRetries = 0, Delay = TimeSpan.FromMilliseconds(1), MaximumDelay = TimeSpan.FromMilliseconds(10), Mode = RetryMode.Fixed }}; + } + + /// + /// Verifies functionality of the constructor. + /// + /// + [Test] + [TestCase(null)] + [TestCase("")] + public void ConstructorRequiresTheEventHubName(string eventHub) + { + Assert.That(() => new AmqpEventHubProducer(eventHub, null, Mock.Of(), Mock.Of(), Mock.Of()), Throws.InstanceOf()); + } + + /// + /// Verifies functionality of the constructor. + /// + /// + [Test] + public void ConstructorRequiresTheConnectionScope() + { + Assert.That(() => new AmqpEventHubProducer("theMostAwesomeHubEvar", "0", null, Mock.Of(), Mock.Of()), Throws.ArgumentNullException); + } + + /// + /// Verifies functionality of the constructor. + /// + /// + [Test] + public void ConstructorRequiresTheRetryPolicy() + { + Assert.That(() => new AmqpEventHubProducer("theMostAwesomeHubEvar", null, Mock.Of(), Mock.Of(), null), Throws.ArgumentNullException); + } + + /// + /// Verifies functionality of the + /// method. + /// + /// + [Test] + public async Task CloseMarksTheProducerAsClosed() + { + var producer = new AmqpEventHubProducer("aHub", "0", Mock.Of(), Mock.Of(), Mock.Of()); + Assert.That(producer.Closed, Is.False, "The producer should not be closed on creation"); + + await producer.CloseAsync(CancellationToken.None); + Assert.That(producer.Closed, Is.True, "The producer should be marked as closed after closing"); + } + + /// + /// Verifies functionality of the + /// method. + /// + /// + [Test] + public void CloseRespectsTheCancellationToken() + { + var producer = new AmqpEventHubProducer("aHub", null, Mock.Of(), Mock.Of(), Mock.Of()); + using var cancellationSource = new CancellationTokenSource(); + + cancellationSource.Cancel(); + Assert.That(async () => await producer.CloseAsync(cancellationSource.Token), Throws.InstanceOf(), "Cancellation should trigger the appropriate exception."); + Assert.That(producer.Closed, Is.False, "Cancellation should have interrupted closing and left the producer in an open state."); + } + + /// + /// Verifies functionality of the + /// method. + /// + /// + [Test] + public void UpdateRetryPolicyValidatesTheRetryPolicy() + { + var producer = new AmqpEventHubProducer("aHub", "0", Mock.Of(), Mock.Of(), Mock.Of()); + Assert.That(() => producer.UpdateRetryPolicy(null), Throws.ArgumentNullException); + } + + /// + /// Verifies functionality of the + /// method. + /// + /// + [Test] + public void UpdateRetryPolicyUpdatesTheRetryPolicy() + { + var newPolicy = new BasicRetryPolicy(new RetryOptions { Delay = TimeSpan.FromMilliseconds(50) }); + var producer = new AmqpEventHubProducer("aHub", null, Mock.Of(), Mock.Of(), Mock.Of()); + + Assert.That(GetActiveRetryPolicy(producer), Is.Not.SameAs(newPolicy), "The initial policy should be a unique instance"); + + producer.UpdateRetryPolicy(newPolicy); + Assert.That(GetActiveRetryPolicy(producer), Is.SameAs(newPolicy), "The updated policy should match"); + } + + /// + /// Verifies functionality of the + /// method. + /// + /// + [Test] + public void UpdateRetryPolicyUpdatesTheOperationTimeout() + { + var initialPolicy = new BasicRetryPolicy(new RetryOptions { TryTimeout = TimeSpan.FromSeconds(17) }); + var initialTimeout = initialPolicy.CalculateTryTimeout(0); + var producer = new AmqpEventHubProducer("aHub", "0", Mock.Of(), Mock.Of(), initialPolicy); + + Assert.That(GetTimeout(producer), Is.EqualTo(initialTimeout), "The initial timeout should match"); + + var newPolicy = new BasicRetryPolicy(new RetryOptions { TryTimeout = TimeSpan.FromMilliseconds(50) }); + TimeSpan newTimeout = newPolicy.CalculateTryTimeout(0); + + producer.UpdateRetryPolicy(newPolicy); + Assert.That(GetTimeout(producer), Is.EqualTo(newTimeout), "The updated timeout should match"); + } + + /// + /// Verifies functionality of the + /// method. + /// + /// + [Test] + public void CreateBatchAsyncValidatesTheOptions() + { + var producer = new AmqpEventHubProducer("aHub", null, Mock.Of(), Mock.Of(), Mock.Of()); + Assert.That(async () => await producer.CreateBatchAsync(null, CancellationToken.None), Throws.ArgumentNullException); + } + + /// + /// Verifies functionality of the + /// method. + /// + /// + [Test] + public async Task CreateBatchAsyncEnsuresMaximumMessageSizeIsPopulated() + { + var retryPolicy = new BasicRetryPolicy(new RetryOptions { TryTimeout = TimeSpan.FromSeconds(17) }); + var producer = new Mock("aHub", null, Mock.Of(), new AmqpMessageConverter(), retryPolicy) + { + CallBase = true + }; + + producer + .Protected() + .Setup>("CreateLinkAndEnsureProducerStateAsync", + ItExpr.IsAny(), + ItExpr.IsAny(), + ItExpr.IsAny()) + .Callback(() => SetMaximumMessageSize(producer.Object, 512)) + .Returns(Task.FromResult(new SendingAmqpLink(new AmqpLinkSettings()))) + .Verifiable(); + + using TransportEventBatch batch = await producer.Object.CreateBatchAsync(new BatchOptions(), default); + producer.VerifyAll(); + } + + /// + /// Verifies functionality of the + /// method. + /// + /// + [Test] + public async Task CreateBatchAsyncDefaultsTheMaximumSizeWhenNotProvided() + { + var expectedMaximumSize = 512; + var options = new BatchOptions { MaximumSizeInBytes = null }; + var retryPolicy = new BasicRetryPolicy(new RetryOptions { TryTimeout = TimeSpan.FromSeconds(17) }); + + var producer = new Mock("aHub", null, Mock.Of(), new AmqpMessageConverter(), retryPolicy) + { + CallBase = true + }; + + producer + .Protected() + .Setup>("CreateLinkAndEnsureProducerStateAsync", + ItExpr.IsAny(), + ItExpr.IsAny(), + ItExpr.IsAny()) + .Callback(() => SetMaximumMessageSize(producer.Object, expectedMaximumSize)) + .Returns(Task.FromResult(new SendingAmqpLink(new AmqpLinkSettings()))) + .Verifiable(); + + using TransportEventBatch batch = await producer.Object.CreateBatchAsync(options, default); + Assert.That(options.MaximumSizeInBytes, Is.EqualTo(expectedMaximumSize)); + } + + /// + /// Verifies functionality of the + /// method. + /// + /// + [Test] + public async Task CreateBatchAsyncRespectsTheMaximumSizeWhenProvided() + { + var expectedMaximumSize = 512; + var options = new BatchOptions { MaximumSizeInBytes = expectedMaximumSize }; + var retryPolicy = new BasicRetryPolicy(new RetryOptions { TryTimeout = TimeSpan.FromSeconds(17) }); + + var producer = new Mock("aHub", null, Mock.Of(), new AmqpMessageConverter(), retryPolicy) + { + CallBase = true + }; + + producer + .Protected() + .Setup>("CreateLinkAndEnsureProducerStateAsync", + ItExpr.IsAny(), + ItExpr.IsAny(), + ItExpr.IsAny()) + .Callback(() => SetMaximumMessageSize(producer.Object, expectedMaximumSize + 27)) + .Returns(Task.FromResult(new SendingAmqpLink(new AmqpLinkSettings()))) + .Verifiable(); + + using TransportEventBatch batch = await producer.Object.CreateBatchAsync(options, default); + Assert.That(options.MaximumSizeInBytes, Is.EqualTo(expectedMaximumSize)); + } + + /// + /// Verifies functionality of the + /// method. + /// + /// + [Test] + public void CreateBatchAsyncVerifiesTheMaximumSize() + { + var linkMaximumSize = 512; + var options = new BatchOptions { MaximumSizeInBytes = 1024 }; + var retryPolicy = new BasicRetryPolicy(new RetryOptions { TryTimeout = TimeSpan.FromSeconds(17) }); + + var producer = new Mock("aHub", null, Mock.Of(), new AmqpMessageConverter(), retryPolicy) + { + CallBase = true + }; + + producer + .Protected() + .Setup>("CreateLinkAndEnsureProducerStateAsync", + ItExpr.IsAny(), + ItExpr.IsAny(), + ItExpr.IsAny()) + .Callback(() => SetMaximumMessageSize(producer.Object, linkMaximumSize)) + .Returns(Task.FromResult(new SendingAmqpLink(new AmqpLinkSettings()))) + .Verifiable(); + + Assert.That(async () => await producer.Object.CreateBatchAsync(options, default), Throws.InstanceOf()); + } + + /// + /// Verifies functionality of the + /// method. + /// + /// + [Test] + public async Task CreateBatchAsyncBuildsAnAmqpEventBatchWithTheOptions() + { + var options = new BatchOptions { MaximumSizeInBytes = 512 }; + var retryPolicy = new BasicRetryPolicy(new RetryOptions { TryTimeout = TimeSpan.FromSeconds(17) }); + + var producer = new Mock("aHub", null, Mock.Of(), new AmqpMessageConverter(), retryPolicy) + { + CallBase = true + }; + + producer + .Protected() + .Setup>("CreateLinkAndEnsureProducerStateAsync", + ItExpr.IsAny(), + ItExpr.IsAny(), + ItExpr.IsAny()) + .Callback(() => SetMaximumMessageSize(producer.Object, options.MaximumSizeInBytes.Value + 982)) + .Returns(Task.FromResult(new SendingAmqpLink(new AmqpLinkSettings()))) + .Verifiable(); + + using TransportEventBatch batch = await producer.Object.CreateBatchAsync(options, default); + + Assert.That(batch, Is.Not.Null, "The created batch should be populated."); + Assert.That(batch, Is.InstanceOf(), $"The created batch should be an { nameof(AmqpEventBatch) }."); + Assert.That(GetEventBatchOptions((AmqpEventBatch)batch), Is.SameAs(options), "The provided options should have been used."); + } + + /// + /// Verifies functionality of the + /// method. + /// + /// + [Test] + public void SendEnumerableValidatesTheEvents() + { + var producer = new AmqpEventHubProducer("aHub", null, Mock.Of(), new AmqpMessageConverter(), Mock.Of()); + Assert.That(async () => await producer.SendAsync(null, new SendOptions(), CancellationToken.None), Throws.ArgumentNullException); + } + + /// + /// Verifies functionality of the + /// method. + /// + /// + [Test] + public async Task SendEnumerableEnsuresNotClosed() + { + var producer = new AmqpEventHubProducer("aHub", null, Mock.Of(), new AmqpMessageConverter(), Mock.Of()); + await producer.CloseAsync(CancellationToken.None); + + Assert.That(async () => await producer.SendAsync(Enumerable.Empty(), new SendOptions(), CancellationToken.None), Throws.InstanceOf()); + } + + /// + /// Verifies functionality of the + /// method. + /// + /// + [Test] + public async Task SendEnumerableUsesThePartitionKey() + { + var expectedPartitionKey = "some key"; + var options = new BatchOptions { PartitionKey = expectedPartitionKey }; + var retryPolicy = new BasicRetryPolicy(new RetryOptions { TryTimeout = TimeSpan.FromSeconds(17) }); + + var producer = new Mock("aHub", null, Mock.Of(), new AmqpMessageConverter(), retryPolicy) + { + CallBase = true + }; + + producer + .Protected() + .Setup("SendAsync", + ItExpr.IsAny>(), + ItExpr.Is(value => value == expectedPartitionKey), + ItExpr.IsAny()) + .Returns(Task.CompletedTask) + .Verifiable(); + + await producer.Object.SendAsync(new[] { new EventData(new byte[] { 0x15 }) }, options, CancellationToken.None); + producer.VerifyAll(); + } + + /// + /// Verifies functionality of the + /// method. + /// + /// + [Test] + [TestCase(null)] + [TestCase("")] + [TestCase("somekEy")] + public async Task SendEnumerableCreatesTheAmqpMessageFromTheEnumerable(string partitonKey) + { + var messageFactory = default(Func); + var events = new[] { new EventData(new byte[] { 0x15 }) }; + + var producer = new Mock("aHub", null, Mock.Of(), new AmqpMessageConverter(), Mock.Of()) + { + CallBase = true + }; + + producer + .Protected() + .Setup("SendAsync", + ItExpr.IsAny>(), + ItExpr.IsAny(), + ItExpr.IsAny()) + .Callback, string, CancellationToken>( (factory, key, token) => messageFactory = factory) + .Returns(Task.CompletedTask); + + await producer.Object.SendAsync(events, new SendOptions { PartitionKey = partitonKey }, CancellationToken.None); + Assert.That(messageFactory, Is.Not.Null, "The batch message factory should have been set."); + + using var batchMessage = new AmqpMessageConverter().CreateBatchFromEvents(events, partitonKey); + using var factoryMessage = messageFactory(); + + Assert.That(factoryMessage.SerializedMessageSize, Is.EqualTo(batchMessage.SerializedMessageSize), "The serialized size of the messages should match."); + } + + /// + /// Verifies functionality of the + /// method. + /// + /// + [Test] + public void SendEnumerableRespectsTheCancellationTokenIfSetWhenCalled() + { + using CancellationTokenSource cancellationSource = new CancellationTokenSource(); + cancellationSource.Cancel(); + + var producer = new AmqpEventHubProducer("aHub", null, Mock.Of(), new AmqpMessageConverter(), Mock.Of()); + Assert.That(async () => await producer.SendAsync(new[] { new EventData(new byte[] { 0x15 }) }, new SendOptions(), cancellationSource.Token), Throws.InstanceOf()); + } + + /// + /// Verifies functionality of the + /// method. + /// + /// + [Test] + [TestCaseSource(nameof(RetryOptionTestCases))] + public void SendEnumerableRespectsTheRetryPolicy(RetryOptions retryOptions) + { + var partitionId = "testMe"; + var retriableException = new EventHubsException(true, "Test"); + var retryPolicy = new BasicRetryPolicy(retryOptions); + + var producer = new Mock("aHub", partitionId, Mock.Of(), new AmqpMessageConverter(), retryPolicy) + { + CallBase = true + }; + + producer + .Protected() + .Setup>("CreateLinkAndEnsureProducerStateAsync", + ItExpr.IsAny(), + ItExpr.IsAny(), + ItExpr.IsAny()) + .Throws(retriableException); + + using CancellationTokenSource cancellationSource = new CancellationTokenSource(); + Assert.That(async () => await producer.Object.SendAsync(new[] { new EventData(new byte[] { 0x65 }) }, new SendOptions(), cancellationSource.Token), Throws.InstanceOf(retriableException.GetType())); + + producer + .Protected() + .Verify("CreateLinkAndEnsureProducerStateAsync", Times.Exactly(1 + retryOptions.MaximumRetries), + ItExpr.Is(value => value == partitionId), + ItExpr.IsAny(), + ItExpr.IsAny()); + } + + /// + /// Verifies functionality of the + /// method. + /// + /// + [Test] + public void SendBatchValidatesTheBatch() + { + var producer = new AmqpEventHubProducer("aHub", null, Mock.Of(), new AmqpMessageConverter(), Mock.Of()); + Assert.That(async () => await producer.SendAsync(null, CancellationToken.None), Throws.ArgumentNullException); + } + + /// + /// Verifies functionality of the + /// method. + /// + /// + [Test] + public async Task SendBatchEnsuresNotClosed() + { + var expectedMaximumSize = 512; + var options = new BatchOptions { MaximumSizeInBytes = null }; + var retryPolicy = new BasicRetryPolicy(new RetryOptions { TryTimeout = TimeSpan.FromSeconds(17) }); + + var producer = new Mock("aHub", null, Mock.Of(), new AmqpMessageConverter(), retryPolicy) + { + CallBase = true + }; + + producer + .Protected() + .Setup>("CreateLinkAndEnsureProducerStateAsync", + ItExpr.IsAny(), + ItExpr.IsAny(), + ItExpr.IsAny()) + .Callback(() => SetMaximumMessageSize(producer.Object, expectedMaximumSize)) + .Returns(Task.FromResult(new SendingAmqpLink(new AmqpLinkSettings()))); + + using TransportEventBatch batch = await producer.Object.CreateBatchAsync(options, default); + + await producer.Object.CloseAsync(CancellationToken.None); + Assert.That(async () => await producer.Object.SendAsync(new EventDataBatch(batch, new SendOptions()), CancellationToken.None), Throws.InstanceOf()); + } + + /// + /// Verifies functionality of the + /// method. + /// + /// + [Test] + public async Task SendBatchUsesThePartitionKey() + { + var expectedMaximumSize = 512; + var expectedPartitionKey = "some key"; + var options = new BatchOptions { PartitionKey = expectedPartitionKey }; + var retryPolicy = new BasicRetryPolicy(new RetryOptions { TryTimeout = TimeSpan.FromSeconds(17) }); + + var producer = new Mock("aHub", null, Mock.Of(), new AmqpMessageConverter(), retryPolicy) + { + CallBase = true + }; + + producer + .Protected() + .Setup>("CreateLinkAndEnsureProducerStateAsync", + ItExpr.IsAny(), + ItExpr.IsAny(), + ItExpr.IsAny()) + .Callback(() => SetMaximumMessageSize(producer.Object, expectedMaximumSize)) + .Returns(Task.FromResult(new SendingAmqpLink(new AmqpLinkSettings()))); + + producer + .Protected() + .Setup("SendAsync", + ItExpr.IsAny>(), + ItExpr.Is(value => value == expectedPartitionKey), + ItExpr.IsAny()) + .Returns(Task.CompletedTask) + .Verifiable(); + + using TransportEventBatch batch = await producer.Object.CreateBatchAsync(options, default); + await producer.Object.SendAsync(new EventDataBatch(batch, options), CancellationToken.None); + + producer.VerifyAll(); + } + + /// + /// Verifies functionality of the + /// method. + /// + /// + [Test] + [TestCase(null)] + [TestCase("")] + [TestCase("somekEy")] + public async Task SendBatchCreatesTheAmqpMessageFromTheBatch(string partitonKey) + { + var messageFactory = default(Func); + var expectedMaximumSize = 512; + var options = new BatchOptions { PartitionKey = partitonKey }; + var retryPolicy = new BasicRetryPolicy(new RetryOptions { TryTimeout = TimeSpan.FromSeconds(17) }); + + var producer = new Mock("aHub", null, Mock.Of(), new AmqpMessageConverter(), retryPolicy) + { + CallBase = true + }; + + producer + .Protected() + .Setup>("CreateLinkAndEnsureProducerStateAsync", + ItExpr.IsAny(), + ItExpr.IsAny(), + ItExpr.IsAny()) + .Callback(() => SetMaximumMessageSize(producer.Object, expectedMaximumSize)) + .Returns(Task.FromResult(new SendingAmqpLink(new AmqpLinkSettings()))); + + producer + .Protected() + .Setup("SendAsync", + ItExpr.IsAny>(), + ItExpr.IsAny(), + ItExpr.IsAny()) + .Callback, string, CancellationToken>( (factory, key, token) => messageFactory = factory) + .Returns(Task.CompletedTask); + + using TransportEventBatch transportBatch = await producer.Object.CreateBatchAsync(options, default); + + using var batch = new EventDataBatch(transportBatch, options); + batch.TryAdd(new EventData(new byte[] { 0x15 })); + + await producer.Object.SendAsync(batch, CancellationToken.None); + Assert.That(messageFactory, Is.Not.Null, "The batch message factory should have been set."); + + using var batchMessage = new AmqpMessageConverter().CreateBatchFromMessages(batch.AsEnumerable(), partitonKey); + using var factoryMessage = messageFactory(); + + Assert.That(factoryMessage.SerializedMessageSize, Is.EqualTo(batchMessage.SerializedMessageSize), "The serialized size of the messages should match."); + } + + /// + /// Verifies functionality of the + /// method. + /// + /// + [Test] + public async Task SendBatchDoesNotDisposeTheEventDataBatch() + { + var expectedMaximumSize = 512; + var options = new BatchOptions { MaximumSizeInBytes = null }; + var retryPolicy = new BasicRetryPolicy(new RetryOptions { TryTimeout = TimeSpan.FromSeconds(17) }); + + var producer = new Mock("aHub", null, Mock.Of(), new AmqpMessageConverter(), retryPolicy) + { + CallBase = true + }; + + producer + .Protected() + .Setup>("CreateLinkAndEnsureProducerStateAsync", + ItExpr.IsAny(), + ItExpr.IsAny(), + ItExpr.IsAny()) + .Callback(() => SetMaximumMessageSize(producer.Object, expectedMaximumSize)) + .Returns(Task.FromResult(new SendingAmqpLink(new AmqpLinkSettings()))); + + producer + .Protected() + .Setup("SendAsync", + ItExpr.IsAny>(), + ItExpr.IsAny(), + ItExpr.IsAny()) + .Returns(Task.CompletedTask); + + using TransportEventBatch transportBatch = await producer.Object.CreateBatchAsync(options, default); + + using var batch = new EventDataBatch(transportBatch, options); + batch.TryAdd(new EventData(new byte[] { 0x15 })); + + await producer.Object.SendAsync(batch, CancellationToken.None); + + Assert.That(batch, Is.Not.Null, "The batch should not have been set to null."); + Assert.That(() => batch.TryAdd(new EventData(new byte[] { 0x23 })), Throws.Nothing, "The batch should not have been disposed."); + } + + /// + /// Verifies functionality of the + /// method. + /// + /// + [Test] + public async Task SendBatchDoesNotDisposeTheEventsInTheSourceBatch() + { + var expectedMaximumSize = 512; + var options = new BatchOptions { MaximumSizeInBytes = null }; + var retryPolicy = new BasicRetryPolicy(new RetryOptions { TryTimeout = TimeSpan.FromSeconds(17) }); + + var producer = new Mock("aHub", null, Mock.Of(), new AmqpMessageConverter(), retryPolicy) + { + CallBase = true + }; + + producer + .Protected() + .Setup>("CreateLinkAndEnsureProducerStateAsync", + ItExpr.IsAny(), + ItExpr.IsAny(), + ItExpr.IsAny()) + .Callback(() => SetMaximumMessageSize(producer.Object, expectedMaximumSize)) + .Returns(Task.FromResult(new SendingAmqpLink(new AmqpLinkSettings()))); + + producer + .Protected() + .Setup("SendAsync", + ItExpr.IsAny>(), + ItExpr.IsAny(), + ItExpr.IsAny()) + .Returns(Task.CompletedTask); + + using TransportEventBatch transportBatch = await producer.Object.CreateBatchAsync(options, default); + + using var batch = new EventDataBatch(transportBatch, options); + batch.TryAdd(new EventData(new byte[] { 0x15 })); + + await producer.Object.SendAsync(batch, CancellationToken.None); + + Assert.That(batch, Is.Not.Null, "The batch should not have been set to null."); + Assert.That(() => batch.AsEnumerable().Single().ThrowIfDisposed(), Throws.Nothing, "The events within the source batch should not have been disposed."); + } + + /// + /// Verifies functionality of the + /// method. + /// + /// + [Test] + public async Task SendBatchRespectsTheCancellationTokenIfSetWhenCalled() + { + var expectedMaximumSize = 512; + var options = new BatchOptions(); + var retryPolicy = new BasicRetryPolicy(new RetryOptions { TryTimeout = TimeSpan.FromSeconds(17) }); + + var producer = new Mock("aHub", null, Mock.Of(), new AmqpMessageConverter(), retryPolicy) + { + CallBase = true + }; + + producer + .Protected() + .Setup>("CreateLinkAndEnsureProducerStateAsync", + ItExpr.IsAny(), + ItExpr.IsAny(), + ItExpr.IsAny()) + .Callback(() => SetMaximumMessageSize(producer.Object, expectedMaximumSize)) + .Returns(Task.FromResult(new SendingAmqpLink(new AmqpLinkSettings()))); + + using TransportEventBatch batch = await producer.Object.CreateBatchAsync(options, default); + using CancellationTokenSource cancellationSource = new CancellationTokenSource(); + + cancellationSource.Cancel(); + Assert.That(async () => await producer.Object.SendAsync(new EventDataBatch(batch, options), cancellationSource.Token), Throws.InstanceOf()); + } + + /// + /// Verifies functionality of the + /// method. + /// + /// + [Test] + [TestCaseSource(nameof(RetryOptionTestCases))] + public void SendBatchRespectsTheRetryPolicy(RetryOptions retryOptions) + { + var partitionKey = "testMe"; + var options = new BatchOptions { PartitionKey = partitionKey }; + var retriableException = new EventHubsException(true, "Test"); + var retryPolicy = new BasicRetryPolicy(retryOptions); + var batch = new EventDataBatch(Mock.Of(), options); + + var producer = new Mock("aHub", null, Mock.Of(), new AmqpMessageConverter(), retryPolicy) + { + CallBase = true + }; + + producer + .Protected() + .Setup>("CreateLinkAndEnsureProducerStateAsync", + ItExpr.IsAny(), + ItExpr.IsAny(), + ItExpr.IsAny()) + .Throws(retriableException); + + using CancellationTokenSource cancellationSource = new CancellationTokenSource(); + Assert.That(async () => await producer.Object.SendAsync(batch, cancellationSource.Token), Throws.InstanceOf(retriableException.GetType())); + + producer + .Protected() + .Verify("CreateLinkAndEnsureProducerStateAsync", Times.Exactly(1 + retryOptions.MaximumRetries), + ItExpr.Is(value => value == null), + ItExpr.IsAny(), + ItExpr.IsAny()); + } + + /// + /// Gets set of batch options that a is using + /// by accessing its private field. + /// + /// + /// The batch to retrieve the source policy from. + /// + /// The batch options. + /// + private static BatchOptions GetEventBatchOptions(AmqpEventBatch batch) => + (BatchOptions) + typeof(AmqpEventBatch) + .GetProperty("Options", BindingFlags.Instance | BindingFlags.NonPublic) + .GetValue(batch); + + /// + /// Gets the active retry policy for the given producer, using the + /// private field. + /// + /// + private static EventHubRetryPolicy GetActiveRetryPolicy(AmqpEventHubProducer target) => + (EventHubRetryPolicy) + typeof(AmqpEventHubProducer) + .GetField("_retryPolicy", BindingFlags.Instance | BindingFlags.NonPublic) + .GetValue(target); + + /// + /// Gets the active operation timeout for the given producer, using the + /// private field. + /// + /// + private static TimeSpan GetTimeout(AmqpEventHubProducer target) => + (TimeSpan) + typeof(AmqpEventHubProducer) + .GetField("_tryTimeout", BindingFlags.Instance | BindingFlags.NonPublic) + .GetValue(target); + + /// + /// Sets the maximum message size for the given producer, using its + /// private accessor. + /// + /// + private static void SetMaximumMessageSize(AmqpEventHubProducer target, long value) + { + typeof(AmqpEventHubProducer) + .GetProperty("MaximumMessageSize", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.SetProperty) + .SetValue(target, value); + } + } +} diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpMessageConverterTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpMessageConverterTests.cs index 2e75cdc069c4..fc51d6ae27a7 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpMessageConverterTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Amqp/AmqpMessageConverterTests.cs @@ -124,7 +124,7 @@ public void CreateMessageFromEventProperlySetsThePartitionKeyAnnotation(string p using AmqpMessage message = converter.CreateMessageFromEvent(eventData, partitionKey); Assert.That(message, Is.Not.Null, "The AMQP message should have been created."); - Assert.That(message.MessageAnnotations.Map.TryGetValue(AmqpAnnotation.PartitionKey, out object annotationPartionKey), Is.EqualTo(!string.IsNullOrEmpty(partitionKey)), "The partition key annotation was not correctly set."); + Assert.That(message.MessageAnnotations.Map.TryGetValue(AmqpProperty.PartitionKey, out object annotationPartionKey), Is.EqualTo(!string.IsNullOrEmpty(partitionKey)), "The partition key annotation was not correctly set."); if (!string.IsNullOrEmpty(partitionKey)) { @@ -337,10 +337,10 @@ public void CreateBatchFromEventsWithOneMessagePopulatesEnvelopeProperties(strin using AmqpMessage message = converter.CreateBatchFromEvents(new[] { eventData }, partitionKey); Assert.That(message, Is.Not.Null, "The batch envelope should have been created."); Assert.That(message.Batchable, Is.True, "The batch envelope should be set to batchable."); - Assert.That(message.MessageFormat, Is.EqualTo(AmqpConstants.AmqpBatchedMessageFormat), "The batch envelope should have a batchable format."); + Assert.That(message.MessageFormat, Is.Null, "The batch envelope should be not be marked with a batchable format when created from one event."); Assert.That(message.DataBody, Is.Not.Null, "The batch envelope should a body."); Assert.That(message.DataBody.ToList().Count, Is.EqualTo(1), "The batch envelope should contain a single event in the body."); - Assert.That(message.MessageAnnotations.Map.TryGetValue(AmqpAnnotation.PartitionKey, out string partitionKeyAnnotation), Is.EqualTo(!string.IsNullOrEmpty(partitionKey)), "There should be an annotation if a partition key was present."); + Assert.That(message.MessageAnnotations.Map.TryGetValue(AmqpProperty.PartitionKey, out string partitionKeyAnnotation), Is.EqualTo(!string.IsNullOrEmpty(partitionKey)), "There should be an annotation if a partition key was present."); if (!string.IsNullOrEmpty(partitionKey)) { @@ -371,7 +371,7 @@ public void CreateBatchFromEventsWithMultipleEventsMessagePopulatesEnvelopePrope Assert.That(message.MessageFormat, Is.EqualTo(AmqpConstants.AmqpBatchedMessageFormat), "The batch envelope should be marked with a batchable format."); Assert.That(message.DataBody, Is.Not.Null, "The batch envelope should a body."); Assert.That(message.DataBody.ToList().Count, Is.EqualTo(events.Length), "The batch envelope should contain each batch event in the body."); - Assert.That(message.MessageAnnotations.Map.TryGetValue(AmqpAnnotation.PartitionKey, out string partitionKeyAnnotation), Is.EqualTo(!string.IsNullOrEmpty(partitionKey)), "There should be an annotation if a partition key was present."); + Assert.That(message.MessageAnnotations.Map.TryGetValue(AmqpProperty.PartitionKey, out string partitionKeyAnnotation), Is.EqualTo(!string.IsNullOrEmpty(partitionKey)), "There should be an annotation if a partition key was present."); if (!string.IsNullOrEmpty(partitionKey)) { @@ -481,7 +481,7 @@ public void CreateBatchFromEventsWithMultipleEventsAssignsThePartitionKeyToBodyM { AmqpMessage eventMessage = converter.CreateMessageFromEvent(events[index]); eventMessage.Batchable = true; - eventMessage.MessageAnnotations.Map[AmqpAnnotation.PartitionKey] = partitionKey; + eventMessage.MessageAnnotations.Map[AmqpProperty.PartitionKey] = partitionKey; using var memoryStream = new MemoryStream(); using var eventStream = eventMessage.ToStream(); @@ -538,10 +538,10 @@ public void CreateBatchFromMessagesWithOneMessagePopulatesEnvelopeProperties(str using AmqpMessage batchEnvelope = converter.CreateBatchFromMessages(new[] { source }, partitionKey); Assert.That(batchEnvelope, Is.Not.Null, "The batch envelope should have been created."); Assert.That(batchEnvelope.Batchable, Is.True, "The batch envelope should be set to batchable."); - Assert.That(batchEnvelope.MessageFormat, Is.EqualTo(AmqpConstants.AmqpBatchedMessageFormat), "The batch envelope should have a batchable format."); + Assert.That(batchEnvelope.MessageFormat, Is.Null, "The batch envelope should be not be marked with a batchable format when created from one event."); Assert.That(batchEnvelope.DataBody, Is.Not.Null, "The batch envelope should a body."); Assert.That(batchEnvelope.DataBody.ToList().Count, Is.EqualTo(1), "The batch envelope should contain a single event in the body."); - Assert.That(batchEnvelope.MessageAnnotations.Map.TryGetValue(AmqpAnnotation.PartitionKey, out string partitionKeyAnnotation), Is.EqualTo(!string.IsNullOrEmpty(partitionKey)), "There should be an annotation if a partition key was present."); + Assert.That(batchEnvelope.MessageAnnotations.Map.TryGetValue(AmqpProperty.PartitionKey, out string partitionKeyAnnotation), Is.EqualTo(!string.IsNullOrEmpty(partitionKey)), "There should be an annotation if a partition key was present."); if (!string.IsNullOrEmpty(partitionKey)) { @@ -571,7 +571,7 @@ public void CreateBatchFromMessagesWithMultipleEventsMessagePopulatesEnvelopePro Assert.That(batchEnvelope.MessageFormat, Is.EqualTo(AmqpConstants.AmqpBatchedMessageFormat), "The batch envelope should be marked with a batchable format."); Assert.That(batchEnvelope.DataBody, Is.Not.Null, "The batch envelope should a body."); Assert.That(batchEnvelope.DataBody.ToList().Count, Is.EqualTo(source.Length), "The batch envelope should contain each batch event in the body."); - Assert.That(batchEnvelope.MessageAnnotations.Map.TryGetValue(AmqpAnnotation.PartitionKey, out string partitionKeyAnnotation), Is.EqualTo(!string.IsNullOrEmpty(partitionKey)), "There should be an annotation if a partition key was present."); + Assert.That(batchEnvelope.MessageAnnotations.Map.TryGetValue(AmqpProperty.PartitionKey, out string partitionKeyAnnotation), Is.EqualTo(!string.IsNullOrEmpty(partitionKey)), "There should be an annotation if a partition key was present."); if (!string.IsNullOrEmpty(partitionKey)) { @@ -951,7 +951,7 @@ public void CreateEventFromMessagePopulatesTypedSystemProperties() message.MessageAnnotations.Map.Add(AmqpProperty.Offset, offset.ToString()); message.MessageAnnotations.Map.Add(AmqpProperty.SequenceNumber, sequenceNumber); - message.MessageAnnotations.Map.Add(AmqpProperty.EnqueuedTime, new DescribedType(AmqpProperty.Descriptor.DateTimeOffset, enqueuedTime.Ticks)); + message.MessageAnnotations.Map.Add(AmqpProperty.EnqueuedTime, enqueuedTime.Ticks); message.MessageAnnotations.Map.Add(AmqpProperty.PartitionKey, partitionKey); var converter = new AmqpMessageConverter(); @@ -1030,12 +1030,12 @@ public void CreateEventFromMessagePopulatesTypedSystemPropertiesAndMetrics() message.MessageAnnotations.Map.Add(AmqpProperty.Offset, offset.ToString()); message.MessageAnnotations.Map.Add(AmqpProperty.SequenceNumber, sequenceNumber); - message.MessageAnnotations.Map.Add(AmqpProperty.EnqueuedTime, new DescribedType(AmqpProperty.Descriptor.DateTimeOffset, enqueuedTime.Ticks)); + message.MessageAnnotations.Map.Add(AmqpProperty.EnqueuedTime, enqueuedTime.Ticks); message.MessageAnnotations.Map.Add(AmqpProperty.PartitionKey, partitionKey); - message.DeliveryAnnotations.Map.Add(AmqpManagement.ResponseMap.PartitionLastEnqueuedSequenceNumber, lastSequenceNumber); - message.DeliveryAnnotations.Map.Add(AmqpManagement.ResponseMap.PartitionLastEnqueuedOffset, lastOffset.ToString()); - message.DeliveryAnnotations.Map.Add(AmqpManagement.ResponseMap.PartitionLastEnqueuedTimeUtc, new DescribedType(AmqpProperty.Descriptor.DateTimeOffset, lastEnqueuedTime.Ticks)); + message.DeliveryAnnotations.Map.Add(AmqpProperty.PartitionLastEnqueuedSequenceNumber, lastSequenceNumber); + message.DeliveryAnnotations.Map.Add(AmqpProperty.PartitionLastEnqueuedOffset, lastOffset.ToString()); + message.DeliveryAnnotations.Map.Add(AmqpProperty.PartitionLastEnqueuedTimeUtc, lastEnqueuedTime.Ticks); var converter = new AmqpMessageConverter(); EventData eventData = converter.CreateEventFromMessage(message); @@ -1052,6 +1052,56 @@ public void CreateEventFromMessagePopulatesTypedSystemPropertiesAndMetrics() Assert.That(eventData.LastPartitionEnqueuedTime, Is.EqualTo(lastEnqueuedTime), "The last enqueued time should match."); } + /// + /// Verifies functionality of the + /// method. + /// + /// + [Test] + public void CreateEventFromMessagePopulatesEnqueueTimeFromDateTime() + { + var enqueuedTime = DateTimeOffset.Parse("2015-10-27T12:00:00Z"); + var lastEnqueuedTime = DateTimeOffset.Parse("2012-03-04T08:42:00Z"); + + using var bodyStream = new MemoryStream(new byte[] { 0x11, 0x22, 0x33 }, false); + using var message = AmqpMessage.Create(bodyStream, true); + + message.MessageAnnotations.Map.Add(AmqpProperty.EnqueuedTime, enqueuedTime.UtcDateTime); + message.DeliveryAnnotations.Map.Add(AmqpProperty.PartitionLastEnqueuedTimeUtc, lastEnqueuedTime.UtcDateTime); + + var converter = new AmqpMessageConverter(); + EventData eventData = converter.CreateEventFromMessage(message); + + Assert.That(eventData, Is.Not.Null, "The event should have been created."); + Assert.That(eventData.EnqueuedTime, Is.EqualTo(enqueuedTime), "The enqueue time should match."); + Assert.That(eventData.LastPartitionEnqueuedTime, Is.EqualTo(lastEnqueuedTime), "The last enqueued time should match."); + } + + /// + /// Verifies functionality of the + /// method. + /// + /// + [Test] + public void CreateEventFromMessagePopulatesEnqueueTimeFromTicks() + { + var enqueuedTime = DateTimeOffset.Parse("2015-10-27T12:00:00Z"); + var lastEnqueuedTime = DateTimeOffset.Parse("2012-03-04T08:42:00Z"); + + using var bodyStream = new MemoryStream(new byte[] { 0x11, 0x22, 0x33 }, false); + using var message = AmqpMessage.Create(bodyStream, true); + + message.MessageAnnotations.Map.Add(AmqpProperty.EnqueuedTime, enqueuedTime.UtcTicks); + message.DeliveryAnnotations.Map.Add(AmqpProperty.PartitionLastEnqueuedTimeUtc, lastEnqueuedTime.UtcTicks); + + var converter = new AmqpMessageConverter(); + EventData eventData = converter.CreateEventFromMessage(message); + + Assert.That(eventData, Is.Not.Null, "The event should have been created."); + Assert.That(eventData.EnqueuedTime, Is.EqualTo(enqueuedTime), "The enqueue time should match."); + Assert.That(eventData.LastPartitionEnqueuedTime, Is.EqualTo(lastEnqueuedTime), "The last enqueued time should match."); + } + /// /// Verifies functionality of the /// method. diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Compatibility/TrackOneEventHubProducerTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Compatibility/TrackOneEventHubProducerTests.cs index a5551099ff35..946927c5aee8 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Compatibility/TrackOneEventHubProducerTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Compatibility/TrackOneEventHubProducerTests.cs @@ -189,7 +189,7 @@ public async Task SendAsyncTransformsEventBatches() AmqpMessage.Create(new Data { Value = new ArraySegment(new byte[] { 0x33 }) }), }; - var options = new BatchOptions { MaximumizeInBytes = 30 }; + var options = new BatchOptions { MaximumSizeInBytes = 30 }; var transportBatch = new TransportBatchMock { Messages = messages }; var batch = new EventDataBatch(transportBatch, options); var mock = new ObservableSenderMock(new ClientMock(), null); @@ -231,7 +231,7 @@ public async Task SendAsyncForwardsThePartitionHashKeyForBatches() }; var expectedHashKey = "TestKEy"; - var options = new BatchOptions { MaximumizeInBytes = 30, PartitionKey = expectedHashKey }; + var options = new BatchOptions { MaximumSizeInBytes = 30, PartitionKey = expectedHashKey }; var transportBatch = new TransportBatchMock { Messages = messages }; var batch = new EventDataBatch(transportBatch, options); var mock = new ObservableSenderMock(new ClientMock(), null); @@ -366,12 +366,12 @@ public async Task CreateBatchAsyncEnsuresLinkCreation() public async Task CreateBatchAsyncDefaultsTheMaximumSizeWhenNotProvided() { var expectedMaximumSize = 512; - var options = new BatchOptions { MaximumizeInBytes = null }; + var options = new BatchOptions { MaximumSizeInBytes = null }; var mock = new ObservableSenderMock(new ClientMock(), null, expectedMaximumSize); var producer = new TrackOneEventHubProducer(_ => mock, Mock.Of()); await producer.CreateBatchAsync(options, default); - Assert.That(options.MaximumizeInBytes, Is.EqualTo(expectedMaximumSize)); + Assert.That(options.MaximumSizeInBytes, Is.EqualTo(expectedMaximumSize)); } /// @@ -383,12 +383,12 @@ public async Task CreateBatchAsyncDefaultsTheMaximumSizeWhenNotProvided() public async Task CreateBatchAsyncRespectsTheMaximumSizeWhenProvided() { var expectedMaximumSize = 512; - var options = new BatchOptions { MaximumizeInBytes = 512 }; + var options = new BatchOptions { MaximumSizeInBytes = 512 }; var mock = new ObservableSenderMock(new ClientMock(), null); var producer = new TrackOneEventHubProducer(_ => mock, Mock.Of()); await producer.CreateBatchAsync(options, default); - Assert.That(options.MaximumizeInBytes, Is.EqualTo(expectedMaximumSize)); + Assert.That(options.MaximumSizeInBytes, Is.EqualTo(expectedMaximumSize)); } /// @@ -400,7 +400,7 @@ public async Task CreateBatchAsyncRespectsTheMaximumSizeWhenProvided() public void CreateBatchAsyncVerifiesTheMaximumSize() { var linkMaximumSize = 512; - var options = new BatchOptions { MaximumizeInBytes = 1024 }; + var options = new BatchOptions { MaximumSizeInBytes = 1024 }; var mock = new ObservableSenderMock(new ClientMock(), null, linkMaximumSize); var producer = new TrackOneEventHubProducer(_ => mock, Mock.Of()); @@ -415,7 +415,7 @@ public void CreateBatchAsyncVerifiesTheMaximumSize() [Test] public async Task CreateBatchAsyncBuildsAnAmqpEventBatchWithTheOptions() { - var options = new BatchOptions { MaximumizeInBytes = 512 }; + var options = new BatchOptions { MaximumSizeInBytes = 512 }; var mock = new ObservableSenderMock(new ClientMock(), null); var producer = new TrackOneEventHubProducer(_ => mock, Mock.Of()); TransportEventBatch batch = await producer.CreateBatchAsync(options, default); diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Compatibility/TrackOneExceptionExtensionsTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Compatibility/TrackOneExceptionExtensionsTests.cs index 65936c61ddf5..ba678e7e334f 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Compatibility/TrackOneExceptionExtensionsTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Compatibility/TrackOneExceptionExtensionsTests.cs @@ -93,7 +93,7 @@ public void EventHubsExceptionTypesShouldHaveMappings() var exemptions = new HashSet(new[] { - typeof(EventHubsObjectClosedException) + typeof(EventHubsClientClosedException) }); IOrderedEnumerable allDerrivedTypes = typeof(EventHubsException) diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Core/ArgumentTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Core/ArgumentTests.cs index 7b44915bad21..697e8879085f 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Core/ArgumentTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Core/ArgumentTests.cs @@ -196,7 +196,7 @@ public void NotClosedAllowsUnclosed() public void NotClosedEnforcesClosed() { var target = "test"; - Assert.That(() => Argument.AssertNotClosed(true, target), Throws.InstanceOf().And.Message.Contains(target)); + Assert.That(() => Argument.AssertNotClosed(true, target), Throws.InstanceOf().And.Message.Contains(target)); } } } diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Errors/EventHubsExceptionTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Errors/EventHubsExceptionTests.cs index a76190f1f8c5..72c007616c68 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Errors/EventHubsExceptionTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Errors/EventHubsExceptionTests.cs @@ -54,7 +54,7 @@ public static IEnumerable DerrivedExceptionTransientTestCases() yield return new object[] { new EventHubsResourceNotFoundException("resource", "message"), false }; yield return new object[] { new QuotaExceededException("resource", "message"), false }; yield return new object[] { new ConsumerDisconnectedException("resource", "message"), false }; - yield return new object[] { new EventHubsObjectClosedException("resource", "message"), false }; + yield return new object[] { new EventHubsClientClosedException("resource", "message"), false }; } /// diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/EventHubClient/EventHubClientLiveTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/EventHubClient/EventHubClientLiveTests.cs index f9b7a24e2959..38238de5651b 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/EventHubClient/EventHubClientLiveTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/EventHubClient/EventHubClientLiveTests.cs @@ -10,6 +10,7 @@ using System.Threading.Tasks; using Azure.Messaging.EventHubs.Authorization; using Azure.Messaging.EventHubs.Core; +using Azure.Messaging.EventHubs.Errors; using Azure.Messaging.EventHubs.Metadata; using Azure.Messaging.EventHubs.Tests.Infrastructure; using NUnit.Framework; @@ -145,7 +146,7 @@ public async Task ClientCanRetrieveProperties(TransportType transportType) Assert.That(properties, Is.Not.Null, "A set of properties should have been returned."); Assert.That(properties.Name, Is.EqualTo(scope.EventHubName), "The property Event Hub name should match the scope."); Assert.That(properties.PartitionIds.Length, Is.EqualTo(partitionCount), "The properties should have the requested number of partitions."); - Assert.That(properties.CreatedAt, Is.EqualTo(DateTimeOffset.UtcNow).Within(TimeSpan.FromSeconds(10)), "The Event Hub should have been created just about now."); + Assert.That(properties.CreatedAt, Is.EqualTo(DateTimeOffset.UtcNow).Within(TimeSpan.FromSeconds(60)), "The Event Hub should have been created just about now."); } } } @@ -253,9 +254,9 @@ public async Task ClientCannotRetrieveMetadataWhenClosed(bool sync) await Task.Delay(TimeSpan.FromSeconds(5)); - Assert.That(async () => await client.GetPartitionIdsAsync(), Throws.TypeOf()); - Assert.That(async () => await client.GetPropertiesAsync(), Throws.TypeOf()); - Assert.That(async () => await client.GetPartitionPropertiesAsync(partition), Throws.TypeOf()); + Assert.That(async () => await client.GetPartitionIdsAsync(), Throws.TypeOf().Or.TypeOf()); + Assert.That(async () => await client.GetPropertiesAsync(), Throws.TypeOf().Or.TypeOf()); + Assert.That(async () => await client.GetPartitionPropertiesAsync(partition), Throws.TypeOf().Or.TypeOf()); } } } diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/EventHubConsumer/EventHubConsumerLiveTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/EventHubConsumer/EventHubConsumerLiveTests.cs index 2b08f94dd38d..608da1e33130 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/EventHubConsumer/EventHubConsumerLiveTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/EventHubConsumer/EventHubConsumerLiveTests.cs @@ -1379,7 +1379,7 @@ public async Task ConsumerCannotReceiveWhenClosed(bool sync) await consumer.CloseAsync(); } - Assert.That(async () => await consumer.ReceiveAsync(1, TimeSpan.Zero), Throws.InstanceOf()); + Assert.That(async () => await consumer.ReceiveAsync(1, TimeSpan.Zero), Throws.InstanceOf().Or.InstanceOf()); } } } @@ -1738,10 +1738,11 @@ public async Task OwnerConsumerDoesNotCloseLowerOrNoOwnerLevelConsumersFromOther /// /// [Test] - [Ignore("Test fails in Track One as well")] public async Task FailingToCreateOwnerConsumerDoesNotCompromiseReceiveBehavior() { - await using (EventHubScope scope = await EventHubScope.CreateAsync(2, "anotherConsumerGroup")) + var customConsumerGroup = "anotherConsumerGroup"; + + await using (EventHubScope scope = await EventHubScope.CreateAsync(2, new[] { customConsumerGroup })) { var connectionString = TestEnvironment.BuildConnectionStringForEventHub(scope.EventHubName); @@ -1760,9 +1761,9 @@ public async Task FailingToCreateOwnerConsumerDoesNotCompromiseReceiveBehavior() // It should be possible to create new valid consumers. - EventHubConsumer newExclusiveConsumer = client.CreateConsumer(EventHubConsumer.DefaultConsumerGroupName, partitionIds[0], EventPosition.Latest, new EventHubConsumerOptions { OwnerLevel = 10 }); + EventHubConsumer newExclusiveConsumer = client.CreateConsumer(EventHubConsumer.DefaultConsumerGroupName, partitionIds[0], EventPosition.Latest, new EventHubConsumerOptions { OwnerLevel = 30 }); EventHubConsumer anotherPartitionConsumer = client.CreateConsumer(EventHubConsumer.DefaultConsumerGroupName, partitionIds[1], EventPosition.Latest); - EventHubConsumer anotherConsumerGroupConsumer = client.CreateConsumer("anotherConsumerGroup", partitionIds[0], EventPosition.Latest); + EventHubConsumer anotherConsumerGroupConsumer = client.CreateConsumer(customConsumerGroup, partitionIds[0], EventPosition.Latest); Assert.That(async () => await newExclusiveConsumer.ReceiveAsync(1, TimeSpan.Zero), Throws.Nothing); Assert.That(async () => await anotherPartitionConsumer.ReceiveAsync(1, TimeSpan.Zero), Throws.Nothing); @@ -1786,7 +1787,6 @@ public async Task FailingToCreateOwnerConsumerDoesNotCompromiseReceiveBehavior() /// /// [Test] - [Ignore("Test fails in Track One as well")] public async Task FailingToCreateInvalidPartitionConsumerDoesNotCompromiseReceiveBehavior() { await using (EventHubScope scope = await EventHubScope.CreateAsync(1)) @@ -1827,7 +1827,6 @@ public async Task FailingToCreateInvalidPartitionConsumerDoesNotCompromiseReceiv /// /// [Test] - [Ignore("Test fails in Track One as well")] public async Task FailingToCreateInvalidConsumerGroupConsumerDoesNotCompromiseReceiveBehavior() { await using (EventHubScope scope = await EventHubScope.CreateAsync(1)) @@ -1928,7 +1927,9 @@ public async Task ConsumerCannotReceiveEventsSentToAnotherPartition() [Test] public async Task ConsumersInDifferentConsumerGroupsShouldAllReceiveEvents() { - await using (EventHubScope scope = await EventHubScope.CreateAsync(1, consumerGroup: "anotherConsumerGroup")) + var customConsumerGroup = "anotherConsumerGroup"; + + await using (EventHubScope scope = await EventHubScope.CreateAsync(1, new[] { customConsumerGroup })) { var connectionString = TestEnvironment.BuildConnectionStringForEventHub(scope.EventHubName); @@ -1945,7 +1946,7 @@ public async Task ConsumersInDifferentConsumerGroupsShouldAllReceiveEvents() await using (EventHubProducer producer = client.CreateProducer(new EventHubProducerOptions { PartitionId = partition })) await using (EventHubConsumer consumer = client.CreateConsumer(EventHubConsumer.DefaultConsumerGroupName, partition, EventPosition.Latest)) - await using (EventHubConsumer anotherConsumer = client.CreateConsumer("anotherConsumerGroup", partition, EventPosition.Latest)) + await using (EventHubConsumer anotherConsumer = client.CreateConsumer(customConsumerGroup, partition, EventPosition.Latest)) { // Initiate an operation to force the consumers to connect and set their positions at the // end of the event stream. diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/EventHubProducer/BatchOptionsTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/EventHubProducer/BatchOptionsTests.cs index eb8d501e7721..04c8662d67a1 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/EventHubProducer/BatchOptionsTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/EventHubProducer/BatchOptionsTests.cs @@ -25,7 +25,7 @@ public void CloneProducesACopy() var options = new BatchOptions { PartitionKey = "some_partition_123", - MaximumizeInBytes = (int.MaxValue + 122L) + MaximumSizeInBytes = (int.MaxValue + 122L) }; BatchOptions clone = options.Clone(); @@ -33,11 +33,11 @@ public void CloneProducesACopy() Assert.That(clone, Is.Not.Null, "The clone should not be null."); Assert.That(clone, Is.Not.SameAs(options), "The clone should not the same reference as the options."); Assert.That(clone.PartitionKey, Is.EqualTo(options.PartitionKey), "The partition key of the clone should match."); - Assert.That(clone.MaximumizeInBytes, Is.EqualTo(options.MaximumizeInBytes), "The maximum size should match."); + Assert.That(clone.MaximumSizeInBytes, Is.EqualTo(options.MaximumSizeInBytes), "The maximum size should match."); } /// - /// Verifies functionality of the + /// Verifies functionality of the /// method. /// /// @@ -45,11 +45,11 @@ public void CloneProducesACopy() public void MaximumBatchSizeInBytesEnforcesMinimum() { var options = new BatchOptions(); - Assert.That(() => options.MaximumizeInBytes = (EventHubProducer.MinimumBatchSizeLimit - 1), Throws.InstanceOf()); + Assert.That(() => options.MaximumSizeInBytes = (EventHubProducer.MinimumBatchSizeLimit - 1), Throws.InstanceOf()); } /// - /// Verifies functionality of the + /// Verifies functionality of the /// method. /// /// @@ -57,11 +57,11 @@ public void MaximumBatchSizeInBytesEnforcesMinimum() public void MaximumBatchSizeInBytesDoesNotLimitMaximum() { var options = new BatchOptions(); - Assert.That(() => options.MaximumizeInBytes = int.MaxValue, Throws.Nothing); + Assert.That(() => options.MaximumSizeInBytes = int.MaxValue, Throws.Nothing); } /// - /// Verifies functionality of the + /// Verifies functionality of the /// method. /// /// @@ -69,7 +69,7 @@ public void MaximumBatchSizeInBytesDoesNotLimitMaximum() public void MaximumBatchSizeInBytesAllowsNull() { var options = new BatchOptions(); - Assert.That(() => options.MaximumizeInBytes = null, Throws.Nothing); + Assert.That(() => options.MaximumSizeInBytes = null, Throws.Nothing); } } } diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/EventHubProducer/EventHubProducerLiveTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/EventHubProducer/EventHubProducerLiveTests.cs index b515cd4fbe8b..ec8232e28a06 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/EventHubProducer/EventHubProducerLiveTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/EventHubProducer/EventHubProducerLiveTests.cs @@ -242,10 +242,7 @@ public async Task ProducerCanSendSingleZeroLengthEvent() await using (EventHubProducer producer = client.CreateProducer()) { var singleEvent = new EventData(Array.Empty()); - EventData[] eventSet = new[] { new EventData(new byte[0]) }; - Assert.That(async () => await producer.SendAsync(singleEvent), Throws.Nothing); - Assert.That(async () => await producer.SendAsync(eventSet), Throws.Nothing); } } } @@ -446,7 +443,7 @@ public async Task ProducerCanSendZeroLengthEventBatch() await using (EventHubProducer producer = client.CreateProducer()) { using EventDataBatch batch = await producer.CreateBatchAsync(); - batch.TryAdd(new EventData(new byte[0])); + batch.TryAdd(new EventData(Array.Empty())); Assert.That(batch.Count, Is.EqualTo(1), "The batch should contain a single event."); Assert.That(async () => await producer.SendAsync(batch), Throws.Nothing); @@ -596,7 +593,7 @@ public async Task ProducerCannotSendWhenClosed(bool sync) await producer.CloseAsync(); } - Assert.That(async () => await producer.SendAsync(events), Throws.TypeOf()); + Assert.That(async () => await producer.SendAsync(events), Throws.TypeOf().Or.TypeOf()); } } } diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/EventHubProducer/EventHubProducerTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/EventHubProducer/EventHubProducerTests.cs index cc94fe548eb2..2bd73bc3885c 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/EventHubProducer/EventHubProducerTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/EventHubProducer/EventHubProducerTests.cs @@ -153,6 +153,7 @@ public void SettingTheRetryUpdatesTheTransportProducer() /// /// Verifies functionality of the + /// method. /// /// [Test] @@ -166,6 +167,7 @@ public void SendSingleWithoutOptionsRequiresAnEvent() /// /// Verifies functionality of the + /// method. /// /// [Test] @@ -179,6 +181,7 @@ public void SendSingleRequiresAnEvent() /// /// Verifies functionality of the + /// method. /// /// [Test] @@ -197,6 +200,7 @@ public async Task SendSingleWithoutOptionsDelegatesToBatchSend() /// /// Verifies functionality of the + /// method. /// /// [Test] @@ -215,6 +219,7 @@ public async Task SendSingleWitOptionsDelegatesToBatchSend() /// /// Verifies functionality of the + /// method. /// /// [Test] @@ -228,6 +233,7 @@ public void SendWithoutOptionsRequiresEvents() /// /// Verifies functionality of the + /// method. /// /// [Test] @@ -241,6 +247,7 @@ public void SendRequiresEvents() /// /// Verifies functionality of the + /// method. /// /// [Test] @@ -254,6 +261,7 @@ public void SendRequiresTheBatch() /// /// Verifies functionality of the + /// method. /// /// [Test] @@ -269,6 +277,7 @@ public void SendAllowsAPartitionHashKey() /// /// Verifies functionality of the + /// method. /// /// [Test] @@ -284,6 +293,7 @@ public void SendAllowsAPartitionHashKeyWithABatch() /// /// Verifies functionality of the + /// method. /// /// [Test] @@ -299,6 +309,7 @@ public void SendForASpecificPartitionDoesNotAllowAPartitionHashKey() /// /// Verifies functionality of the + /// method. /// /// [Test] @@ -314,6 +325,7 @@ public void SendForASpecificPartitionDoesNotAllowAPartitionHashKeyWithABatch() /// /// Verifies functionality of the + /// method. /// /// [Test] @@ -333,6 +345,7 @@ public async Task SendWithoutOptionsInvokesTheTransportProducer() /// /// Verifies functionality of the + /// method. /// /// [Test] @@ -353,6 +366,7 @@ public async Task SendInvokesTheTransportProducer() /// /// Verifies functionality of the + /// method. /// /// [Test] @@ -369,6 +383,7 @@ public async Task SendInvokesTheTransportProducerWithABatch() /// /// Verifies functionality of the + /// method. /// /// [Test] @@ -383,12 +398,13 @@ public void CreateBatchForASpecificPartitionDoesNotAllowAPartitionHashKey() /// /// Verifies functionality of the + /// method. /// /// [Test] public async Task CreateBatchInvokesTheTransportProducer() { - var batchOptions = new BatchOptions { PartitionKey = "Hi", MaximumizeInBytes = 9999 }; + var batchOptions = new BatchOptions { PartitionKey = "Hi", MaximumSizeInBytes = 9999 }; var transportProducer = new ObservableTransportProducerMock(); var producer = new EventHubProducer(transportProducer, new Uri("amqp://some.endpoint.com/path"), "dummy", new EventHubProducerOptions(), Mock.Of()); @@ -397,11 +413,12 @@ public async Task CreateBatchInvokesTheTransportProducer() Assert.That(transportProducer.CreateBatchCalledWith, Is.Not.Null, "The batch creation should have passed options."); Assert.That(transportProducer.CreateBatchCalledWith, Is.Not.SameAs(batchOptions), "The options should have been cloned."); Assert.That(transportProducer.CreateBatchCalledWith.PartitionKey, Is.EqualTo(batchOptions.PartitionKey), "The partition key should match."); - Assert.That(transportProducer.CreateBatchCalledWith.MaximumizeInBytes, Is.EqualTo(batchOptions.MaximumizeInBytes), "The maximum size should match."); + Assert.That(transportProducer.CreateBatchCalledWith.MaximumSizeInBytes, Is.EqualTo(batchOptions.MaximumSizeInBytes), "The maximum size should match."); } /// /// Verifies functionality of the + /// method. /// /// [Test] @@ -416,17 +433,18 @@ public async Task CreateBatchDefaultsBatchOptions() Assert.That(transportProducer.CreateBatchCalledWith, Is.Not.Null, "The batch creation should have passed options."); Assert.That(transportProducer.CreateBatchCalledWith, Is.Not.SameAs(expectedOptions), "The options should have been cloned."); Assert.That(transportProducer.CreateBatchCalledWith.PartitionKey, Is.EqualTo(expectedOptions.PartitionKey), "The partition key should match."); - Assert.That(transportProducer.CreateBatchCalledWith.MaximumizeInBytes, Is.EqualTo(expectedOptions.MaximumizeInBytes), "The maximum size should match."); + Assert.That(transportProducer.CreateBatchCalledWith.MaximumSizeInBytes, Is.EqualTo(expectedOptions.MaximumSizeInBytes), "The maximum size should match."); } /// /// Verifies functionality of the + /// method. /// /// [Test] public async Task CreateBatchSetsTheSendOptionsForTheEventBatch() { - var batchOptions = new BatchOptions { PartitionKey = "Hi", MaximumizeInBytes = 9999 }; + var batchOptions = new BatchOptions { PartitionKey = "Hi", MaximumSizeInBytes = 9999 }; var transportProducer = new ObservableTransportProducerMock(); var producer = new EventHubProducer(transportProducer, new Uri("amqp://some.endpoint.com/path"), "dummy", new EventHubProducerOptions(), Mock.Of()); EventDataBatch eventBatch = await producer.CreateBatchAsync(batchOptions); diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Infrastructure/EventHubScope.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Infrastructure/EventHubScope.cs index 397288ac312e..29d55118c90b 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Infrastructure/EventHubScope.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Infrastructure/EventHubScope.cs @@ -104,19 +104,6 @@ public async ValueTask DisposeAsync() public static Task CreateAsync(int partitionCount, [CallerMemberName] string caller = "") => CreateAsync(partitionCount, Enumerable.Empty(), caller); - /// - /// Performs the tasks needed to create a new Event Hub instance with the requested - /// partition count and a dynamically assigned unique name. - /// - /// - /// The number of partitions that the Event Hub should be configured with. - /// The name of a consumer group to create and associate with the Event Hub; the default consumer group should not be specified, as it is implicitly created. - /// The name of the calling method; this is intended to be populated by the runtime. - /// - public static Task CreateAsync(int partitionCount, - string consumerGroup, - [CallerMemberName] string caller = "") => CreateAsync(partitionCount, new[] { consumerGroup }, caller); - /// /// Performs the tasks needed to create a new Event Hub instance with the requested /// partition count and a dynamically assigned unique name. diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Infrastructure/LiveResourceManager.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Infrastructure/LiveResourceManager.cs index 668bf00b2f21..bcc3e0ab3f0f 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Infrastructure/LiveResourceManager.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Infrastructure/LiveResourceManager.cs @@ -31,7 +31,7 @@ public sealed class LiveResourceManager private const double RetryExponentialBackoffSeconds = 2.5; /// The number of seconds to use as the basis for applying jitter to retry back-off calculations. - private const double RetryBaseJitterSeconds = 15.0; + private const double RetryBaseJitterSeconds = 18.0; /// The buffer to apply when considering refreshing; credentials that expire less than this duration will be refreshed. private static readonly TimeSpan CredentialRefreshBuffer = TimeSpan.FromMinutes(5); diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Processor/EventProcessorLiveTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Processor/EventProcessorLiveTests.cs index 7072ec82f896..6e7f873e8d3e 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/Processor/EventProcessorLiveTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/Processor/EventProcessorLiveTests.cs @@ -822,6 +822,7 @@ public async Task EventProcessorCanReceiveFromSpecifiedInitialEventPosition() [TestCase(2)] [TestCase(4)] [TestCase(15)] + [Ignore("Failing test: needs debugging (Tracked by: #7458)")] public async Task EventProcessorWaitsMaximumReceiveWaitTimeForEvents(int maximumWaitTimeInSecs) { await using (EventHubScope scope = await EventHubScope.CreateAsync(2)) diff --git a/sdk/eventhub/Azure.Messaging.EventHubs/tests/RetryPolicies/BasicRetryPolicyTests.cs b/sdk/eventhub/Azure.Messaging.EventHubs/tests/RetryPolicies/BasicRetryPolicyTests.cs index 18775c007d31..1975d7858e1f 100755 --- a/sdk/eventhub/Azure.Messaging.EventHubs/tests/RetryPolicies/BasicRetryPolicyTests.cs +++ b/sdk/eventhub/Azure.Messaging.EventHubs/tests/RetryPolicies/BasicRetryPolicyTests.cs @@ -29,9 +29,10 @@ public static IEnumerable RetriableExceptionTestCases() yield return new object[] { new TimeoutException() }; yield return new object[] { new SocketException(500) }; - // Task Canceled should use the inner exception as the decision point. + // Task/Operation Canceled should use the inner exception as the decision point. yield return new object[] { new TaskCanceledException("dummy", new EventHubsException(true, null)) }; + yield return new object[] { new OperationCanceledException("dummy", new EventHubsException(true, null)) }; // Aggregate should use the first inner exception as the decision point. @@ -58,9 +59,10 @@ public static IEnumerable NonRetriableExceptionTestCases() yield return new object[] { new OutOfMemoryException() }; yield return new object[] { new ObjectDisposedException("dummy") }; - // Task Canceled should use the inner exception as the decision point. + // Task/Operation Canceled should use the inner exception as the decision point. yield return new object[] { new TaskCanceledException("dummy", new EventHubsException(false, null)) }; + yield return new object[] { new OperationCanceledException("dummy", new EventHubsException(false, null)) }; // Null is not retriable, even if it is a blessed type. diff --git a/sdk/identity/Azure.Identity/src/MsalCacheReader.cs b/sdk/identity/Azure.Identity/src/MsalCacheReader.cs index ac7347c93406..bb54ae627855 100644 --- a/sdk/identity/Azure.Identity/src/MsalCacheReader.cs +++ b/sdk/identity/Azure.Identity/src/MsalCacheReader.cs @@ -21,7 +21,7 @@ public MsalCacheReader(ITokenCache cache, string cachePath, int cacheRetryCount, { _cachePath = cachePath; - _cacheLockPath = cachePath + ".lock"; + _cacheLockPath = cachePath + ".lockfile"; _cacheRetryCount = cacheRetryCount; diff --git a/sdk/storage/Azure.Storage.Blobs/src/AppendBlobClient.cs b/sdk/storage/Azure.Storage.Blobs/src/AppendBlobClient.cs index 07d378d985d5..c18b358d8a73 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/AppendBlobClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/AppendBlobClient.cs @@ -271,7 +271,7 @@ protected sealed override BlobBaseClient WithCustomerProvidedKeyCore(CustomerPro /// a failure occurs. /// public virtual Response Create( - BlobHttpHeaders? httpHeaders = default, + BlobHttpHeaders httpHeaders = default, Metadata metadata = default, AppendBlobAccessConditions? accessConditions = default, CancellationToken cancellationToken = default) => @@ -315,7 +315,7 @@ public virtual Response Create( /// a failure occurs. /// public virtual async Task> CreateAsync( - BlobHttpHeaders? httpHeaders = default, + BlobHttpHeaders httpHeaders = default, Metadata metadata = default, AppendBlobAccessConditions? accessConditions = default, CancellationToken cancellationToken = default) => @@ -355,7 +355,7 @@ await CreateInternal( /// a failure occurs. /// public virtual Response CreateIfNotExists( - BlobHttpHeaders? httpHeaders = default, + BlobHttpHeaders httpHeaders = default, Metadata metadata = default, CancellationToken cancellationToken = default) => CreateIfNotExistsInternal( @@ -393,7 +393,7 @@ public virtual Response CreateIfNotExists( /// a failure occurs. /// public virtual async Task> CreateIfNotExistsAsync( - BlobHttpHeaders? httpHeaders = default, + BlobHttpHeaders httpHeaders = default, Metadata metadata = default, CancellationToken cancellationToken = default) => await CreateIfNotExistsInternal( @@ -434,7 +434,7 @@ await CreateIfNotExistsInternal( /// a failure occurs. /// private async Task> CreateIfNotExistsInternal( - BlobHttpHeaders? httpHeaders, + BlobHttpHeaders httpHeaders, Metadata metadata, bool async, CancellationToken cancellationToken) @@ -502,7 +502,7 @@ private async Task> CreateIfNotExistsInternal( /// a failure occurs. /// private async Task> CreateInternal( - BlobHttpHeaders? httpHeaders, + BlobHttpHeaders httpHeaders, Metadata metadata, AppendBlobAccessConditions? accessConditions, bool async, diff --git a/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs b/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs index 97657f85037f..c160fbf8c995 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/BlobBaseClient.cs @@ -2411,7 +2411,7 @@ private async Task> GetPropertiesInternal( /// a failure occurs. /// public virtual Response SetHttpHeaders( - BlobHttpHeaders? httpHeaders = default, + BlobHttpHeaders httpHeaders = default, BlobAccessConditions? accessConditions = default, CancellationToken cancellationToken = default) => SetHttpHeadersInternal( @@ -2447,7 +2447,7 @@ public virtual Response SetHttpHeaders( /// a failure occurs. /// public virtual async Task> SetHttpHeadersAsync( - BlobHttpHeaders? httpHeaders = default, + BlobHttpHeaders httpHeaders = default, BlobAccessConditions? accessConditions = default, CancellationToken cancellationToken = default) => await SetHttpHeadersInternal( @@ -2486,7 +2486,7 @@ await SetHttpHeadersInternal( /// a failure occurs. /// private async Task> SetHttpHeadersInternal( - BlobHttpHeaders? httpHeaders, + BlobHttpHeaders httpHeaders, BlobAccessConditions? accessConditions, bool async, CancellationToken cancellationToken) diff --git a/sdk/storage/Azure.Storage.Blobs/src/BlobClient.cs b/sdk/storage/Azure.Storage.Blobs/src/BlobClient.cs index 872ff3528787..1818277dfc26 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/BlobClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/BlobClient.cs @@ -437,7 +437,7 @@ public virtual Task> UploadAsync( #pragma warning restore AZC0002 // Client method should have cancellationToken as the last optional parameter /// - /// The + /// The /// operation creates a new block blob or updates the content of an /// existing block blob. Updating an existing block blob overwrites /// any existing metadata on the blob. @@ -490,7 +490,7 @@ public virtual Task> UploadAsync( [ForwardsClientCalls] public virtual Response Upload( Stream content, - BlobHttpHeaders? httpHeaders = default, + BlobHttpHeaders httpHeaders = default, Metadata metadata = default, BlobAccessConditions? accessConditions = default, IProgress progressHandler = default, @@ -510,7 +510,7 @@ public virtual Response Upload( .EnsureCompleted(); /// - /// The + /// The /// operation creates a new block blob or updates the content of an /// existing block blob. Updating an existing block blob overwrites /// any existing metadata on the blob. @@ -563,7 +563,7 @@ public virtual Response Upload( [ForwardsClientCalls] public virtual Response Upload( FileInfo content, - BlobHttpHeaders? httpHeaders = default, + BlobHttpHeaders httpHeaders = default, Metadata metadata = default, BlobAccessConditions? accessConditions = default, IProgress progressHandler = default, @@ -583,7 +583,7 @@ public virtual Response Upload( .EnsureCompleted(); /// - /// The + /// The /// operation creates a new block blob or updates the content of an /// existing block blob. Updating an existing block blob overwrites /// any existing metadata on the blob. @@ -636,7 +636,7 @@ public virtual Response Upload( [ForwardsClientCalls] public virtual Task> UploadAsync( Stream content, - BlobHttpHeaders? httpHeaders = default, + BlobHttpHeaders httpHeaders = default, Metadata metadata = default, BlobAccessConditions? accessConditions = default, IProgress progressHandler = default, @@ -655,7 +655,7 @@ public virtual Task> UploadAsync( cancellationToken: cancellationToken); /// - /// The + /// The /// operation creates a new block blob or updates the content of an /// existing block blob. Updating an existing block blob overwrites /// any existing metadata on the blob. @@ -708,7 +708,7 @@ public virtual Task> UploadAsync( [ForwardsClientCalls] public virtual Task> UploadAsync( FileInfo content, - BlobHttpHeaders? httpHeaders = default, + BlobHttpHeaders httpHeaders = default, Metadata metadata = default, BlobAccessConditions? accessConditions = default, IProgress progressHandler = default, @@ -778,7 +778,7 @@ public virtual Task> UploadAsync( /// internal async Task> StagedUploadAsync( Stream content, - BlobHttpHeaders? blobHttpHeaders, + BlobHttpHeaders blobHttpHeaders, Metadata metadata, BlobAccessConditions? blobAccessConditions, IProgress progressHandler, @@ -952,7 +952,7 @@ Task> CommitBlockListAsync( /// internal async Task> StagedUploadAsync( FileInfo file, - BlobHttpHeaders? blobHttpHeaders, + BlobHttpHeaders blobHttpHeaders, Metadata metadata, BlobAccessConditions? blobAccessConditions, IProgress progressHandler, diff --git a/sdk/storage/Azure.Storage.Blobs/src/BlockBlobClient.cs b/sdk/storage/Azure.Storage.Blobs/src/BlockBlobClient.cs index 9cb594481867..3f50c4b732cb 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/BlockBlobClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/BlockBlobClient.cs @@ -367,7 +367,7 @@ protected sealed override BlobBaseClient WithCustomerProvidedKeyCore(CustomerPro /// public virtual Response Upload( Stream content, - BlobHttpHeaders? httpHeaders = default, + BlobHttpHeaders httpHeaders = default, Metadata metadata = default, BlobAccessConditions? accessConditions = default, AccessTier? accessTier = default, @@ -433,7 +433,7 @@ public virtual Response Upload( /// public virtual async Task> UploadAsync( Stream content, - BlobHttpHeaders? httpHeaders = default, + BlobHttpHeaders httpHeaders = default, Metadata metadata = default, BlobAccessConditions? accessConditions = default, AccessTier? accessTier = default, @@ -502,7 +502,7 @@ await UploadInternal( /// internal async Task> UploadInternal( Stream content, - BlobHttpHeaders? blobHttpHeaders, + BlobHttpHeaders blobHttpHeaders, Metadata metadata, BlobAccessConditions? blobAccessConditions, AccessTier? accessTier, @@ -1145,7 +1145,7 @@ private async Task> StageBlockFromUriInternal( /// public virtual Response CommitBlockList( IEnumerable base64BlockIds, - BlobHttpHeaders? httpHeaders = default, + BlobHttpHeaders httpHeaders = default, Metadata metadata = default, BlobAccessConditions? accessConditions = default, AccessTier? accessTier = default, @@ -1212,7 +1212,7 @@ public virtual Response CommitBlockList( /// public virtual async Task> CommitBlockListAsync( IEnumerable base64BlockIds, - BlobHttpHeaders? httpHeaders = default, + BlobHttpHeaders httpHeaders = default, Metadata metadata = default, BlobAccessConditions? accessConditions = default, AccessTier? accessTier = default, @@ -1282,7 +1282,7 @@ await CommitBlockListInternal( /// internal async Task> CommitBlockListInternal( IEnumerable base64BlockIds, - BlobHttpHeaders? blobHttpHeaders, + BlobHttpHeaders blobHttpHeaders, Metadata metadata, BlobAccessConditions? blobAccessConditions, AccessTier? accessTier, diff --git a/sdk/storage/Azure.Storage.Blobs/src/Generated/BlobRestClient.cs b/sdk/storage/Azure.Storage.Blobs/src/Generated/BlobRestClient.cs index e652b731f623..9acf9873c3bc 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/Generated/BlobRestClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/Generated/BlobRestClient.cs @@ -7723,42 +7723,36 @@ internal static Azure.Core.HttpMessage UploadPagesAsync_CreateMessage( { case 201: { + // Create the result + Azure.Storage.Blobs.Models.PageInfo _value = new Azure.Storage.Blobs.Models.PageInfo(); // Get response headers string _header; - Azure.ETag eTag = default; - System.DateTimeOffset lastModified = default; - byte[] contentHash = default; - byte[] contentCrc64 = default; - long blobSequenceNumber = default; - string encryptionKeySha256 = default; if (response.Headers.TryGetValue("ETag", out _header)) { - eTag = new Azure.ETag(_header); + _value.ETag = new Azure.ETag(_header); } if (response.Headers.TryGetValue("Last-Modified", out _header)) { - lastModified = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInfo.InvariantCulture); + _value.LastModified = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInfo.InvariantCulture); } if (response.Headers.TryGetValue("Content-MD5", out _header)) { - contentHash = System.Convert.FromBase64String(_header); + _value.ContentHash = System.Convert.FromBase64String(_header); } if (response.Headers.TryGetValue("x-ms-content-crc64", out _header)) { - contentCrc64 = System.Convert.FromBase64String(_header); + _value.ContentCrc64 = System.Convert.FromBase64String(_header); } if (response.Headers.TryGetValue("x-ms-blob-sequence-number", out _header)) { - blobSequenceNumber = long.Parse(_header, System.Globalization.CultureInfo.InvariantCulture); + _value.BlobSequenceNumber = long.Parse(_header, System.Globalization.CultureInfo.InvariantCulture); } if (response.Headers.TryGetValue("x-ms-encryption-key-sha256", out _header)) { - encryptionKeySha256 = _header; + _value.EncryptionKeySha256 = _header; } - Azure.Storage.Blobs.Models.PageInfo _value = new Azure.Storage.Blobs.Models.PageInfo(eTag, lastModified, contentHash, contentCrc64, blobSequenceNumber, encryptionKeySha256); - // Create the response return Response.FromValue(_value, response); } @@ -7964,42 +7958,36 @@ internal static Azure.Core.HttpMessage ClearPagesAsync_CreateMessage( { case 201: { + // Create the result + Azure.Storage.Blobs.Models.PageInfo _value = new Azure.Storage.Blobs.Models.PageInfo(); // Get response headers string _header; - Azure.ETag eTag = default; - System.DateTimeOffset lastModified = default; - byte[] contentHash = default; - byte[] contentCrc64 = default; - long blobSequenceNumber = default; - string encryptionKeySha256 = default; if (response.Headers.TryGetValue("ETag", out _header)) { - eTag = new Azure.ETag(_header); + _value.ETag = new Azure.ETag(_header); } if (response.Headers.TryGetValue("Last-Modified", out _header)) { - lastModified = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInfo.InvariantCulture); + _value.LastModified = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInfo.InvariantCulture); } if (response.Headers.TryGetValue("Content-MD5", out _header)) { - contentHash = System.Convert.FromBase64String(_header); + _value.ContentHash = System.Convert.FromBase64String(_header); } if (response.Headers.TryGetValue("x-ms-content-crc64", out _header)) { - contentCrc64 = System.Convert.FromBase64String(_header); + _value.ContentCrc64 = System.Convert.FromBase64String(_header); } if (response.Headers.TryGetValue("x-ms-blob-sequence-number", out _header)) { - blobSequenceNumber = long.Parse(_header, System.Globalization.CultureInfo.InvariantCulture); + _value.BlobSequenceNumber = long.Parse(_header, System.Globalization.CultureInfo.InvariantCulture); } if (response.Headers.TryGetValue("x-ms-encryption-key-sha256", out _header)) { - encryptionKeySha256 = _header; + _value.EncryptionKeySha256 = _header; } - Azure.Storage.Blobs.Models.PageInfo _value = new Azure.Storage.Blobs.Models.PageInfo(eTag, lastModified, contentHash, contentCrc64, blobSequenceNumber, encryptionKeySha256); - // Create the response return Response.FromValue(_value, response); } @@ -8265,42 +8253,36 @@ internal static Azure.Core.HttpMessage UploadPagesFromUriAsync_CreateMessage( { case 201: { + // Create the result + Azure.Storage.Blobs.Models.PageInfo _value = new Azure.Storage.Blobs.Models.PageInfo(); // Get response headers string _header; - Azure.ETag eTag = default; - System.DateTimeOffset lastModified = default; - byte[] contentHash = default; - byte[] contentCrc64 = default; - long blobSequenceNumber = default; - string encryptionKeySha256 = default; if (response.Headers.TryGetValue("ETag", out _header)) { - eTag = new Azure.ETag(_header); + _value.ETag = new Azure.ETag(_header); } if (response.Headers.TryGetValue("Last-Modified", out _header)) { - lastModified = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInfo.InvariantCulture); + _value.LastModified = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInfo.InvariantCulture); } if (response.Headers.TryGetValue("Content-MD5", out _header)) { - contentHash = System.Convert.FromBase64String(_header); + _value.ContentHash = System.Convert.FromBase64String(_header); } if (response.Headers.TryGetValue("x-ms-content-crc64", out _header)) { - contentCrc64 = System.Convert.FromBase64String(_header); + _value.ContentCrc64 = System.Convert.FromBase64String(_header); } if (response.Headers.TryGetValue("x-ms-blob-sequence-number", out _header)) { - blobSequenceNumber = long.Parse(_header, System.Globalization.CultureInfo.InvariantCulture); + _value.BlobSequenceNumber = long.Parse(_header, System.Globalization.CultureInfo.InvariantCulture); } if (response.Headers.TryGetValue("x-ms-encryption-key-sha256", out _header)) { - encryptionKeySha256 = _header; + _value.EncryptionKeySha256 = _header; } - Azure.Storage.Blobs.Models.PageInfo _value = new Azure.Storage.Blobs.Models.PageInfo(eTag, lastModified, contentHash, contentCrc64, blobSequenceNumber, encryptionKeySha256); - // Create the response return Response.FromValue(_value, response); } @@ -13176,29 +13158,79 @@ internal BlobBatchResult() { } } #endregion class BlobBatchResult -#region class BlobBlock +#region struct BlobBlock namespace Azure.Storage.Blobs.Models { /// /// Represents a single block in a block blob. It describes the block's ID and size. /// - public partial class BlobBlock + public readonly partial struct BlobBlock: System.IEquatable { /// /// The base64 encoded block ID. /// - public string Name { get; internal set; } + public string Name { get; } /// /// The block size in bytes. /// - public int Size { get; internal set; } + public int Size { get; } /// /// Prevent direct instantiation of BlobBlock instances. /// You can use BlobsModelFactory.BlobBlock instead. /// - internal BlobBlock() { } + internal BlobBlock( + string name, + int size) + { + Name = name; + Size = size; + } + + /// + /// Check if two BlobBlock instances are equal. + /// + /// The instance to compare to. + /// True if they're equal, false otherwise. + [System.ComponentModel.EditorBrowsable((System.ComponentModel.EditorBrowsableState.Never))] + public bool Equals(BlobBlock other) + { + if (!System.StringComparer.Ordinal.Equals(Name, other.Name)) + { + return false; + } + if (!Size.Equals(other.Size)) + { + return false; + } + + return true; + } + + /// + /// Check if two BlobBlock instances are equal. + /// + /// The instance to compare to. + /// True if they're equal, false otherwise. + [System.ComponentModel.EditorBrowsable((System.ComponentModel.EditorBrowsableState.Never))] + public override bool Equals(object obj) => obj is BlobBlock && Equals((BlobBlock)obj); + + /// + /// Get a hash code for the BlobBlock. + /// + [System.ComponentModel.EditorBrowsable((System.ComponentModel.EditorBrowsableState.Never))] + public override int GetHashCode() + { + var hashCode = new Azure.Core.HashCodeBuilder(); + if (Name != null) + { + hashCode.Add(Name, System.StringComparer.Ordinal); + } + hashCode.Add(Size); + + return hashCode.ToHashCode(); + } /// /// Deserializes XML into a new BlobBlock instance. @@ -13209,17 +13241,19 @@ internal static Azure.Storage.Blobs.Models.BlobBlock FromXml(System.Xml.Linq.XEl { System.Diagnostics.Debug.Assert(element != null); System.Xml.Linq.XElement _child; - Azure.Storage.Blobs.Models.BlobBlock _value = new Azure.Storage.Blobs.Models.BlobBlock(); + string name = default; + int size = default; _child = element.Element(System.Xml.Linq.XName.Get("Name", "")); if (_child != null) { - _value.Name = _child.Value; + name = _child.Value; } _child = element.Element(System.Xml.Linq.XName.Get("Size", "")); if (_child != null) { - _value.Size = int.Parse(_child.Value, System.Globalization.CultureInfo.InvariantCulture); + size = int.Parse(_child.Value, System.Globalization.CultureInfo.InvariantCulture); } + Azure.Storage.Blobs.Models.BlobBlock _value = new Azure.Storage.Blobs.Models.BlobBlock(name, size); CustomizeFromXml(element, _value); return _value; } @@ -13239,15 +13273,11 @@ public static BlobBlock BlobBlock( string name, int size) { - return new BlobBlock() - { - Name = name, - Size = size, - }; + return new BlobBlock(name, size); } } } -#endregion class BlobBlock +#endregion struct BlobBlock #region class BlobContainerAccessPolicy namespace Azure.Storage.Blobs.Models @@ -18068,131 +18098,53 @@ public static PageBlobInfo PageBlobInfo( } #endregion class PageBlobInfo -#region struct PageInfo +#region class PageInfo namespace Azure.Storage.Blobs.Models { /// /// PageInfo /// - public readonly partial struct PageInfo: System.IEquatable + public partial class PageInfo { /// /// 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 Azure.ETag ETag { get; } + public Azure.ETag ETag { get; internal set; } /// /// 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 System.DateTimeOffset LastModified { get; } + public System.DateTimeOffset LastModified { get; internal set; } /// /// If the blob has an MD5 hash and this operation is to read the full blob, this response header is returned so that the client can check for message content integrity. /// #pragma warning disable CA1819 // Properties should not return arrays - public byte[] ContentHash { get; } + public byte[] ContentHash { get; internal set; } #pragma warning restore CA1819 // Properties should not return arrays /// /// This header is returned so that the client can check for message content integrity. The value of this header is computed by the Blob service; it is not necessarily the same value specified in the request headers. /// #pragma warning disable CA1819 // Properties should not return arrays - public byte[] ContentCrc64 { get; } + public byte[] ContentCrc64 { get; internal set; } #pragma warning restore CA1819 // Properties should not return arrays /// /// The current sequence number for the page blob. This is only returned for page blobs. /// - public long BlobSequenceNumber { get; } + public long BlobSequenceNumber { get; internal set; } /// /// The SHA-256 hash of the encryption key used to encrypt the pages. This header is only returned when the pages were encrypted with a customer-provided key. /// - public string EncryptionKeySha256 { get; } + public string EncryptionKeySha256 { get; internal set; } /// /// Prevent direct instantiation of PageInfo instances. /// You can use BlobsModelFactory.PageInfo instead. /// - internal PageInfo( - Azure.ETag eTag, - System.DateTimeOffset lastModified, - byte[] contentHash, - byte[] contentCrc64, - long blobSequenceNumber, - string encryptionKeySha256) - { - ETag = eTag; - LastModified = lastModified; - ContentHash = contentHash; - ContentCrc64 = contentCrc64; - BlobSequenceNumber = blobSequenceNumber; - EncryptionKeySha256 = encryptionKeySha256; - } - - /// - /// Check if two PageInfo instances are equal. - /// - /// The instance to compare to. - /// True if they're equal, false otherwise. - [System.ComponentModel.EditorBrowsable((System.ComponentModel.EditorBrowsableState.Never))] - public bool Equals(PageInfo other) - { - if (!ETag.Equals(other.ETag)) - { - return false; - } - if (!LastModified.Equals(other.LastModified)) - { - return false; - } - if (!System.Collections.StructuralComparisons.StructuralEqualityComparer.Equals(ContentHash, other.ContentHash)) - { - return false; - } - if (!System.Collections.StructuralComparisons.StructuralEqualityComparer.Equals(ContentCrc64, other.ContentCrc64)) - { - return false; - } - if (!BlobSequenceNumber.Equals(other.BlobSequenceNumber)) - { - return false; - } - if (!System.StringComparer.Ordinal.Equals(EncryptionKeySha256, other.EncryptionKeySha256)) - { - return false; - } - - return true; - } - - /// - /// Check if two PageInfo instances are equal. - /// - /// The instance to compare to. - /// True if they're equal, false otherwise. - [System.ComponentModel.EditorBrowsable((System.ComponentModel.EditorBrowsableState.Never))] - public override bool Equals(object obj) => obj is PageInfo && Equals((PageInfo)obj); - - /// - /// Get a hash code for the PageInfo. - /// - [System.ComponentModel.EditorBrowsable((System.ComponentModel.EditorBrowsableState.Never))] - public override int GetHashCode() - { - var hashCode = new Azure.Core.HashCodeBuilder(); - hashCode.Add(ETag); - hashCode.Add(LastModified); - hashCode.Add(System.Collections.StructuralComparisons.StructuralEqualityComparer.GetHashCode(ContentHash)); - hashCode.Add(System.Collections.StructuralComparisons.StructuralEqualityComparer.GetHashCode(ContentCrc64)); - hashCode.Add(BlobSequenceNumber); - if (EncryptionKeySha256 != null) - { - hashCode.Add(EncryptionKeySha256, System.StringComparer.Ordinal); - } - - return hashCode.ToHashCode(); - } + internal PageInfo() { } } /// @@ -18211,11 +18163,19 @@ public static PageInfo PageInfo( long blobSequenceNumber, string encryptionKeySha256) { - return new PageInfo(eTag, lastModified, contentHash, contentCrc64, blobSequenceNumber, encryptionKeySha256); + return new PageInfo() + { + ETag = eTag, + LastModified = lastModified, + ContentHash = contentHash, + ContentCrc64 = contentCrc64, + BlobSequenceNumber = blobSequenceNumber, + EncryptionKeySha256 = encryptionKeySha256, + }; } } } -#endregion struct PageInfo +#endregion class PageInfo #region class PageList namespace Azure.Storage.Blobs.Models diff --git a/sdk/storage/Azure.Storage.Blobs/src/Models/BlobHttpHeaders.cs b/sdk/storage/Azure.Storage.Blobs/src/Models/BlobHttpHeaders.cs index 353f44bebc48..3b130807ca42 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/Models/BlobHttpHeaders.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/Models/BlobHttpHeaders.cs @@ -2,6 +2,7 @@ // Licensed under the MIT License. using System; +using System.ComponentModel; namespace Azure.Storage.Blobs.Models { @@ -13,7 +14,7 @@ namespace Azure.Storage.Blobs.Models /// /// For more information, see . /// - public struct BlobHttpHeaders : IEquatable + public class BlobHttpHeaders { /// /// The MIME content type of the blob. @@ -59,53 +60,25 @@ public struct BlobHttpHeaders : IEquatable public string CacheControl { get; set; } /// - /// Check if two BlobHttpHeaders instances are equal. + /// Creates a string representation of a + /// . /// - /// The instance to compare to. - /// True if they're equal, false otherwise. - public override bool Equals(object obj) - => obj is BlobHttpHeaders other && Equals(other); - - /// - /// Get a hash code for the BlobHttpHeaders. - /// - /// Hash code for the BlobHttpHeaders. - public override int GetHashCode() - => CacheControl.GetHashCode() - ^ ContentDisposition.GetHashCode() - ^ ContentEncoding.GetHashCode() - ^ ContentLanguage.GetHashCode() - ^ ContentHash.GetHashCode() - ^ ContentType.GetHashCode() - ; + [EditorBrowsable(EditorBrowsableState.Never)] + public override string ToString() => base.ToString(); /// - /// Check if two BlobHttpHeaders instances are equal. + /// Check if two instances are equal. /// - /// The first instance to compare. - /// The second instance to compare. + /// The instance to compare to. /// True if they're equal, false otherwise. - public static bool operator ==(BlobHttpHeaders left, BlobHttpHeaders right) => left.Equals(right); - - /// - /// Check if two BlobHttpHeaders instances are not equal. - /// - /// The first instance to compare. - /// The second instance to compare. - /// True if they're not equal, false otherwise. - public static bool operator !=(BlobHttpHeaders left, BlobHttpHeaders right) => !(left == right); + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => base.Equals(obj); /// - /// Check if two BlobHttpHeaders instances are equal. + /// Get a hash code for the . /// - /// The instance to compare to. - public bool Equals(BlobHttpHeaders other) - => CacheControl == other.CacheControl - && ContentDisposition == other.ContentDisposition - && ContentEncoding == other.ContentEncoding - && ContentLanguage == other.ContentLanguage - && ContentHash == other.ContentHash - && ContentType == other.ContentType - ; + /// Hash code for the . + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => base.GetHashCode(); } } diff --git a/sdk/storage/Azure.Storage.Blobs/src/Models/ReleasedObjectInfo.cs b/sdk/storage/Azure.Storage.Blobs/src/Models/ReleasedObjectInfo.cs index a163c5ba8cbf..f3c910fd5bee 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/Models/ReleasedObjectInfo.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/Models/ReleasedObjectInfo.cs @@ -10,7 +10,7 @@ namespace Azure.Storage.Blobs.Models /// Provides the version state of a succesfully released blob or container /// object. /// - public readonly struct ReleasedObjectInfo : IEquatable + public class ReleasedObjectInfo { /// /// The ETag contains a value that you can use to perform operations @@ -74,43 +74,13 @@ internal ReleasedObjectInfo(BlobContainerInfo info) /// The instance to compare to. /// True if they're equal, false otherwise. [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => - obj is ReleasedObjectInfo other && Equals(other); - - /// - /// Check if two instances are equal. - /// - /// The instance to compare to. - /// True if they're equal, false otherwise. - public bool Equals(ReleasedObjectInfo other) => - ETag == other.ETag && - LastModified == other.LastModified; + public override bool Equals(object obj) => base.Equals(obj); /// /// Get a hash code for the . /// /// Hash code for the . [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => - ETag.GetHashCode() ^ - LastModified.GetHashCode(); - - /// - /// Check if two instances are equal. - /// - /// The first instance to compare. - /// The second instance to compare. - /// True if they're equal, false otherwise. - public static bool operator ==(ReleasedObjectInfo left, ReleasedObjectInfo right) => - left.Equals(right); - - /// - /// Check if two instances are not equal. - /// - /// The first instance to compare. - /// The second instance to compare. - /// True if they're not equal, false otherwise. - public static bool operator !=(ReleasedObjectInfo left, ReleasedObjectInfo right) => - !(left == right); + public override int GetHashCode() => base.GetHashCode(); } } diff --git a/sdk/storage/Azure.Storage.Blobs/src/PageBlobClient.cs b/sdk/storage/Azure.Storage.Blobs/src/PageBlobClient.cs index 31fdc5fa3580..fa3247505fb3 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/PageBlobClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/PageBlobClient.cs @@ -304,7 +304,7 @@ protected sealed override BlobBaseClient WithCustomerProvidedKeyCore(CustomerPro public virtual Response Create( long size, long? sequenceNumber = default, - BlobHttpHeaders? httpHeaders = default, + BlobHttpHeaders httpHeaders = default, Metadata metadata = default, PageBlobAccessConditions? accessConditions = default, CancellationToken cancellationToken = default) => @@ -362,7 +362,7 @@ public virtual Response Create( public virtual async Task> CreateAsync( long size, long? sequenceNumber = default, - BlobHttpHeaders? httpHeaders = default, + BlobHttpHeaders httpHeaders = default, Metadata metadata = default, PageBlobAccessConditions? accessConditions = default, CancellationToken cancellationToken = default) => @@ -416,7 +416,7 @@ await CreateInternal( public virtual Response CreateIfNotExists( long size, long? sequenceNumber = default, - BlobHttpHeaders? httpHeaders = default, + BlobHttpHeaders httpHeaders = default, Metadata metadata = default, CancellationToken cancellationToken = default) => CreateIfNotExistsInternal( @@ -468,7 +468,7 @@ public virtual Response CreateIfNotExists( public virtual async Task> CreateIfNotExistsAsync( long size, long? sequenceNumber = default, - BlobHttpHeaders? httpHeaders = default, + BlobHttpHeaders httpHeaders = default, Metadata metadata = default, CancellationToken cancellationToken = default) => await CreateIfNotExistsInternal( @@ -524,7 +524,7 @@ await CreateIfNotExistsInternal( private async Task> CreateIfNotExistsInternal( long size, long? sequenceNumber, - BlobHttpHeaders? httpHeaders, + BlobHttpHeaders httpHeaders, Metadata metadata, bool async, CancellationToken cancellationToken) @@ -606,7 +606,7 @@ private async Task> CreateIfNotExistsInternal( private async Task> CreateInternal( long size, long? sequenceNumber, - BlobHttpHeaders? httpHeaders, + BlobHttpHeaders httpHeaders, Metadata metadata, PageBlobAccessConditions? accessConditions, bool async, diff --git a/sdk/storage/Azure.Storage.Blobs/src/Sas/BlobSasBuilder.cs b/sdk/storage/Azure.Storage.Blobs/src/Sas/BlobSasBuilder.cs index ce00703d5062..74d1f352c8e0 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/Sas/BlobSasBuilder.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/Sas/BlobSasBuilder.cs @@ -14,7 +14,7 @@ namespace Azure.Storage.Sas /// Signature (SAS) for an Azure Storage container or blob. /// For more information, see . /// - public struct BlobSasBuilder : IEquatable + public class BlobSasBuilder { /// /// The storage service version to use to authenticate requests made @@ -66,7 +66,7 @@ public struct BlobSasBuilder : IEquatable /// When specifying a range of IP addresses, note that the range is /// inclusive. /// - public IPRange IPRange { get; set; } + public SasIPRange IPRange { get; set; } /// /// An optional unique value up to 64 characters in length that @@ -355,66 +355,13 @@ public override string ToString() => /// True if they're equal, false otherwise. [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) - => obj is BlobSasBuilder other && Equals(other); + => base.Equals(obj); /// /// Get a hash code for the BlobSasBuilder. /// /// Hash code for the BlobSasBuilder. [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => - BlobName.GetHashCode() ^ - CacheControl.GetHashCode() ^ - BlobContainerName.GetHashCode() ^ - ContentDisposition.GetHashCode() ^ - ContentEncoding.GetHashCode() ^ - ContentLanguage.GetHashCode() ^ - ContentType.GetHashCode() ^ - ExpiresOn.GetHashCode() ^ - Identifier.GetHashCode() ^ - IPRange.GetHashCode() ^ - Permissions.GetHashCode() ^ - Protocol.GetHashCode() ^ - StartsOn.GetHashCode() ^ - Version.GetHashCode(); - - /// - /// Check if two BlobSasBuilder instances are equal. - /// - /// The first instance to compare. - /// The second instance to compare. - /// True if they're equal, false otherwise. - public static bool operator ==(BlobSasBuilder left, BlobSasBuilder right) => - left.Equals(right); - - /// - /// Check if two BlobSasBuilder instances are not equal. - /// - /// The first instance to compare. - /// The second instance to compare. - /// True if they're not equal, false otherwise. - public static bool operator !=(BlobSasBuilder left, BlobSasBuilder right) => - !(left == right); - - /// - /// Check if two BlobSasBuilder instances are equal. - /// - /// The instance to compare to. - /// True if they're equal, false otherwise. - public bool Equals(BlobSasBuilder other) => - BlobName == other.BlobName && - CacheControl == other.CacheControl && - BlobContainerName == other.BlobContainerName && - ContentDisposition == other.ContentDisposition && - ContentEncoding == other.ContentEncoding && - ContentLanguage == other.ContentEncoding && - ContentType == other.ContentType && - ExpiresOn == other.ExpiresOn && - Identifier == other.Identifier && - IPRange == other.IPRange && - Permissions == other.Permissions && - Protocol == other.Protocol && - StartsOn == other.StartsOn && - Version == other.Version; + public override int GetHashCode() => base.GetHashCode(); } } diff --git a/sdk/storage/Azure.Storage.Blobs/src/Sas/BlobSasQueryParameters.cs b/sdk/storage/Azure.Storage.Blobs/src/Sas/BlobSasQueryParameters.cs index 36e543df8fa3..9c1b620bdd7e 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/Sas/BlobSasQueryParameters.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/Sas/BlobSasQueryParameters.cs @@ -68,7 +68,7 @@ internal BlobSasQueryParameters( SasProtocol protocol, DateTimeOffset startsOn, DateTimeOffset expiresOn, - IPRange ipRange, + SasIPRange ipRange, string identifier, string resource, string permissions, diff --git a/sdk/storage/Azure.Storage.Blobs/swagger/readme.md b/sdk/storage/Azure.Storage.Blobs/swagger/readme.md index 129d0a0962ba..d4f7e52aefd2 100644 --- a/sdk/storage/Azure.Storage.Blobs/swagger/readme.md +++ b/sdk/storage/Azure.Storage.Blobs/swagger/readme.md @@ -248,7 +248,6 @@ directive: transform: > $.get.description = "Returns the sku name and account kind"; $.get.responses["200"]["x-az-response-name"] = "AccountInfo"; - $.get.responses["200"]["x-az-struct"] = true; - from: swagger-document where: $["x-ms-paths"] transform: > @@ -729,7 +728,6 @@ directive: transform: > $.put.responses["201"]["x-az-response-name"] = "PageInfo"; $.put.responses["201"].description = "The operation completed successfully."; - $.put.responses["201"]["x-az-struct"] = true; $.put.responses["201"].headers["x-ms-blob-sequence-number"].description = "The current sequence number for the page blob. This is only returned for page blobs."; $.put.responses["201"].headers["x-ms-request-server-encrypted"]["x-az-demote-header"] = true; ``` @@ -742,7 +740,6 @@ directive: transform: > $.put.responses["201"]["x-az-response-name"] = "PageInfo"; $.put.responses["201"].description = "The operation completed successfully."; - $.put.responses["201"]["x-az-struct"] = true; $.put.responses["201"].headers["x-ms-blob-sequence-number"].description = "The current sequence number for the page blob. This is only returned for page blobs."; $.put.responses["201"].headers["x-ms-request-server-encrypted"] = { "x-ms-client-name": "IsServerEncrypted", @@ -766,7 +763,6 @@ directive: $.put.operationId = "PageBlob_UploadPagesFromUri"; $.put.responses["201"]["x-az-response-name"] = "PageInfo"; $.put.responses["201"].description = "The operation completed successfully."; - $.put.responses["201"]["x-az-struct"] = true; $.put.responses["201"].headers["x-ms-blob-sequence-number"].description = "The current sequence number for the page blob. This is only returned for page blobs."; $.put.responses["201"].headers["x-ms-request-server-encrypted"]["x-az-demote-header"] = true; $.put.responses["304"] = { @@ -1305,6 +1301,7 @@ directive: $.BlobBlock = $.Block; delete $.Block; $.BlobBlock.xml = { "name": "Block" }; + $.BlobBlock["x-az-struct"] = true; const path = $.BlockList.properties.CommittedBlocks.items.$ref.replace(/[#].*$/, "#/definitions/BlobBlock"); $.BlockList.properties.CommittedBlocks.items.$ref = path; $.BlockList.properties.CommittedBlocks.xml.name = "CommittedBlocks"; @@ -1338,6 +1335,7 @@ directive: $.PageList["x-az-public"] = false; $.PageRange["x-az-public"] = false; $.ClearRange["x-az-public"] = false; +``` ### Access Policy properties renaming ``` yaml diff --git a/sdk/storage/Azure.Storage.Blobs/tests/BlobTestBase.cs b/sdk/storage/Azure.Storage.Blobs/tests/BlobTestBase.cs index b9b2e60111a5..5fa714339cc8 100644 --- a/sdk/storage/Azure.Storage.Blobs/tests/BlobTestBase.cs +++ b/sdk/storage/Azure.Storage.Blobs/tests/BlobTestBase.cs @@ -254,7 +254,7 @@ public SasQueryParameters GetNewAccountSasCredentials(StorageSharedKeyCredential StartsOn = Recording.UtcNow.AddHours(-1), ExpiresOn = Recording.UtcNow.AddHours(+1), Permissions = new BlobContainerSasPermissions { Read = true, Add = true, Create = true, Write = true, Delete = true, List = true }.ToString(), - IPRange = new IPRange(IPAddress.None, IPAddress.None) + IPRange = new SasIPRange(IPAddress.None, IPAddress.None) }.ToSasQueryParameters(sharedKeyCredentials); public BlobSasQueryParameters GetNewBlobServiceSasCredentialsContainer(string containerName, StorageSharedKeyCredential sharedKeyCredentials = default) @@ -265,7 +265,7 @@ public BlobSasQueryParameters GetNewBlobServiceSasCredentialsContainer(string co StartsOn = Recording.UtcNow.AddHours(-1), ExpiresOn = Recording.UtcNow.AddHours(+1), Permissions = new BlobContainerSasPermissions { Read = true, Add = true, Create = true, Write = true, Delete = true, List = true }.ToString(), - IPRange = new IPRange(IPAddress.None, IPAddress.None) + IPRange = new SasIPRange(IPAddress.None, IPAddress.None) }.ToSasQueryParameters(sharedKeyCredentials ?? GetNewSharedKeyCredentials()); public BlobSasQueryParameters GetNewBlobServiceIdentitySasCredentialsContainer(string containerName, UserDelegationKey userDelegationKey, string accountName) @@ -276,7 +276,7 @@ public BlobSasQueryParameters GetNewBlobServiceIdentitySasCredentialsContainer(s StartsOn = Recording.UtcNow.AddHours(-1), ExpiresOn = Recording.UtcNow.AddHours(+1), Permissions = new BlobContainerSasPermissions { Read = true, Add = true, Create = true, Write = true, Delete = true, List = true }.ToString(), - IPRange = new IPRange(IPAddress.None, IPAddress.None) + IPRange = new SasIPRange(IPAddress.None, IPAddress.None) }.ToSasQueryParameters(userDelegationKey, accountName); public BlobSasQueryParameters GetNewBlobServiceSasCredentialsBlob(string containerName, string blobName, StorageSharedKeyCredential sharedKeyCredentials = default) @@ -288,7 +288,7 @@ public BlobSasQueryParameters GetNewBlobServiceSasCredentialsBlob(string contain StartsOn = Recording.UtcNow.AddHours(-1), ExpiresOn = Recording.UtcNow.AddHours(+1), Permissions = new BlobSasPermissions { Read = true, Add = true, Create = true, Write = true, Delete = true }.ToString(), - IPRange = new IPRange(IPAddress.None, IPAddress.None) + IPRange = new SasIPRange(IPAddress.None, IPAddress.None) }.ToSasQueryParameters(sharedKeyCredentials ?? GetNewSharedKeyCredentials()); public BlobSasQueryParameters GetNewBlobServiceIdentitySasCredentialsBlob(string containerName, string blobName, UserDelegationKey userDelegationKey, string accountName) @@ -300,7 +300,7 @@ public BlobSasQueryParameters GetNewBlobServiceIdentitySasCredentialsBlob(string StartsOn = Recording.UtcNow.AddHours(-1), ExpiresOn = Recording.UtcNow.AddHours(+1), Permissions = new BlobSasPermissions { Read = true, Add = true, Create = true, Write = true, Delete = true }.ToString(), - IPRange = new IPRange(IPAddress.None, IPAddress.None) + IPRange = new SasIPRange(IPAddress.None, IPAddress.None) }.ToSasQueryParameters(userDelegationKey, accountName); public BlobSasQueryParameters GetNewBlobServiceSasCredentialsSnapshot(string containerName, string blobName, string snapshot, StorageSharedKeyCredential sharedKeyCredentials = default) @@ -313,7 +313,7 @@ public BlobSasQueryParameters GetNewBlobServiceSasCredentialsSnapshot(string con StartsOn = Recording.UtcNow.AddHours(-1), ExpiresOn = Recording.UtcNow.AddHours(+1), Permissions = new SnapshotSasPermissions { Read = true, Write = true, Delete = true }.ToString(), - IPRange = new IPRange(IPAddress.None, IPAddress.None) + IPRange = new SasIPRange(IPAddress.None, IPAddress.None) }.ToSasQueryParameters(sharedKeyCredentials ?? GetNewSharedKeyCredentials()); public async Task CreatePageBlobClientAsync(BlobContainerClient container, long size) diff --git a/sdk/storage/Azure.Storage.Blobs/tests/BlobUriBuilderTests.cs b/sdk/storage/Azure.Storage.Blobs/tests/BlobUriBuilderTests.cs index b574ac9f4bbd..7613a6efd86f 100644 --- a/sdk/storage/Azure.Storage.Blobs/tests/BlobUriBuilderTests.cs +++ b/sdk/storage/Azure.Storage.Blobs/tests/BlobUriBuilderTests.cs @@ -171,7 +171,7 @@ public void BlobUriBuilder_RegularUrl_SasTest() Assert.AreEqual(new DateTimeOffset(2015, 4, 30, 2, 23, 26, TimeSpan.Zero), blobUriBuilder.Sas.ExpiresOn); Assert.AreEqual("", blobUriBuilder.Sas.Identifier); - Assert.AreEqual(IPRange.Parse("168.1.5.60-168.1.5.70"), blobUriBuilder.Sas.IPRange); + Assert.AreEqual(SasIPRange.Parse("168.1.5.60-168.1.5.70"), blobUriBuilder.Sas.IPRange); Assert.AreEqual("rw", blobUriBuilder.Sas.Permissions); Assert.AreEqual(SasProtocol.Https, blobUriBuilder.Sas.Protocol); Assert.AreEqual("b", blobUriBuilder.Sas.Resource); @@ -332,7 +332,7 @@ public void BlobUriBuilder_IPStyleUrl_SasTest() Assert.AreEqual(new DateTimeOffset(2015, 4, 30, 2, 23, 26, TimeSpan.Zero), blobUriBuilder.Sas.ExpiresOn); Assert.AreEqual("", blobUriBuilder.Sas.Identifier); - Assert.AreEqual(IPRange.Parse("168.1.5.60-168.1.5.70"), blobUriBuilder.Sas.IPRange); + Assert.AreEqual(SasIPRange.Parse("168.1.5.60-168.1.5.70"), blobUriBuilder.Sas.IPRange); Assert.AreEqual("rw", blobUriBuilder.Sas.Permissions); Assert.AreEqual(SasProtocol.Https, blobUriBuilder.Sas.Protocol); Assert.AreEqual("b", blobUriBuilder.Sas.Resource); diff --git a/sdk/storage/Azure.Storage.Blobs/tests/PageInfoTest.cs b/sdk/storage/Azure.Storage.Blobs/tests/PageInfoTest.cs deleted file mode 100644 index 758fe212b886..000000000000 --- a/sdk/storage/Azure.Storage.Blobs/tests/PageInfoTest.cs +++ /dev/null @@ -1,208 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System; -using Azure.Storage.Blobs.Models; -using NUnit.Framework; - -namespace Azure.Storage.Blobs.Tests -{ - /// - /// These tests are related to our generated struct behavior. - /// - public class PageInfoTest - { - [Test] - public void EqualsReturnsTrueForEqualValues() - { - var hash = new byte[] { 1, 2, 3 }; - - var info1 = new PageInfo( - new ETag("A"), - new DateTimeOffset(2019, 9, 25, 1, 1, 1, TimeSpan.Zero), - hash, - hash, - 1, - "key1"); - - var info2 = new PageInfo( - new ETag("A"), - new DateTimeOffset(2019, 9, 25, 1, 1, 1, TimeSpan.Zero), - hash, - hash, - 1, - "key1"); - - Assert.True(info1.Equals(info2)); - Assert.True(info2.Equals(info1)); - - Assert.AreEqual(info1.GetHashCode(), info2.GetHashCode()); - } - - [Test] - public void EqualsReturnsTrueForNullValues() - { - var info1 = new PageInfo( - new ETag("A"), - new DateTimeOffset(2019, 9, 25, 1, 1, 1, TimeSpan.Zero), - null, - null, - 1, - null); - - var info2 = new PageInfo( - new ETag("A"), - new DateTimeOffset(2019, 9, 25, 1, 1, 1, TimeSpan.Zero), - null, - null, - 1, - null); - - Assert.True(info1.Equals(info2)); - Assert.True(info2.Equals(info1)); - - Assert.AreEqual(info1.GetHashCode(), info2.GetHashCode()); - - } - - [Test] - public void EqualsReturnsTrueIfCompareContentHashByValues() - { - var hash1 = new byte[] { 1, 2, 3 }; - var hash2 = new byte[] { 1, 2, 3 }; - - var info1 = new PageInfo( - new ETag("A"), - new DateTimeOffset(2019, 9, 25, 1, 1, 1, TimeSpan.Zero), - hash1, - hash1, - 1, - "key1"); - - var info2 = new PageInfo( - new ETag("A"), - new DateTimeOffset(2019, 9, 25, 1, 1, 1, TimeSpan.Zero), - hash2, - hash1, - 1, - "key1"); - - Assert.True(info1.Equals(info2)); - Assert.True(info2.Equals(info1)); - - Assert.AreEqual(info1.GetHashCode(), info2.GetHashCode()); - } - - [Test] - public void EqualsReturnsTrueIfCompareContentCrc64ByValues() - { - var hash1 = new byte[] { 1, 2, 3 }; - var hash2 = new byte[] { 1, 2, 3 }; - - var info1 = new PageInfo( - new ETag("A"), - new DateTimeOffset(2019, 9, 25, 1, 1, 1, TimeSpan.Zero), - hash1, - hash1, - 1, - "key1"); - - var info2 = new PageInfo( - new ETag("A"), - new DateTimeOffset(2019, 9, 25, 1, 1, 1, TimeSpan.Zero), - hash1, - hash2, - 1, - "key1"); - - Assert.True(info1.Equals(info2)); - Assert.True(info2.Equals(info1)); - - Assert.AreEqual(info1.GetHashCode(), info2.GetHashCode()); - } - - [Test] - public void EqualsReturnsFalseIfCompareContentHashWithNull() - { - var hash = new byte[] { 1, 2, 3 }; - - var info1 = new PageInfo( - new ETag("A"), - new DateTimeOffset(2019, 9, 25, 1, 1, 1, TimeSpan.Zero), - null, - hash, - 1, - "key1"); - - var info2 = new PageInfo( - new ETag("A"), - new DateTimeOffset(2019, 9, 25, 1, 1, 1, TimeSpan.Zero), - hash, - hash, - 1, - "key1"); - - Assert.True(!info1.Equals(info2)); - Assert.True(!info2.Equals(info1)); - - Assert.AreNotEqual(info1.GetHashCode(), info2.GetHashCode()); - - } - - [Test] - public void EqualsReturnsFalseIfCompareContentCrc64WithNull() - { - var hash = new byte[] { 1, 2, 3 }; - - var info1 = new PageInfo( - new ETag("A"), - new DateTimeOffset(2019, 9, 25, 1, 1, 1, TimeSpan.Zero), - hash, - null, - 1, - "key1"); - - var info2 = new PageInfo( - new ETag("A"), - new DateTimeOffset(2019, 9, 25, 1, 1, 1, TimeSpan.Zero), - hash, - hash, - 1, - "key1"); - - Assert.True(!info1.Equals(info2)); - Assert.True(!info2.Equals(info1)); - - Assert.AreNotEqual(info1.GetHashCode(), info2.GetHashCode()); - - } - - - [Test] - public void EqualsReturnFalseIfCompareDifferentValues() - { - var hash = new byte[] { 1, 2, 3 }; - - var info1 = new PageInfo( - new ETag("B"), - new DateTimeOffset(2019, 9, 25, 1, 1, 1, TimeSpan.Zero), - hash, - hash, - 1, - "key1"); - - var info2 = new PageInfo( - new ETag("A"), - new DateTimeOffset(2019, 11, 25, 1, 1, 1, TimeSpan.Zero), - hash, - hash, - 2, - "key2"); - - Assert.True(!info1.Equals(info2)); - Assert.True(!info2.Equals(info1)); - - Assert.AreNotEqual(info1.GetHashCode(), info2.GetHashCode()); - } - } -} diff --git a/sdk/storage/Azure.Storage.Blobs/tests/SasQueryParametersTests.cs b/sdk/storage/Azure.Storage.Blobs/tests/SasQueryParametersTests.cs index e0cadb9a9397..dbbb7f39a8fd 100644 --- a/sdk/storage/Azure.Storage.Blobs/tests/SasQueryParametersTests.cs +++ b/sdk/storage/Azure.Storage.Blobs/tests/SasQueryParametersTests.cs @@ -25,7 +25,7 @@ public void SasQueryParameters_RoundTrip() SasProtocol protocol = SasProtocol.Https; DateTimeOffset startTime = DateTimeOffset.Now; DateTimeOffset expiryTime = startTime.AddDays(1); - var ipRange = new IPRange(); + var ipRange = new SasIPRange(); var identifier = "foo"; var resource = "bar"; var permissions = "rw"; diff --git a/sdk/storage/Azure.Storage.Common/src/Constants.cs b/sdk/storage/Azure.Storage.Common/src/Constants.cs index f5e3173b1f57..eaaef915ddfa 100644 --- a/sdk/storage/Azure.Storage.Common/src/Constants.cs +++ b/sdk/storage/Azure.Storage.Common/src/Constants.cs @@ -293,6 +293,11 @@ internal static class File public const string SetHttpHeadersOperationName = "Azure.Storage.Files.FileClient.SetHttpHeaders"; + public const string ForceCloseAllHandlesOperationName = + "Azure.Storage.Files.FileClient.ForceCloseAllHandles"; + public const string ForceCloseHandleOperationName = + "Azure.Storage.Files.FileClient.ForceCloseHandle"; + internal static class Directory { public const string CreateOperationName = @@ -309,8 +314,10 @@ internal static class Directory "Azure.Storage.Files.DirectoryClient.ListFilesAndDirectoriesSegment"; public const string GetHandlesOperationName = "Azure.Storage.Files.DirectoryClient.ListHandles"; - public const string ForceCloseHandlesOperationName = - "Azure.Storage.Files.DirectoryClient.ForceCloseHandles"; + public const string ForceCloseAllHandlesOperationName = + "Azure.Storage.Files.DirectoryClient.ForceCloseAllHandles"; + public const string ForceCloseHandleOperationName = + "Azure.Storage.Files.DirectoryClient.ForceCloseHandle"; } internal static class Service diff --git a/sdk/storage/Azure.Storage.Common/src/Sas/AccountSasBuilder.cs b/sdk/storage/Azure.Storage.Common/src/Sas/AccountSasBuilder.cs index 7816e898de5d..b2ea9f581e10 100644 --- a/sdk/storage/Azure.Storage.Common/src/Sas/AccountSasBuilder.cs +++ b/sdk/storage/Azure.Storage.Common/src/Sas/AccountSasBuilder.cs @@ -12,7 +12,7 @@ namespace Azure.Storage.Sas /// For more information, see /// . /// - public struct AccountSasBuilder : IEquatable + public class AccountSasBuilder { /// /// The storage service version to use to authenticate requests made @@ -61,7 +61,7 @@ public struct AccountSasBuilder : IEquatable /// When specifying a range of IP addresses, note that the range is /// inclusive. /// - public IPRange IPRange { get; set; } + public SasIPRange IPRange { get; set; } /// /// The services associated with the shared access signature. The @@ -139,8 +139,7 @@ public SasQueryParameters ToSasQueryParameters(StorageSharedKeyCredential shared /// /// A string that represents the current object. [EditorBrowsable(EditorBrowsableState.Never)] - public override string ToString() => - base.ToString(); + public override string ToString() => base.ToString(); /// /// Check if two instances are equal. @@ -148,57 +147,13 @@ public override string ToString() => /// The instance to compare to. /// True if they're equal, false otherwise. [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => - obj is AccountSasBuilder other && - Equals(other); + public override bool Equals(object obj) => base.Equals(obj); /// /// Get a hash code for the . /// /// Hash code for the . [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => - ExpiresOn.GetHashCode() ^ - IPRange.GetHashCode() ^ - (Permissions?.GetHashCode() ?? 0) ^ - Protocol.GetHashCode() ^ - ResourceTypes.GetHashCode() ^ - (Services.GetHashCode()) ^ - StartsOn.GetHashCode() ^ - (Version?.GetHashCode() ?? 0); - - /// - /// Check if two instances are equal. - /// - /// The first instance to compare. - /// The second instance to compare. - /// True if they're equal, false otherwise. - public static bool operator ==(AccountSasBuilder left, AccountSasBuilder right) => - left.Equals(right); - - /// - /// Check if two instances are not - /// equal. - /// - /// The first instance to compare. - /// The second instance to compare. - /// True if they're not equal, false otherwise. - public static bool operator !=(AccountSasBuilder left, AccountSasBuilder right) => - !(left == right); - - /// - /// Check if two instances are equal. - /// - /// The instance to compare to. - /// True if they're equal, false otherwise. - public bool Equals(AccountSasBuilder other) => - ExpiresOn == other.ExpiresOn && - IPRange == other.IPRange && - Permissions == other.Permissions && - Protocol == other.Protocol && - ResourceTypes == other.ResourceTypes && - Services == other.Services && - StartsOn == other.StartsOn && - Version == other.Version; + public override int GetHashCode() => base.GetHashCode(); } } diff --git a/sdk/storage/Azure.Storage.Common/src/Sas/IPRange.cs b/sdk/storage/Azure.Storage.Common/src/Sas/SasIPRange.cs similarity index 73% rename from sdk/storage/Azure.Storage.Common/src/Sas/IPRange.cs rename to sdk/storage/Azure.Storage.Common/src/Sas/SasIPRange.cs index 0a5bf78f3e89..28a25e2d9f3f 100644 --- a/sdk/storage/Azure.Storage.Common/src/Sas/IPRange.cs +++ b/sdk/storage/Azure.Storage.Common/src/Sas/SasIPRange.cs @@ -11,7 +11,7 @@ namespace Azure.Storage.Sas /// Represents a range of allowed IP addresses for constructing a Shared /// Access Signature. /// - public readonly struct IPRange : IEquatable + public readonly struct SasIPRange : IEquatable { /// /// Gets the start of the IP range. Not specified if equal to null or @@ -26,7 +26,7 @@ namespace Azure.Storage.Sas public IPAddress End { get; } /// - /// Creates a new . + /// Creates a new . /// /// /// The range's start . @@ -34,7 +34,7 @@ namespace Azure.Storage.Sas /// /// The range's optional end . /// - public IPRange(IPAddress start, IPAddress end = null) + public SasIPRange(IPAddress start, IPAddress end = null) { Start = start ?? IPAddress.None; End = end ?? IPAddress.None; @@ -49,10 +49,10 @@ private static bool IsEmpty(IPAddress address) => address == null || address == IPAddress.None; /// - /// Creates a string representation of an . + /// Creates a string representation of an . /// /// - /// A string representation of an . + /// A string representation of an . /// public override string ToString() => IsEmpty(Start) ? string.Empty : @@ -60,61 +60,61 @@ public override string ToString() => Start.ToString() + "-" + End.ToString(); /// - /// Parse an IP range string into a new . + /// Parse an IP range string into a new . /// /// IP range string to parse. - /// The parsed . - public static IPRange Parse(string s) + /// The parsed . + public static SasIPRange Parse(string s) { var dashIndex = s.IndexOf('-'); return dashIndex == -1 ? - new IPRange(IPAddress.Parse(s)) : - new IPRange( + new SasIPRange(IPAddress.Parse(s)) : + new SasIPRange( IPAddress.Parse(s.Substring(0, dashIndex)), IPAddress.Parse(s.Substring(dashIndex + 1))); } /// - /// Check if two instances are equal. + /// Check if two instances are equal. /// /// The instance to compare to. /// True if they're equal, false otherwise. [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object obj) => - obj is IPRange other && Equals(other); + obj is SasIPRange other && Equals(other); /// - /// Get a hash code for the . + /// Get a hash code for the . /// - /// Hash code for the . + /// Hash code for the . [EditorBrowsable(EditorBrowsableState.Never)] public override int GetHashCode() => (Start?.GetHashCode() ?? 0) ^ (End?.GetHashCode() ?? 0); /// - /// Check if two instances are equal. + /// Check if two instances are equal. /// /// The first instance to compare. /// The second instance to compare. /// True if they're equal, false otherwise. - public static bool operator ==(IPRange left, IPRange right) => + public static bool operator ==(SasIPRange left, SasIPRange right) => left.Equals(right); /// - /// Check if two instances are not equal. + /// Check if two instances are not equal. /// /// The first instance to compare. /// The second instance to compare. /// True if they're not equal, false otherwise. - public static bool operator !=(IPRange left, IPRange right) => + public static bool operator !=(SasIPRange left, SasIPRange right) => !(left == right); /// - /// Check if two instances are equal. + /// Check if two instances are equal. /// /// The instance to compare to. /// True if they're equal, false otherwise. - public bool Equals(IPRange other) => + public bool Equals(SasIPRange other) => ((IsEmpty(Start) && IsEmpty(other.Start)) || (Start != null && Start.Equals(other.Start))) && ((IsEmpty(End) && IsEmpty(other.End)) || diff --git a/sdk/storage/Azure.Storage.Common/src/Sas/SasQueryParameters.cs b/sdk/storage/Azure.Storage.Common/src/Sas/SasQueryParameters.cs index 600ed22ca6aa..87ba7c84d5ff 100644 --- a/sdk/storage/Azure.Storage.Common/src/Sas/SasQueryParameters.cs +++ b/sdk/storage/Azure.Storage.Common/src/Sas/SasQueryParameters.cs @@ -56,7 +56,7 @@ internal static string FormatTimesForSasSigning(DateTimeOffset time) => private readonly DateTimeOffset _expiryTime; // sip - private readonly IPRange _ipRange; + private readonly SasIPRange _ipRange; // si private readonly string _identifier; @@ -128,7 +128,7 @@ internal static string FormatTimesForSasSigning(DateTimeOffset time) => /// to accept requests. When specifying a range, note that the range /// is inclusive. /// - public IPRange IPRange => _ipRange; + public SasIPRange IPRange => _ipRange; /// /// Gets the optional unique value up to 64 characters in length that @@ -228,7 +228,7 @@ internal SasQueryParameters( SasProtocol protocol, DateTimeOffset startsOn, DateTimeOffset expiresOn, - IPRange ipRange, + SasIPRange ipRange, string identifier, string resource, string permissions, @@ -312,7 +312,7 @@ internal SasQueryParameters( _expiryTime = DateTimeOffset.ParseExact(kv.Value, Constants.SasTimeFormat, CultureInfo.InvariantCulture); break; case Constants.Sas.Parameters.IPRangeUpper: - _ipRange = IPRange.Parse(kv.Value); + _ipRange = SasIPRange.Parse(kv.Value); break; case Constants.Sas.Parameters.IdentifierUpper: _identifier = kv.Value; diff --git a/sdk/storage/Azure.Storage.Common/tests/Shared/Constants.cs b/sdk/storage/Azure.Storage.Common/tests/Shared/Constants.cs index 4d04721f7ee0..58ea0e6ffff2 100644 --- a/sdk/storage/Azure.Storage.Common/tests/Shared/Constants.cs +++ b/sdk/storage/Azure.Storage.Common/tests/Shared/Constants.cs @@ -49,7 +49,7 @@ internal class SasConstants public DateTimeOffset ExpiryTime { get; protected internal set; } public IPAddress StartAddress { get; protected internal set; } public IPAddress EndAddress { get; protected internal set; } - public IPRange IPRange { get; protected internal set; } + public SasIPRange IPRange { get; protected internal set; } public DateTimeOffset KeyStart { get; protected internal set; } public DateTimeOffset KeyExpiry { get; protected internal set; } public StorageSharedKeyCredential SharedKeyCredential { get; protected internal set; } @@ -82,7 +82,7 @@ public Constants(StorageTestBase test) KeyStart = test.GetUtcNow().AddHours(-1), KeyExpiry = test.GetUtcNow().AddHours(+1) }; - Sas.IPRange = new IPRange(Sas.StartAddress, Sas.EndAddress); + Sas.IPRange = new SasIPRange(Sas.StartAddress, Sas.EndAddress); Sas.SharedKeyCredential = new StorageSharedKeyCredential(Sas.Account, Sas.AccountKey); } } diff --git a/sdk/storage/Azure.Storage.Files/src/DirectoryClient.cs b/sdk/storage/Azure.Storage.Files/src/DirectoryClient.cs index cd710227f5dd..357c13fe9440 100644 --- a/sdk/storage/Azure.Storage.Files/src/DirectoryClient.cs +++ b/sdk/storage/Azure.Storage.Files/src/DirectoryClient.cs @@ -339,7 +339,7 @@ private void SetNameFieldsIfNull() /// public virtual Response Create( Metadata metadata = default, - FileSmbProperties? smbProperties = default, + FileSmbProperties smbProperties = default, string filePermission = default, CancellationToken cancellationToken = default) => CreateInternal( @@ -379,7 +379,7 @@ public virtual Response Create( /// public virtual async Task> CreateAsync( Metadata metadata = default, - FileSmbProperties? smbProperties = default, + FileSmbProperties smbProperties = default, string filePermission = default, CancellationToken cancellationToken = default) => await CreateInternal( @@ -422,7 +422,7 @@ await CreateInternal( /// private async Task> CreateInternal( Metadata metadata, - FileSmbProperties? smbProperties, + FileSmbProperties smbProperties, string filePermission, bool async, CancellationToken cancellationToken) @@ -731,7 +731,7 @@ private async Task> GetPropertiesInternal( /// a failure occurs. /// public virtual Response SetHttpHeaders( - FileSmbProperties? smbProperties = default, + FileSmbProperties smbProperties = default, string filePermission = default, CancellationToken cancellationToken = default) => SetHttpHeadersInternal( @@ -766,7 +766,7 @@ public virtual Response SetHttpHeaders( /// a failure occurs. /// public virtual async Task> SetHttpHeadersAsync( - FileSmbProperties? smbProperties = default, + FileSmbProperties smbProperties = default, string filePermission = default, CancellationToken cancellationToken = default) => await SetHttpHeadersInternal( @@ -804,7 +804,7 @@ await SetHttpHeadersInternal( /// a failure occurs. /// private async Task> SetHttpHeadersInternal( - FileSmbProperties? smbProperties, + FileSmbProperties smbProperties, string filePermission, bool async, CancellationToken cancellationToken) @@ -1268,10 +1268,8 @@ internal async Task> GetHandlesInternal( #region ForceCloseHandles /// - /// The operation closes a handle or handles opened on a directory - /// or a file at the service. It supports closing a single handle specified by on a file or - /// directory or closing all handles opened on that resource. It optionally supports recursively closing - /// handles on subresources when the resource is a directory. + /// The operation closes a handle opened on a directory + /// or a file at the service. It supports closing a single handle specified by . /// /// This API is intended to be used alongside to force close handles that /// block operations, such as renaming a directory. These handles may have leaked or been lost track of by @@ -1282,17 +1280,86 @@ internal async Task> GetHandlesInternal( /// For more information, see . /// /// - /// Optional. Specifies the handle ID to be closed. If not specified, or if equal to "*", will close all handles. + /// Specifies the handle ID to be closed. /// - /// - /// An optional string value that identifies the segment of the handles - /// to be closed with the next call to . The - /// operation returns a non-empty - /// if the operation did not return all items remaining to be - /// closed with the current segment. The NextMarker value can - /// be used as the value for the parameter - /// in a subsequent call to request the closure of the next segment of handles. + /// + /// Optional to propagate + /// notifications that the operation should be cancelled. /// + /// + /// A describing the status of the + /// operation. + /// + /// + /// A will be thrown if + /// a failure occurs. + /// + public virtual Response ForceCloseHandle( + string handleId, + CancellationToken cancellationToken = default) => + ForceCloseHandlesInternal( + handleId, + null, + null, + false, // async + cancellationToken, + Constants.File.Directory.ForceCloseHandleOperationName) + .EnsureCompleted() + .GetRawResponse(); + + /// + /// The operation closes a handle opened on a directory + /// or a file at the service. It supports closing a single handle specified by . + /// + /// This API is intended to be used alongside to force close handles that + /// block operations, such as renaming a directory. These handles may have leaked or been lost track of by + /// SMB clients. The API has client-side impact on the handle being closed, including user visible + /// errors due to failed attempts to read or write files. This API is not intended for use as a replacement + /// or alternative for SMB close. + /// + /// For more information, see . + /// + /// + /// Specifies the handle ID to be closed. + /// + /// + /// Optional to propagate + /// notifications that the operation should be cancelled. + /// + /// + /// A describing the status of the + /// operation. + /// + /// + /// A will be thrown if + /// a failure occurs. + /// + public virtual async Task ForceCloseHandleAsync( + string handleId, + CancellationToken cancellationToken = default) => + (await ForceCloseHandlesInternal( + handleId, + null, + null, + true, // async + cancellationToken, + Constants.File.Directory.ForceCloseHandleOperationName) + .ConfigureAwait(false)) + .GetRawResponse(); + + /// + /// The operation closes all handles opened on a directory + /// or a file at the service. It optionally supports recursively closing handles on subresources + /// when the resource is a directory. + /// + /// This API is intended to be used alongside to force close handles that + /// block operations, such as renaming a directory. These handles may have leaked or been lost track of by + /// SMB clients. The API has client-side impact on the handle being closed, including user visible + /// errors due to failed attempts to read or write files. This API is not intended for use as a replacement + /// or alternative for SMB close. + /// + /// For more information, see . + /// /// /// Optional. A boolean value that specifies if the operation should also apply to the files and subdirectories of the directory specified. /// @@ -1301,31 +1368,25 @@ internal async Task> GetHandlesInternal( /// notifications that the operation should be cancelled. /// /// - /// A describing a - /// segment of the handles closed. + /// The number of handles closed. /// /// /// A will be thrown if /// a failure occurs. /// - public virtual Response ForceCloseHandles( - string handleId = Constants.CloseAllHandles, - string marker = default, + public virtual int ForceCloseAllHandles( bool? recursive = default, CancellationToken cancellationToken = default) => - ForceCloseHandlesInternal( - handleId, - marker, + ForceCloseAllHandlesInternal( recursive, false, // async cancellationToken) .EnsureCompleted(); /// - /// The operation closes a handle or handles opened on a directory - /// or a file at the service. It supports closing a single handle specified by on a file or - /// directory or closing all handles opened on that resource. It optionally supports recursively closing - /// handles on subresources when the resource is a directory. + /// The operation closes all handles opened on a directory + /// or a file at the service. It optionally supports recursively closing handles on subresources + /// when the resource is a directory. /// /// This API is intended to be used alongside to force close handles that /// block operations, such as renaming a directory. These handles may have leaked or been lost track of by @@ -1335,18 +1396,6 @@ public virtual Response ForceCloseHandles( /// /// For more information, see . /// - /// - /// Optional. Specifies the handle ID to be closed. If not specified, or if equal to "*", will close all handles. - /// - /// - /// An optional string value that identifies the segment of the handles - /// to be closed with the next call to . The - /// operation returns a non-empty - /// if the operation did not return all items remaining to be - /// closed with the current segment. The NextMarker value can - /// be used as the value for the parameter - /// in a subsequent call to request the closure of the next segment of handles. - /// /// /// Optional. A boolean value that specifies if the operation should also apply to the files and subdirectories of the directory specified. /// @@ -1355,28 +1404,78 @@ public virtual Response ForceCloseHandles( /// notifications that the operation should be cancelled. /// /// - /// A describing a - /// segment of the handles closed. + /// The number of handles closed. /// /// /// A will be thrown if /// a failure occurs. /// - public virtual async Task> ForceCloseHandlesAsync( - string handleId = Constants.CloseAllHandles, - string marker = default, + public virtual async Task ForceCloseAllHandlesAsync( bool? recursive = default, CancellationToken cancellationToken = default) => - await ForceCloseHandlesInternal( - handleId, - marker, + await ForceCloseAllHandlesInternal( recursive, true, // async cancellationToken) .ConfigureAwait(false); /// - /// The operation closes a handle or handles opened on a directory + /// The operation closes all handles opened on a directory + /// or a file at the service. It optionally supports recursively closing handles on subresources + /// when the resource is a directory. + /// + /// This API is intended to be used alongside to force close handles that + /// block operations. These handles may have leaked or been lost track of by + /// SMB clients. The API has client-side impact on the handle being closed, including user visible + /// errors due to failed attempts to read or write files. This API is not intended for use as a replacement + /// or alternative for SMB close. + /// + /// For more information, see . + /// + /// + /// Optional. A boolean value that specifies if the operation should also apply to the files and subdirectories of the directory specified. + /// + /// + /// Whether to invoke the operation asynchronously. + /// + /// + /// Optional to propagate + /// notifications that the operation should be cancelled. + /// + /// + /// The number of handles closed. + /// + /// + /// A will be thrown if + /// a failure occurs. + /// + private async Task ForceCloseAllHandlesInternal( + bool? recursive, + bool async, + CancellationToken cancellationToken) + { + int handlesClosed = 0; + string marker = null; + do + { + Response response = + await ForceCloseHandlesInternal( + Constants.CloseAllHandles, + marker, + recursive, + async, + cancellationToken) + .ConfigureAwait(false); + marker = response.Value.Marker; + handlesClosed += response.Value.NumberOfHandlesClosed; + + } while (!string.IsNullOrEmpty(marker)); + + return handlesClosed; + } + + /// + /// The operation closes a handle or handles opened on a directory /// or a file at the service. It supports closing a single handle specified by on a file or /// directory or closing all handles opened on that resource. It optionally supports recursively closing /// handles on subresources when the resource is a directory. @@ -1394,7 +1493,7 @@ await ForceCloseHandlesInternal( /// /// /// An optional string value that identifies the segment of the handles - /// to be closed with the next call to . The + /// to be closed with the next call to . The /// operation returns a non-empty /// if the operation did not return all items remaining to be /// closed with the current segment. The NextMarker value can @@ -1411,6 +1510,9 @@ await ForceCloseHandlesInternal( /// Optional to propagate /// notifications that the operation should be cancelled. /// + /// + /// Optional. Used to indicate the name of the operation. + /// /// /// A describing a /// segment of the handles closed. @@ -1424,7 +1526,8 @@ private async Task> ForceCloseHandlesInter string marker, bool? recursive, bool async, - CancellationToken cancellationToken) + CancellationToken cancellationToken, + string operationName = Constants.File.Directory.ForceCloseAllHandlesOperationName) { // TODO Support share snapshot @@ -1447,7 +1550,7 @@ private async Task> ForceCloseHandlesInter handleId: handleId, recursive: recursive, async: async, - operationName: Constants.File.Directory.ForceCloseHandlesOperationName, + operationName: operationName, cancellationToken: cancellationToken) .ConfigureAwait(false); } @@ -1497,7 +1600,7 @@ private async Task> ForceCloseHandlesInter public virtual Response CreateSubdirectory( string subdirectoryName, Metadata metadata = default, - FileSmbProperties? smbProperties = default, + FileSmbProperties smbProperties = default, string filePermission = default, CancellationToken cancellationToken = default) { @@ -1542,7 +1645,7 @@ public virtual Response CreateSubdirectory( public virtual async Task> CreateSubdirectoryAsync( string subdirectoryName, Metadata metadata = default, - FileSmbProperties? smbProperties = default, + FileSmbProperties smbProperties = default, string filePermission = default, CancellationToken cancellationToken = default) { @@ -1648,9 +1751,9 @@ await GetSubdirectoryClient(subdirectoryName) public virtual Response CreateFile( string fileName, long maxSize, - FileHttpHeaders? httpHeaders = default, + FileHttpHeaders httpHeaders = default, Metadata metadata = default, - FileSmbProperties? smbProperties = default, + FileSmbProperties smbProperties = default, string filePermission = default, CancellationToken cancellationToken = default) { @@ -1705,9 +1808,9 @@ public virtual Response CreateFile( public virtual async Task> CreateFileAsync( string fileName, long maxSize, - FileHttpHeaders? httpHeaders = default, + FileHttpHeaders httpHeaders = default, Metadata metadata = default, - FileSmbProperties? smbProperties = default, + FileSmbProperties smbProperties = default, string filePermission = default, CancellationToken cancellationToken = default) { diff --git a/sdk/storage/Azure.Storage.Files/src/FileClient.cs b/sdk/storage/Azure.Storage.Files/src/FileClient.cs index 58a0ce5118f1..868729ae7f56 100644 --- a/sdk/storage/Azure.Storage.Files/src/FileClient.cs +++ b/sdk/storage/Azure.Storage.Files/src/FileClient.cs @@ -357,9 +357,9 @@ private void SetNameFieldsIfNull() /// public virtual Response Create( long maxSize, - FileHttpHeaders? httpHeaders = default, + FileHttpHeaders httpHeaders = default, Metadata metadata = default, - FileSmbProperties? smbProperties = default, + FileSmbProperties smbProperties = default, string filePermission = default, CancellationToken cancellationToken = default) => CreateInternal( @@ -410,9 +410,9 @@ public virtual Response Create( /// public virtual async Task> CreateAsync( long maxSize, - FileHttpHeaders? httpHeaders = default, + FileHttpHeaders httpHeaders = default, Metadata metadata = default, - FileSmbProperties? smbProperties = default, + FileSmbProperties smbProperties = default, string filePermission = default, CancellationToken cancellationToken = default) => await CreateInternal( @@ -466,9 +466,9 @@ await CreateInternal( /// private async Task> CreateInternal( long maxSize, - FileHttpHeaders? httpHeaders, + FileHttpHeaders httpHeaders, Metadata metadata, - FileSmbProperties? smbProperties, + FileSmbProperties smbProperties, string filePermission, bool async, CancellationToken cancellationToken) @@ -1282,8 +1282,8 @@ private async Task> GetPropertiesInternal( /// public virtual Response SetHttpHeaders( long? newSize = default, - FileHttpHeaders? httpHeaders = default, - FileSmbProperties? smbProperties = default, + FileHttpHeaders httpHeaders = default, + FileSmbProperties smbProperties = default, string filePermission = default, CancellationToken cancellationToken = default) => SetHttpHeadersInternal( @@ -1330,8 +1330,8 @@ public virtual Response SetHttpHeaders( /// public virtual async Task> SetHttpHeadersAsync( long? newSize = default, - FileHttpHeaders? httpHeaders = default, - FileSmbProperties? smbProperties = default, + FileHttpHeaders httpHeaders = default, + FileSmbProperties smbProperties = default, string filePermission = default, CancellationToken cancellationToken = default) => await SetHttpHeadersInternal( @@ -1381,8 +1381,8 @@ await SetHttpHeadersInternal( /// private async Task> SetHttpHeadersInternal( long? newSize, - FileHttpHeaders? httpHeaders, - FileSmbProperties? smbProperties, + FileHttpHeaders httpHeaders, + FileSmbProperties smbProperties, string filePermission, bool async, CancellationToken cancellationToken) @@ -2387,9 +2387,8 @@ internal async Task> GetHandlesInternal( #region ForceCloseHandles /// - /// The operation closes a handle or handles opened on a file - /// at the service. It supports closing a single handle specified by or - /// or closing all handles opened on that resource. + /// The operation closes a handle opened on a file + /// at the service. It supports closing a single handle specified by . /// /// This API is intended to be used alongside to force close handles that /// block operations. These handles may have leaked or been lost track of by @@ -2400,44 +2399,35 @@ internal async Task> GetHandlesInternal( /// For more information, see . /// /// - /// Optional. Specifies the handle ID to be closed. If not specified, or if equal to "*", will close all handles. - /// - /// - /// An optional string value that identifies the segment of the handles - /// to be closed with the next call to . The - /// operation returns a non-empty - /// if the operation did not return all items remaining to be - /// closed with the current segment. The NextMarker value can - /// be used as the value for the parameter - /// in a subsequent call to request the closure of the next segment of handles. + /// Specifies the handle ID to be closed. /// /// /// Optional to propagate /// notifications that the operation should be cancelled. /// /// - /// A describing a - /// segment of the handles closed. + /// A describing the status of the + /// operation. /// /// /// A will be thrown if /// a failure occurs. /// - public virtual Response ForceCloseHandles( - string handleId = Constants.CloseAllHandles, - string marker = default, + public virtual Response ForceCloseHandle( + string handleId, CancellationToken cancellationToken = default) => ForceCloseHandlesInternal( handleId, - marker, + null, false, // async, - cancellationToken) - .EnsureCompleted(); + cancellationToken, + Constants.File.ForceCloseHandleOperationName) + .EnsureCompleted() + .GetRawResponse(); /// - /// The operation closes a handle or handles opened on a file - /// at the service. It supports closing a single handle specified by or - /// or closing all handles opened on that resource. + /// The operation closes a handle opened on a file + /// at the service. It supports closing a single handle specified by . /// /// This API is intended to be used alongside to force close handles that /// block operations. These handles may have leaked or been lost track of by @@ -2448,40 +2438,136 @@ public virtual Response ForceCloseHandles( /// For more information, see . /// /// - /// Optional. Specifies the handle ID to be closed. If not specified, or if equal to "*", will close all handles. - /// - /// - /// An optional string value that identifies the segment of the handles - /// to be closed with the next call to . The - /// operation returns a non-empty - /// if the operation did not return all items remaining to be - /// closed with the current segment. The NextMarker value can - /// be used as the value for the parameter - /// in a subsequent call to request the closure of the next segment of handles. + /// Specifies the handle ID to be closed. /// /// /// Optional to propagate /// notifications that the operation should be cancelled. /// /// - /// A describing a - /// segment of the handles closed. + /// A describing the status of the + /// operation. /// /// /// A will be thrown if /// a failure occurs. /// - public virtual async Task> ForceCloseHandlesAsync( - string handleId = Constants.CloseAllHandles, - string marker = default, + public virtual async Task ForceCloseHandleAsync( + string handleId, CancellationToken cancellationToken = default) => - await ForceCloseHandlesInternal( + (await ForceCloseHandlesInternal( handleId, - marker, + null, + true, // async, + cancellationToken, + Constants.File.ForceCloseHandleOperationName) + .ConfigureAwait(false)). + GetRawResponse(); + + /// + /// The operation closes all handles opened on a file + /// at the service. + /// + /// This API is intended to be used alongside to force close handles that + /// block operations. These handles may have leaked or been lost track of by + /// SMB clients. The API has client-side impact on the handle being closed, including user visible + /// errors due to failed attempts to read or write files. This API is not intended for use as a replacement + /// or alternative for SMB close. + /// + /// For more information, see . + /// + /// + /// Optional to propagate + /// notifications that the operation should be cancelled. + /// + /// + /// The number of handles closed. + /// + /// + /// A will be thrown if + /// a failure occurs. + /// + public virtual int ForceCloseAllHandles( + CancellationToken cancellationToken = default) => + ForceCloseAllHandlesInternal( + false, // async, + cancellationToken) + .EnsureCompleted(); + + /// + /// The operation closes all handles opened on a file + /// at the service. + /// + /// This API is intended to be used alongside to force close handles that + /// block operations. These handles may have leaked or been lost track of by + /// SMB clients. The API has client-side impact on the handle being closed, including user visible + /// errors due to failed attempts to read or write files. This API is not intended for use as a replacement + /// or alternative for SMB close. + /// + /// For more information, see . + /// + /// + /// Optional to propagate + /// notifications that the operation should be cancelled. + /// + /// + /// The number of handles closed. + /// + /// + /// A will be thrown if + /// a failure occurs. + /// + public virtual async Task ForceCloseAllHandlesAsync( + CancellationToken cancellationToken = default) => + await ForceCloseAllHandlesInternal( true, // async, cancellationToken) .ConfigureAwait(false); + /// + /// The operation closes a handle or handles opened on a file + /// at the service. It supports closing all handles opened on that resource. + /// + /// This API is intended to be used alongside to force close handles that + /// block operations. These handles may have leaked or been lost track of by + /// SMB clients. The API has client-side impact on the handle being closed, including user visible + /// errors due to failed attempts to read or write files. This API is not intended for use as a replacement + /// or alternative for SMB close. + /// + /// For more information, see . + /// + /// + /// Whether to invoke the operation asynchronously. + /// + /// + /// Optional to propagate + /// notifications that the operation should be cancelled. + /// + /// + /// The number of handles closed. + /// + /// + /// A will be thrown if + /// a failure occurs. + /// + private async Task ForceCloseAllHandlesInternal( + bool async, + CancellationToken cancellationToken) + { + int handlesClosed = 0; + string marker = null; + do + { + Response response = + await ForceCloseHandlesInternal(Constants.CloseAllHandles, marker, async, cancellationToken).ConfigureAwait(false); + marker = response.Value.Marker; + handlesClosed += response.Value.NumberOfHandlesClosed; + + } while (!string.IsNullOrEmpty(marker)); + + return handlesClosed; + } + /// /// The operation closes a handle or handles opened on a file /// at the service. It supports closing a single handle specified by or @@ -2500,7 +2586,7 @@ await ForceCloseHandlesInternal( /// /// /// An optional string value that identifies the segment of the handles - /// to be closed with the next call to . The + /// to be closed with the next call to . The /// operation returns a non-empty /// if the operation did not return all items remaining to be /// closed with the current segment. The NextMarker value can @@ -2514,6 +2600,9 @@ await ForceCloseHandlesInternal( /// Optional to propagate /// notifications that the operation should be cancelled. /// + /// + /// Optional. Used to indicate the name of the operation. + /// /// /// A describing a /// segment of the handles closed. @@ -2526,7 +2615,8 @@ private async Task> ForceCloseHandlesInter string handleId, string marker, bool async, - CancellationToken cancellationToken) + CancellationToken cancellationToken, + string operationName = Constants.File.ForceCloseAllHandlesOperationName) { using (Pipeline.BeginLoggingScope(nameof(FileClient))) { @@ -2545,7 +2635,8 @@ private async Task> ForceCloseHandlesInter marker: marker, handleId: handleId, async: async, - cancellationToken: cancellationToken) + cancellationToken: cancellationToken, + operationName: operationName) .ConfigureAwait(false); } catch (Exception ex) diff --git a/sdk/storage/Azure.Storage.Files/src/Generated/FileRestClient.cs b/sdk/storage/Azure.Storage.Files/src/Generated/FileRestClient.cs index 7c3a5428f124..dfccb8c7b16a 100644 --- a/sdk/storage/Azure.Storage.Files/src/Generated/FileRestClient.cs +++ b/sdk/storage/Azure.Storage.Files/src/Generated/FileRestClient.cs @@ -7437,7 +7437,7 @@ namespace Azure.Storage.Files.Models /// /// ListSharesIncludeType values /// - public enum ListSharesIncludeType + internal enum ListSharesIncludeType { /// /// snapshots diff --git a/sdk/storage/Azure.Storage.Files/src/Models/FileHttpHeaders.cs b/sdk/storage/Azure.Storage.Files/src/Models/FileHttpHeaders.cs index afe2790907df..2d7be69fa402 100644 --- a/sdk/storage/Azure.Storage.Files/src/Models/FileHttpHeaders.cs +++ b/sdk/storage/Azure.Storage.Files/src/Models/FileHttpHeaders.cs @@ -2,6 +2,7 @@ // Licensed under the MIT License. using System; +using System.ComponentModel; namespace Azure.Storage.Files.Models { @@ -15,7 +16,7 @@ namespace Azure.Storage.Files.Models /// /// For more information, see . /// - public struct FileHttpHeaders : IEquatable + public class FileHttpHeaders { /// /// The MIME content type of the file. @@ -65,49 +66,14 @@ public struct FileHttpHeaders : IEquatable /// /// The instance to compare to. /// True if they're equal, false otherwise. - public override bool Equals(object obj) - => obj is FileHttpHeaders other && Equals(other); + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => base.Equals(obj); /// /// Get a hash code for the FileHttpHeaders. /// /// Hash code for the FileHttpHeaders. - public override int GetHashCode() - => ContentType.GetHashCode() - ^ ContentHash.GetHashCode() - ^ ContentEncoding.GetHashCode() - ^ ContentLanguage.GetHashCode() - ^ ContentDisposition.GetHashCode() - ^ CacheControl.GetHashCode() - ; - - /// - /// Check if two FileHttpHeaders instances are equal. - /// - /// The first instance to compare. - /// The second instance to compare. - /// True if they're equal, false otherwise. - public static bool operator ==(FileHttpHeaders left, FileHttpHeaders right) => left.Equals(right); - - /// - /// Check if two FileHttpHeaders instances are not equal. - /// - /// The first instance to compare. - /// The second instance to compare. - /// True if they're not equal, false otherwise. - public static bool operator !=(FileHttpHeaders left, FileHttpHeaders right) => !(left == right); - - /// - /// Check if two FileHttpHeaders instances are equal. - /// - /// The instance to compare to. - public bool Equals(FileHttpHeaders other) - => CacheControl == other.CacheControl - && ContentDisposition == other.ContentDisposition - && ContentEncoding == other.ContentEncoding - && ContentLanguage == other.ContentLanguage - && ContentHash == other.ContentHash - && ContentType == other.ContentType - ; + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => base.GetHashCode(); } } diff --git a/sdk/storage/Azure.Storage.Files/src/Models/FileSmbProperties.cs b/sdk/storage/Azure.Storage.Files/src/Models/FileSmbProperties.cs index bc6bbb9872e3..f5d8d08e8a19 100644 --- a/sdk/storage/Azure.Storage.Files/src/Models/FileSmbProperties.cs +++ b/sdk/storage/Azure.Storage.Files/src/Models/FileSmbProperties.cs @@ -3,21 +3,24 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Globalization; using System.Linq; using System.Text; +#pragma warning disable SA1402 // File may only contain a single type + namespace Azure.Storage.Files.Models { /// /// The SMB properties for a file. /// - public struct FileSmbProperties : IEquatable + public class FileSmbProperties { /// /// The file system attributes for this file. /// - public NtfsFileAttributes? FileAttributes { get; set; } + public NtfsFileAttributes FileAttributes { get; set; } /// /// The key of the file permission. @@ -49,6 +52,10 @@ public struct FileSmbProperties : IEquatable /// public string ParentId { get; internal set; } + internal FileSmbProperties() + { + } + internal FileSmbProperties(RawStorageFileInfo rawStorageFileInfo) { FileAttributes = NtfsFileAttributes.Parse(rawStorageFileInfo.FileAttributes); @@ -110,50 +117,16 @@ internal FileSmbProperties(RawStorageDirectoryProperties rawStorageDirectoryProp /// /// The other instance to compare to. /// + [EditorBrowsable(EditorBrowsableState.Never)] public override bool Equals(object other) - => other is FileSmbProperties props && Equals(props); + => base.Equals(other); /// /// Gets the hash code for the FileSmbProperties. /// /// - public override int GetHashCode() - => FileAttributes.GetHashCode() - ^ FilePermissionKey.GetHashCode() - ^ FileCreationTime.GetHashCode() - ^ FileLastWriteTime.GetHashCode() - ^ FileChangeTime.GetHashCode() - ^ FileId.GetHashCode() - ^ ParentId.GetHashCode(); - - /// - /// Check if two FileSmbProperties instances are equal. - /// - /// The first instance to compare. - /// The second instance to compare. - /// True if they're equal, false otherwise. - public static bool operator ==(FileSmbProperties left, FileSmbProperties right) => left.Equals(right); - - /// - /// Check if two FileSmbProperties instances are not equal. - /// - /// The first instance to compare. - /// The second instance to compare. - /// True if they're not equal, false otherwise. - public static bool operator !=(FileSmbProperties left, FileSmbProperties right) => !(left == right); - - /// - /// Check if two FileSmbProperties instances are equal. - /// - /// The other instance to compare to. - public bool Equals(FileSmbProperties other) - => FileAttributes == other.FileAttributes - && FilePermissionKey == other.FilePermissionKey - && FileCreationTime == other.FileCreationTime - && FileLastWriteTime == other.FileLastWriteTime - && FileChangeTime == other.FileChangeTime - && FileId == other.FileId - && ParentId == other.ParentId; + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => base.GetHashCode(); internal string FileCreationTimeToString() => NullableDateTimeOffsetToString(FileCreationTime); @@ -167,10 +140,9 @@ private static string NullableDateTimeOffsetToString(DateTimeOffset? dateTimeOff private static string DateTimeOffSetToString(DateTimeOffset dateTimeOffset) => dateTimeOffset.UtcDateTime.ToString(Constants.File.FileTimeFormat, CultureInfo.InvariantCulture); } - - /// - /// FilesModelFactory provides utilities for mocking. - /// + /// + /// FilesModelFactory provides utilities for mocking. + /// public static partial class FilesModelFactory { /// diff --git a/sdk/storage/Azure.Storage.Files/src/Models/NtfsFileAttributes.cs b/sdk/storage/Azure.Storage.Files/src/Models/NtfsFileAttributes.cs index bb6a9b70645b..b1c9b794a712 100644 --- a/sdk/storage/Azure.Storage.Files/src/Models/NtfsFileAttributes.cs +++ b/sdk/storage/Azure.Storage.Files/src/Models/NtfsFileAttributes.cs @@ -14,7 +14,7 @@ namespace Azure.Storage.Files.Models /// /// NTFS file attributes for Files and Directories. /// - public struct NtfsFileAttributes : IEquatable + public class NtfsFileAttributes { /// /// The File or Directory has no NTFS attributes. @@ -94,16 +94,16 @@ public override bool Equals(object other) /// public bool Equals(NtfsFileAttributes other) => None == other.None - && ReadOnly == other.ReadOnly - && Hidden == other.Hidden - && System == other.System - && Normal == other.Normal - && Directory == other.Directory - && Archive == other.Archive - && Temporary == other.Temporary - && Offline == other.Offline - && NotContentIndexed == other.NotContentIndexed - && NoScrubData == other.NoScrubData; + && ReadOnly == other.ReadOnly + && Hidden == other.Hidden + && System == other.System + && Normal == other.Normal + && Directory == other.Directory + && Archive == other.Archive + && Temporary == other.Temporary + && Offline == other.Offline + && NotContentIndexed == other.NotContentIndexed + && NoScrubData == other.NoScrubData; /// /// Get a hash code for the FileNtfsAttributes. @@ -199,7 +199,7 @@ public override string ToString() /// /// string to parse /// - public static NtfsFileAttributes? Parse(string attributesString) + public static NtfsFileAttributes Parse(string attributesString) { if (attributesString == null) { diff --git a/sdk/storage/Azure.Storage.Files/src/Models/StorageDirectoryInfo.cs b/sdk/storage/Azure.Storage.Files/src/Models/StorageDirectoryInfo.cs index 50e2a14d38da..5df2828a8517 100644 --- a/sdk/storage/Azure.Storage.Files/src/Models/StorageDirectoryInfo.cs +++ b/sdk/storage/Azure.Storage.Files/src/Models/StorageDirectoryInfo.cs @@ -30,7 +30,7 @@ public class StorageDirectoryInfo /// /// The directory's SMB properties. /// - public FileSmbProperties? SmbProperties { get; set; } + public FileSmbProperties SmbProperties { get; set; } internal StorageDirectoryInfo(RawStorageDirectoryInfo rawStorageDirectoryInfo) { diff --git a/sdk/storage/Azure.Storage.Files/src/Models/StorageFileInfo.cs b/sdk/storage/Azure.Storage.Files/src/Models/StorageFileInfo.cs index 4c61a1be67a4..9149f68fe816 100644 --- a/sdk/storage/Azure.Storage.Files/src/Models/StorageFileInfo.cs +++ b/sdk/storage/Azure.Storage.Files/src/Models/StorageFileInfo.cs @@ -37,7 +37,7 @@ public class StorageFileInfo /// /// The file's SMB properties. /// - public FileSmbProperties? SmbProperties { get; set; } + public FileSmbProperties SmbProperties { get; set; } internal StorageFileInfo(RawStorageFileInfo rawStorageFileInfo) { diff --git a/sdk/storage/Azure.Storage.Files/src/Sas/FileSasBuilder.cs b/sdk/storage/Azure.Storage.Files/src/Sas/FileSasBuilder.cs index b06827bdd0fd..a2909a6e011c 100644 --- a/sdk/storage/Azure.Storage.Files/src/Sas/FileSasBuilder.cs +++ b/sdk/storage/Azure.Storage.Files/src/Sas/FileSasBuilder.cs @@ -11,7 +11,7 @@ namespace Azure.Storage.Sas /// Signature (SAS) for an Azure Storage share, directory, or file. /// For more information, see . /// - public struct FileSasBuilder : IEquatable + public class FileSasBuilder { /// /// The storage service version to use to authenticate requests made @@ -61,7 +61,7 @@ public struct FileSasBuilder : IEquatable /// When specifying a range of IP addresses, note that the range is /// inclusive. /// - public IPRange IPRange { get; set; } + public SasIPRange IPRange { get; set; } /// /// An optional unique value up to 64 characters in length that @@ -202,8 +202,7 @@ private static string GetCanonicalName(string account, string shareName, string /// /// A string that represents the current object. [EditorBrowsable(EditorBrowsableState.Never)] - public override string ToString() => - base.ToString(); + public override string ToString() => base.ToString(); /// /// Check if two FileSasBuilder instances are equal. @@ -211,67 +210,13 @@ public override string ToString() => /// The instance to compare to. /// True if they're equal, false otherwise. [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) - => obj is FileSasBuilder other && Equals(other); + public override bool Equals(object obj) => base.Equals(obj); /// /// Get a hash code for the FileSasBuilder. /// /// Hash code for the FileSasBuilder. [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() - => CacheControl.GetHashCode() - ^ ContentDisposition.GetHashCode() - ^ ContentEncoding.GetHashCode() - ^ ContentLanguage.GetHashCode() - ^ ContentType.GetHashCode() - ^ ExpiresOn.GetHashCode() - ^ FilePath.GetHashCode() - ^ Identifier.GetHashCode() - ^ IPRange.GetHashCode() - ^ Permissions.GetHashCode() - ^ Protocol.GetHashCode() - ^ ShareName.GetHashCode() - ^ StartsOn.GetHashCode() - ^ Version.GetHashCode() - ; - - /// - /// Check if two FileSasBuilder instances are equal. - /// - /// The first instance to compare. - /// The second instance to compare. - /// True if they're equal, false otherwise. - public static bool operator ==(FileSasBuilder left, FileSasBuilder right) => left.Equals(right); - - /// - /// Check if two FileSasBuilder instances are not equal. - /// - /// The first instance to compare. - /// The second instance to compare. - /// True if they're not equal, false otherwise. - public static bool operator !=(FileSasBuilder left, FileSasBuilder right) => !(left == right); - - /// - /// Check if two FileSasBuilder instances are equal. - /// - /// The instance to compare to. - /// True if they're equal, false otherwise. - public bool Equals(FileSasBuilder other) - => CacheControl == other.CacheControl - && ContentDisposition == other.ContentDisposition - && ContentEncoding == other.ContentEncoding - && ContentLanguage == other.ContentEncoding - && ContentType == other.ContentType - && ExpiresOn == other.ExpiresOn - && FilePath == other.FilePath - && Identifier == other.Identifier - && IPRange == other.IPRange - && Permissions == other.Permissions - && Protocol == other.Protocol - && ShareName == other.ShareName - && StartsOn == other.StartsOn - && Version == other.Version - ; + public override int GetHashCode() => base.GetHashCode(); } } diff --git a/sdk/storage/Azure.Storage.Files/src/ShareClient.cs b/sdk/storage/Azure.Storage.Files/src/ShareClient.cs index df40292a22ff..4318f692f4b4 100644 --- a/sdk/storage/Azure.Storage.Files/src/ShareClient.cs +++ b/sdk/storage/Azure.Storage.Files/src/ShareClient.cs @@ -868,7 +868,7 @@ await SetQuotaInternal( /// A will be thrown if /// a failure occurs. /// - public virtual async Task> SetQuotaInternal( + internal virtual async Task> SetQuotaInternal( int quotaInBytes, bool async, CancellationToken cancellationToken) @@ -1593,7 +1593,7 @@ private async Task> CreatePermissionInternal( public virtual Response CreateDirectory( string directoryName, IDictionary metadata = default, - FileSmbProperties? smbProperties = default, + FileSmbProperties smbProperties = default, string filePermission = default, CancellationToken cancellationToken = default) { @@ -1640,7 +1640,7 @@ public virtual Response CreateDirectory( public virtual async Task> CreateDirectoryAsync( string directoryName, IDictionary metadata = default, - FileSmbProperties? smbProperties = default, + FileSmbProperties smbProperties = default, string filePermission = default, CancellationToken cancellationToken = default) { diff --git a/sdk/storage/Azure.Storage.Files/swagger/readme.md b/sdk/storage/Azure.Storage.Files/swagger/readme.md index 7e8dc74179f0..9488a47504e4 100644 --- a/sdk/storage/Azure.Storage.Files/swagger/readme.md +++ b/sdk/storage/Azure.Storage.Files/swagger/readme.md @@ -148,6 +148,15 @@ directive: } ``` +### Hide ListSharesIncludeType +``` yaml +directive: +- from: swagger-document + where: $.parameters.ListSharesInclude + transform: > + $.items["x-az-public"] = false; +``` + ### /{shareName}?restype=share ``` yaml directive: diff --git a/sdk/storage/Azure.Storage.Files/tests/DirectoryClientTests.cs b/sdk/storage/Azure.Storage.Files/tests/DirectoryClientTests.cs index f5ba85f9b182..e224ddae966d 100644 --- a/sdk/storage/Azure.Storage.Files/tests/DirectoryClientTests.cs +++ b/sdk/storage/Azure.Storage.Files/tests/DirectoryClientTests.cs @@ -185,8 +185,8 @@ public async Task CreateAsync_SmbProperties() // Assert AssertValidStorageDirectoryInfo(response); //Assert.AreEqual(smbProperties.FileAttributes, response.Value.SmbProperties.Value.FileAttributes); - Assert.AreEqual(smbProperties.FileCreationTime, response.Value.SmbProperties.Value.FileCreationTime); - Assert.AreEqual(smbProperties.FileLastWriteTime, response.Value.SmbProperties.Value.FileLastWriteTime); + Assert.AreEqual(smbProperties.FileCreationTime, response.Value.SmbProperties.FileCreationTime); + Assert.AreEqual(smbProperties.FileLastWriteTime, response.Value.SmbProperties.FileLastWriteTime); } } @@ -268,7 +268,7 @@ public async Task GetPropertiesAsync() // Assert Assert.AreEqual(createResponse.Value.ETag, getPropertiesResponse.Value.ETag); Assert.AreEqual(createResponse.Value.LastModified, getPropertiesResponse.Value.LastModified); - Assert.AreEqual(createResponse.Value.SmbProperties, getPropertiesResponse.Value.SmbProperties); + AssertPropertiesEqual(createResponse.Value.SmbProperties, getPropertiesResponse.Value.SmbProperties); } } @@ -331,9 +331,9 @@ public async Task SetPropertiesAsync_SmbProperties() // Assert AssertValidStorageDirectoryInfo(response); - Assert.AreEqual(smbProperties.FileAttributes, response.Value.SmbProperties.Value.FileAttributes); - Assert.AreEqual(smbProperties.FileCreationTime, response.Value.SmbProperties.Value.FileCreationTime); - Assert.AreEqual(smbProperties.FileLastWriteTime, response.Value.SmbProperties.Value.FileLastWriteTime); + Assert.AreEqual(smbProperties.FileAttributes, response.Value.SmbProperties.FileAttributes); + Assert.AreEqual(smbProperties.FileCreationTime, response.Value.SmbProperties.FileCreationTime); + Assert.AreEqual(smbProperties.FileLastWriteTime, response.Value.SmbProperties.FileLastWriteTime); } } @@ -535,10 +535,10 @@ public async Task ForceCloseHandles_Min() using (GetNewDirectory(out DirectoryClient directory)) { // Act - Response response = await directory.ForceCloseHandlesAsync(); + int handlesClosed = await directory.ForceCloseAllHandlesAsync(); // Assert - Assert.AreEqual(0, response.Value.NumberOfHandlesClosed); + Assert.AreEqual(0, handlesClosed); } } @@ -550,10 +550,10 @@ public async Task ForceCloseHandles_Recursive() using (GetNewDirectory(out DirectoryClient directory)) { // Act - Response response = await directory.ForceCloseHandlesAsync(recursive: true); + int handlesClosed = await directory.ForceCloseAllHandlesAsync(recursive: true); // Assert - Assert.AreEqual(0, response.Value.NumberOfHandlesClosed); + Assert.AreEqual(0, handlesClosed); } } @@ -568,12 +568,27 @@ public async Task ForceCloseHandles_Error() // Act await TestHelper.AssertExpectedExceptionAsync( - directory.ForceCloseHandlesAsync(), + directory.ForceCloseAllHandlesAsync(), actualException => Assert.AreEqual("ResourceNotFound", actualException.ErrorCode)); } } + [Test] + public async Task ForceCloseHandle_Error() + { + // Arrange + using (GetNewShare(out ShareClient share)) + { + DirectoryClient directory = InstrumentClient(share.GetDirectoryClient(GetNewDirectoryName())); + AsyncPageable handles = directory.GetHandlesAsync(); + // Act + await TestHelper.AssertExpectedExceptionAsync( + directory.ForceCloseHandleAsync("nonExistantHandleId"), + actualException => Assert.AreEqual("InvalidHeaderValue", actualException.ErrorCode)); + } + } + [Test] public async Task CreateSubdirectoryAsync() { @@ -625,5 +640,6 @@ public async Task DeleteFileAsync() async () => await file.GetPropertiesAsync()); } } + } } diff --git a/sdk/storage/Azure.Storage.Files/tests/FileClientTests.cs b/sdk/storage/Azure.Storage.Files/tests/FileClientTests.cs index 66bf8aa2f5a1..eff1d4a1ea86 100644 --- a/sdk/storage/Azure.Storage.Files/tests/FileClientTests.cs +++ b/sdk/storage/Azure.Storage.Files/tests/FileClientTests.cs @@ -205,9 +205,9 @@ public async Task CreateAsync_SmbProperties() // Assert AssertValidStorageFileInfo(response); - Assert.AreEqual(smbProperties.FileAttributes, response.Value.SmbProperties.Value.FileAttributes); - Assert.AreEqual(smbProperties.FileCreationTime, response.Value.SmbProperties.Value.FileCreationTime); - Assert.AreEqual(smbProperties.FileLastWriteTime, response.Value.SmbProperties.Value.FileLastWriteTime); + Assert.AreEqual(smbProperties.FileAttributes, response.Value.SmbProperties.FileAttributes); + Assert.AreEqual(smbProperties.FileCreationTime, response.Value.SmbProperties.FileCreationTime); + Assert.AreEqual(smbProperties.FileLastWriteTime, response.Value.SmbProperties.FileLastWriteTime); } } @@ -331,7 +331,7 @@ public async Task GetPropertiesAsync() Assert.AreEqual(createResponse.Value.ETag, getPropertiesResponse.Value.ETag); Assert.AreEqual(createResponse.Value.LastModified, getPropertiesResponse.Value.LastModified); Assert.AreEqual(createResponse.Value.IsServerEncrypted, getPropertiesResponse.Value.IsServerEncrypted); - Assert.AreEqual(createResponse.Value.SmbProperties, getPropertiesResponse.Value.SmbProperties); + AssertPropertiesEqual(createResponse.Value.SmbProperties, getPropertiesResponse.Value.SmbProperties); } } @@ -483,9 +483,9 @@ public async Task SetPropertiesAsync_SmbProperties() // Assert AssertValidStorageFileInfo(response); - Assert.AreEqual(smbProperties.FileAttributes, response.Value.SmbProperties.Value.FileAttributes); - Assert.AreEqual(smbProperties.FileCreationTime, response.Value.SmbProperties.Value.FileCreationTime); - Assert.AreEqual(smbProperties.FileLastWriteTime, response.Value.SmbProperties.Value.FileLastWriteTime); + Assert.AreEqual(smbProperties.FileAttributes, response.Value.SmbProperties.FileAttributes); + Assert.AreEqual(smbProperties.FileCreationTime, response.Value.SmbProperties.FileCreationTime); + Assert.AreEqual(smbProperties.FileLastWriteTime, response.Value.SmbProperties.FileLastWriteTime); } } @@ -784,7 +784,7 @@ await file.UploadRangeAsync( Assert.AreEqual(getPropertiesResponse.Value.CopySource, downloadResponse.Value.Details.CopySource); Assert.AreEqual(getPropertiesResponse.Value.CopyStatus, downloadResponse.Value.Details.CopyStatus); Assert.AreEqual(getPropertiesResponse.Value.IsServerEncrypted, downloadResponse.Value.Details.IsServerEncrypted); - Assert.AreEqual(getPropertiesResponse.Value.SmbProperties, downloadResponse.Value.Details.SmbProperties); + AssertPropertiesEqual(getPropertiesResponse.Value.SmbProperties, downloadResponse.Value.Details.SmbProperties); } } @@ -1157,10 +1157,10 @@ public async Task ForceCloseHandles_Min() using (GetNewFile(out FileClient file)) { // Act - Response response = await file.ForceCloseHandlesAsync(); + int handlesClosed = await file.ForceCloseAllHandlesAsync(); // Assert - Assert.AreEqual(0, response.Value.NumberOfHandlesClosed); + Assert.AreEqual(0, handlesClosed); } } @@ -1174,12 +1174,28 @@ public async Task ForceCloseHandles_Error() // Act await TestHelper.AssertExpectedExceptionAsync( - file.ForceCloseHandlesAsync(), + file.ForceCloseAllHandlesAsync(), actualException => Assert.AreEqual("ResourceNotFound", actualException.ErrorCode)); } } + [Test] + public async Task ForceCloseHandle_Error() + { + // Arrange + using (GetNewDirectory(out DirectoryClient directory)) + { + FileClient file = InstrumentClient(directory.GetFileClient(GetNewDirectoryName())); + + // Act + await TestHelper.AssertExpectedExceptionAsync( + file.ForceCloseHandleAsync("nonExistantHandleId"), + actualException => Assert.AreEqual("InvalidHeaderValue", actualException.ErrorCode)); + + } + } + private async Task WaitForCopy(FileClient file, int milliWait = 200) { CopyStatus status = CopyStatus.Pending; diff --git a/sdk/storage/Azure.Storage.Files/tests/FileTestBase.cs b/sdk/storage/Azure.Storage.Files/tests/FileTestBase.cs index a7c98cbae322..483ce9c5c227 100644 --- a/sdk/storage/Azure.Storage.Files/tests/FileTestBase.cs +++ b/sdk/storage/Azure.Storage.Files/tests/FileTestBase.cs @@ -131,7 +131,7 @@ public SasQueryParameters GetNewAccountSasCredentials(StorageSharedKeyCredential StartsOn = Recording.UtcNow.AddHours(-1), ExpiresOn = Recording.UtcNow.AddHours(+1), Permissions = new FileAccountSasPermissions { Create = true, Delete = true }.ToString(), - IPRange = new IPRange(IPAddress.None, IPAddress.None) + IPRange = new SasIPRange(IPAddress.None, IPAddress.None) }.ToSasQueryParameters(sharedKeyCredentials); public SasQueryParameters GetNewFileServiceSasCredentialsShare(string shareName, StorageSharedKeyCredential sharedKeyCredentials = default) @@ -142,7 +142,7 @@ public SasQueryParameters GetNewFileServiceSasCredentialsShare(string shareName, StartsOn = Recording.UtcNow.AddHours(-1), ExpiresOn = Recording.UtcNow.AddHours(+1), Permissions = new ShareSasPermissions { Read = true, Write = true, List = true, Create = true, Delete = true }.ToString(), - IPRange = new IPRange(IPAddress.None, IPAddress.None) + IPRange = new SasIPRange(IPAddress.None, IPAddress.None) }.ToSasQueryParameters(sharedKeyCredentials ?? GetNewSharedKeyCredentials()); public SasQueryParameters GetNewFileServiceSasCredentialsFile(string shareName, string filePath, StorageSharedKeyCredential sharedKeyCredentials = default) @@ -154,7 +154,7 @@ public SasQueryParameters GetNewFileServiceSasCredentialsFile(string shareName, StartsOn = Recording.UtcNow.AddHours(-1), ExpiresOn = Recording.UtcNow.AddHours(+1), Permissions = new FileSasPermissions { Read = true, Write = true, Create = true, Delete = true }.ToString(), - IPRange = new IPRange(IPAddress.None, IPAddress.None) + IPRange = new SasIPRange(IPAddress.None, IPAddress.None) }.ToSasQueryParameters(sharedKeyCredentials ?? GetNewSharedKeyCredentials()); public SignedIdentifier[] BuildSignedIdentifiers() => @@ -179,7 +179,7 @@ public static void AssertValidStorageFileInfo(StorageFileInfo storageFileInfo) Assert.IsNotNull(storageFileInfo.LastModified); Assert.IsNotNull(storageFileInfo.IsServerEncrypted); Assert.IsNotNull(storageFileInfo.SmbProperties); - AssertValidFileSmbProperties(storageFileInfo.SmbProperties.Value); + AssertValidFileSmbProperties(storageFileInfo.SmbProperties); } public static void AssertValidStorageDirectoryInfo(StorageDirectoryInfo storageDirectoryInfo) @@ -187,7 +187,7 @@ public static void AssertValidStorageDirectoryInfo(StorageDirectoryInfo storageD Assert.IsNotNull(storageDirectoryInfo.ETag); Assert.IsNotNull(storageDirectoryInfo.LastModified); Assert.IsNotNull(storageDirectoryInfo.SmbProperties); - AssertValidFileSmbProperties(storageDirectoryInfo.SmbProperties.Value); + AssertValidFileSmbProperties(storageDirectoryInfo.SmbProperties); } public static void AssertValidFileSmbProperties(FileSmbProperties fileSmbProperties) @@ -201,6 +201,17 @@ public static void AssertValidFileSmbProperties(FileSmbProperties fileSmbPropert Assert.IsNotNull(fileSmbProperties.ParentId); } + internal static void AssertPropertiesEqual(FileSmbProperties left, FileSmbProperties right) + { + Assert.AreEqual(left.FileAttributes, right.FileAttributes); + Assert.AreEqual(left.FileCreationTime, right.FileCreationTime); + Assert.AreEqual(left.FileChangeTime, right.FileChangeTime); + Assert.AreEqual(left.FileId, right.FileId); + Assert.AreEqual(left.FileLastWriteTime, right.FileLastWriteTime); + Assert.AreEqual(left.FilePermissionKey, right.FilePermissionKey); + Assert.AreEqual(left.ParentId, right.ParentId); + } + private class DisposingShare : IDisposable { public ShareClient ShareClient { get; } diff --git a/sdk/storage/Azure.Storage.Files/tests/FileUriBuilderTests.cs b/sdk/storage/Azure.Storage.Files/tests/FileUriBuilderTests.cs index 7a2ae1036522..1aed7262983e 100644 --- a/sdk/storage/Azure.Storage.Files/tests/FileUriBuilderTests.cs +++ b/sdk/storage/Azure.Storage.Files/tests/FileUriBuilderTests.cs @@ -160,7 +160,7 @@ public void FileUriBuilder_SasTest() Assert.AreEqual(new DateTimeOffset(2015, 4, 30, 2, 23, 26, TimeSpan.Zero), fileUriBuilder.Sas.ExpiresOn); Assert.AreEqual("", fileUriBuilder.Sas.Identifier); - Assert.AreEqual(IPRange.Parse("168.1.5.60-168.1.5.70"), fileUriBuilder.Sas.IPRange); + Assert.AreEqual(SasIPRange.Parse("168.1.5.60-168.1.5.70"), fileUriBuilder.Sas.IPRange); Assert.AreEqual("rw", fileUriBuilder.Sas.Permissions); Assert.AreEqual(SasProtocol.Https, fileUriBuilder.Sas.Protocol); Assert.AreEqual("b", fileUriBuilder.Sas.Resource); diff --git a/sdk/storage/Azure.Storage.Files/tests/SessionRecords/DirectoryClientTests/ForceCloseHandle_Error.json b/sdk/storage/Azure.Storage.Files/tests/SessionRecords/DirectoryClientTests/ForceCloseHandle_Error.json new file mode 100644 index 000000000000..052a65cf5968 --- /dev/null +++ b/sdk/storage/Azure.Storage.Files/tests/SessionRecords/DirectoryClientTests/ForceCloseHandle_Error.json @@ -0,0 +1,108 @@ +{ + "Entries": [ + { + "RequestUri": "http://jolovstorage.file.core.windows.net/test-share-128f8a2f-5fed-2f02-8078-8c2deeadc1b5?restype=share", + "RequestMethod": "PUT", + "RequestHeaders": { + "Authorization": "Sanitized", + "traceparent": "00-0ffe4a3225e07846a4af6fa162e0452a-e058931fcb674040-00", + "User-Agent": [ + "azsdk-net-Storage.Files/12.0.0-dev.20191015.1\u002B57ef4720914a34ab66322af016d927dc4992c5c9", + "(.NET Core 4.6.28008.01; Microsoft Windows 10.0.18362 )" + ], + "x-ms-client-request-id": "a8c1a478-d489-16e0-fa22-99de55755443", + "x-ms-date": "Wed, 16 Oct 2019 00:35:13 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-share-quota": "1", + "x-ms-version": "2019-02-02" + }, + "RequestBody": null, + "StatusCode": 201, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Wed, 16 Oct 2019 00:35:13 GMT", + "ETag": "\u00220x8D751D0B5840E05\u0022", + "Last-Modified": "Wed, 16 Oct 2019 00:35:13 GMT", + "Server": [ + "Windows-Azure-File/1.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-client-request-id": "a8c1a478-d489-16e0-fa22-99de55755443", + "x-ms-request-id": "c10f33a0-901a-006d-40b9-835b81000000", + "x-ms-version": "2019-02-02" + }, + "ResponseBody": [] + }, + { + "RequestUri": "http://jolovstorage.file.core.windows.net/test-share-128f8a2f-5fed-2f02-8078-8c2deeadc1b5/test-directory-87d98f1e-5f20-15e6-809e-02c19fb4a3f4?comp=forceclosehandles", + "RequestMethod": "PUT", + "RequestHeaders": { + "Authorization": "Sanitized", + "traceparent": "00-52be1499b0efbf45ae2bbfa970d9095f-2c9a6f3841ba624a-00", + "User-Agent": [ + "azsdk-net-Storage.Files/12.0.0-dev.20191015.1\u002B57ef4720914a34ab66322af016d927dc4992c5c9", + "(.NET Core 4.6.28008.01; Microsoft Windows 10.0.18362 )" + ], + "x-ms-client-request-id": "fb2f7cd7-57b1-18b7-beab-28ead21e7745", + "x-ms-date": "Wed, 16 Oct 2019 00:35:13 GMT", + "x-ms-handle-id": "nonExistantHandleId", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": null, + "StatusCode": 400, + "ResponseHeaders": { + "Content-Length": "339", + "Content-Type": "application/xml", + "Date": "Wed, 16 Oct 2019 00:35:13 GMT", + "Server": [ + "Windows-Azure-File/1.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-client-request-id": "fb2f7cd7-57b1-18b7-beab-28ead21e7745", + "x-ms-error-code": "InvalidHeaderValue", + "x-ms-request-id": "c10f33a2-901a-006d-41b9-835b81000000", + "x-ms-version": "2019-02-02" + }, + "ResponseBody": [ + "\uFEFF\u003C?xml version=\u00221.0\u0022 encoding=\u0022utf-8\u0022?\u003E\u003CError\u003E\u003CCode\u003EInvalidHeaderValue\u003C/Code\u003E\u003CMessage\u003EThe value for one of the HTTP headers is not in the correct format.\n", + "RequestId:c10f33a2-901a-006d-41b9-835b81000000\n", + "Time:2019-10-16T00:35:13.7082763Z\u003C/Message\u003E\u003CHeaderName\u003Ex-ms-handle-id\u003C/HeaderName\u003E\u003CHeaderValue\u003EnonExistantHandleId\u003C/HeaderValue\u003E\u003C/Error\u003E" + ] + }, + { + "RequestUri": "http://jolovstorage.file.core.windows.net/test-share-128f8a2f-5fed-2f02-8078-8c2deeadc1b5?restype=share", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Authorization": "Sanitized", + "traceparent": "00-61b9c7103d32e943b33d811502c5629b-1467fe8cfa671c40-00", + "User-Agent": [ + "azsdk-net-Storage.Files/12.0.0-dev.20191015.1\u002B57ef4720914a34ab66322af016d927dc4992c5c9", + "(.NET Core 4.6.28008.01; Microsoft Windows 10.0.18362 )" + ], + "x-ms-client-request-id": "22ea6804-a784-4143-fc9c-8c40f0409061", + "x-ms-date": "Wed, 16 Oct 2019 00:35:13 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": null, + "StatusCode": 202, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Wed, 16 Oct 2019 00:35:13 GMT", + "Server": [ + "Windows-Azure-File/1.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-client-request-id": "22ea6804-a784-4143-fc9c-8c40f0409061", + "x-ms-request-id": "c10f33a3-901a-006d-42b9-835b81000000", + "x-ms-version": "2019-02-02" + }, + "ResponseBody": [] + } + ], + "Variables": { + "RandomSeed": "2008209462", + "Storage_TestConfigDefault": "ProductionTenant\njolovstorage\nU2FuaXRpemVk\nhttp://jolovstorage.blob.core.windows.net\nhttp://jolovstorage.file.core.windows.net\nhttp://jolovstorage.queue.core.windows.net\nhttp://jolovstorage.table.core.windows.net\n\n\n\n\nhttp://jolovstorage-secondary.blob.core.windows.net\n\nhttp://jolovstorage-secondary.queue.core.windows.net\nhttp://jolovstorage-secondary.table.core.windows.net\n\nSanitized\n\n\nCloud\nBlobEndpoint=http://jolovstorage.blob.core.windows.net/;QueueEndpoint=http://jolovstorage.queue.core.windows.net/;TableEndpoint=http://jolovstorage.table.core.windows.net/;FileEndpoint=http://jolovstorage.file.core.windows.net/;BlobSecondaryEndpoint=http://jolovstorage-secondary.blob.core.windows.net/;QueueSecondaryEndpoint=http://jolovstorage-secondary.queue.core.windows.net/;TableSecondaryEndpoint=http://jolovstorage-secondary.table.core.windows.net/;AccountName=jolovstorage;AccountKey=Sanitized" + } +} \ No newline at end of file diff --git a/sdk/storage/Azure.Storage.Files/tests/SessionRecords/DirectoryClientTests/ForceCloseHandle_ErrorAsync.json b/sdk/storage/Azure.Storage.Files/tests/SessionRecords/DirectoryClientTests/ForceCloseHandle_ErrorAsync.json new file mode 100644 index 000000000000..29f8c298c4be --- /dev/null +++ b/sdk/storage/Azure.Storage.Files/tests/SessionRecords/DirectoryClientTests/ForceCloseHandle_ErrorAsync.json @@ -0,0 +1,108 @@ +{ + "Entries": [ + { + "RequestUri": "http://jolovstorage.file.core.windows.net/test-share-012d4a1f-42c6-ecfc-8f8b-972d693775a1?restype=share", + "RequestMethod": "PUT", + "RequestHeaders": { + "Authorization": "Sanitized", + "traceparent": "00-290d152c301fbb4aa8ac1beb6bb381ce-182dbb4085f1c94d-00", + "User-Agent": [ + "azsdk-net-Storage.Files/12.0.0-dev.20191015.1\u002B57ef4720914a34ab66322af016d927dc4992c5c9", + "(.NET Core 4.6.28008.01; Microsoft Windows 10.0.18362 )" + ], + "x-ms-client-request-id": "825fd1ff-dd9e-62c3-9cf5-a1dd29df9874", + "x-ms-date": "Wed, 16 Oct 2019 00:35:19 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-share-quota": "1", + "x-ms-version": "2019-02-02" + }, + "RequestBody": null, + "StatusCode": 201, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Wed, 16 Oct 2019 00:35:18 GMT", + "ETag": "\u00220x8D751D0B8E96575\u0022", + "Last-Modified": "Wed, 16 Oct 2019 00:35:19 GMT", + "Server": [ + "Windows-Azure-File/1.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-client-request-id": "825fd1ff-dd9e-62c3-9cf5-a1dd29df9874", + "x-ms-request-id": "c10f3440-901a-006d-3eb9-835b81000000", + "x-ms-version": "2019-02-02" + }, + "ResponseBody": [] + }, + { + "RequestUri": "http://jolovstorage.file.core.windows.net/test-share-012d4a1f-42c6-ecfc-8f8b-972d693775a1/test-directory-27887d4d-70e9-d7bb-a7de-829754513b43?comp=forceclosehandles", + "RequestMethod": "PUT", + "RequestHeaders": { + "Authorization": "Sanitized", + "traceparent": "00-ceacd8f37b6f37439601ebe9c8cd3b72-f67c41baec81f84e-00", + "User-Agent": [ + "azsdk-net-Storage.Files/12.0.0-dev.20191015.1\u002B57ef4720914a34ab66322af016d927dc4992c5c9", + "(.NET Core 4.6.28008.01; Microsoft Windows 10.0.18362 )" + ], + "x-ms-client-request-id": "325e7996-bfc3-8e9a-1688-dbbf5b2c0e4b", + "x-ms-date": "Wed, 16 Oct 2019 00:35:19 GMT", + "x-ms-handle-id": "nonExistantHandleId", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": null, + "StatusCode": 400, + "ResponseHeaders": { + "Content-Length": "339", + "Content-Type": "application/xml", + "Date": "Wed, 16 Oct 2019 00:35:18 GMT", + "Server": [ + "Windows-Azure-File/1.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-client-request-id": "325e7996-bfc3-8e9a-1688-dbbf5b2c0e4b", + "x-ms-error-code": "InvalidHeaderValue", + "x-ms-request-id": "c10f3442-901a-006d-3fb9-835b81000000", + "x-ms-version": "2019-02-02" + }, + "ResponseBody": [ + "\uFEFF\u003C?xml version=\u00221.0\u0022 encoding=\u0022utf-8\u0022?\u003E\u003CError\u003E\u003CCode\u003EInvalidHeaderValue\u003C/Code\u003E\u003CMessage\u003EThe value for one of the HTTP headers is not in the correct format.\n", + "RequestId:c10f3442-901a-006d-3fb9-835b81000000\n", + "Time:2019-10-16T00:35:19.3995880Z\u003C/Message\u003E\u003CHeaderName\u003Ex-ms-handle-id\u003C/HeaderName\u003E\u003CHeaderValue\u003EnonExistantHandleId\u003C/HeaderValue\u003E\u003C/Error\u003E" + ] + }, + { + "RequestUri": "http://jolovstorage.file.core.windows.net/test-share-012d4a1f-42c6-ecfc-8f8b-972d693775a1?restype=share", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Authorization": "Sanitized", + "traceparent": "00-2fc2133e4c50d0499b6469eefaac9a97-55369a588829f447-00", + "User-Agent": [ + "azsdk-net-Storage.Files/12.0.0-dev.20191015.1\u002B57ef4720914a34ab66322af016d927dc4992c5c9", + "(.NET Core 4.6.28008.01; Microsoft Windows 10.0.18362 )" + ], + "x-ms-client-request-id": "da00e2b9-08f2-e67f-789f-814f1743704b", + "x-ms-date": "Wed, 16 Oct 2019 00:35:19 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": null, + "StatusCode": 202, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Wed, 16 Oct 2019 00:35:18 GMT", + "Server": [ + "Windows-Azure-File/1.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-client-request-id": "da00e2b9-08f2-e67f-789f-814f1743704b", + "x-ms-request-id": "c10f3443-901a-006d-40b9-835b81000000", + "x-ms-version": "2019-02-02" + }, + "ResponseBody": [] + } + ], + "Variables": { + "RandomSeed": "1515064791", + "Storage_TestConfigDefault": "ProductionTenant\njolovstorage\nU2FuaXRpemVk\nhttp://jolovstorage.blob.core.windows.net\nhttp://jolovstorage.file.core.windows.net\nhttp://jolovstorage.queue.core.windows.net\nhttp://jolovstorage.table.core.windows.net\n\n\n\n\nhttp://jolovstorage-secondary.blob.core.windows.net\n\nhttp://jolovstorage-secondary.queue.core.windows.net\nhttp://jolovstorage-secondary.table.core.windows.net\n\nSanitized\n\n\nCloud\nBlobEndpoint=http://jolovstorage.blob.core.windows.net/;QueueEndpoint=http://jolovstorage.queue.core.windows.net/;TableEndpoint=http://jolovstorage.table.core.windows.net/;FileEndpoint=http://jolovstorage.file.core.windows.net/;BlobSecondaryEndpoint=http://jolovstorage-secondary.blob.core.windows.net/;QueueSecondaryEndpoint=http://jolovstorage-secondary.queue.core.windows.net/;TableSecondaryEndpoint=http://jolovstorage-secondary.table.core.windows.net/;AccountName=jolovstorage;AccountKey=Sanitized" + } +} \ No newline at end of file diff --git a/sdk/storage/Azure.Storage.Files/tests/SessionRecords/FileClientTests/ForceCloseHandle_Error.json b/sdk/storage/Azure.Storage.Files/tests/SessionRecords/FileClientTests/ForceCloseHandle_Error.json new file mode 100644 index 000000000000..a55f4a4e240d --- /dev/null +++ b/sdk/storage/Azure.Storage.Files/tests/SessionRecords/FileClientTests/ForceCloseHandle_Error.json @@ -0,0 +1,152 @@ +{ + "Entries": [ + { + "RequestUri": "http://jolovstorage.file.core.windows.net/test-share-94acab9d-b00d-6f3d-91e2-d8ede8b9baf8?restype=share", + "RequestMethod": "PUT", + "RequestHeaders": { + "Authorization": "Sanitized", + "traceparent": "00-5a1b24a29e35c3489231b5ef1b8c7a1c-d2cb349f92e47a4d-00", + "User-Agent": [ + "azsdk-net-Storage.Files/12.0.0-dev.20191015.1\u002B57ef4720914a34ab66322af016d927dc4992c5c9", + "(.NET Core 4.6.28008.01; Microsoft Windows 10.0.18362 )" + ], + "x-ms-client-request-id": "229f8633-50c7-2a10-2880-a63d3c057c2f", + "x-ms-date": "Wed, 16 Oct 2019 00:42:16 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-share-quota": "1", + "x-ms-version": "2019-02-02" + }, + "RequestBody": null, + "StatusCode": 201, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Wed, 16 Oct 2019 00:42:15 GMT", + "ETag": "\u00220x8D751D1B17AF3C9\u0022", + "Last-Modified": "Wed, 16 Oct 2019 00:42:16 GMT", + "Server": [ + "Windows-Azure-File/1.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-client-request-id": "229f8633-50c7-2a10-2880-a63d3c057c2f", + "x-ms-request-id": "443dd996-801a-0072-69ba-838091000000", + "x-ms-version": "2019-02-02" + }, + "ResponseBody": [] + }, + { + "RequestUri": "http://jolovstorage.file.core.windows.net/test-share-94acab9d-b00d-6f3d-91e2-d8ede8b9baf8/test-directory-24592af0-7ece-9316-91d3-ed903670cbb3?restype=directory", + "RequestMethod": "PUT", + "RequestHeaders": { + "Authorization": "Sanitized", + "traceparent": "00-613f394ab90a6b4dab5ce97179621f74-968c2cac1dc9084b-00", + "User-Agent": [ + "azsdk-net-Storage.Files/12.0.0-dev.20191015.1\u002B57ef4720914a34ab66322af016d927dc4992c5c9", + "(.NET Core 4.6.28008.01; Microsoft Windows 10.0.18362 )" + ], + "x-ms-client-request-id": "79db49ff-cc84-b518-700c-90f3627ff3b7", + "x-ms-date": "Wed, 16 Oct 2019 00:42:16 GMT", + "x-ms-file-attributes": "None", + "x-ms-file-creation-time": "Now", + "x-ms-file-last-write-time": "Now", + "x-ms-file-permission": "Inherit", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": null, + "StatusCode": 201, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Wed, 16 Oct 2019 00:42:15 GMT", + "ETag": "\u00220x8D751D1B1817241\u0022", + "Last-Modified": "Wed, 16 Oct 2019 00:42:16 GMT", + "Server": [ + "Windows-Azure-File/1.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-client-request-id": "79db49ff-cc84-b518-700c-90f3627ff3b7", + "x-ms-file-attributes": "Directory", + "x-ms-file-change-time": "2019-10-16T00:42:16.4279873Z", + "x-ms-file-creation-time": "2019-10-16T00:42:16.4279873Z", + "x-ms-file-id": "13835128424026341376", + "x-ms-file-last-write-time": "2019-10-16T00:42:16.4279873Z", + "x-ms-file-parent-id": "0", + "x-ms-file-permission-key": "2514336555444402195*5350155227445161882", + "x-ms-request-id": "443dd998-801a-0072-6aba-838091000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2019-02-02" + }, + "ResponseBody": [] + }, + { + "RequestUri": "http://jolovstorage.file.core.windows.net/test-share-94acab9d-b00d-6f3d-91e2-d8ede8b9baf8/test-directory-24592af0-7ece-9316-91d3-ed903670cbb3/test-directory-4b4cf3b5-1b4b-5916-f94b-d2f216412eb6?comp=forceclosehandles", + "RequestMethod": "PUT", + "RequestHeaders": { + "Authorization": "Sanitized", + "traceparent": "00-f1b55bd0606ed74c8b554ea189da58b8-f753bd996fbe5c4b-00", + "User-Agent": [ + "azsdk-net-Storage.Files/12.0.0-dev.20191015.1\u002B57ef4720914a34ab66322af016d927dc4992c5c9", + "(.NET Core 4.6.28008.01; Microsoft Windows 10.0.18362 )" + ], + "x-ms-client-request-id": "711eb0e9-508f-e455-3382-7f39fa269e2e", + "x-ms-date": "Wed, 16 Oct 2019 00:42:16 GMT", + "x-ms-handle-id": "nonExistantHandleId", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": null, + "StatusCode": 400, + "ResponseHeaders": { + "Content-Length": "339", + "Content-Type": "application/xml", + "Date": "Wed, 16 Oct 2019 00:42:15 GMT", + "Server": [ + "Windows-Azure-File/1.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-client-request-id": "711eb0e9-508f-e455-3382-7f39fa269e2e", + "x-ms-error-code": "InvalidHeaderValue", + "x-ms-request-id": "443dd999-801a-0072-6bba-838091000000", + "x-ms-version": "2019-02-02" + }, + "ResponseBody": [ + "\uFEFF\u003C?xml version=\u00221.0\u0022 encoding=\u0022utf-8\u0022?\u003E\u003CError\u003E\u003CCode\u003EInvalidHeaderValue\u003C/Code\u003E\u003CMessage\u003EThe value for one of the HTTP headers is not in the correct format.\n", + "RequestId:443dd999-801a-0072-6bba-838091000000\n", + "Time:2019-10-16T00:42:16.4784928Z\u003C/Message\u003E\u003CHeaderName\u003Ex-ms-handle-id\u003C/HeaderName\u003E\u003CHeaderValue\u003EnonExistantHandleId\u003C/HeaderValue\u003E\u003C/Error\u003E" + ] + }, + { + "RequestUri": "http://jolovstorage.file.core.windows.net/test-share-94acab9d-b00d-6f3d-91e2-d8ede8b9baf8?restype=share", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Authorization": "Sanitized", + "traceparent": "00-c4d88793004e7e4a9d8a549dcce6d0bc-603369fcfdb0e942-00", + "User-Agent": [ + "azsdk-net-Storage.Files/12.0.0-dev.20191015.1\u002B57ef4720914a34ab66322af016d927dc4992c5c9", + "(.NET Core 4.6.28008.01; Microsoft Windows 10.0.18362 )" + ], + "x-ms-client-request-id": "6609ff9f-bd22-e626-f6ad-ba11d2f52ab2", + "x-ms-date": "Wed, 16 Oct 2019 00:42:16 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": null, + "StatusCode": 202, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Wed, 16 Oct 2019 00:42:15 GMT", + "Server": [ + "Windows-Azure-File/1.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-client-request-id": "6609ff9f-bd22-e626-f6ad-ba11d2f52ab2", + "x-ms-request-id": "443dd99a-801a-0072-6cba-838091000000", + "x-ms-version": "2019-02-02" + }, + "ResponseBody": [] + } + ], + "Variables": { + "RandomSeed": "350272571", + "Storage_TestConfigDefault": "ProductionTenant\njolovstorage\nU2FuaXRpemVk\nhttp://jolovstorage.blob.core.windows.net\nhttp://jolovstorage.file.core.windows.net\nhttp://jolovstorage.queue.core.windows.net\nhttp://jolovstorage.table.core.windows.net\n\n\n\n\nhttp://jolovstorage-secondary.blob.core.windows.net\n\nhttp://jolovstorage-secondary.queue.core.windows.net\nhttp://jolovstorage-secondary.table.core.windows.net\n\nSanitized\n\n\nCloud\nBlobEndpoint=http://jolovstorage.blob.core.windows.net/;QueueEndpoint=http://jolovstorage.queue.core.windows.net/;TableEndpoint=http://jolovstorage.table.core.windows.net/;FileEndpoint=http://jolovstorage.file.core.windows.net/;BlobSecondaryEndpoint=http://jolovstorage-secondary.blob.core.windows.net/;QueueSecondaryEndpoint=http://jolovstorage-secondary.queue.core.windows.net/;TableSecondaryEndpoint=http://jolovstorage-secondary.table.core.windows.net/;AccountName=jolovstorage;AccountKey=Sanitized" + } +} \ No newline at end of file diff --git a/sdk/storage/Azure.Storage.Files/tests/SessionRecords/FileClientTests/ForceCloseHandle_ErrorAsync.json b/sdk/storage/Azure.Storage.Files/tests/SessionRecords/FileClientTests/ForceCloseHandle_ErrorAsync.json new file mode 100644 index 000000000000..21140eebe0af --- /dev/null +++ b/sdk/storage/Azure.Storage.Files/tests/SessionRecords/FileClientTests/ForceCloseHandle_ErrorAsync.json @@ -0,0 +1,152 @@ +{ + "Entries": [ + { + "RequestUri": "http://jolovstorage.file.core.windows.net/test-share-7182f0d4-9cd4-3c73-9eed-6cc4ea4e6f67?restype=share", + "RequestMethod": "PUT", + "RequestHeaders": { + "Authorization": "Sanitized", + "traceparent": "00-72bcf9f9e2488a4ead5883b19f034fdc-9a4817d9e5e55c4c-00", + "User-Agent": [ + "azsdk-net-Storage.Files/12.0.0-dev.20191015.1\u002B57ef4720914a34ab66322af016d927dc4992c5c9", + "(.NET Core 4.6.28008.01; Microsoft Windows 10.0.18362 )" + ], + "x-ms-client-request-id": "f18feefe-aeef-4b49-7b76-5ea9193f7794", + "x-ms-date": "Wed, 16 Oct 2019 00:42:57 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-share-quota": "1", + "x-ms-version": "2019-02-02" + }, + "RequestBody": null, + "StatusCode": 201, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Wed, 16 Oct 2019 00:42:56 GMT", + "ETag": "\u00220x8D751D1C9C77868\u0022", + "Last-Modified": "Wed, 16 Oct 2019 00:42:57 GMT", + "Server": [ + "Windows-Azure-File/1.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-client-request-id": "f18feefe-aeef-4b49-7b76-5ea9193f7794", + "x-ms-request-id": "5893820b-601a-0051-5eba-83ef5a000000", + "x-ms-version": "2019-02-02" + }, + "ResponseBody": [] + }, + { + "RequestUri": "http://jolovstorage.file.core.windows.net/test-share-7182f0d4-9cd4-3c73-9eed-6cc4ea4e6f67/test-directory-dbd84f0c-464d-39f1-2417-9a67f4e991e1?restype=directory", + "RequestMethod": "PUT", + "RequestHeaders": { + "Authorization": "Sanitized", + "traceparent": "00-11a65645bbb31b478f6b02c0fe9b2133-161eecedd81b6a4f-00", + "User-Agent": [ + "azsdk-net-Storage.Files/12.0.0-dev.20191015.1\u002B57ef4720914a34ab66322af016d927dc4992c5c9", + "(.NET Core 4.6.28008.01; Microsoft Windows 10.0.18362 )" + ], + "x-ms-client-request-id": "5b7d13f5-abe4-b84c-fd55-ccd814e25692", + "x-ms-date": "Wed, 16 Oct 2019 00:42:57 GMT", + "x-ms-file-attributes": "None", + "x-ms-file-creation-time": "Now", + "x-ms-file-last-write-time": "Now", + "x-ms-file-permission": "Inherit", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": null, + "StatusCode": 201, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Wed, 16 Oct 2019 00:42:56 GMT", + "ETag": "\u00220x8D751D1C9CEC3EA\u0022", + "Last-Modified": "Wed, 16 Oct 2019 00:42:57 GMT", + "Server": [ + "Windows-Azure-File/1.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-client-request-id": "5b7d13f5-abe4-b84c-fd55-ccd814e25692", + "x-ms-file-attributes": "Directory", + "x-ms-file-change-time": "2019-10-16T00:42:57.2000234Z", + "x-ms-file-creation-time": "2019-10-16T00:42:57.2000234Z", + "x-ms-file-id": "13835128424026341376", + "x-ms-file-last-write-time": "2019-10-16T00:42:57.2000234Z", + "x-ms-file-parent-id": "0", + "x-ms-file-permission-key": "2514336555444402195*5350155227445161882", + "x-ms-request-id": "5893820d-601a-0051-5fba-83ef5a000000", + "x-ms-request-server-encrypted": "true", + "x-ms-version": "2019-02-02" + }, + "ResponseBody": [] + }, + { + "RequestUri": "http://jolovstorage.file.core.windows.net/test-share-7182f0d4-9cd4-3c73-9eed-6cc4ea4e6f67/test-directory-dbd84f0c-464d-39f1-2417-9a67f4e991e1/test-directory-46427de5-7c7a-8ed5-d7d1-9701dabefd02?comp=forceclosehandles", + "RequestMethod": "PUT", + "RequestHeaders": { + "Authorization": "Sanitized", + "traceparent": "00-4ccb9e4c0381d24098c60b1804e5922f-c8700348a543b04d-00", + "User-Agent": [ + "azsdk-net-Storage.Files/12.0.0-dev.20191015.1\u002B57ef4720914a34ab66322af016d927dc4992c5c9", + "(.NET Core 4.6.28008.01; Microsoft Windows 10.0.18362 )" + ], + "x-ms-client-request-id": "bf4dd9f5-0ae0-791d-3eef-8313134bde3f", + "x-ms-date": "Wed, 16 Oct 2019 00:42:57 GMT", + "x-ms-handle-id": "nonExistantHandleId", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": null, + "StatusCode": 400, + "ResponseHeaders": { + "Content-Length": "339", + "Content-Type": "application/xml", + "Date": "Wed, 16 Oct 2019 00:42:56 GMT", + "Server": [ + "Windows-Azure-File/1.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-client-request-id": "bf4dd9f5-0ae0-791d-3eef-8313134bde3f", + "x-ms-error-code": "InvalidHeaderValue", + "x-ms-request-id": "5893820e-601a-0051-60ba-83ef5a000000", + "x-ms-version": "2019-02-02" + }, + "ResponseBody": [ + "\uFEFF\u003C?xml version=\u00221.0\u0022 encoding=\u0022utf-8\u0022?\u003E\u003CError\u003E\u003CCode\u003EInvalidHeaderValue\u003C/Code\u003E\u003CMessage\u003EThe value for one of the HTTP headers is not in the correct format.\n", + "RequestId:5893820e-601a-0051-60ba-83ef5a000000\n", + "Time:2019-10-16T00:42:57.2412783Z\u003C/Message\u003E\u003CHeaderName\u003Ex-ms-handle-id\u003C/HeaderName\u003E\u003CHeaderValue\u003EnonExistantHandleId\u003C/HeaderValue\u003E\u003C/Error\u003E" + ] + }, + { + "RequestUri": "http://jolovstorage.file.core.windows.net/test-share-7182f0d4-9cd4-3c73-9eed-6cc4ea4e6f67?restype=share", + "RequestMethod": "DELETE", + "RequestHeaders": { + "Authorization": "Sanitized", + "traceparent": "00-b4cf7ea5edd889428ea96b4f60a4ecb8-54f3b0cd0d76da4c-00", + "User-Agent": [ + "azsdk-net-Storage.Files/12.0.0-dev.20191015.1\u002B57ef4720914a34ab66322af016d927dc4992c5c9", + "(.NET Core 4.6.28008.01; Microsoft Windows 10.0.18362 )" + ], + "x-ms-client-request-id": "010b34df-3d71-bc21-e5f8-a27cb3e9a83a", + "x-ms-date": "Wed, 16 Oct 2019 00:42:57 GMT", + "x-ms-return-client-request-id": "true", + "x-ms-version": "2019-02-02" + }, + "RequestBody": null, + "StatusCode": 202, + "ResponseHeaders": { + "Content-Length": "0", + "Date": "Wed, 16 Oct 2019 00:42:56 GMT", + "Server": [ + "Windows-Azure-File/1.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-client-request-id": "010b34df-3d71-bc21-e5f8-a27cb3e9a83a", + "x-ms-request-id": "5893820f-601a-0051-61ba-83ef5a000000", + "x-ms-version": "2019-02-02" + }, + "ResponseBody": [] + } + ], + "Variables": { + "RandomSeed": "1605347705", + "Storage_TestConfigDefault": "ProductionTenant\njolovstorage\nU2FuaXRpemVk\nhttp://jolovstorage.blob.core.windows.net\nhttp://jolovstorage.file.core.windows.net\nhttp://jolovstorage.queue.core.windows.net\nhttp://jolovstorage.table.core.windows.net\n\n\n\n\nhttp://jolovstorage-secondary.blob.core.windows.net\n\nhttp://jolovstorage-secondary.queue.core.windows.net\nhttp://jolovstorage-secondary.table.core.windows.net\n\nSanitized\n\n\nCloud\nBlobEndpoint=http://jolovstorage.blob.core.windows.net/;QueueEndpoint=http://jolovstorage.queue.core.windows.net/;TableEndpoint=http://jolovstorage.table.core.windows.net/;FileEndpoint=http://jolovstorage.file.core.windows.net/;BlobSecondaryEndpoint=http://jolovstorage-secondary.blob.core.windows.net/;QueueSecondaryEndpoint=http://jolovstorage-secondary.queue.core.windows.net/;TableSecondaryEndpoint=http://jolovstorage-secondary.table.core.windows.net/;AccountName=jolovstorage;AccountKey=Sanitized" + } +} \ No newline at end of file diff --git a/sdk/storage/Azure.Storage.Queues/src/Generated/QueueRestClient.cs b/sdk/storage/Azure.Storage.Queues/src/Generated/QueueRestClient.cs index aca386039230..20348428e2ad 100644 --- a/sdk/storage/Azure.Storage.Queues/src/Generated/QueueRestClient.cs +++ b/sdk/storage/Azure.Storage.Queues/src/Generated/QueueRestClient.cs @@ -2585,7 +2585,7 @@ internal static Azure.Storage.Queues.Models.GeoReplication FromXml(System.Xml.Li _child = element.Element(System.Xml.Linq.XName.Get("Status", "")); if (_child != null && !string.IsNullOrEmpty(_child.Value)) { - _value.Status = _child.Value; + _value.Status = Azure.Storage.Queues.QueueRestClient.Serialization.ParseGeoReplicationStatus(_child.Value); } _child = element.Element(System.Xml.Linq.XName.Get("LastSyncTime", "")); if (_child != null) @@ -2621,93 +2621,64 @@ public static GeoReplication GeoReplication( } #endregion class GeoReplication -#region enum strings GeoReplicationStatus +#region enum GeoReplicationStatus namespace Azure.Storage.Queues.Models { /// /// The status of the secondary location /// - public readonly struct GeoReplicationStatus : System.IEquatable + #pragma warning disable CA1717 // Only FlagsAttribute enums should have plural names + public enum GeoReplicationStatus + #pragma warning restore CA1717 // Only FlagsAttribute enums should have plural names { - /// - /// The GeoReplicationStatus value. - /// - private readonly string _value; - - /// - /// Initializes a new instance of the structure. - /// - /// The string value of the instance. - public GeoReplicationStatus(string value) { _value = value ?? throw new System.ArgumentNullException(nameof(value)); } - /// /// live /// - public static readonly Azure.Storage.Queues.Models.GeoReplicationStatus Live = new GeoReplicationStatus(@"live"); + Live, /// /// bootstrap /// - public static readonly Azure.Storage.Queues.Models.GeoReplicationStatus Bootstrap = new GeoReplicationStatus(@"bootstrap"); + Bootstrap, /// /// unavailable /// - public static readonly Azure.Storage.Queues.Models.GeoReplicationStatus Unavailable = new GeoReplicationStatus(@"unavailable"); - - /// - /// Determines if two values are the same. - /// - /// The first to compare. - /// The second to compare. - /// True if and are the same; otherwise, false. - public static bool operator ==(Azure.Storage.Queues.Models.GeoReplicationStatus left, Azure.Storage.Queues.Models.GeoReplicationStatus right) => left.Equals(right); - - /// - /// Determines if two values are different. - /// - /// The first to compare. - /// The second to compare. - /// True if and are different; otherwise, false. - public static bool operator !=(Azure.Storage.Queues.Models.GeoReplicationStatus left, Azure.Storage.Queues.Models.GeoReplicationStatus right) => !left.Equals(right); - - /// - /// Converts a string to a . - /// - /// The string value to convert. - /// The GeoReplicationStatus value. - public static implicit operator GeoReplicationStatus(string value) => new Azure.Storage.Queues.Models.GeoReplicationStatus(value); - - /// - /// Check if two instances are equal. - /// - /// The instance to compare to. - /// True if they're equal, false otherwise. - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is Azure.Storage.Queues.Models.GeoReplicationStatus other && Equals(other); - - /// - /// Check if two instances are equal. - /// - /// The instance to compare to. - /// True if they're equal, false otherwise. - public bool Equals(Azure.Storage.Queues.Models.GeoReplicationStatus other) => string.Equals(_value, other._value, System.StringComparison.Ordinal); + Unavailable + } +} - /// - /// Get a hash code for the . - /// - /// Hash code for the GeoReplicationStatus. - [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; +namespace Azure.Storage.Queues +{ + internal static partial class QueueRestClient + { + public static partial class Serialization + { + public static string ToString(Azure.Storage.Queues.Models.GeoReplicationStatus value) + { + return value switch + { + Azure.Storage.Queues.Models.GeoReplicationStatus.Live => "live", + Azure.Storage.Queues.Models.GeoReplicationStatus.Bootstrap => "bootstrap", + Azure.Storage.Queues.Models.GeoReplicationStatus.Unavailable => "unavailable", + _ => throw new System.ArgumentOutOfRangeException(nameof(value), value, "Unknown Azure.Storage.Queues.Models.GeoReplicationStatus value.") + }; + } - /// - /// Convert the to a string. - /// - /// String representation of the GeoReplicationStatus. - public override string ToString() => _value; + public static Azure.Storage.Queues.Models.GeoReplicationStatus ParseGeoReplicationStatus(string value) + { + return value switch + { + "live" => Azure.Storage.Queues.Models.GeoReplicationStatus.Live, + "bootstrap" => Azure.Storage.Queues.Models.GeoReplicationStatus.Bootstrap, + "unavailable" => Azure.Storage.Queues.Models.GeoReplicationStatus.Unavailable, + _ => throw new System.ArgumentOutOfRangeException(nameof(value), value, "Unknown Azure.Storage.Queues.Models.GeoReplicationStatus value.") + }; + } + } } } -#endregion enum strings GeoReplicationStatus +#endregion enum GeoReplicationStatus #region enum ListQueuesIncludeType namespace Azure.Storage.Queues.Models diff --git a/sdk/storage/Azure.Storage.Queues/src/Sas/QueueSasBuilder.cs b/sdk/storage/Azure.Storage.Queues/src/Sas/QueueSasBuilder.cs index 65fb4c16dfe4..3e97f2150518 100644 --- a/sdk/storage/Azure.Storage.Queues/src/Sas/QueueSasBuilder.cs +++ b/sdk/storage/Azure.Storage.Queues/src/Sas/QueueSasBuilder.cs @@ -11,7 +11,7 @@ namespace Azure.Storage.Sas /// Signature (SAS) for an Azure Storage queue. /// For more information, see . /// - public struct QueueSasBuilder : IEquatable + public class QueueSasBuilder { /// /// The storage service version to use to authenticate requests made @@ -62,7 +62,7 @@ public struct QueueSasBuilder : IEquatable /// When specifying a range of IP addresses, note that the range is /// inclusive. /// - public IPRange IPRange { get; set; } + public SasIPRange IPRange { get; set; } /// /// An optional unique value up to 64 characters in length that @@ -147,8 +147,7 @@ private static string GetCanonicalName(string account, string queueName) => /// /// A string that represents the current object. [EditorBrowsable(EditorBrowsableState.Never)] - public override string ToString() => - base.ToString(); + public override string ToString() => base.ToString(); /// /// Check if two QueueSasBuilder instances are equal. @@ -156,56 +155,13 @@ public override string ToString() => /// The instance to compare to. /// True if they're equal, false otherwise. [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => - obj is QueueSasBuilder other && Equals(other); + public override bool Equals(object obj) => base.Equals(obj); /// /// Get a hash code for the QueueSasBuilder. /// /// Hash code for the QueueSasBuilder. [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => - ExpiresOn.GetHashCode() ^ - Identifier.GetHashCode() ^ - IPRange.GetHashCode() ^ - Permissions.GetHashCode() ^ - Protocol.GetHashCode() ^ - QueueName.GetHashCode() ^ - StartsOn.GetHashCode() ^ - Version.GetHashCode(); - - /// - /// Check if two QueueSasBuilder instances are equal. - /// - /// The first instance to compare. - /// The second instance to compare. - /// True if they're equal, false otherwise. - public static bool operator ==(QueueSasBuilder left, QueueSasBuilder right) => - left.Equals(right); - - /// - /// Check if two QueueSasBuilder instances are not equal. - /// - /// The first instance to compare. - /// The second instance to compare. - /// True if they're not equal, false otherwise. - - public static bool operator !=(QueueSasBuilder left, QueueSasBuilder right) => - !(left == right); - - /// - /// Check if two QueueSasBuilder instances are equal. - /// - /// The instance to compare to. - /// True if they're equal, false otherwise. - public bool Equals(QueueSasBuilder other) => - ExpiresOn == other.ExpiresOn && - Identifier == other.Identifier && - IPRange == other.IPRange && - Permissions == other.Permissions && - Protocol == other.Protocol && - QueueName == other.QueueName && - StartsOn == other.StartsOn && - Version == other.Version; + public override int GetHashCode() => base.GetHashCode(); } } diff --git a/sdk/storage/Azure.Storage.Queues/swagger/readme.md b/sdk/storage/Azure.Storage.Queues/swagger/readme.md index 826614e79c01..e96ad63edd38 100644 --- a/sdk/storage/Azure.Storage.Queues/swagger/readme.md +++ b/sdk/storage/Azure.Storage.Queues/swagger/readme.md @@ -185,6 +185,7 @@ directive: where: $.definitions.GeoReplication.properties.Status transform: > $["x-ms-enum"].name = "GeoReplicationStatus"; + $["x-ms-enum"].modelAsString = false; ``` ### StorageError diff --git a/sdk/storage/Azure.Storage.Queues/tests/QueueTestBase.cs b/sdk/storage/Azure.Storage.Queues/tests/QueueTestBase.cs index 53ee4819e3c7..d1b5b96bc351 100644 --- a/sdk/storage/Azure.Storage.Queues/tests/QueueTestBase.cs +++ b/sdk/storage/Azure.Storage.Queues/tests/QueueTestBase.cs @@ -144,7 +144,7 @@ public SasQueryParameters GetNewAccountSasCredentials(StorageSharedKeyCredential StartsOn = Recording.UtcNow.AddHours(-1), ExpiresOn = Recording.UtcNow.AddHours(+1), Permissions = new QueueAccountSasPermissions { Read = true, Write = true, Update = true, Process = true, Add = true, Delete = true, List = true }.ToString(), - IPRange = new IPRange(IPAddress.None, IPAddress.None) + IPRange = new SasIPRange(IPAddress.None, IPAddress.None) }.ToSasQueryParameters(sharedKeyCredentials); public SasQueryParameters GetNewQueueServiceSasCredentials(string queueName, StorageSharedKeyCredential sharedKeyCredentials = default) @@ -155,7 +155,7 @@ public SasQueryParameters GetNewQueueServiceSasCredentials(string queueName, Sto StartsOn = Recording.UtcNow.AddHours(-1), ExpiresOn = Recording.UtcNow.AddHours(+1), Permissions = new QueueAccountSasPermissions { Read = true, Update = true, Process = true, Add = true }.ToString(), - IPRange = new IPRange(IPAddress.None, IPAddress.None) + IPRange = new SasIPRange(IPAddress.None, IPAddress.None) }.ToSasQueryParameters(sharedKeyCredentials ?? GetNewSharedKeyCredentials()); private class DisposingQueue : IDisposable diff --git a/sdk/storage/Azure.Storage.Queues/tests/QueueUriBuilderTests.cs b/sdk/storage/Azure.Storage.Queues/tests/QueueUriBuilderTests.cs index deca4108471f..d96bdc8d2716 100644 --- a/sdk/storage/Azure.Storage.Queues/tests/QueueUriBuilderTests.cs +++ b/sdk/storage/Azure.Storage.Queues/tests/QueueUriBuilderTests.cs @@ -162,7 +162,7 @@ public void QueueUriBuilder_RegularUrl_SasTest() Assert.AreEqual(new DateTimeOffset(2015, 4, 30, 2, 23, 26, TimeSpan.Zero), queueUriBuilder.Sas.ExpiresOn); Assert.AreEqual("", queueUriBuilder.Sas.Identifier); - Assert.AreEqual(IPRange.Parse("168.1.5.60-168.1.5.70"), queueUriBuilder.Sas.IPRange); + Assert.AreEqual(SasIPRange.Parse("168.1.5.60-168.1.5.70"), queueUriBuilder.Sas.IPRange); Assert.AreEqual("rw", queueUriBuilder.Sas.Permissions); Assert.AreEqual(SasProtocol.Https, queueUriBuilder.Sas.Protocol); Assert.AreEqual("b", queueUriBuilder.Sas.Resource); @@ -349,7 +349,7 @@ public void QueueUriBuilder_IPStyleUrl_SasTest() Assert.AreEqual(new DateTimeOffset(2015, 4, 30, 2, 23, 26, TimeSpan.Zero), queueUriBuilder.Sas.ExpiresOn); Assert.AreEqual("", queueUriBuilder.Sas.Identifier); - Assert.AreEqual(IPRange.Parse("168.1.5.60-168.1.5.70"), queueUriBuilder.Sas.IPRange); + Assert.AreEqual(SasIPRange.Parse("168.1.5.60-168.1.5.70"), queueUriBuilder.Sas.IPRange); Assert.AreEqual("rw", queueUriBuilder.Sas.Permissions); Assert.AreEqual(SasProtocol.Https, queueUriBuilder.Sas.Protocol); Assert.AreEqual("b", queueUriBuilder.Sas.Resource);