diff --git a/eng/mgmt/mgmtmetadata/databoxedge_resource-manager.txt b/eng/mgmt/mgmtmetadata/databoxedge_resource-manager.txt new file mode 100644 index 0000000000000..290fd9d608911 --- /dev/null +++ b/eng/mgmt/mgmtmetadata/databoxedge_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/databoxedge/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=D:\Code\azure-sdk-for-net\azure-sdk-for-net\sdk +2019-12-09 08:27:42 UTC +Azure-rest-api-specs repository information +GitHub fork: Azure +Branch: master +Commit: ef354ec8d6580227707ed935684e533b898beabe +AutoRest information +Requested version: latest +Bootstrapper version: autorest@2.0.4407 diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/AzSdk.RP.props b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/AzSdk.RP.props index 009051ddc9d42..cf2d50e66d451 100644 --- a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/AzSdk.RP.props +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/AzSdk.RP.props @@ -1,7 +1,7 @@ - DataBox_2018-01-01; + DataBox_2019-08-01; $(PackageTags);$(CommonTags);$(AzureApiTag); \ No newline at end of file diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Customizations/CryptoUtilities.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Customizations/CryptoUtilities.cs new file mode 100644 index 0000000000000..33244afa706ee --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Customizations/CryptoUtilities.cs @@ -0,0 +1,157 @@ +namespace Microsoft.Azure.Management.DataBoxEdge +{ + using System; + using System.IO; + using System.Security.Cryptography; + using System.Security.Cryptography.X509Certificates; + using System.Text; + + /// + /// The crypto helper. + /// + public class CryptoUtilities + { + /// + /// The salt for generating encryption keys. + /// + private static readonly byte[] Salt = Encoding.ASCII.GetBytes("o6806642kbM7c5"); + + /// + /// The AES algorithm is used to decrypt the given cipherText. + /// + /// The cipher text. + /// The shared secret. + /// The decrypted secret in pain text. + public static string DecryptCipherAES(string cipherText, string sharedSecret) + { + if (string.IsNullOrEmpty(cipherText)) + { + return cipherText; + } + + Aes aesAlg = null; + + string plaintext = null; + + // generate the key from the shared secret and the salt + Rfc2898DeriveBytes key = new Rfc2898DeriveBytes(sharedSecret, Salt); + + // Create the streams used for decryption. + byte[] bytes = Convert.FromBase64String(cipherText); + using (MemoryStream memoryDecrypt = new MemoryStream(bytes)) + { + aesAlg = Aes.Create(); + aesAlg.Key = key.GetBytes(aesAlg.KeySize / 8); + + // Get the initialization vector from the encrypted stream + aesAlg.IV = ReadByteArray(memoryDecrypt); + + // Create a decrytor to perform the stream transform. + ICryptoTransform decryptor = aesAlg.CreateDecryptor(aesAlg.Key, aesAlg.IV); + using (CryptoStream cryptoDecrypt = new CryptoStream(memoryDecrypt, decryptor, CryptoStreamMode.Read)) + { + using (StreamReader streamDecrypt = new StreamReader(cryptoDecrypt)) + { + // Read the decrypted bytes from the decrypting stream and place them in a string. + plaintext = streamDecrypt.ReadToEnd(); + } + } + } + + return plaintext; + } + + public static string DecryptStringAES(string cipherText, string sharedSecret) + { + if (string.IsNullOrEmpty(cipherText)) + return cipherText; + + Aes aesAlg = null; + string plaintext = null; + + // generate the key from the shared secret and the salt + Rfc2898DeriveBytes key = new Rfc2898DeriveBytes(sharedSecret, Salt); + + // Create the streams used for decryption. + byte[] bytes = Convert.FromBase64String(cipherText); + using (MemoryStream msDecrypt = new MemoryStream(bytes)) + { + aesAlg = Aes.Create(); + aesAlg.Key = key.GetBytes(aesAlg.KeySize / 8); + // Get the initialization vector from the encrypted stream + aesAlg.IV = ReadByteArray(msDecrypt); + // Create a decrytor to perform the stream transform. + ICryptoTransform decryptor = aesAlg.CreateDecryptor(aesAlg.Key, aesAlg.IV); + using (CryptoStream csDecrypt = + new CryptoStream(msDecrypt, decryptor, CryptoStreamMode.Read)) + { + using (StreamReader srDecrypt = new StreamReader(csDecrypt)) + + // Read the decrypted bytes from the decrypting stream + // and place them in a string. + plaintext = srDecrypt.ReadToEnd(); + } + } + + return plaintext; + } + + /// + /// This method encrypts a given secret using the public certificate. + /// + /// The secret in plain text. + /// The public certificate to be used for encryption. + /// The encrypted secret. + public static string EncryptSecretRSAPKCS(string plainText, string publicCertificate) + { + string encryptedSecret = null; + encryptedSecret = EncryptStringRsaPkcs1v15(plainText, publicCertificate); + return encryptedSecret; + } + + public static string EncryptStringRsaPkcs1v15(string plaintext, string encodedCertificate) + { + X509Certificate2 cert = new X509Certificate2(Convert.FromBase64String(encodedCertificate)); + if (string.IsNullOrEmpty(plaintext) || cert == null) + { + return null; + } + + byte[] textBytes = Encoding.UTF8.GetBytes(plaintext); + byte[] encryptedTextBytes; + + // Create a new instance of RSACryptoServiceProvider, and encrypt the passed byte array and specify OAEP padding false to use PKCS#1 V1.5 padding. +#if FullNetFx + RSACryptoServiceProvider rsa = (RSACryptoServiceProvider)cert.PublicKey.Key; + encryptedTextBytes = rsa.Encrypt(textBytes, false); +#else + RSA rsa = cert.GetRSAPublicKey(); + encryptedTextBytes = rsa.Encrypt(textBytes, RSAEncryptionPadding.Pkcs1); +#endif + var encryptedBase64 = Convert.ToBase64String(encryptedTextBytes); + return encryptedBase64; + } + + /// + /// Helper method to read byte array from a stream. + /// + /// The stream. + /// The byte array. + private static byte[] ReadByteArray(Stream s) + { + byte[] rawLength = new byte[sizeof(int)]; + if (s.Read(rawLength, 0, rawLength.Length) != rawLength.Length) + { + throw new Exception("Stream did not contain properly formatted byte array"); + } + + byte[] buffer = new byte[BitConverter.ToInt32(rawLength, 0)]; + if (s.Read(buffer, 0, buffer.Length) != buffer.Length) + { + throw new Exception("Did not read byte array properly"); + } + + return buffer; + } + } +} \ No newline at end of file diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Customizations/ExtendedClientMethods.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Customizations/ExtendedClientMethods.cs new file mode 100644 index 0000000000000..86b0a21f350ba --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Customizations/ExtendedClientMethods.cs @@ -0,0 +1,123 @@ +using Microsoft.Azure.Management.DataBoxEdge.Models; +using Microsoft.Rest; +using Newtonsoft.Json.Linq; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Microsoft.Azure.Management.DataBoxEdge +{ + public static partial class ExtendedClientMethods + { + + /// + /// Use this method to encrypt the user secrets (Storage Account Access Key, Volume Container Encryption Key etc.) using activation key + /// + /// + /// The resource name. + /// + /// + /// The resource group name. + /// + /// + /// The plain text secret. + /// + /// + /// The . + /// + /// + /// + /// + /// + public static AsymmetricEncryptedSecret GetAsymmetricEncryptedSecretUsingActivationKey( + this IDevicesOperations operations, + string deviceName, + string resourceGroupName, + + string plainTextSecret, + string activationKey) + { + if (string.IsNullOrWhiteSpace(activationKey)) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "activationKey"); + } + + + + string channelIntegrationKey = GetChannelIntegrityKey(activationKey); + return operations.GetAsymmetricEncryptedSecret(deviceName, resourceGroupName, plainTextSecret, channelIntegrationKey); + } + + /// + /// Use this method to encrypt the user secrets (Storage Account Access Key, Volume Container Encryption Key etc.) using CIK + /// + /// + /// The resource name. + /// + /// + /// The resource group name. + /// + /// + /// The plain text secret. + /// + /// + /// The . + /// + /// + /// + /// + /// + public static AsymmetricEncryptedSecret GetAsymmetricEncryptedSecret( + this IDevicesOperations operations, + string deviceName, + string resourceGroupName, + string plainTextSecret, + string channelIntegrationKey) + { + if (string.IsNullOrWhiteSpace(plainTextSecret)) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "plainTextSecret"); + } + + if (string.IsNullOrWhiteSpace(resourceGroupName)) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + + if (string.IsNullOrWhiteSpace(deviceName)) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceName"); + } + + DataBoxEdgeDeviceExtendedInfo extendedInfo = operations.GetExtendedInformation(deviceName, resourceGroupName); + string encryptionKey = extendedInfo.EncryptionKey; + string encryptionKeyThumbprint = extendedInfo.EncryptionKeyThumbprint; + + string ChannelEncryptionKey = CryptoUtilities.DecryptStringAES(encryptionKey, channelIntegrationKey); + + var secret = new AsymmetricEncryptedSecret() + { + EncryptionAlgorithm = EncryptionAlgorithm.AES256, + EncryptionCertThumbprint = encryptionKeyThumbprint, + Value = CryptoUtilities.EncryptStringRsaPkcs1v15(plainTextSecret, ChannelEncryptionKey) + }; + + return secret; + } + + + private static string GetChannelIntegrityKey(string activationKey) + { + string[] keys = activationKey.Split('#'); + string encodedString = keys[0]; + byte[] data = Convert.FromBase64String(encodedString); + string decodedString = Encoding.UTF8.GetString(data); + var jsondata = (JObject)JsonConvert.DeserializeObject(decodedString); + string serviceDataIntegrityKey = jsondata["serviceDataIntegrityKey"].Value(); + return serviceDataIntegrityKey; + } + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/AlertsOperations.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/AlertsOperations.cs new file mode 100644 index 0000000000000..4c65c6ec94912 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/AlertsOperations.cs @@ -0,0 +1,628 @@ +// +// 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.DataBoxEdge +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// AlertsOperations operations. + /// + internal partial class AlertsOperations : IServiceOperations, IAlertsOperations + { + /// + /// Initializes a new instance of the AlertsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal AlertsOperations(DataBoxEdgeManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the DataBoxEdgeManagementClient + /// + public DataBoxEdgeManagementClient Client { get; private set; } + + /// + /// Gets all the alerts for a Data Box Edge/Data Box Gateway device. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// 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>> ListByDataBoxEdgeDeviceWithHttpMessagesAsync(string deviceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByDataBoxEdgeDevice", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/alerts").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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("GET"); + _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; + } + + /// + /// Gets an alert by name. + /// + /// + /// The device name. + /// + /// + /// The alert name. + /// + /// + /// The resource group name. + /// + /// + /// 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> GetWithHttpMessagesAsync(string deviceName, string name, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("name", name); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/alerts/{name}").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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("GET"); + _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; + } + + /// + /// Gets all the alerts for a Data Box Edge/Data Box Gateway device. + /// + /// + /// 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>> ListByDataBoxEdgeDeviceNextWithHttpMessagesAsync(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, "ListByDataBoxEdgeDeviceNext", 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("GET"); + _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/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/AlertsOperationsExtensions.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/AlertsOperationsExtensions.cs new file mode 100644 index 0000000000000..8babeba361194 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/AlertsOperationsExtensions.cs @@ -0,0 +1,145 @@ +// +// 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.DataBoxEdge +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for AlertsOperations. + /// + public static partial class AlertsOperationsExtensions + { + /// + /// Gets all the alerts for a Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + public static IPage ListByDataBoxEdgeDevice(this IAlertsOperations operations, string deviceName, string resourceGroupName) + { + return operations.ListByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Gets all the alerts for a Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByDataBoxEdgeDeviceAsync(this IAlertsOperations operations, string deviceName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByDataBoxEdgeDeviceWithHttpMessagesAsync(deviceName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets an alert by name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The alert name. + /// + /// + /// The resource group name. + /// + public static Alert Get(this IAlertsOperations operations, string deviceName, string name, string resourceGroupName) + { + return operations.GetAsync(deviceName, name, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Gets an alert by name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The alert name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IAlertsOperations operations, string deviceName, string name, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(deviceName, name, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets all the alerts for a Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByDataBoxEdgeDeviceNext(this IAlertsOperations operations, string nextPageLink) + { + return operations.ListByDataBoxEdgeDeviceNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all the alerts for a Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByDataBoxEdgeDeviceNextAsync(this IAlertsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByDataBoxEdgeDeviceNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/BandwidthSchedulesOperations.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/BandwidthSchedulesOperations.cs new file mode 100644 index 0000000000000..3d4568b164be8 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/BandwidthSchedulesOperations.cs @@ -0,0 +1,1090 @@ +// +// 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.DataBoxEdge +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// BandwidthSchedulesOperations operations. + /// + internal partial class BandwidthSchedulesOperations : IServiceOperations, IBandwidthSchedulesOperations + { + /// + /// Initializes a new instance of the BandwidthSchedulesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal BandwidthSchedulesOperations(DataBoxEdgeManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the DataBoxEdgeManagementClient + /// + public DataBoxEdgeManagementClient Client { get; private set; } + + /// + /// Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway + /// device. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// 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>> ListByDataBoxEdgeDeviceWithHttpMessagesAsync(string deviceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByDataBoxEdgeDevice", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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("GET"); + _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; + } + + /// + /// Gets the properties of the specified bandwidth schedule. + /// + /// + /// The device name. + /// + /// + /// The bandwidth schedule name. + /// + /// + /// The resource group name. + /// + /// + /// 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> GetWithHttpMessagesAsync(string deviceName, string name, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("name", name); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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("GET"); + _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; + } + + /// + /// Creates or updates a bandwidth schedule. + /// + /// + /// The device name. + /// + /// + /// The bandwidth schedule name which needs to be added/updated. + /// + /// + /// The bandwidth schedule to be added or updated. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string deviceName, string name, BandwidthSchedule parameters, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(deviceName, name, parameters, resourceGroupName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes the specified bandwidth schedule. + /// + /// + /// The device name. + /// + /// + /// The bandwidth schedule name. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string deviceName, string name, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(deviceName, name, resourceGroupName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Creates or updates a bandwidth schedule. + /// + /// + /// The device name. + /// + /// + /// The bandwidth schedule name which needs to be added/updated. + /// + /// + /// The bandwidth schedule to be added or updated. + /// + /// + /// The resource group name. + /// + /// + /// 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> BeginCreateOrUpdateWithHttpMessagesAsync(string deviceName, string name, BandwidthSchedule parameters, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("name", name); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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("PUT"); + _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(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, 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 && (int)_statusCode != 202) + { + 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; + } + + /// + /// Deletes the specified bandwidth schedule. + /// + /// + /// The device name. + /// + /// + /// The bandwidth schedule name. + /// + /// + /// The resource group name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 BeginDeleteWithHttpMessagesAsync(string deviceName, string name, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("name", name); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/bandwidthSchedules/{name}").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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("DELETE"); + _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 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + 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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway + /// device. + /// + /// + /// 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>> ListByDataBoxEdgeDeviceNextWithHttpMessagesAsync(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, "ListByDataBoxEdgeDeviceNext", 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("GET"); + _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/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/BandwidthSchedulesOperationsExtensions.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/BandwidthSchedulesOperationsExtensions.cs new file mode 100644 index 0000000000000..81f6616876959 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/BandwidthSchedulesOperationsExtensions.cs @@ -0,0 +1,339 @@ +// +// 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.DataBoxEdge +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for BandwidthSchedulesOperations. + /// + public static partial class BandwidthSchedulesOperationsExtensions + { + /// + /// Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway + /// device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + public static IPage ListByDataBoxEdgeDevice(this IBandwidthSchedulesOperations operations, string deviceName, string resourceGroupName) + { + return operations.ListByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway + /// device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByDataBoxEdgeDeviceAsync(this IBandwidthSchedulesOperations operations, string deviceName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByDataBoxEdgeDeviceWithHttpMessagesAsync(deviceName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the properties of the specified bandwidth schedule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The bandwidth schedule name. + /// + /// + /// The resource group name. + /// + public static BandwidthSchedule Get(this IBandwidthSchedulesOperations operations, string deviceName, string name, string resourceGroupName) + { + return operations.GetAsync(deviceName, name, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Gets the properties of the specified bandwidth schedule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The bandwidth schedule name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IBandwidthSchedulesOperations operations, string deviceName, string name, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(deviceName, name, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates a bandwidth schedule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The bandwidth schedule name which needs to be added/updated. + /// + /// + /// The bandwidth schedule to be added or updated. + /// + /// + /// The resource group name. + /// + public static BandwidthSchedule CreateOrUpdate(this IBandwidthSchedulesOperations operations, string deviceName, string name, BandwidthSchedule parameters, string resourceGroupName) + { + return operations.CreateOrUpdateAsync(deviceName, name, parameters, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a bandwidth schedule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The bandwidth schedule name which needs to be added/updated. + /// + /// + /// The bandwidth schedule to be added or updated. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IBandwidthSchedulesOperations operations, string deviceName, string name, BandwidthSchedule parameters, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(deviceName, name, parameters, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the specified bandwidth schedule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The bandwidth schedule name. + /// + /// + /// The resource group name. + /// + public static void Delete(this IBandwidthSchedulesOperations operations, string deviceName, string name, string resourceGroupName) + { + operations.DeleteAsync(deviceName, name, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified bandwidth schedule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The bandwidth schedule name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IBandwidthSchedulesOperations operations, string deviceName, string name, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(deviceName, name, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Creates or updates a bandwidth schedule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The bandwidth schedule name which needs to be added/updated. + /// + /// + /// The bandwidth schedule to be added or updated. + /// + /// + /// The resource group name. + /// + public static BandwidthSchedule BeginCreateOrUpdate(this IBandwidthSchedulesOperations operations, string deviceName, string name, BandwidthSchedule parameters, string resourceGroupName) + { + return operations.BeginCreateOrUpdateAsync(deviceName, name, parameters, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a bandwidth schedule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The bandwidth schedule name which needs to be added/updated. + /// + /// + /// The bandwidth schedule to be added or updated. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this IBandwidthSchedulesOperations operations, string deviceName, string name, BandwidthSchedule parameters, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(deviceName, name, parameters, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the specified bandwidth schedule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The bandwidth schedule name. + /// + /// + /// The resource group name. + /// + public static void BeginDelete(this IBandwidthSchedulesOperations operations, string deviceName, string name, string resourceGroupName) + { + operations.BeginDeleteAsync(deviceName, name, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the specified bandwidth schedule. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The bandwidth schedule name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IBandwidthSchedulesOperations operations, string deviceName, string name, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(deviceName, name, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway + /// device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByDataBoxEdgeDeviceNext(this IBandwidthSchedulesOperations operations, string nextPageLink) + { + return operations.ListByDataBoxEdgeDeviceNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all the bandwidth schedules for a Data Box Edge/Data Box Gateway + /// device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByDataBoxEdgeDeviceNextAsync(this IBandwidthSchedulesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByDataBoxEdgeDeviceNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/ContainersOperations.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/ContainersOperations.cs new file mode 100644 index 0000000000000..507236cc377ba --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/ContainersOperations.cs @@ -0,0 +1,1353 @@ +// +// 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.DataBoxEdge +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ContainersOperations operations. + /// + internal partial class ContainersOperations : IServiceOperations, IContainersOperations + { + /// + /// Initializes a new instance of the ContainersOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ContainersOperations(DataBoxEdgeManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the DataBoxEdgeManagementClient + /// + public DataBoxEdgeManagementClient Client { get; private set; } + + /// + /// Lists all the containers of a storage Account in a Data Box Edge/Data Box + /// Gateway device. + /// + /// + /// The device name. + /// + /// + /// The storage Account name. + /// + /// + /// The resource group name. + /// + /// + /// 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>> ListByStorageAccountWithHttpMessagesAsync(string deviceName, string storageAccountName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (storageAccountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "storageAccountName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("storageAccountName", storageAccountName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByStorageAccount", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{storageAccountName}", System.Uri.EscapeDataString(storageAccountName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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("GET"); + _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; + } + + /// + /// Gets a container by name. + /// + /// + /// The device name. + /// + /// + /// The Storage Account Name + /// + /// + /// The container Name + /// + /// + /// The resource group name. + /// + /// + /// 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> GetWithHttpMessagesAsync(string deviceName, string storageAccountName, string containerName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (storageAccountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "storageAccountName"); + } + if (containerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "containerName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("storageAccountName", storageAccountName); + tracingParameters.Add("containerName", containerName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{storageAccountName}", System.Uri.EscapeDataString(storageAccountName)); + _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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("GET"); + _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; + } + + /// + /// Creates a new container or updates an existing container on the device. + /// + /// + /// The device name. + /// + /// + /// The Storage Account Name + /// + /// + /// The container name. + /// + /// + /// The container properties. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string deviceName, string storageAccountName, string containerName, Container container, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(deviceName, storageAccountName, containerName, container, resourceGroupName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes the container on the Data Box Edge/Data Box Gateway device. + /// + /// + /// The device name. + /// + /// + /// The Storage Account Name + /// + /// + /// The container name. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string deviceName, string storageAccountName, string containerName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(deviceName, storageAccountName, containerName, resourceGroupName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Refreshes the container metadata with the data from the cloud. + /// + /// + /// The device name. + /// + /// + /// The Storage Account Name + /// + /// + /// The container name. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task RefreshWithHttpMessagesAsync(string deviceName, string storageAccountName, string containerName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginRefreshWithHttpMessagesAsync(deviceName, storageAccountName, containerName, resourceGroupName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Creates a new container or updates an existing container on the device. + /// + /// + /// The device name. + /// + /// + /// The Storage Account Name + /// + /// + /// The container name. + /// + /// + /// The container properties. + /// + /// + /// The resource group name. + /// + /// + /// 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> BeginCreateOrUpdateWithHttpMessagesAsync(string deviceName, string storageAccountName, string containerName, Container container, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (storageAccountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "storageAccountName"); + } + if (containerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "containerName"); + } + if (container == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "container"); + } + if (container != null) + { + container.Validate(); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("storageAccountName", storageAccountName); + tracingParameters.Add("containerName", containerName); + tracingParameters.Add("container", container); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{storageAccountName}", System.Uri.EscapeDataString(storageAccountName)); + _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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("PUT"); + _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(container != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(container, 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 && (int)_statusCode != 202) + { + 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; + } + + /// + /// Deletes the container on the Data Box Edge/Data Box Gateway device. + /// + /// + /// The device name. + /// + /// + /// The Storage Account Name + /// + /// + /// The container name. + /// + /// + /// The resource group name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 BeginDeleteWithHttpMessagesAsync(string deviceName, string storageAccountName, string containerName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (storageAccountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "storageAccountName"); + } + if (containerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "containerName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("storageAccountName", storageAccountName); + tracingParameters.Add("containerName", containerName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{storageAccountName}", System.Uri.EscapeDataString(storageAccountName)); + _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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("DELETE"); + _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 != 202 && (int)_statusCode != 204) + { + 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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Refreshes the container metadata with the data from the cloud. + /// + /// + /// The device name. + /// + /// + /// The Storage Account Name + /// + /// + /// The container name. + /// + /// + /// The resource group name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 BeginRefreshWithHttpMessagesAsync(string deviceName, string storageAccountName, string containerName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (storageAccountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "storageAccountName"); + } + if (containerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "containerName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("storageAccountName", storageAccountName); + tracingParameters.Add("containerName", containerName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginRefresh", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}/refresh").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{storageAccountName}", System.Uri.EscapeDataString(storageAccountName)); + _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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; + // 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 && (int)_statusCode != 202) + { + 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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists all the containers of a storage Account in a Data Box Edge/Data Box + /// Gateway device. + /// + /// + /// 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>> ListByStorageAccountNextWithHttpMessagesAsync(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, "ListByStorageAccountNext", 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("GET"); + _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/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/ContainersOperationsExtensions.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/ContainersOperationsExtensions.cs new file mode 100644 index 0000000000000..04dc7303ffeae --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/ContainersOperationsExtensions.cs @@ -0,0 +1,473 @@ +// +// 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.DataBoxEdge +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ContainersOperations. + /// + public static partial class ContainersOperationsExtensions + { + /// + /// Lists all the containers of a storage Account in a Data Box Edge/Data Box + /// Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The storage Account name. + /// + /// + /// The resource group name. + /// + public static IPage ListByStorageAccount(this IContainersOperations operations, string deviceName, string storageAccountName, string resourceGroupName) + { + return operations.ListByStorageAccountAsync(deviceName, storageAccountName, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Lists all the containers of a storage Account in a Data Box Edge/Data Box + /// Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The storage Account name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByStorageAccountAsync(this IContainersOperations operations, string deviceName, string storageAccountName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByStorageAccountWithHttpMessagesAsync(deviceName, storageAccountName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a container by name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The Storage Account Name + /// + /// + /// The container Name + /// + /// + /// The resource group name. + /// + public static Container Get(this IContainersOperations operations, string deviceName, string storageAccountName, string containerName, string resourceGroupName) + { + return operations.GetAsync(deviceName, storageAccountName, containerName, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Gets a container by name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The Storage Account Name + /// + /// + /// The container Name + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IContainersOperations operations, string deviceName, string storageAccountName, string containerName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(deviceName, storageAccountName, containerName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates a new container or updates an existing container on the device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The Storage Account Name + /// + /// + /// The container name. + /// + /// + /// The container properties. + /// + /// + /// The resource group name. + /// + public static Container CreateOrUpdate(this IContainersOperations operations, string deviceName, string storageAccountName, string containerName, Container container, string resourceGroupName) + { + return operations.CreateOrUpdateAsync(deviceName, storageAccountName, containerName, container, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Creates a new container or updates an existing container on the device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The Storage Account Name + /// + /// + /// The container name. + /// + /// + /// The container properties. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IContainersOperations operations, string deviceName, string storageAccountName, string containerName, Container container, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(deviceName, storageAccountName, containerName, container, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the container on the Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The Storage Account Name + /// + /// + /// The container name. + /// + /// + /// The resource group name. + /// + public static void Delete(this IContainersOperations operations, string deviceName, string storageAccountName, string containerName, string resourceGroupName) + { + operations.DeleteAsync(deviceName, storageAccountName, containerName, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the container on the Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The Storage Account Name + /// + /// + /// The container name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IContainersOperations operations, string deviceName, string storageAccountName, string containerName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(deviceName, storageAccountName, containerName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Refreshes the container metadata with the data from the cloud. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The Storage Account Name + /// + /// + /// The container name. + /// + /// + /// The resource group name. + /// + public static void Refresh(this IContainersOperations operations, string deviceName, string storageAccountName, string containerName, string resourceGroupName) + { + operations.RefreshAsync(deviceName, storageAccountName, containerName, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Refreshes the container metadata with the data from the cloud. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The Storage Account Name + /// + /// + /// The container name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task RefreshAsync(this IContainersOperations operations, string deviceName, string storageAccountName, string containerName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.RefreshWithHttpMessagesAsync(deviceName, storageAccountName, containerName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Creates a new container or updates an existing container on the device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The Storage Account Name + /// + /// + /// The container name. + /// + /// + /// The container properties. + /// + /// + /// The resource group name. + /// + public static Container BeginCreateOrUpdate(this IContainersOperations operations, string deviceName, string storageAccountName, string containerName, Container container, string resourceGroupName) + { + return operations.BeginCreateOrUpdateAsync(deviceName, storageAccountName, containerName, container, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Creates a new container or updates an existing container on the device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The Storage Account Name + /// + /// + /// The container name. + /// + /// + /// The container properties. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this IContainersOperations operations, string deviceName, string storageAccountName, string containerName, Container container, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(deviceName, storageAccountName, containerName, container, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the container on the Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The Storage Account Name + /// + /// + /// The container name. + /// + /// + /// The resource group name. + /// + public static void BeginDelete(this IContainersOperations operations, string deviceName, string storageAccountName, string containerName, string resourceGroupName) + { + operations.BeginDeleteAsync(deviceName, storageAccountName, containerName, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the container on the Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The Storage Account Name + /// + /// + /// The container name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IContainersOperations operations, string deviceName, string storageAccountName, string containerName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(deviceName, storageAccountName, containerName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Refreshes the container metadata with the data from the cloud. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The Storage Account Name + /// + /// + /// The container name. + /// + /// + /// The resource group name. + /// + public static void BeginRefresh(this IContainersOperations operations, string deviceName, string storageAccountName, string containerName, string resourceGroupName) + { + operations.BeginRefreshAsync(deviceName, storageAccountName, containerName, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Refreshes the container metadata with the data from the cloud. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The Storage Account Name + /// + /// + /// The container name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task BeginRefreshAsync(this IContainersOperations operations, string deviceName, string storageAccountName, string containerName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginRefreshWithHttpMessagesAsync(deviceName, storageAccountName, containerName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Lists all the containers of a storage Account in a Data Box Edge/Data Box + /// Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByStorageAccountNext(this IContainersOperations operations, string nextPageLink) + { + return operations.ListByStorageAccountNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all the containers of a storage Account in a Data Box Edge/Data Box + /// Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByStorageAccountNextAsync(this IContainersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByStorageAccountNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/DataBoxEdgeManagementClient.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/DataBoxEdgeManagementClient.cs new file mode 100644 index 0000000000000..1c08d81dc6707 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/DataBoxEdgeManagementClient.cs @@ -0,0 +1,451 @@ +// +// 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.DataBoxEdge +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Serialization; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + + public partial class DataBoxEdgeManagementClient : ServiceClient, IDataBoxEdgeManagementClient, IAzureClient + { + /// + /// The base URI of the service. + /// + public System.Uri BaseUri { get; set; } + + /// + /// Gets or sets json serialization settings. + /// + public JsonSerializerSettings SerializationSettings { get; private set; } + + /// + /// Gets or sets json deserialization settings. + /// + public JsonSerializerSettings DeserializationSettings { get; private set; } + + /// + /// Credentials needed for the client to connect to Azure. + /// + public ServiceClientCredentials Credentials { get; private set; } + + /// + /// The API version. + /// + public string ApiVersion { get; private set; } + + /// + /// The subscription ID. + /// + public string SubscriptionId { get; set; } + + /// + /// The preferred language for the response. + /// + public string AcceptLanguage { get; set; } + + /// + /// The retry timeout in seconds for Long Running Operations. Default value is + /// 30. + /// + public int? LongRunningOperationRetryTimeout { get; set; } + + /// + /// Whether a unique x-ms-client-request-id should be generated. When set to + /// true a unique x-ms-client-request-id value is generated and included in + /// each request. Default is true. + /// + public bool? GenerateClientRequestId { get; set; } + + /// + /// Gets the IOperations. + /// + public virtual IOperations Operations { get; private set; } + + /// + /// Gets the IDevicesOperations. + /// + public virtual IDevicesOperations Devices { get; private set; } + + /// + /// Gets the IAlertsOperations. + /// + public virtual IAlertsOperations Alerts { get; private set; } + + /// + /// Gets the IBandwidthSchedulesOperations. + /// + public virtual IBandwidthSchedulesOperations BandwidthSchedules { get; private set; } + + /// + /// Gets the IJobsOperations. + /// + public virtual IJobsOperations Jobs { get; private set; } + + /// + /// Gets the INodesOperations. + /// + public virtual INodesOperations Nodes { get; private set; } + + /// + /// Gets the IOperationsStatus. + /// + public virtual IOperationsStatus OperationsStatus { get; private set; } + + /// + /// Gets the IOrdersOperations. + /// + public virtual IOrdersOperations Orders { get; private set; } + + /// + /// Gets the IRolesOperations. + /// + public virtual IRolesOperations Roles { get; private set; } + + /// + /// Gets the ISharesOperations. + /// + public virtual ISharesOperations Shares { get; private set; } + + /// + /// Gets the IStorageAccountCredentialsOperations. + /// + public virtual IStorageAccountCredentialsOperations StorageAccountCredentials { get; private set; } + + /// + /// Gets the IStorageAccountsOperations. + /// + public virtual IStorageAccountsOperations StorageAccounts { get; private set; } + + /// + /// Gets the IContainersOperations. + /// + public virtual IContainersOperations Containers { get; private set; } + + /// + /// Gets the ITriggersOperations. + /// + public virtual ITriggersOperations Triggers { get; private set; } + + /// + /// Gets the IUsersOperations. + /// + public virtual IUsersOperations Users { get; private set; } + + /// + /// Gets the ISkusOperations. + /// + public virtual ISkusOperations Skus { get; private set; } + + /// + /// Initializes a new instance of the DataBoxEdgeManagementClient class. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling DataBoxEdgeManagementClient.Dispose(). False: will not dispose provided httpClient + protected DataBoxEdgeManagementClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) + { + Initialize(); + } + + /// + /// Initializes a new instance of the DataBoxEdgeManagementClient class. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected DataBoxEdgeManagementClient(params DelegatingHandler[] handlers) : base(handlers) + { + Initialize(); + } + + /// + /// Initializes a new instance of the DataBoxEdgeManagementClient class. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + protected DataBoxEdgeManagementClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) + { + Initialize(); + } + + /// + /// Initializes a new instance of the DataBoxEdgeManagementClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + protected DataBoxEdgeManagementClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + BaseUri = baseUri; + } + + /// + /// Initializes a new instance of the DataBoxEdgeManagementClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + protected DataBoxEdgeManagementClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + BaseUri = baseUri; + } + + /// + /// Initializes a new instance of the DataBoxEdgeManagementClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public DataBoxEdgeManagementClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the DataBoxEdgeManagementClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// HttpClient to be used + /// + /// + /// True: will dispose the provided httpClient on calling DataBoxEdgeManagementClient.Dispose(). False: will not dispose provided httpClient + /// + /// Thrown when a required parameter is null + /// + public DataBoxEdgeManagementClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : this(httpClient, disposeHttpClient) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the DataBoxEdgeManagementClient class. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public DataBoxEdgeManagementClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the DataBoxEdgeManagementClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public DataBoxEdgeManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// Initializes a new instance of the DataBoxEdgeManagementClient class. + /// + /// + /// Optional. The base URI of the service. + /// + /// + /// Required. Credentials needed for the client to connect to Azure. + /// + /// + /// Optional. The http client handler used to handle http transport. + /// + /// + /// Optional. The delegating handlers to add to the http client pipeline. + /// + /// + /// Thrown when a required parameter is null + /// + public DataBoxEdgeManagementClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) + { + if (baseUri == null) + { + throw new System.ArgumentNullException("baseUri"); + } + if (credentials == null) + { + throw new System.ArgumentNullException("credentials"); + } + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) + { + Credentials.InitializeServiceClient(this); + } + } + + /// + /// An optional partial-method to perform custom initialization. + /// + partial void CustomInitialize(); + /// + /// Initializes client properties. + /// + private void Initialize() + { + Operations = new Operations(this); + Devices = new DevicesOperations(this); + Alerts = new AlertsOperations(this); + BandwidthSchedules = new BandwidthSchedulesOperations(this); + Jobs = new JobsOperations(this); + Nodes = new NodesOperations(this); + OperationsStatus = new OperationsStatus(this); + Orders = new OrdersOperations(this); + Roles = new RolesOperations(this); + Shares = new SharesOperations(this); + StorageAccountCredentials = new StorageAccountCredentialsOperations(this); + StorageAccounts = new StorageAccountsOperations(this); + Containers = new ContainersOperations(this); + Triggers = new TriggersOperations(this); + Users = new UsersOperations(this); + Skus = new SkusOperations(this); + BaseUri = new System.Uri("https://management.azure.com"); + ApiVersion = "2019-08-01"; + AcceptLanguage = "en-US"; + LongRunningOperationRetryTimeout = 30; + GenerateClientRequestId = true; + SerializationSettings = new JsonSerializerSettings + { + Formatting = Newtonsoft.Json.Formatting.Indented, + DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List + { + new Iso8601TimeSpanConverter() + } + }; + SerializationSettings.Converters.Add(new TransformationJsonConverter()); + DeserializationSettings = new JsonSerializerSettings + { + DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, + DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, + NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, + ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List + { + new Iso8601TimeSpanConverter() + } + }; + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("kind")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("kind")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("kind")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("kind")); + CustomInitialize(); + DeserializationSettings.Converters.Add(new TransformationJsonConverter()); + DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); + } + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/DevicesOperations.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/DevicesOperations.cs new file mode 100644 index 0000000000000..96256326d6548 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/DevicesOperations.cs @@ -0,0 +1,3242 @@ +// +// 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.DataBoxEdge +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// DevicesOperations operations. + /// + internal partial class DevicesOperations : IServiceOperations, IDevicesOperations + { + /// + /// Initializes a new instance of the DevicesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal DevicesOperations(DataBoxEdgeManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the DataBoxEdgeManagementClient + /// + public DataBoxEdgeManagementClient Client { get; private set; } + + /// + /// Gets all the Data Box Edge/Data Box Gateway devices in a subscription. + /// + /// + /// Specify $expand=details to populate additional fields related to the + /// resource or Specify $skipToken=<token> to populate the next page in + /// the list. + /// + /// + /// 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>> ListBySubscriptionWithHttpMessagesAsync(string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("expand", expand); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (expand != null) + { + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); + } + 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("GET"); + _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; + } + + /// + /// Gets all the Data Box Edge/Data Box Gateway devices in a resource group. + /// + /// + /// The resource group name. + /// + /// + /// Specify $expand=details to populate additional fields related to the + /// resource or Specify $skipToken=<token> to populate the next page in + /// the list. + /// + /// + /// 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>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string expand = default(string), 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 (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("expand", expand); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", 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.DataBoxEdge/dataBoxEdgeDevices").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (expand != null) + { + _queryParameters.Add(string.Format("$expand={0}", System.Uri.EscapeDataString(expand))); + } + 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("GET"); + _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; + } + + /// + /// Gets the properties of the Data Box Edge/Data Box Gateway device. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// 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> GetWithHttpMessagesAsync(string deviceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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("GET"); + _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; + } + + /// + /// Creates or updates a Data Box Edge/Data Box Gateway resource. + /// + /// + /// The device name. + /// + /// + /// The resource object. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string deviceName, DataBoxEdgeDevice dataBoxEdgeDevice, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(deviceName, dataBoxEdgeDevice, resourceGroupName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes the Data Box Edge/Data Box Gateway device. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string deviceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(deviceName, resourceGroupName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Modifies a Data Box Edge/Data Box Gateway resource. + /// + /// + /// The device name. + /// + /// + /// The resource parameters. + /// + /// + /// The resource group name. + /// + /// + /// 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> UpdateWithHttpMessagesAsync(string deviceName, DataBoxEdgeDevicePatch parameters, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Update", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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("PATCH"); + _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(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, 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; + } + + /// + /// Downloads the updates on a Data Box Edge/Data Box Gateway device. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DownloadUpdatesWithHttpMessagesAsync(string deviceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDownloadUpdatesWithHttpMessagesAsync(deviceName, resourceGroupName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets additional information for the specified Data Box Edge/Data Box + /// Gateway device. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// 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> GetExtendedInformationWithHttpMessagesAsync(string deviceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetExtendedInformation", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/getExtendedInformation").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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; + // 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; + } + + /// + /// Installs the updates on the Data Box Edge/Data Box Gateway device. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task InstallUpdatesWithHttpMessagesAsync(string deviceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginInstallUpdatesWithHttpMessagesAsync(deviceName, resourceGroupName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the network settings of the specified Data Box Edge/Data Box Gateway + /// device. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// 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> GetNetworkSettingsWithHttpMessagesAsync(string deviceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetNetworkSettings", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/networkSettings/default").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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("GET"); + _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; + } + + /// + /// Scans for updates on a Data Box Edge/Data Box Gateway device. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task ScanForUpdatesWithHttpMessagesAsync(string deviceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginScanForUpdatesWithHttpMessagesAsync(deviceName, resourceGroupName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Updates the security settings on a Data Box Edge/Data Box Gateway device. + /// + /// + /// The device name. + /// + /// + /// The security settings. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task CreateOrUpdateSecuritySettingsWithHttpMessagesAsync(string deviceName, SecuritySettings securitySettings, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginCreateOrUpdateSecuritySettingsWithHttpMessagesAsync(deviceName, securitySettings, resourceGroupName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets information about the availability of updates based on the last scan + /// of the device. It also gets information about any ongoing download or + /// install jobs on the device. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// 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> GetUpdateSummaryWithHttpMessagesAsync(string deviceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetUpdateSummary", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/updateSummary/default").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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("GET"); + _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; + } + + /// + /// Uploads registration certificate for the device. + /// + /// + /// The device name. + /// + /// + /// The upload certificate request. + /// + /// + /// The resource group name. + /// + /// + /// 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> UploadCertificateWithHttpMessagesAsync(string deviceName, UploadCertificateRequest parameters, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "UploadCertificate", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/uploadCertificate").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, 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; + } + + /// + /// Creates or updates a Data Box Edge/Data Box Gateway resource. + /// + /// + /// The device name. + /// + /// + /// The resource object. + /// + /// + /// The resource group name. + /// + /// + /// 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> BeginCreateOrUpdateWithHttpMessagesAsync(string deviceName, DataBoxEdgeDevice dataBoxEdgeDevice, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (dataBoxEdgeDevice == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "dataBoxEdgeDevice"); + } + if (dataBoxEdgeDevice != null) + { + dataBoxEdgeDevice.Validate(); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("dataBoxEdgeDevice", dataBoxEdgeDevice); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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("PUT"); + _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(dataBoxEdgeDevice != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(dataBoxEdgeDevice, 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; + } + + /// + /// Deletes the Data Box Edge/Data Box Gateway device. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 BeginDeleteWithHttpMessagesAsync(string deviceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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("DELETE"); + _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 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + 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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Downloads the updates on a Data Box Edge/Data Box Gateway device. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 BeginDownloadUpdatesWithHttpMessagesAsync(string deviceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDownloadUpdates", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/downloadUpdates").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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; + // 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 && (int)_statusCode != 202) + { + 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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Installs the updates on the Data Box Edge/Data Box Gateway device. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 BeginInstallUpdatesWithHttpMessagesAsync(string deviceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginInstallUpdates", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/installUpdates").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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; + // 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 && (int)_statusCode != 202) + { + 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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Scans for updates on a Data Box Edge/Data Box Gateway device. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 BeginScanForUpdatesWithHttpMessagesAsync(string deviceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginScanForUpdates", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/scanForUpdates").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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; + // 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 && (int)_statusCode != 202) + { + 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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Updates the security settings on a Data Box Edge/Data Box Gateway device. + /// + /// + /// The device name. + /// + /// + /// The security settings. + /// + /// + /// The resource group name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 BeginCreateOrUpdateSecuritySettingsWithHttpMessagesAsync(string deviceName, SecuritySettings securitySettings, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (securitySettings == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "securitySettings"); + } + if (securitySettings != null) + { + securitySettings.Validate(); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("securitySettings", securitySettings); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdateSecuritySettings", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/securitySettings/default/update").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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(securitySettings != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(securitySettings, 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 != 202 && (int)_statusCode != 204) + { + 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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets all the Data Box Edge/Data Box Gateway devices in a subscription. + /// + /// + /// 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>> ListBySubscriptionNextWithHttpMessagesAsync(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, "ListBySubscriptionNext", 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("GET"); + _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; + } + + /// + /// Gets all the Data Box Edge/Data Box Gateway devices in a resource group. + /// + /// + /// 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>> ListByResourceGroupNextWithHttpMessagesAsync(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, "ListByResourceGroupNext", 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("GET"); + _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/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/DevicesOperationsExtensions.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/DevicesOperationsExtensions.cs new file mode 100644 index 0000000000000..83cca91facd6f --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/DevicesOperationsExtensions.cs @@ -0,0 +1,909 @@ +// +// 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.DataBoxEdge +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for DevicesOperations. + /// + public static partial class DevicesOperationsExtensions + { + /// + /// Gets all the Data Box Edge/Data Box Gateway devices in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Specify $expand=details to populate additional fields related to the + /// resource or Specify $skipToken=<token> to populate the next page in + /// the list. + /// + public static IPage ListBySubscription(this IDevicesOperations operations, string expand = default(string)) + { + return operations.ListBySubscriptionAsync(expand).GetAwaiter().GetResult(); + } + + /// + /// Gets all the Data Box Edge/Data Box Gateway devices in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Specify $expand=details to populate additional fields related to the + /// resource or Specify $skipToken=<token> to populate the next page in + /// the list. + /// + /// + /// The cancellation token. + /// + public static async Task> ListBySubscriptionAsync(this IDevicesOperations operations, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets all the Data Box Edge/Data Box Gateway devices in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// Specify $expand=details to populate additional fields related to the + /// resource or Specify $skipToken=<token> to populate the next page in + /// the list. + /// + public static IPage ListByResourceGroup(this IDevicesOperations operations, string resourceGroupName, string expand = default(string)) + { + return operations.ListByResourceGroupAsync(resourceGroupName, expand).GetAwaiter().GetResult(); + } + + /// + /// Gets all the Data Box Edge/Data Box Gateway devices in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The resource group name. + /// + /// + /// Specify $expand=details to populate additional fields related to the + /// resource or Specify $skipToken=<token> to populate the next page in + /// the list. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupAsync(this IDevicesOperations operations, string resourceGroupName, string expand = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, expand, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the properties of the Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + public static DataBoxEdgeDevice Get(this IDevicesOperations operations, string deviceName, string resourceGroupName) + { + return operations.GetAsync(deviceName, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Gets the properties of the Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IDevicesOperations operations, string deviceName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(deviceName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates a Data Box Edge/Data Box Gateway resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource object. + /// + /// + /// The resource group name. + /// + public static DataBoxEdgeDevice CreateOrUpdate(this IDevicesOperations operations, string deviceName, DataBoxEdgeDevice dataBoxEdgeDevice, string resourceGroupName) + { + return operations.CreateOrUpdateAsync(deviceName, dataBoxEdgeDevice, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a Data Box Edge/Data Box Gateway resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource object. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IDevicesOperations operations, string deviceName, DataBoxEdgeDevice dataBoxEdgeDevice, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(deviceName, dataBoxEdgeDevice, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + public static void Delete(this IDevicesOperations operations, string deviceName, string resourceGroupName) + { + operations.DeleteAsync(deviceName, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IDevicesOperations operations, string deviceName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(deviceName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Modifies a Data Box Edge/Data Box Gateway resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource parameters. + /// + /// + /// The resource group name. + /// + public static DataBoxEdgeDevice Update(this IDevicesOperations operations, string deviceName, DataBoxEdgeDevicePatch parameters, string resourceGroupName) + { + return operations.UpdateAsync(deviceName, parameters, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Modifies a Data Box Edge/Data Box Gateway resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource parameters. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IDevicesOperations operations, string deviceName, DataBoxEdgeDevicePatch parameters, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(deviceName, parameters, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Downloads the updates on a Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + public static void DownloadUpdates(this IDevicesOperations operations, string deviceName, string resourceGroupName) + { + operations.DownloadUpdatesAsync(deviceName, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Downloads the updates on a Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task DownloadUpdatesAsync(this IDevicesOperations operations, string deviceName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DownloadUpdatesWithHttpMessagesAsync(deviceName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets additional information for the specified Data Box Edge/Data Box + /// Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + public static DataBoxEdgeDeviceExtendedInfo GetExtendedInformation(this IDevicesOperations operations, string deviceName, string resourceGroupName) + { + return operations.GetExtendedInformationAsync(deviceName, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Gets additional information for the specified Data Box Edge/Data Box + /// Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task GetExtendedInformationAsync(this IDevicesOperations operations, string deviceName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetExtendedInformationWithHttpMessagesAsync(deviceName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Installs the updates on the Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + public static void InstallUpdates(this IDevicesOperations operations, string deviceName, string resourceGroupName) + { + operations.InstallUpdatesAsync(deviceName, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Installs the updates on the Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task InstallUpdatesAsync(this IDevicesOperations operations, string deviceName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.InstallUpdatesWithHttpMessagesAsync(deviceName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets the network settings of the specified Data Box Edge/Data Box Gateway + /// device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + public static NetworkSettings GetNetworkSettings(this IDevicesOperations operations, string deviceName, string resourceGroupName) + { + return operations.GetNetworkSettingsAsync(deviceName, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Gets the network settings of the specified Data Box Edge/Data Box Gateway + /// device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task GetNetworkSettingsAsync(this IDevicesOperations operations, string deviceName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetNetworkSettingsWithHttpMessagesAsync(deviceName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Scans for updates on a Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + public static void ScanForUpdates(this IDevicesOperations operations, string deviceName, string resourceGroupName) + { + operations.ScanForUpdatesAsync(deviceName, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Scans for updates on a Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task ScanForUpdatesAsync(this IDevicesOperations operations, string deviceName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.ScanForUpdatesWithHttpMessagesAsync(deviceName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Updates the security settings on a Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The security settings. + /// + /// + /// The resource group name. + /// + public static void CreateOrUpdateSecuritySettings(this IDevicesOperations operations, string deviceName, SecuritySettings securitySettings, string resourceGroupName) + { + operations.CreateOrUpdateSecuritySettingsAsync(deviceName, securitySettings, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Updates the security settings on a Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The security settings. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateSecuritySettingsAsync(this IDevicesOperations operations, string deviceName, SecuritySettings securitySettings, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.CreateOrUpdateSecuritySettingsWithHttpMessagesAsync(deviceName, securitySettings, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets information about the availability of updates based on the last scan + /// of the device. It also gets information about any ongoing download or + /// install jobs on the device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + public static UpdateSummary GetUpdateSummary(this IDevicesOperations operations, string deviceName, string resourceGroupName) + { + return operations.GetUpdateSummaryAsync(deviceName, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Gets information about the availability of updates based on the last scan + /// of the device. It also gets information about any ongoing download or + /// install jobs on the device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task GetUpdateSummaryAsync(this IDevicesOperations operations, string deviceName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetUpdateSummaryWithHttpMessagesAsync(deviceName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Uploads registration certificate for the device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The upload certificate request. + /// + /// + /// The resource group name. + /// + public static UploadCertificateResponse UploadCertificate(this IDevicesOperations operations, string deviceName, UploadCertificateRequest parameters, string resourceGroupName) + { + return operations.UploadCertificateAsync(deviceName, parameters, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Uploads registration certificate for the device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The upload certificate request. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task UploadCertificateAsync(this IDevicesOperations operations, string deviceName, UploadCertificateRequest parameters, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UploadCertificateWithHttpMessagesAsync(deviceName, parameters, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates a Data Box Edge/Data Box Gateway resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource object. + /// + /// + /// The resource group name. + /// + public static DataBoxEdgeDevice BeginCreateOrUpdate(this IDevicesOperations operations, string deviceName, DataBoxEdgeDevice dataBoxEdgeDevice, string resourceGroupName) + { + return operations.BeginCreateOrUpdateAsync(deviceName, dataBoxEdgeDevice, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a Data Box Edge/Data Box Gateway resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource object. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this IDevicesOperations operations, string deviceName, DataBoxEdgeDevice dataBoxEdgeDevice, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(deviceName, dataBoxEdgeDevice, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + public static void BeginDelete(this IDevicesOperations operations, string deviceName, string resourceGroupName) + { + operations.BeginDeleteAsync(deviceName, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IDevicesOperations operations, string deviceName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(deviceName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Downloads the updates on a Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + public static void BeginDownloadUpdates(this IDevicesOperations operations, string deviceName, string resourceGroupName) + { + operations.BeginDownloadUpdatesAsync(deviceName, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Downloads the updates on a Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDownloadUpdatesAsync(this IDevicesOperations operations, string deviceName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDownloadUpdatesWithHttpMessagesAsync(deviceName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Installs the updates on the Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + public static void BeginInstallUpdates(this IDevicesOperations operations, string deviceName, string resourceGroupName) + { + operations.BeginInstallUpdatesAsync(deviceName, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Installs the updates on the Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task BeginInstallUpdatesAsync(this IDevicesOperations operations, string deviceName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginInstallUpdatesWithHttpMessagesAsync(deviceName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Scans for updates on a Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + public static void BeginScanForUpdates(this IDevicesOperations operations, string deviceName, string resourceGroupName) + { + operations.BeginScanForUpdatesAsync(deviceName, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Scans for updates on a Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task BeginScanForUpdatesAsync(this IDevicesOperations operations, string deviceName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginScanForUpdatesWithHttpMessagesAsync(deviceName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Updates the security settings on a Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The security settings. + /// + /// + /// The resource group name. + /// + public static void BeginCreateOrUpdateSecuritySettings(this IDevicesOperations operations, string deviceName, SecuritySettings securitySettings, string resourceGroupName) + { + operations.BeginCreateOrUpdateSecuritySettingsAsync(deviceName, securitySettings, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Updates the security settings on a Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The security settings. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateSecuritySettingsAsync(this IDevicesOperations operations, string deviceName, SecuritySettings securitySettings, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginCreateOrUpdateSecuritySettingsWithHttpMessagesAsync(deviceName, securitySettings, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets all the Data Box Edge/Data Box Gateway devices in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListBySubscriptionNext(this IDevicesOperations operations, string nextPageLink) + { + return operations.ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all the Data Box Edge/Data Box Gateway devices in a subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListBySubscriptionNextAsync(this IDevicesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets all the Data Box Edge/Data Box Gateway devices in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByResourceGroupNext(this IDevicesOperations operations, string nextPageLink) + { + return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all the Data Box Edge/Data Box Gateway devices in a resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupNextAsync(this IDevicesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/IAlertsOperations.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/IAlertsOperations.cs new file mode 100644 index 0000000000000..8a5d880af7a58 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/IAlertsOperations.cs @@ -0,0 +1,102 @@ +// +// 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.DataBoxEdge +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// AlertsOperations operations. + /// + public partial interface IAlertsOperations + { + /// + /// Gets all the alerts for a Data Box Edge/Data Box Gateway device. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// 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>> ListByDataBoxEdgeDeviceWithHttpMessagesAsync(string deviceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets an alert by name. + /// + /// + /// The device name. + /// + /// + /// The alert name. + /// + /// + /// The resource group name. + /// + /// + /// 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> GetWithHttpMessagesAsync(string deviceName, string name, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets all the alerts for a Data Box Edge/Data Box Gateway device. + /// + /// + /// 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>> ListByDataBoxEdgeDeviceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/IBandwidthSchedulesOperations.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/IBandwidthSchedulesOperations.cs new file mode 100644 index 0000000000000..255dddeeca05d --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/IBandwidthSchedulesOperations.cs @@ -0,0 +1,216 @@ +// +// 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.DataBoxEdge +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// BandwidthSchedulesOperations operations. + /// + public partial interface IBandwidthSchedulesOperations + { + /// + /// Gets all the bandwidth schedules for a Data Box Edge/Data Box + /// Gateway device. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// 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>> ListByDataBoxEdgeDeviceWithHttpMessagesAsync(string deviceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the properties of the specified bandwidth schedule. + /// + /// + /// The device name. + /// + /// + /// The bandwidth schedule name. + /// + /// + /// The resource group name. + /// + /// + /// 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> GetWithHttpMessagesAsync(string deviceName, string name, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a bandwidth schedule. + /// + /// + /// The device name. + /// + /// + /// The bandwidth schedule name which needs to be added/updated. + /// + /// + /// The bandwidth schedule to be added or updated. + /// + /// + /// The resource group name. + /// + /// + /// 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> CreateOrUpdateWithHttpMessagesAsync(string deviceName, string name, BandwidthSchedule parameters, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the specified bandwidth schedule. + /// + /// + /// The device name. + /// + /// + /// The bandwidth schedule name. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string deviceName, string name, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a bandwidth schedule. + /// + /// + /// The device name. + /// + /// + /// The bandwidth schedule name which needs to be added/updated. + /// + /// + /// The bandwidth schedule to be added or updated. + /// + /// + /// The resource group name. + /// + /// + /// 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> BeginCreateOrUpdateWithHttpMessagesAsync(string deviceName, string name, BandwidthSchedule parameters, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the specified bandwidth schedule. + /// + /// + /// The device name. + /// + /// + /// The bandwidth schedule name. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string deviceName, string name, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets all the bandwidth schedules for a Data Box Edge/Data Box + /// Gateway device. + /// + /// + /// 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>> ListByDataBoxEdgeDeviceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/IContainersOperations.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/IContainersOperations.cs new file mode 100644 index 0000000000000..450cb2bc269bd --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/IContainersOperations.cs @@ -0,0 +1,292 @@ +// +// 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.DataBoxEdge +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ContainersOperations operations. + /// + public partial interface IContainersOperations + { + /// + /// Lists all the containers of a storage Account in a Data Box + /// Edge/Data Box Gateway device. + /// + /// + /// The device name. + /// + /// + /// The storage Account name. + /// + /// + /// The resource group name. + /// + /// + /// 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>> ListByStorageAccountWithHttpMessagesAsync(string deviceName, string storageAccountName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a container by name. + /// + /// + /// The device name. + /// + /// + /// The Storage Account Name + /// + /// + /// The container Name + /// + /// + /// The resource group name. + /// + /// + /// 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> GetWithHttpMessagesAsync(string deviceName, string storageAccountName, string containerName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates a new container or updates an existing container on the + /// device. + /// + /// + /// The device name. + /// + /// + /// The Storage Account Name + /// + /// + /// The container name. + /// + /// + /// The container properties. + /// + /// + /// The resource group name. + /// + /// + /// 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> CreateOrUpdateWithHttpMessagesAsync(string deviceName, string storageAccountName, string containerName, Container container, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the container on the Data Box Edge/Data Box Gateway device. + /// + /// + /// The device name. + /// + /// + /// The Storage Account Name + /// + /// + /// The container name. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string deviceName, string storageAccountName, string containerName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Refreshes the container metadata with the data from the cloud. + /// + /// + /// The device name. + /// + /// + /// The Storage Account Name + /// + /// + /// The container name. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task RefreshWithHttpMessagesAsync(string deviceName, string storageAccountName, string containerName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates a new container or updates an existing container on the + /// device. + /// + /// + /// The device name. + /// + /// + /// The Storage Account Name + /// + /// + /// The container name. + /// + /// + /// The container properties. + /// + /// + /// The resource group name. + /// + /// + /// 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> BeginCreateOrUpdateWithHttpMessagesAsync(string deviceName, string storageAccountName, string containerName, Container container, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the container on the Data Box Edge/Data Box Gateway device. + /// + /// + /// The device name. + /// + /// + /// The Storage Account Name + /// + /// + /// The container name. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string deviceName, string storageAccountName, string containerName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Refreshes the container metadata with the data from the cloud. + /// + /// + /// The device name. + /// + /// + /// The Storage Account Name + /// + /// + /// The container name. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginRefreshWithHttpMessagesAsync(string deviceName, string storageAccountName, string containerName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all the containers of a storage Account in a Data Box + /// Edge/Data Box Gateway device. + /// + /// + /// 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>> ListByStorageAccountNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/IDataBoxEdgeManagementClient.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/IDataBoxEdgeManagementClient.cs new file mode 100644 index 0000000000000..4ae3160fe46e3 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/IDataBoxEdgeManagementClient.cs @@ -0,0 +1,152 @@ +// +// 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.DataBoxEdge +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + + /// + /// + public partial interface IDataBoxEdgeManagementClient : System.IDisposable + { + /// + /// The base URI of the service. + /// + System.Uri BaseUri { get; set; } + + /// + /// Gets or sets json serialization settings. + /// + JsonSerializerSettings SerializationSettings { get; } + + /// + /// Gets or sets json deserialization settings. + /// + JsonSerializerSettings DeserializationSettings { get; } + + /// + /// Credentials needed for the client to connect to Azure. + /// + ServiceClientCredentials Credentials { get; } + + /// + /// The API version. + /// + string ApiVersion { get; } + + /// + /// The subscription ID. + /// + string SubscriptionId { get; set; } + + /// + /// The preferred language for the response. + /// + string AcceptLanguage { get; set; } + + /// + /// The retry timeout in seconds for Long Running Operations. Default + /// value is 30. + /// + int? LongRunningOperationRetryTimeout { get; set; } + + /// + /// Whether a unique x-ms-client-request-id should be generated. When + /// set to true a unique x-ms-client-request-id value is generated and + /// included in each request. Default is true. + /// + bool? GenerateClientRequestId { get; set; } + + + /// + /// Gets the IOperations. + /// + IOperations Operations { get; } + + /// + /// Gets the IDevicesOperations. + /// + IDevicesOperations Devices { get; } + + /// + /// Gets the IAlertsOperations. + /// + IAlertsOperations Alerts { get; } + + /// + /// Gets the IBandwidthSchedulesOperations. + /// + IBandwidthSchedulesOperations BandwidthSchedules { get; } + + /// + /// Gets the IJobsOperations. + /// + IJobsOperations Jobs { get; } + + /// + /// Gets the INodesOperations. + /// + INodesOperations Nodes { get; } + + /// + /// Gets the IOperationsStatus. + /// + IOperationsStatus OperationsStatus { get; } + + /// + /// Gets the IOrdersOperations. + /// + IOrdersOperations Orders { get; } + + /// + /// Gets the IRolesOperations. + /// + IRolesOperations Roles { get; } + + /// + /// Gets the ISharesOperations. + /// + ISharesOperations Shares { get; } + + /// + /// Gets the IStorageAccountCredentialsOperations. + /// + IStorageAccountCredentialsOperations StorageAccountCredentials { get; } + + /// + /// Gets the IStorageAccountsOperations. + /// + IStorageAccountsOperations StorageAccounts { get; } + + /// + /// Gets the IContainersOperations. + /// + IContainersOperations Containers { get; } + + /// + /// Gets the ITriggersOperations. + /// + ITriggersOperations Triggers { get; } + + /// + /// Gets the IUsersOperations. + /// + IUsersOperations Users { get; } + + /// + /// Gets the ISkusOperations. + /// + ISkusOperations Skus { get; } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/IDevicesOperations.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/IDevicesOperations.cs new file mode 100644 index 0000000000000..851a1c478945e --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/IDevicesOperations.cs @@ -0,0 +1,570 @@ +// +// 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.DataBoxEdge +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// DevicesOperations operations. + /// + public partial interface IDevicesOperations + { + /// + /// Gets all the Data Box Edge/Data Box Gateway devices in a + /// subscription. + /// + /// + /// Specify $expand=details to populate additional fields related to + /// the resource or Specify $skipToken=<token> to populate the + /// next page in the list. + /// + /// + /// 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>> ListBySubscriptionWithHttpMessagesAsync(string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets all the Data Box Edge/Data Box Gateway devices in a resource + /// group. + /// + /// + /// The resource group name. + /// + /// + /// Specify $expand=details to populate additional fields related to + /// the resource or Specify $skipToken=<token> to populate the + /// next page in the list. + /// + /// + /// 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>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, string expand = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the properties of the Data Box Edge/Data Box Gateway device. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// 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> GetWithHttpMessagesAsync(string deviceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a Data Box Edge/Data Box Gateway resource. + /// + /// + /// The device name. + /// + /// + /// The resource object. + /// + /// + /// The resource group name. + /// + /// + /// 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> CreateOrUpdateWithHttpMessagesAsync(string deviceName, DataBoxEdgeDevice dataBoxEdgeDevice, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the Data Box Edge/Data Box Gateway device. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string deviceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Modifies a Data Box Edge/Data Box Gateway resource. + /// + /// + /// The device name. + /// + /// + /// The resource parameters. + /// + /// + /// The resource group name. + /// + /// + /// 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> UpdateWithHttpMessagesAsync(string deviceName, DataBoxEdgeDevicePatch parameters, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Downloads the updates on a Data Box Edge/Data Box Gateway device. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DownloadUpdatesWithHttpMessagesAsync(string deviceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets additional information for the specified Data Box Edge/Data + /// Box Gateway device. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// 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> GetExtendedInformationWithHttpMessagesAsync(string deviceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Installs the updates on the Data Box Edge/Data Box Gateway device. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task InstallUpdatesWithHttpMessagesAsync(string deviceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the network settings of the specified Data Box Edge/Data Box + /// Gateway device. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// 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> GetNetworkSettingsWithHttpMessagesAsync(string deviceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Scans for updates on a Data Box Edge/Data Box Gateway device. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task ScanForUpdatesWithHttpMessagesAsync(string deviceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates the security settings on a Data Box Edge/Data Box Gateway + /// device. + /// + /// + /// The device name. + /// + /// + /// The security settings. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task CreateOrUpdateSecuritySettingsWithHttpMessagesAsync(string deviceName, SecuritySettings securitySettings, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets information about the availability of updates based on the + /// last scan of the device. It also gets information about any ongoing + /// download or install jobs on the device. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// 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> GetUpdateSummaryWithHttpMessagesAsync(string deviceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Uploads registration certificate for the device. + /// + /// + /// The device name. + /// + /// + /// The upload certificate request. + /// + /// + /// The resource group name. + /// + /// + /// 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> UploadCertificateWithHttpMessagesAsync(string deviceName, UploadCertificateRequest parameters, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a Data Box Edge/Data Box Gateway resource. + /// + /// + /// The device name. + /// + /// + /// The resource object. + /// + /// + /// The resource group name. + /// + /// + /// 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> BeginCreateOrUpdateWithHttpMessagesAsync(string deviceName, DataBoxEdgeDevice dataBoxEdgeDevice, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the Data Box Edge/Data Box Gateway device. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string deviceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Downloads the updates on a Data Box Edge/Data Box Gateway device. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDownloadUpdatesWithHttpMessagesAsync(string deviceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Installs the updates on the Data Box Edge/Data Box Gateway device. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginInstallUpdatesWithHttpMessagesAsync(string deviceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Scans for updates on a Data Box Edge/Data Box Gateway device. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginScanForUpdatesWithHttpMessagesAsync(string deviceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates the security settings on a Data Box Edge/Data Box Gateway + /// device. + /// + /// + /// The device name. + /// + /// + /// The security settings. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginCreateOrUpdateSecuritySettingsWithHttpMessagesAsync(string deviceName, SecuritySettings securitySettings, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets all the Data Box Edge/Data Box Gateway devices in a + /// subscription. + /// + /// + /// 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>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets all the Data Box Edge/Data Box Gateway devices in a resource + /// group. + /// + /// + /// 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>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/IJobsOperations.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/IJobsOperations.cs new file mode 100644 index 0000000000000..be0a5e593ee74 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/IJobsOperations.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.DataBoxEdge +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// JobsOperations operations. + /// + public partial interface IJobsOperations + { + /// + /// Gets the details of a specified job on a Data Box Edge/Data Box + /// Gateway device. + /// + /// + /// The device name. + /// + /// + /// The job name. + /// + /// + /// The resource group name. + /// + /// + /// 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> GetWithHttpMessagesAsync(string deviceName, string name, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/INodesOperations.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/INodesOperations.cs new file mode 100644 index 0000000000000..e43305b38d369 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/INodesOperations.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.DataBoxEdge +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// NodesOperations operations. + /// + public partial interface INodesOperations + { + /// + /// Gets all the nodes currently configured under this Data Box Edge + /// device + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// 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>> ListByDataBoxEdgeDeviceWithHttpMessagesAsync(string deviceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/IOperations.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/IOperations.cs new file mode 100644 index 0000000000000..a67f11bfd0acd --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/IOperations.cs @@ -0,0 +1,68 @@ +// +// 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.DataBoxEdge +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Operations operations. + /// + public partial interface IOperations + { + /// + /// List all the supported operations. + /// + /// + /// 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>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List all the supported operations. + /// + /// + /// 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/IOperationsStatus.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/IOperationsStatus.cs new file mode 100644 index 0000000000000..71c79c377e2ae --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/IOperationsStatus.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.DataBoxEdge +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// OperationsStatus operations. + /// + public partial interface IOperationsStatus + { + /// + /// Gets the details of a specified job on a Data Box Edge/Data Box + /// Gateway device. + /// + /// + /// The device name. + /// + /// + /// The job name. + /// + /// + /// The resource group name. + /// + /// + /// 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> GetWithHttpMessagesAsync(string deviceName, string name, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/IOrdersOperations.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/IOrdersOperations.cs new file mode 100644 index 0000000000000..0fe14db086ba1 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/IOrdersOperations.cs @@ -0,0 +1,201 @@ +// +// 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.DataBoxEdge +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// OrdersOperations operations. + /// + public partial interface IOrdersOperations + { + /// + /// Lists all the orders related to a Data Box Edge/Data Box Gateway + /// device. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// 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>> ListByDataBoxEdgeDeviceWithHttpMessagesAsync(string deviceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a specific order by name. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// 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> GetWithHttpMessagesAsync(string deviceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates an order. + /// + /// + /// The order details of a device. + /// + /// + /// The order to be created or updated. + /// + /// + /// The resource group name. + /// + /// + /// 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> CreateOrUpdateWithHttpMessagesAsync(string deviceName, Order order, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the order related to the device. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string deviceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates an order. + /// + /// + /// The order details of a device. + /// + /// + /// The order to be created or updated. + /// + /// + /// The resource group name. + /// + /// + /// 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> BeginCreateOrUpdateWithHttpMessagesAsync(string deviceName, Order order, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the order related to the device. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string deviceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all the orders related to a Data Box Edge/Data Box Gateway + /// device. + /// + /// + /// 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>> ListByDataBoxEdgeDeviceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/IRolesOperations.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/IRolesOperations.cs new file mode 100644 index 0000000000000..fd01f3b6ab703 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/IRolesOperations.cs @@ -0,0 +1,216 @@ +// +// 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.DataBoxEdge +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// RolesOperations operations. + /// + public partial interface IRolesOperations + { + /// + /// Lists all the roles configured in a Data Box Edge/Data Box Gateway + /// device. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// 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>> ListByDataBoxEdgeDeviceWithHttpMessagesAsync(string deviceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a specific role by name. + /// + /// + /// The device name. + /// + /// + /// The role name. + /// + /// + /// The resource group name. + /// + /// + /// 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> GetWithHttpMessagesAsync(string deviceName, string name, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create or update a role. + /// + /// + /// The device name. + /// + /// + /// The role name. + /// + /// + /// The role properties. + /// + /// + /// The resource group name. + /// + /// + /// 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> CreateOrUpdateWithHttpMessagesAsync(string deviceName, string name, Role role, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the role on the device. + /// + /// + /// The device name. + /// + /// + /// The role name. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string deviceName, string name, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create or update a role. + /// + /// + /// The device name. + /// + /// + /// The role name. + /// + /// + /// The role properties. + /// + /// + /// The resource group name. + /// + /// + /// 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> BeginCreateOrUpdateWithHttpMessagesAsync(string deviceName, string name, Role role, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the role on the device. + /// + /// + /// The device name. + /// + /// + /// The role name. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string deviceName, string name, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all the roles configured in a Data Box Edge/Data Box Gateway + /// device. + /// + /// + /// 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>> ListByDataBoxEdgeDeviceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/ISharesOperations.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/ISharesOperations.cs new file mode 100644 index 0000000000000..0b84ecca1c7cc --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/ISharesOperations.cs @@ -0,0 +1,264 @@ +// +// 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.DataBoxEdge +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// SharesOperations operations. + /// + public partial interface ISharesOperations + { + /// + /// Lists all the shares in a Data Box Edge/Data Box Gateway device. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// 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>> ListByDataBoxEdgeDeviceWithHttpMessagesAsync(string deviceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a share by name. + /// + /// + /// The device name. + /// + /// + /// The share name. + /// + /// + /// The resource group name. + /// + /// + /// 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> GetWithHttpMessagesAsync(string deviceName, string name, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates a new share or updates an existing share on the device. + /// + /// + /// The device name. + /// + /// + /// The share name. + /// + /// + /// The share properties. + /// + /// + /// The resource group name. + /// + /// + /// 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> CreateOrUpdateWithHttpMessagesAsync(string deviceName, string name, Share share, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the share on the Data Box Edge/Data Box Gateway device. + /// + /// + /// The device name. + /// + /// + /// The share name. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string deviceName, string name, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Refreshes the share metadata with the data from the cloud. + /// + /// + /// The device name. + /// + /// + /// The share name. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task RefreshWithHttpMessagesAsync(string deviceName, string name, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates a new share or updates an existing share on the device. + /// + /// + /// The device name. + /// + /// + /// The share name. + /// + /// + /// The share properties. + /// + /// + /// The resource group name. + /// + /// + /// 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> BeginCreateOrUpdateWithHttpMessagesAsync(string deviceName, string name, Share share, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the share on the Data Box Edge/Data Box Gateway device. + /// + /// + /// The device name. + /// + /// + /// The share name. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string deviceName, string name, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Refreshes the share metadata with the data from the cloud. + /// + /// + /// The device name. + /// + /// + /// The share name. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginRefreshWithHttpMessagesAsync(string deviceName, string name, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all the shares in a Data Box Edge/Data Box Gateway device. + /// + /// + /// 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>> ListByDataBoxEdgeDeviceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/ISkusOperations.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/ISkusOperations.cs new file mode 100644 index 0000000000000..05e60533fdb5d --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/ISkusOperations.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.DataBoxEdge +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// SkusOperations operations. + /// + public partial interface ISkusOperations + { + /// + /// List all the available Skus in the region and information related + /// to them + /// + /// + /// Specify $filter='location eq <location>' to filter on + /// location. + /// + /// + /// 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>> ListWithHttpMessagesAsync(string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/IStorageAccountCredentialsOperations.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/IStorageAccountCredentialsOperations.cs new file mode 100644 index 0000000000000..c384edc851b20 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/IStorageAccountCredentialsOperations.cs @@ -0,0 +1,216 @@ +// +// 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.DataBoxEdge +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// StorageAccountCredentialsOperations operations. + /// + public partial interface IStorageAccountCredentialsOperations + { + /// + /// Gets all the storage account credentials in a Data Box Edge/Data + /// Box Gateway device. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// 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>> ListByDataBoxEdgeDeviceWithHttpMessagesAsync(string deviceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the properties of the specified storage account credential. + /// + /// + /// The device name. + /// + /// + /// The storage account credential name. + /// + /// + /// The resource group name. + /// + /// + /// 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> GetWithHttpMessagesAsync(string deviceName, string name, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates the storage account credential. + /// + /// + /// The device name. + /// + /// + /// The storage account credential name. + /// + /// + /// The storage account credential. + /// + /// + /// The resource group name. + /// + /// + /// 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> CreateOrUpdateWithHttpMessagesAsync(string deviceName, string name, StorageAccountCredential storageAccountCredential, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the storage account credential. + /// + /// + /// The device name. + /// + /// + /// The storage account credential name. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string deviceName, string name, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates the storage account credential. + /// + /// + /// The device name. + /// + /// + /// The storage account credential name. + /// + /// + /// The storage account credential. + /// + /// + /// The resource group name. + /// + /// + /// 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> BeginCreateOrUpdateWithHttpMessagesAsync(string deviceName, string name, StorageAccountCredential storageAccountCredential, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the storage account credential. + /// + /// + /// The device name. + /// + /// + /// The storage account credential name. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string deviceName, string name, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets all the storage account credentials in a Data Box Edge/Data + /// Box Gateway device. + /// + /// + /// 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>> ListByDataBoxEdgeDeviceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/IStorageAccountsOperations.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/IStorageAccountsOperations.cs new file mode 100644 index 0000000000000..97b49edb5a412 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/IStorageAccountsOperations.cs @@ -0,0 +1,220 @@ +// +// 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.DataBoxEdge +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// StorageAccountsOperations operations. + /// + public partial interface IStorageAccountsOperations + { + /// + /// Lists all the storage accounts in a Data Box Edge/Data Box Gateway + /// device. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// 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>> ListByDataBoxEdgeDeviceWithHttpMessagesAsync(string deviceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a StorageAccount by name. + /// + /// + /// The device name. + /// + /// + /// The storage account name. + /// + /// + /// The resource group name. + /// + /// + /// 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> GetWithHttpMessagesAsync(string deviceName, string storageAccountName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates a new StorageAccount or updates an existing StorageAccount + /// on the device. + /// + /// + /// The device name. + /// + /// + /// The StorageAccount name. + /// + /// + /// The StorageAccount properties. + /// + /// + /// The resource group name. + /// + /// + /// 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> CreateOrUpdateWithHttpMessagesAsync(string deviceName, string storageAccountName, StorageAccount storageAccount, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the StorageAccount on the Data Box Edge/Data Box Gateway + /// device. + /// + /// + /// The device name. + /// + /// + /// The StorageAccount name. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string deviceName, string storageAccountName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates a new StorageAccount or updates an existing StorageAccount + /// on the device. + /// + /// + /// The device name. + /// + /// + /// The StorageAccount name. + /// + /// + /// The StorageAccount properties. + /// + /// + /// The resource group name. + /// + /// + /// 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> BeginCreateOrUpdateWithHttpMessagesAsync(string deviceName, string storageAccountName, StorageAccount storageAccount, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the StorageAccount on the Data Box Edge/Data Box Gateway + /// device. + /// + /// + /// The device name. + /// + /// + /// The StorageAccount name. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string deviceName, string storageAccountName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all the storage accounts in a Data Box Edge/Data Box Gateway + /// device. + /// + /// + /// 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>> ListByDataBoxEdgeDeviceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/ITriggersOperations.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/ITriggersOperations.cs new file mode 100644 index 0000000000000..25dadd8039ebf --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/ITriggersOperations.cs @@ -0,0 +1,218 @@ +// +// 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.DataBoxEdge +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// TriggersOperations operations. + /// + public partial interface ITriggersOperations + { + /// + /// Lists all the triggers configured in the device. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// Specify $filter='CustomContextTag eq <tag>' to filter on + /// custom context tag property + /// + /// + /// 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>> ListByDataBoxEdgeDeviceWithHttpMessagesAsync(string deviceName, string resourceGroupName, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Get a specific trigger by name. + /// + /// + /// The device name. + /// + /// + /// The trigger name. + /// + /// + /// The resource group name. + /// + /// + /// 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> GetWithHttpMessagesAsync(string deviceName, string name, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a trigger. + /// + /// + /// Creates or updates a trigger + /// + /// + /// The trigger name. + /// + /// + /// The trigger. + /// + /// + /// The resource group name. + /// + /// + /// 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> CreateOrUpdateWithHttpMessagesAsync(string deviceName, string name, Trigger trigger, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the trigger on the gateway device. + /// + /// + /// The device name. + /// + /// + /// The trigger name. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string deviceName, string name, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a trigger. + /// + /// + /// Creates or updates a trigger + /// + /// + /// The trigger name. + /// + /// + /// The trigger. + /// + /// + /// The resource group name. + /// + /// + /// 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> BeginCreateOrUpdateWithHttpMessagesAsync(string deviceName, string name, Trigger trigger, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the trigger on the gateway device. + /// + /// + /// The device name. + /// + /// + /// The trigger name. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string deviceName, string name, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists all the triggers configured in the device. + /// + /// + /// 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>> ListByDataBoxEdgeDeviceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/IUsersOperations.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/IUsersOperations.cs new file mode 100644 index 0000000000000..4d4fa9a86d18e --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/IUsersOperations.cs @@ -0,0 +1,222 @@ +// +// 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.DataBoxEdge +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// UsersOperations operations. + /// + public partial interface IUsersOperations + { + /// + /// Gets all the users registered on a Data Box Edge/Data Box Gateway + /// device. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// Specify $filter='UserType eq <type>' to filter on user type + /// property + /// + /// + /// 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>> ListByDataBoxEdgeDeviceWithHttpMessagesAsync(string deviceName, string resourceGroupName, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the properties of the specified user. + /// + /// + /// The device name. + /// + /// + /// The user name. + /// + /// + /// The resource group name. + /// + /// + /// 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> GetWithHttpMessagesAsync(string deviceName, string name, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates a new user or updates an existing user's information on a + /// Data Box Edge/Data Box Gateway device. + /// + /// + /// The device name. + /// + /// + /// The user name. + /// + /// + /// The user details. + /// + /// + /// The resource group name. + /// + /// + /// 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> CreateOrUpdateWithHttpMessagesAsync(string deviceName, string name, User user, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the user on a databox edge/gateway device. + /// + /// + /// The device name. + /// + /// + /// The user name. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string deviceName, string name, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates a new user or updates an existing user's information on a + /// Data Box Edge/Data Box Gateway device. + /// + /// + /// The device name. + /// + /// + /// The user name. + /// + /// + /// The user details. + /// + /// + /// The resource group name. + /// + /// + /// 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> BeginCreateOrUpdateWithHttpMessagesAsync(string deviceName, string name, User user, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes the user on a databox edge/gateway device. + /// + /// + /// The device name. + /// + /// + /// The user name. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string deviceName, string name, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets all the users registered on a Data Box Edge/Data Box Gateway + /// device. + /// + /// + /// 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>> ListByDataBoxEdgeDeviceNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/JobsOperations.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/JobsOperations.cs new file mode 100644 index 0000000000000..10b9a0be3bec8 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/JobsOperations.cs @@ -0,0 +1,260 @@ +// +// 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.DataBoxEdge +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// JobsOperations operations. + /// + internal partial class JobsOperations : IServiceOperations, IJobsOperations + { + /// + /// Initializes a new instance of the JobsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal JobsOperations(DataBoxEdgeManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the DataBoxEdgeManagementClient + /// + public DataBoxEdgeManagementClient Client { get; private set; } + + /// + /// Gets the details of a specified job on a Data Box Edge/Data Box Gateway + /// device. + /// + /// + /// The device name. + /// + /// + /// The job name. + /// + /// + /// The resource group name. + /// + /// + /// 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> GetWithHttpMessagesAsync(string deviceName, string name, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("name", name); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/jobs/{name}").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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("GET"); + _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/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/JobsOperationsExtensions.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/JobsOperationsExtensions.cs new file mode 100644 index 0000000000000..c384e97eedde4 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/JobsOperationsExtensions.cs @@ -0,0 +1,73 @@ +// +// 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.DataBoxEdge +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for JobsOperations. + /// + public static partial class JobsOperationsExtensions + { + /// + /// Gets the details of a specified job on a Data Box Edge/Data Box Gateway + /// device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The job name. + /// + /// + /// The resource group name. + /// + public static Job Get(this IJobsOperations operations, string deviceName, string name, string resourceGroupName) + { + return operations.GetAsync(deviceName, name, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Gets the details of a specified job on a Data Box Edge/Data Box Gateway + /// device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The job name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IJobsOperations operations, string deviceName, string name, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(deviceName, name, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/ARMBaseModel.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/ARMBaseModel.cs new file mode 100644 index 0000000000000..a66700447e3bf --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/ARMBaseModel.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.DataBoxEdge.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Represents the base class for all object models. + /// + public partial class ARMBaseModel : IResource + { + /// + /// Initializes a new instance of the ARMBaseModel class. + /// + public ARMBaseModel() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ARMBaseModel class. + /// + /// The path ID that uniquely identifies the + /// object. + /// The object name. + /// The hierarchical type of the object. + public ARMBaseModel(string id = default(string), string name = default(string), string type = default(string)) + { + Id = id; + Name = name; + Type = type; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the path ID that uniquely identifies the object. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets the object name. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets the hierarchical type of the object. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/AccountType.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/AccountType.cs new file mode 100644 index 0000000000000..ee969337a6fa3 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/AccountType.cs @@ -0,0 +1,22 @@ +// +// 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.DataBoxEdge.Models +{ + + /// + /// Defines values for AccountType. + /// + public static class AccountType + { + public const string GeneralPurposeStorage = "GeneralPurposeStorage"; + public const string BlobStorage = "BlobStorage"; + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/Address.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/Address.cs new file mode 100644 index 0000000000000..17c431ed009ff --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/Address.cs @@ -0,0 +1,129 @@ +// +// 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.DataBoxEdge.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The shipping address of the customer. + /// + public partial class Address + { + /// + /// Initializes a new instance of the Address class. + /// + public Address() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Address class. + /// + /// The address line1. + /// The postal code. + /// The city name. + /// The state name. + /// The country name. + /// The address line2. + /// The address line3. + public Address(string addressLine1, string postalCode, string city, string state, string country, string addressLine2 = default(string), string addressLine3 = default(string)) + { + AddressLine1 = addressLine1; + AddressLine2 = addressLine2; + AddressLine3 = addressLine3; + PostalCode = postalCode; + City = city; + State = state; + Country = country; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the address line1. + /// + [JsonProperty(PropertyName = "addressLine1")] + public string AddressLine1 { get; set; } + + /// + /// Gets or sets the address line2. + /// + [JsonProperty(PropertyName = "addressLine2")] + public string AddressLine2 { get; set; } + + /// + /// Gets or sets the address line3. + /// + [JsonProperty(PropertyName = "addressLine3")] + public string AddressLine3 { get; set; } + + /// + /// Gets or sets the postal code. + /// + [JsonProperty(PropertyName = "postalCode")] + public string PostalCode { get; set; } + + /// + /// Gets or sets the city name. + /// + [JsonProperty(PropertyName = "city")] + public string City { get; set; } + + /// + /// Gets or sets the state name. + /// + [JsonProperty(PropertyName = "state")] + public string State { get; set; } + + /// + /// Gets or sets the country name. + /// + [JsonProperty(PropertyName = "country")] + public string Country { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (AddressLine1 == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "AddressLine1"); + } + if (PostalCode == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "PostalCode"); + } + if (City == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "City"); + } + if (State == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "State"); + } + if (Country == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Country"); + } + } + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/Alert.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/Alert.cs new file mode 100644 index 0000000000000..1ea7af3ae95f7 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/Alert.cs @@ -0,0 +1,112 @@ +// +// 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.DataBoxEdge.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Alert on the data box edge/gateway device. + /// + [Rest.Serialization.JsonTransformation] + public partial class Alert : ARMBaseModel + { + /// + /// Initializes a new instance of the Alert class. + /// + public Alert() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Alert class. + /// + /// The path ID that uniquely identifies the + /// object. + /// The object name. + /// The hierarchical type of the object. + /// Alert title. + /// Alert type. + /// UTC time when the alert + /// appeared. + /// Alert recommendation. + /// Severity of the alert. Possible values + /// include: 'Informational', 'Warning', 'Critical' + /// Error details of the alert. + /// Alert details. + public Alert(string id = default(string), string name = default(string), string type = default(string), string title = default(string), string alertType = default(string), System.DateTime? appearedAtDateTime = default(System.DateTime?), string recommendation = default(string), string severity = default(string), AlertErrorDetails errorDetails = default(AlertErrorDetails), IDictionary detailedInformation = default(IDictionary)) + : base(id, name, type) + { + Title = title; + AlertType = alertType; + AppearedAtDateTime = appearedAtDateTime; + Recommendation = recommendation; + Severity = severity; + ErrorDetails = errorDetails; + DetailedInformation = detailedInformation; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets alert title. + /// + [JsonProperty(PropertyName = "properties.title")] + public string Title { get; private set; } + + /// + /// Gets alert type. + /// + [JsonProperty(PropertyName = "properties.alertType")] + public string AlertType { get; private set; } + + /// + /// Gets UTC time when the alert appeared. + /// + [JsonProperty(PropertyName = "properties.appearedAtDateTime")] + public System.DateTime? AppearedAtDateTime { get; private set; } + + /// + /// Gets alert recommendation. + /// + [JsonProperty(PropertyName = "properties.recommendation")] + public string Recommendation { get; private set; } + + /// + /// Gets severity of the alert. Possible values include: + /// 'Informational', 'Warning', 'Critical' + /// + [JsonProperty(PropertyName = "properties.severity")] + public string Severity { get; private set; } + + /// + /// Gets error details of the alert. + /// + [JsonProperty(PropertyName = "properties.errorDetails")] + public AlertErrorDetails ErrorDetails { get; private set; } + + /// + /// Gets alert details. + /// + [JsonProperty(PropertyName = "properties.detailedInformation")] + public IDictionary DetailedInformation { get; private set; } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/AlertErrorDetails.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/AlertErrorDetails.cs new file mode 100644 index 0000000000000..be99da7ad07be --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/AlertErrorDetails.cs @@ -0,0 +1,67 @@ +// +// 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.DataBoxEdge.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Error details for the alert. + /// + public partial class AlertErrorDetails + { + /// + /// Initializes a new instance of the AlertErrorDetails class. + /// + public AlertErrorDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AlertErrorDetails class. + /// + /// Error code. + /// Error Message. + /// Number of occurrences. + public AlertErrorDetails(string errorCode = default(string), string errorMessage = default(string), int? occurrences = default(int?)) + { + ErrorCode = errorCode; + ErrorMessage = errorMessage; + Occurrences = occurrences; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets error code. + /// + [JsonProperty(PropertyName = "errorCode")] + public string ErrorCode { get; private set; } + + /// + /// Gets error Message. + /// + [JsonProperty(PropertyName = "errorMessage")] + public string ErrorMessage { get; private set; } + + /// + /// Gets number of occurrences. + /// + [JsonProperty(PropertyName = "occurrences")] + public int? Occurrences { get; private set; } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/AlertSeverity.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/AlertSeverity.cs new file mode 100644 index 0000000000000..da3b7e262a92b --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/AlertSeverity.cs @@ -0,0 +1,23 @@ +// +// 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.DataBoxEdge.Models +{ + + /// + /// Defines values for AlertSeverity. + /// + public static class AlertSeverity + { + public const string Informational = "Informational"; + public const string Warning = "Warning"; + public const string Critical = "Critical"; + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/AsymmetricEncryptedSecret.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/AsymmetricEncryptedSecret.cs new file mode 100644 index 0000000000000..a2e466da95393 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/AsymmetricEncryptedSecret.cs @@ -0,0 +1,91 @@ +// +// 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.DataBoxEdge.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Represent the secrets intended for encryption with asymmetric key pair. + /// + public partial class AsymmetricEncryptedSecret + { + /// + /// Initializes a new instance of the AsymmetricEncryptedSecret class. + /// + public AsymmetricEncryptedSecret() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AsymmetricEncryptedSecret class. + /// + /// The value of the secret. + /// The algorithm used to encrypt + /// "Value". Possible values include: 'None', 'AES256', + /// 'RSAES_PKCS1_v_1_5' + /// Thumbprint certificate used + /// to encrypt \"Value\". If the value is unencrypted, it will be + /// null. + public AsymmetricEncryptedSecret(string value, string encryptionAlgorithm, string encryptionCertThumbprint = default(string)) + { + Value = value; + EncryptionCertThumbprint = encryptionCertThumbprint; + EncryptionAlgorithm = encryptionAlgorithm; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the value of the secret. + /// + [JsonProperty(PropertyName = "value")] + public string Value { get; set; } + + /// + /// Gets or sets thumbprint certificate used to encrypt \"Value\". If + /// the value is unencrypted, it will be null. + /// + [JsonProperty(PropertyName = "encryptionCertThumbprint")] + public string EncryptionCertThumbprint { get; set; } + + /// + /// Gets or sets the algorithm used to encrypt "Value". Possible values + /// include: 'None', 'AES256', 'RSAES_PKCS1_v_1_5' + /// + [JsonProperty(PropertyName = "encryptionAlgorithm")] + public string EncryptionAlgorithm { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Value == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Value"); + } + if (EncryptionAlgorithm == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "EncryptionAlgorithm"); + } + } + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/Authentication.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/Authentication.cs new file mode 100644 index 0000000000000..5d8507b8908f5 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/Authentication.cs @@ -0,0 +1,65 @@ +// +// 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.DataBoxEdge.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Authentication mechanism for IoT devices. + /// + public partial class Authentication + { + /// + /// Initializes a new instance of the Authentication class. + /// + public Authentication() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Authentication class. + /// + /// Symmetric key for + /// authentication. + public Authentication(SymmetricKey symmetricKey = default(SymmetricKey)) + { + SymmetricKey = symmetricKey; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets symmetric key for authentication. + /// + [JsonProperty(PropertyName = "symmetricKey")] + public SymmetricKey SymmetricKey { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (SymmetricKey != null) + { + SymmetricKey.Validate(); + } + } + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/AuthenticationType.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/AuthenticationType.cs new file mode 100644 index 0000000000000..5fefa1e838188 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/AuthenticationType.cs @@ -0,0 +1,22 @@ +// +// 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.DataBoxEdge.Models +{ + + /// + /// Defines values for AuthenticationType. + /// + public static class AuthenticationType + { + public const string Invalid = "Invalid"; + public const string AzureActiveDirectory = "AzureActiveDirectory"; + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/AzureContainerDataFormat.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/AzureContainerDataFormat.cs new file mode 100644 index 0000000000000..3efeccfccc98c --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/AzureContainerDataFormat.cs @@ -0,0 +1,23 @@ +// +// 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.DataBoxEdge.Models +{ + + /// + /// Defines values for AzureContainerDataFormat. + /// + public static class AzureContainerDataFormat + { + public const string BlockBlob = "BlockBlob"; + public const string PageBlob = "PageBlob"; + public const string AzureFile = "AzureFile"; + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/AzureContainerInfo.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/AzureContainerInfo.cs new file mode 100644 index 0000000000000..ad8408ed42505 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/AzureContainerInfo.cs @@ -0,0 +1,98 @@ +// +// 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.DataBoxEdge.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Azure container mapping of the endpoint. + /// + public partial class AzureContainerInfo + { + /// + /// Initializes a new instance of the AzureContainerInfo class. + /// + public AzureContainerInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureContainerInfo class. + /// + /// ID of the storage account + /// credential used to access storage. + /// Container name (Based on the data + /// format specified, this represents the name of Azure Files/Page + /// blob/Block blob). + /// Storage format used for the file + /// represented by the share. Possible values include: 'BlockBlob', + /// 'PageBlob', 'AzureFile' + public AzureContainerInfo(string storageAccountCredentialId, string containerName, string dataFormat) + { + StorageAccountCredentialId = storageAccountCredentialId; + ContainerName = containerName; + DataFormat = dataFormat; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets ID of the storage account credential used to access + /// storage. + /// + [JsonProperty(PropertyName = "storageAccountCredentialId")] + public string StorageAccountCredentialId { get; set; } + + /// + /// Gets or sets container name (Based on the data format specified, + /// this represents the name of Azure Files/Page blob/Block blob). + /// + [JsonProperty(PropertyName = "containerName")] + public string ContainerName { get; set; } + + /// + /// Gets or sets storage format used for the file represented by the + /// share. Possible values include: 'BlockBlob', 'PageBlob', + /// 'AzureFile' + /// + [JsonProperty(PropertyName = "dataFormat")] + public string DataFormat { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (StorageAccountCredentialId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "StorageAccountCredentialId"); + } + if (ContainerName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ContainerName"); + } + if (DataFormat == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "DataFormat"); + } + } + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/BandwidthSchedule.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/BandwidthSchedule.cs new file mode 100644 index 0000000000000..c5662e8d8ea22 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/BandwidthSchedule.cs @@ -0,0 +1,107 @@ +// +// 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.DataBoxEdge.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The bandwidth schedule details. + /// + [Rest.Serialization.JsonTransformation] + public partial class BandwidthSchedule : ARMBaseModel + { + /// + /// Initializes a new instance of the BandwidthSchedule class. + /// + public BandwidthSchedule() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BandwidthSchedule class. + /// + /// The start time of the schedule in UTC. + /// The stop time of the schedule in UTC. + /// The bandwidth rate in Mbps. + /// The days of the week when this schedule is + /// applicable. + /// The path ID that uniquely identifies the + /// object. + /// The object name. + /// The hierarchical type of the object. + public BandwidthSchedule(string start, string stop, int rateInMbps, IList days, string id = default(string), string name = default(string), string type = default(string)) + : base(id, name, type) + { + Start = start; + Stop = stop; + RateInMbps = rateInMbps; + Days = days; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the start time of the schedule in UTC. + /// + [JsonProperty(PropertyName = "properties.start")] + public string Start { get; set; } + + /// + /// Gets or sets the stop time of the schedule in UTC. + /// + [JsonProperty(PropertyName = "properties.stop")] + public string Stop { get; set; } + + /// + /// Gets or sets the bandwidth rate in Mbps. + /// + [JsonProperty(PropertyName = "properties.rateInMbps")] + public int RateInMbps { get; set; } + + /// + /// Gets or sets the days of the week when this schedule is applicable. + /// + [JsonProperty(PropertyName = "properties.days")] + public IList Days { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Start == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Start"); + } + if (Stop == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Stop"); + } + if (Days == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Days"); + } + } + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/ClientAccessRight.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/ClientAccessRight.cs new file mode 100644 index 0000000000000..1ec3d970acf58 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/ClientAccessRight.cs @@ -0,0 +1,81 @@ +// +// 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.DataBoxEdge.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The mapping between a particular client IP and the type of access + /// client has on the NFS share. + /// + public partial class ClientAccessRight + { + /// + /// Initializes a new instance of the ClientAccessRight class. + /// + public ClientAccessRight() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ClientAccessRight class. + /// + /// IP of the client. + /// Type of access to be allowed for the + /// client. Possible values include: 'NoAccess', 'ReadOnly', + /// 'ReadWrite' + public ClientAccessRight(string client, string accessPermission) + { + Client = client; + AccessPermission = accessPermission; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets IP of the client. + /// + [JsonProperty(PropertyName = "client")] + public string Client { get; set; } + + /// + /// Gets or sets type of access to be allowed for the client. Possible + /// values include: 'NoAccess', 'ReadOnly', 'ReadWrite' + /// + [JsonProperty(PropertyName = "accessPermission")] + public string AccessPermission { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Client == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Client"); + } + if (AccessPermission == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "AccessPermission"); + } + } + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/ClientPermissionType.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/ClientPermissionType.cs new file mode 100644 index 0000000000000..67a07c80b443c --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/ClientPermissionType.cs @@ -0,0 +1,23 @@ +// +// 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.DataBoxEdge.Models +{ + + /// + /// Defines values for ClientPermissionType. + /// + public static class ClientPermissionType + { + public const string NoAccess = "NoAccess"; + public const string ReadOnly = "ReadOnly"; + public const string ReadWrite = "ReadWrite"; + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/ContactDetails.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/ContactDetails.cs new file mode 100644 index 0000000000000..8ffcd4c5992aa --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/ContactDetails.cs @@ -0,0 +1,103 @@ +// +// 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.DataBoxEdge.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Contains all the contact details of the customer. + /// + public partial class ContactDetails + { + /// + /// Initializes a new instance of the ContactDetails class. + /// + public ContactDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ContactDetails class. + /// + /// The contact person name. + /// The name of the company. + /// The phone number. + /// The email list. + public ContactDetails(string contactPerson, string companyName, string phone, IList emailList) + { + ContactPerson = contactPerson; + CompanyName = companyName; + Phone = phone; + EmailList = emailList; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the contact person name. + /// + [JsonProperty(PropertyName = "contactPerson")] + public string ContactPerson { get; set; } + + /// + /// Gets or sets the name of the company. + /// + [JsonProperty(PropertyName = "companyName")] + public string CompanyName { get; set; } + + /// + /// Gets or sets the phone number. + /// + [JsonProperty(PropertyName = "phone")] + public string Phone { get; set; } + + /// + /// Gets or sets the email list. + /// + [JsonProperty(PropertyName = "emailList")] + public IList EmailList { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ContactPerson == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ContactPerson"); + } + if (CompanyName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "CompanyName"); + } + if (Phone == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Phone"); + } + if (EmailList == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "EmailList"); + } + } + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/Container.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/Container.cs new file mode 100644 index 0000000000000..44da362f65e7a --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/Container.cs @@ -0,0 +1,103 @@ +// +// 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.DataBoxEdge.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Represents a container on the Data Box Edge/Gateway device. + /// + [Rest.Serialization.JsonTransformation] + public partial class Container : ARMBaseModel + { + /// + /// Initializes a new instance of the Container class. + /// + public Container() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Container class. + /// + /// DataFormat for Container. Possible values + /// include: 'BlockBlob', 'PageBlob', 'AzureFile' + /// The path ID that uniquely identifies the + /// object. + /// The object name. + /// The hierarchical type of the object. + /// Current status of the container. + /// Possible values include: 'OK', 'Offline', 'Unknown', 'Updating', + /// 'NeedsAttention' + /// Details of the refresh job on this + /// container. + /// The UTC time when container got + /// created. + public Container(string dataFormat, string id = default(string), string name = default(string), string type = default(string), string containerStatus = default(string), RefreshDetails refreshDetails = default(RefreshDetails), System.DateTime? createdDateTime = default(System.DateTime?)) + : base(id, name, type) + { + ContainerStatus = containerStatus; + DataFormat = dataFormat; + RefreshDetails = refreshDetails; + CreatedDateTime = createdDateTime; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets current status of the container. Possible values include: + /// 'OK', 'Offline', 'Unknown', 'Updating', 'NeedsAttention' + /// + [JsonProperty(PropertyName = "properties.containerStatus")] + public string ContainerStatus { get; private set; } + + /// + /// Gets or sets dataFormat for Container. Possible values include: + /// 'BlockBlob', 'PageBlob', 'AzureFile' + /// + [JsonProperty(PropertyName = "properties.dataFormat")] + public string DataFormat { get; set; } + + /// + /// Gets details of the refresh job on this container. + /// + [JsonProperty(PropertyName = "properties.refreshDetails")] + public RefreshDetails RefreshDetails { get; private set; } + + /// + /// Gets the UTC time when container got created. + /// + [JsonProperty(PropertyName = "properties.createdDateTime")] + public System.DateTime? CreatedDateTime { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (DataFormat == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "DataFormat"); + } + } + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/ContainerStatus.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/ContainerStatus.cs new file mode 100644 index 0000000000000..161bb78b553b6 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/ContainerStatus.cs @@ -0,0 +1,25 @@ +// +// 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.DataBoxEdge.Models +{ + + /// + /// Defines values for ContainerStatus. + /// + public static class ContainerStatus + { + public const string OK = "OK"; + public const string Offline = "Offline"; + public const string Unknown = "Unknown"; + public const string Updating = "Updating"; + public const string NeedsAttention = "NeedsAttention"; + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/DataBoxEdgeDevice.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/DataBoxEdgeDevice.cs new file mode 100644 index 0000000000000..1cf358d32e95c --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/DataBoxEdgeDevice.cs @@ -0,0 +1,243 @@ +// +// 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.DataBoxEdge.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The Data Box Edge/Gateway device. + /// + [Rest.Serialization.JsonTransformation] + public partial class DataBoxEdgeDevice : ARMBaseModel + { + /// + /// Initializes a new instance of the DataBoxEdgeDevice class. + /// + public DataBoxEdgeDevice() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataBoxEdgeDevice class. + /// + /// The location of the device. This is a + /// supported and registered Azure geographical region (for example, + /// West US, East US, or Southeast Asia). The geographical region of a + /// device cannot be changed once it is created, but if an identical + /// geographical region is specified on update, the request will + /// succeed. + /// The path ID that uniquely identifies the + /// object. + /// The object name. + /// The hierarchical type of the object. + /// The list of tags that describe the device. These + /// tags can be used to view and group this device (across resource + /// groups). + /// The SKU type. + /// The etag for the devices. + /// The status of the Data Box + /// Edge/Gateway device. Possible values include: 'ReadyToSetup', + /// 'Online', 'Offline', 'NeedsAttention', 'Disconnected', + /// 'PartiallyDisconnected', 'Maintenance' + /// The Serial Number of Data Box + /// Edge/Gateway device. + /// The Description of the Data Box + /// Edge/Gateway device. + /// The description of the Data Box + /// Edge/Gateway device model. + /// The type of the Data Box Edge/Gateway + /// device. Possible values include: 'DataBoxEdgeDevice' + /// The Data Box Edge/Gateway device + /// name. + /// The Data Box Edge/Gateway device + /// culture. + /// The Data Box Edge/Gateway device + /// model. + /// The Data Box Edge/Gateway + /// device software version. + /// The Data Box Edge/Gateway device + /// local capacity in MB. + /// The Data Box Edge/Gateway device + /// timezone. + /// The device software version number + /// of the device (eg: 1.2.18105.6). + /// Type of compute roles + /// configured. + /// The number of nodes in the cluster. + public DataBoxEdgeDevice(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), Sku sku = default(Sku), string etag = default(string), string dataBoxEdgeDeviceStatus = default(string), string serialNumber = default(string), string description = default(string), string modelDescription = default(string), string deviceType = default(string), string friendlyName = default(string), string culture = default(string), string deviceModel = default(string), string deviceSoftwareVersion = default(string), long? deviceLocalCapacity = default(long?), string timeZone = default(string), string deviceHcsVersion = default(string), IList configuredRoleTypes = default(IList), int? nodeCount = default(int?)) + : base(id, name, type) + { + Location = location; + Tags = tags; + Sku = sku; + Etag = etag; + DataBoxEdgeDeviceStatus = dataBoxEdgeDeviceStatus; + SerialNumber = serialNumber; + Description = description; + ModelDescription = modelDescription; + DeviceType = deviceType; + FriendlyName = friendlyName; + Culture = culture; + DeviceModel = deviceModel; + DeviceSoftwareVersion = deviceSoftwareVersion; + DeviceLocalCapacity = deviceLocalCapacity; + TimeZone = timeZone; + DeviceHcsVersion = deviceHcsVersion; + ConfiguredRoleTypes = configuredRoleTypes; + NodeCount = nodeCount; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the location of the device. This is a supported and + /// registered Azure geographical region (for example, West US, East + /// US, or Southeast Asia). The geographical region of a device cannot + /// be changed once it is created, but if an identical geographical + /// region is specified on update, the request will succeed. + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; set; } + + /// + /// Gets or sets the list of tags that describe the device. These tags + /// can be used to view and group this device (across resource groups). + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// Gets or sets the SKU type. + /// + [JsonProperty(PropertyName = "sku")] + public Sku Sku { get; set; } + + /// + /// Gets or sets the etag for the devices. + /// + [JsonProperty(PropertyName = "etag")] + public string Etag { get; set; } + + /// + /// Gets or sets the status of the Data Box Edge/Gateway device. + /// Possible values include: 'ReadyToSetup', 'Online', 'Offline', + /// 'NeedsAttention', 'Disconnected', 'PartiallyDisconnected', + /// 'Maintenance' + /// + [JsonProperty(PropertyName = "properties.dataBoxEdgeDeviceStatus")] + public string DataBoxEdgeDeviceStatus { get; set; } + + /// + /// Gets the Serial Number of Data Box Edge/Gateway device. + /// + [JsonProperty(PropertyName = "properties.serialNumber")] + public string SerialNumber { get; private set; } + + /// + /// Gets or sets the Description of the Data Box Edge/Gateway device. + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; set; } + + /// + /// Gets or sets the description of the Data Box Edge/Gateway device + /// model. + /// + [JsonProperty(PropertyName = "properties.modelDescription")] + public string ModelDescription { get; set; } + + /// + /// Gets the type of the Data Box Edge/Gateway device. Possible values + /// include: 'DataBoxEdgeDevice' + /// + [JsonProperty(PropertyName = "properties.deviceType")] + public string DeviceType { get; private set; } + + /// + /// Gets or sets the Data Box Edge/Gateway device name. + /// + [JsonProperty(PropertyName = "properties.friendlyName")] + public string FriendlyName { get; set; } + + /// + /// Gets the Data Box Edge/Gateway device culture. + /// + [JsonProperty(PropertyName = "properties.culture")] + public string Culture { get; private set; } + + /// + /// Gets the Data Box Edge/Gateway device model. + /// + [JsonProperty(PropertyName = "properties.deviceModel")] + public string DeviceModel { get; private set; } + + /// + /// Gets the Data Box Edge/Gateway device software version. + /// + [JsonProperty(PropertyName = "properties.deviceSoftwareVersion")] + public string DeviceSoftwareVersion { get; private set; } + + /// + /// Gets the Data Box Edge/Gateway device local capacity in MB. + /// + [JsonProperty(PropertyName = "properties.deviceLocalCapacity")] + public long? DeviceLocalCapacity { get; private set; } + + /// + /// Gets the Data Box Edge/Gateway device timezone. + /// + [JsonProperty(PropertyName = "properties.timeZone")] + public string TimeZone { get; private set; } + + /// + /// Gets the device software version number of the device (eg: + /// 1.2.18105.6). + /// + [JsonProperty(PropertyName = "properties.deviceHcsVersion")] + public string DeviceHcsVersion { get; private set; } + + /// + /// Gets type of compute roles configured. + /// + [JsonProperty(PropertyName = "properties.configuredRoleTypes")] + public IList ConfiguredRoleTypes { get; private set; } + + /// + /// Gets the number of nodes in the cluster. + /// + [JsonProperty(PropertyName = "properties.nodeCount")] + public int? NodeCount { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Location"); + } + } + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/DataBoxEdgeDeviceExtendedInfo.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/DataBoxEdgeDeviceExtendedInfo.cs new file mode 100644 index 0000000000000..96bceeba29cd4 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/DataBoxEdgeDeviceExtendedInfo.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.DataBoxEdge.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The extended Info of the Data Box Edge/Gateway device. + /// + [Rest.Serialization.JsonTransformation] + public partial class DataBoxEdgeDeviceExtendedInfo : ARMBaseModel + { + /// + /// Initializes a new instance of the DataBoxEdgeDeviceExtendedInfo + /// class. + /// + public DataBoxEdgeDeviceExtendedInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataBoxEdgeDeviceExtendedInfo + /// class. + /// + /// The path ID that uniquely identifies the + /// object. + /// The object name. + /// The hierarchical type of the object. + /// The digital signature of + /// encrypted certificate. + /// The public part of the encryption + /// certificate. Client uses this to encrypt any secret. + /// The Resource ID of the Resource. + public DataBoxEdgeDeviceExtendedInfo(string id = default(string), string name = default(string), string type = default(string), string encryptionKeyThumbprint = default(string), string encryptionKey = default(string), string resourceKey = default(string)) + : base(id, name, type) + { + EncryptionKeyThumbprint = encryptionKeyThumbprint; + EncryptionKey = encryptionKey; + ResourceKey = resourceKey; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the digital signature of encrypted certificate. + /// + [JsonProperty(PropertyName = "properties.encryptionKeyThumbprint")] + public string EncryptionKeyThumbprint { get; set; } + + /// + /// Gets or sets the public part of the encryption certificate. Client + /// uses this to encrypt any secret. + /// + [JsonProperty(PropertyName = "properties.encryptionKey")] + public string EncryptionKey { get; set; } + + /// + /// Gets the Resource ID of the Resource. + /// + [JsonProperty(PropertyName = "properties.resourceKey")] + public string ResourceKey { get; private set; } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/DataBoxEdgeDevicePatch.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/DataBoxEdgeDevicePatch.cs new file mode 100644 index 0000000000000..38ee25286aa09 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/DataBoxEdgeDevicePatch.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.DataBoxEdge.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The Data Box Edge/Gateway device patch. + /// + public partial class DataBoxEdgeDevicePatch + { + /// + /// Initializes a new instance of the DataBoxEdgeDevicePatch class. + /// + public DataBoxEdgeDevicePatch() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataBoxEdgeDevicePatch class. + /// + /// The tags attached to the Data Box Edge/Gateway + /// resource. + public DataBoxEdgeDevicePatch(IDictionary tags = default(IDictionary)) + { + Tags = tags; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the tags attached to the Data Box Edge/Gateway + /// resource. + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/DataBoxEdgeDeviceStatus.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/DataBoxEdgeDeviceStatus.cs new file mode 100644 index 0000000000000..70aaab2d2e408 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/DataBoxEdgeDeviceStatus.cs @@ -0,0 +1,27 @@ +// +// 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.DataBoxEdge.Models +{ + + /// + /// Defines values for DataBoxEdgeDeviceStatus. + /// + public static class DataBoxEdgeDeviceStatus + { + public const string ReadyToSetup = "ReadyToSetup"; + public const string Online = "Online"; + public const string Offline = "Offline"; + public const string NeedsAttention = "NeedsAttention"; + public const string Disconnected = "Disconnected"; + public const string PartiallyDisconnected = "PartiallyDisconnected"; + public const string Maintenance = "Maintenance"; + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/DataPolicy.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/DataPolicy.cs new file mode 100644 index 0000000000000..4968af0382702 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/DataPolicy.cs @@ -0,0 +1,22 @@ +// +// 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.DataBoxEdge.Models +{ + + /// + /// Defines values for DataPolicy. + /// + public static class DataPolicy + { + public const string Cloud = "Cloud"; + public const string Local = "Local"; + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/DayOfWeek.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/DayOfWeek.cs new file mode 100644 index 0000000000000..ba1ee9e4cd23e --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/DayOfWeek.cs @@ -0,0 +1,27 @@ +// +// 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.DataBoxEdge.Models +{ + + /// + /// Defines values for DayOfWeek. + /// + public static class DayOfWeek + { + public const string Sunday = "Sunday"; + public const string Monday = "Monday"; + public const string Tuesday = "Tuesday"; + public const string Wednesday = "Wednesday"; + public const string Thursday = "Thursday"; + public const string Friday = "Friday"; + public const string Saturday = "Saturday"; + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/DeviceType.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/DeviceType.cs new file mode 100644 index 0000000000000..4016a7d4162ca --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/DeviceType.cs @@ -0,0 +1,21 @@ +// +// 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.DataBoxEdge.Models +{ + + /// + /// Defines values for DeviceType. + /// + public static class DeviceType + { + public const string DataBoxEdgeDevice = "DataBoxEdgeDevice"; + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/DownloadPhase.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/DownloadPhase.cs new file mode 100644 index 0000000000000..c5ca26f5b6112 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/DownloadPhase.cs @@ -0,0 +1,24 @@ +// +// 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.DataBoxEdge.Models +{ + + /// + /// Defines values for DownloadPhase. + /// + public static class DownloadPhase + { + public const string Unknown = "Unknown"; + public const string Initializing = "Initializing"; + public const string Downloading = "Downloading"; + public const string Verifying = "Verifying"; + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/EncryptionAlgorithm.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/EncryptionAlgorithm.cs new file mode 100644 index 0000000000000..53faebbb3cc15 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/EncryptionAlgorithm.cs @@ -0,0 +1,23 @@ +// +// 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.DataBoxEdge.Models +{ + + /// + /// Defines values for EncryptionAlgorithm. + /// + public static class EncryptionAlgorithm + { + public const string None = "None"; + public const string AES256 = "AES256"; + public const string RSAESPKCS1V15 = "RSAES_PKCS1_v_1_5"; + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/FileEventTrigger.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/FileEventTrigger.cs new file mode 100644 index 0000000000000..c9772605cb7a4 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/FileEventTrigger.cs @@ -0,0 +1,108 @@ +// +// 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.DataBoxEdge.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Trigger details. + /// + [Newtonsoft.Json.JsonObject("FileEvent")] + [Rest.Serialization.JsonTransformation] + public partial class FileEventTrigger : Trigger + { + /// + /// Initializes a new instance of the FileEventTrigger class. + /// + public FileEventTrigger() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the FileEventTrigger class. + /// + /// File event source details. + /// Role sink info. + /// The path ID that uniquely identifies the + /// object. + /// The object name. + /// The hierarchical type of the object. + /// A custom context tag typically used + /// to correlate the trigger against its usage. For example, if a + /// periodic timer trigger is intended for certain specific IoT modules + /// in the device, the tag can be the name or the image URL of the + /// module. + public FileEventTrigger(FileSourceInfo sourceInfo, RoleSinkInfo sinkInfo, string id = default(string), string name = default(string), string type = default(string), string customContextTag = default(string)) + : base(id, name, type) + { + SourceInfo = sourceInfo; + SinkInfo = sinkInfo; + CustomContextTag = customContextTag; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets file event source details. + /// + [JsonProperty(PropertyName = "properties.sourceInfo")] + public FileSourceInfo SourceInfo { get; set; } + + /// + /// Gets or sets role sink info. + /// + [JsonProperty(PropertyName = "properties.sinkInfo")] + public RoleSinkInfo SinkInfo { get; set; } + + /// + /// Gets or sets a custom context tag typically used to correlate the + /// trigger against its usage. For example, if a periodic timer trigger + /// is intended for certain specific IoT modules in the device, the tag + /// can be the name or the image URL of the module. + /// + [JsonProperty(PropertyName = "properties.customContextTag")] + public string CustomContextTag { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (SourceInfo == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "SourceInfo"); + } + if (SinkInfo == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "SinkInfo"); + } + if (SourceInfo != null) + { + SourceInfo.Validate(); + } + if (SinkInfo != null) + { + SinkInfo.Validate(); + } + } + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/FileSourceInfo.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/FileSourceInfo.cs new file mode 100644 index 0000000000000..306a33e5267c1 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/FileSourceInfo.cs @@ -0,0 +1,65 @@ +// +// 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.DataBoxEdge.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// File source details. + /// + public partial class FileSourceInfo + { + /// + /// Initializes a new instance of the FileSourceInfo class. + /// + public FileSourceInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the FileSourceInfo class. + /// + /// File share ID. + public FileSourceInfo(string shareId) + { + ShareId = shareId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets file share ID. + /// + [JsonProperty(PropertyName = "shareId")] + public string ShareId { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ShareId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ShareId"); + } + } + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/InstallRebootBehavior.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/InstallRebootBehavior.cs new file mode 100644 index 0000000000000..2d5f09a1e7cc8 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/InstallRebootBehavior.cs @@ -0,0 +1,23 @@ +// +// 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.DataBoxEdge.Models +{ + + /// + /// Defines values for InstallRebootBehavior. + /// + public static class InstallRebootBehavior + { + public const string NeverReboots = "NeverReboots"; + public const string RequiresReboot = "RequiresReboot"; + public const string RequestReboot = "RequestReboot"; + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/IoTDeviceInfo.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/IoTDeviceInfo.cs new file mode 100644 index 0000000000000..4b4a3389ecdee --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/IoTDeviceInfo.cs @@ -0,0 +1,100 @@ +// +// 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.DataBoxEdge.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Metadata of IoT device/IoT Edge device to be configured. + /// + public partial class IoTDeviceInfo + { + /// + /// Initializes a new instance of the IoTDeviceInfo class. + /// + public IoTDeviceInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the IoTDeviceInfo class. + /// + /// ID of the IoT device/edge device. + /// Host name for the IoT hub associated to + /// the device. + /// Id for the IoT hub associated to the + /// device. + /// IoT device authentication + /// info. + public IoTDeviceInfo(string deviceId, string ioTHostHub, string ioTHostHubId = default(string), Authentication authentication = default(Authentication)) + { + DeviceId = deviceId; + IoTHostHub = ioTHostHub; + IoTHostHubId = ioTHostHubId; + Authentication = authentication; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets ID of the IoT device/edge device. + /// + [JsonProperty(PropertyName = "deviceId")] + public string DeviceId { get; set; } + + /// + /// Gets or sets host name for the IoT hub associated to the device. + /// + [JsonProperty(PropertyName = "ioTHostHub")] + public string IoTHostHub { get; set; } + + /// + /// Gets or sets id for the IoT hub associated to the device. + /// + [JsonProperty(PropertyName = "ioTHostHubId")] + public string IoTHostHubId { get; set; } + + /// + /// Gets or sets ioT device authentication info. + /// + [JsonProperty(PropertyName = "authentication")] + public Authentication Authentication { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (DeviceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "DeviceId"); + } + if (IoTHostHub == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "IoTHostHub"); + } + if (Authentication != null) + { + Authentication.Validate(); + } + } + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/IoTRole.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/IoTRole.cs new file mode 100644 index 0000000000000..2387f3ffd5745 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/IoTRole.cs @@ -0,0 +1,146 @@ +// +// 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.DataBoxEdge.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Compute role. + /// + [Newtonsoft.Json.JsonObject("IOT")] + [Rest.Serialization.JsonTransformation] + public partial class IoTRole : Role + { + /// + /// Initializes a new instance of the IoTRole class. + /// + public IoTRole() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the IoTRole class. + /// + /// Host OS supported by the IoT role. + /// Possible values include: 'Windows', 'Linux' + /// IoT device metadata to which data + /// box edge device needs to be connected. + /// IoT edge device to which the IoT + /// role needs to be configured. + /// Role status. Possible values include: + /// 'Enabled', 'Disabled' + /// The path ID that uniquely identifies the + /// object. + /// The object name. + /// The hierarchical type of the object. + /// Mount points of shares in + /// role(s). + public IoTRole(string hostPlatform, IoTDeviceInfo ioTDeviceDetails, IoTDeviceInfo ioTEdgeDeviceDetails, string roleStatus, string id = default(string), string name = default(string), string type = default(string), IList shareMappings = default(IList)) + : base(id, name, type) + { + HostPlatform = hostPlatform; + IoTDeviceDetails = ioTDeviceDetails; + IoTEdgeDeviceDetails = ioTEdgeDeviceDetails; + ShareMappings = shareMappings; + RoleStatus = roleStatus; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets host OS supported by the IoT role. Possible values + /// include: 'Windows', 'Linux' + /// + [JsonProperty(PropertyName = "properties.hostPlatform")] + public string HostPlatform { get; set; } + + /// + /// Gets or sets ioT device metadata to which data box edge device + /// needs to be connected. + /// + [JsonProperty(PropertyName = "properties.ioTDeviceDetails")] + public IoTDeviceInfo IoTDeviceDetails { get; set; } + + /// + /// Gets or sets ioT edge device to which the IoT role needs to be + /// configured. + /// + [JsonProperty(PropertyName = "properties.ioTEdgeDeviceDetails")] + public IoTDeviceInfo IoTEdgeDeviceDetails { get; set; } + + /// + /// Gets or sets mount points of shares in role(s). + /// + [JsonProperty(PropertyName = "properties.shareMappings")] + public IList ShareMappings { get; set; } + + /// + /// Gets or sets role status. Possible values include: 'Enabled', + /// 'Disabled' + /// + [JsonProperty(PropertyName = "properties.roleStatus")] + public string RoleStatus { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (HostPlatform == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "HostPlatform"); + } + if (IoTDeviceDetails == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "IoTDeviceDetails"); + } + if (IoTEdgeDeviceDetails == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "IoTEdgeDeviceDetails"); + } + if (RoleStatus == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "RoleStatus"); + } + if (IoTDeviceDetails != null) + { + IoTDeviceDetails.Validate(); + } + if (IoTEdgeDeviceDetails != null) + { + IoTEdgeDeviceDetails.Validate(); + } + if (ShareMappings != null) + { + foreach (var element in ShareMappings) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/Ipv4Config.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/Ipv4Config.cs new file mode 100644 index 0000000000000..8801df5687f2a --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/Ipv4Config.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.DataBoxEdge.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Details related to the IPv4 address configuration. + /// + public partial class Ipv4Config + { + /// + /// Initializes a new instance of the Ipv4Config class. + /// + public Ipv4Config() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Ipv4Config class. + /// + /// The IPv4 address of the network + /// adapter. + /// The IPv4 subnet of the network + /// adapter. + /// The IPv4 gateway of the network + /// adapter. + public Ipv4Config(string ipAddress = default(string), string subnet = default(string), string gateway = default(string)) + { + IpAddress = ipAddress; + Subnet = subnet; + Gateway = gateway; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the IPv4 address of the network adapter. + /// + [JsonProperty(PropertyName = "ipAddress")] + public string IpAddress { get; private set; } + + /// + /// Gets the IPv4 subnet of the network adapter. + /// + [JsonProperty(PropertyName = "subnet")] + public string Subnet { get; private set; } + + /// + /// Gets the IPv4 gateway of the network adapter. + /// + [JsonProperty(PropertyName = "gateway")] + public string Gateway { get; private set; } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/Ipv6Config.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/Ipv6Config.cs new file mode 100644 index 0000000000000..ebbf2d563cbfb --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/Ipv6Config.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.DataBoxEdge.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Details related to the IPv6 address configuration. + /// + public partial class Ipv6Config + { + /// + /// Initializes a new instance of the Ipv6Config class. + /// + public Ipv6Config() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Ipv6Config class. + /// + /// The IPv6 address of the network + /// adapter. + /// The IPv6 prefix of the network + /// adapter. + /// The IPv6 gateway of the network + /// adapter. + public Ipv6Config(string ipAddress = default(string), int? prefixLength = default(int?), string gateway = default(string)) + { + IpAddress = ipAddress; + PrefixLength = prefixLength; + Gateway = gateway; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the IPv6 address of the network adapter. + /// + [JsonProperty(PropertyName = "ipAddress")] + public string IpAddress { get; private set; } + + /// + /// Gets the IPv6 prefix of the network adapter. + /// + [JsonProperty(PropertyName = "prefixLength")] + public int? PrefixLength { get; private set; } + + /// + /// Gets the IPv6 gateway of the network adapter. + /// + [JsonProperty(PropertyName = "gateway")] + public string Gateway { get; private set; } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/Job.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/Job.cs new file mode 100644 index 0000000000000..cee41f92c233d --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/Job.cs @@ -0,0 +1,205 @@ +// +// 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.DataBoxEdge.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// A device job. + /// + [Rest.Serialization.JsonTransformation] + public partial class Job + { + /// + /// Initializes a new instance of the Job class. + /// + public Job() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Job class. + /// + /// The path ID that uniquely identifies the + /// object. + /// The name of the object. + /// The hierarchical type of the object. + /// The current status of the job. Possible values + /// include: 'Invalid', 'Running', 'Succeeded', 'Failed', 'Canceled', + /// 'Paused', 'Scheduled' + /// The UTC date and time at which the job + /// started. + /// The UTC date and time at which the job + /// completed. + /// The percentage of the job that is + /// complete. + /// The error details. + /// The type of the job. Possible values include: + /// 'Invalid', 'ScanForUpdates', 'DownloadUpdates', 'InstallUpdates', + /// 'RefreshShare', 'RefreshContainer' + /// Current stage of the update operation. + /// Possible values include: 'Unknown', 'Initial', 'ScanStarted', + /// 'ScanComplete', 'ScanFailed', 'DownloadStarted', + /// 'DownloadComplete', 'DownloadFailed', 'InstallStarted', + /// 'InstallComplete', 'InstallFailed', 'RebootInitiated', 'Success', + /// 'Failure', 'RescanStarted', 'RescanComplete', + /// 'RescanFailed' + /// The download progress. + /// The install progress. + /// Total number of errors encountered + /// during the refresh process. + /// Local share/remote container + /// relative path to the error manifest file of the refresh. + /// ARM ID of the entity that was + /// refreshed. + /// If only subfolders need to be refreshed, then + /// the subfolder path inside the share or container. (The path is + /// empty if there are no subfolders.) + public Job(string id = default(string), string name = default(string), string type = default(string), string status = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), int? percentComplete = default(int?), JobErrorDetails error = default(JobErrorDetails), string jobType = default(string), string currentStage = default(string), UpdateDownloadProgress downloadProgress = default(UpdateDownloadProgress), UpdateInstallProgress installProgress = default(UpdateInstallProgress), int? totalRefreshErrors = default(int?), string errorManifestFile = default(string), string refreshedEntityId = default(string), string folder = default(string)) + { + Id = id; + Name = name; + Type = type; + Status = status; + StartTime = startTime; + EndTime = endTime; + PercentComplete = percentComplete; + Error = error; + JobType = jobType; + CurrentStage = currentStage; + DownloadProgress = downloadProgress; + InstallProgress = installProgress; + TotalRefreshErrors = totalRefreshErrors; + ErrorManifestFile = errorManifestFile; + RefreshedEntityId = refreshedEntityId; + Folder = folder; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the path ID that uniquely identifies the object. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets the name of the object. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets the hierarchical type of the object. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets the current status of the job. Possible values include: + /// 'Invalid', 'Running', 'Succeeded', 'Failed', 'Canceled', 'Paused', + /// 'Scheduled' + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; private set; } + + /// + /// Gets the UTC date and time at which the job started. + /// + [JsonProperty(PropertyName = "startTime")] + public System.DateTime? StartTime { get; private set; } + + /// + /// Gets the UTC date and time at which the job completed. + /// + [JsonProperty(PropertyName = "endTime")] + public System.DateTime? EndTime { get; private set; } + + /// + /// Gets the percentage of the job that is complete. + /// + [JsonProperty(PropertyName = "percentComplete")] + public int? PercentComplete { get; private set; } + + /// + /// Gets the error details. + /// + [JsonProperty(PropertyName = "error")] + public JobErrorDetails Error { get; private set; } + + /// + /// Gets the type of the job. Possible values include: 'Invalid', + /// 'ScanForUpdates', 'DownloadUpdates', 'InstallUpdates', + /// 'RefreshShare', 'RefreshContainer' + /// + [JsonProperty(PropertyName = "properties.jobType")] + public string JobType { get; private set; } + + /// + /// Gets current stage of the update operation. Possible values + /// include: 'Unknown', 'Initial', 'ScanStarted', 'ScanComplete', + /// 'ScanFailed', 'DownloadStarted', 'DownloadComplete', + /// 'DownloadFailed', 'InstallStarted', 'InstallComplete', + /// 'InstallFailed', 'RebootInitiated', 'Success', 'Failure', + /// 'RescanStarted', 'RescanComplete', 'RescanFailed' + /// + [JsonProperty(PropertyName = "properties.currentStage")] + public string CurrentStage { get; private set; } + + /// + /// Gets the download progress. + /// + [JsonProperty(PropertyName = "properties.downloadProgress")] + public UpdateDownloadProgress DownloadProgress { get; private set; } + + /// + /// Gets the install progress. + /// + [JsonProperty(PropertyName = "properties.installProgress")] + public UpdateInstallProgress InstallProgress { get; private set; } + + /// + /// Gets total number of errors encountered during the refresh process. + /// + [JsonProperty(PropertyName = "properties.totalRefreshErrors")] + public int? TotalRefreshErrors { get; private set; } + + /// + /// Gets local share/remote container relative path to the error + /// manifest file of the refresh. + /// + [JsonProperty(PropertyName = "properties.errorManifestFile")] + public string ErrorManifestFile { get; private set; } + + /// + /// Gets ARM ID of the entity that was refreshed. + /// + [JsonProperty(PropertyName = "properties.refreshedEntityId")] + public string RefreshedEntityId { get; private set; } + + /// + /// Gets or sets if only subfolders need to be refreshed, then the + /// subfolder path inside the share or container. (The path is empty if + /// there are no subfolders.) + /// + [JsonProperty(PropertyName = "properties.folder")] + public string Folder { get; set; } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/JobErrorDetails.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/JobErrorDetails.cs new file mode 100644 index 0000000000000..8617ebc4ac6ad --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/JobErrorDetails.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.DataBoxEdge.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The job error information containing the list of job errors. + /// + public partial class JobErrorDetails + { + /// + /// Initializes a new instance of the JobErrorDetails class. + /// + public JobErrorDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the JobErrorDetails class. + /// + /// The error details. + /// The code intended for programmatic + /// access. + /// The message that describes the error in + /// detail. + public JobErrorDetails(IList errorDetails = default(IList), string code = default(string), string message = default(string)) + { + ErrorDetails = errorDetails; + Code = code; + Message = message; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the error details. + /// + [JsonProperty(PropertyName = "errorDetails")] + public IList ErrorDetails { get; private set; } + + /// + /// Gets the code intended for programmatic access. + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; private set; } + + /// + /// Gets the message that describes the error in detail. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; private set; } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/JobErrorItem.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/JobErrorItem.cs new file mode 100644 index 0000000000000..31aa017698c56 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/JobErrorItem.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.DataBoxEdge.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The job error items. + /// + public partial class JobErrorItem + { + /// + /// Initializes a new instance of the JobErrorItem class. + /// + public JobErrorItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the JobErrorItem class. + /// + /// The recommended actions. + /// The code intended for programmatic + /// access. + /// The message that describes the error in + /// detail. + public JobErrorItem(IList recommendations = default(IList), string code = default(string), string message = default(string)) + { + Recommendations = recommendations; + Code = code; + Message = message; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the recommended actions. + /// + [JsonProperty(PropertyName = "recommendations")] + public IList Recommendations { get; private set; } + + /// + /// Gets the code intended for programmatic access. + /// + [JsonProperty(PropertyName = "code")] + public string Code { get; private set; } + + /// + /// Gets the message that describes the error in detail. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; private set; } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/JobStatus.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/JobStatus.cs new file mode 100644 index 0000000000000..949653ac3eb65 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/JobStatus.cs @@ -0,0 +1,27 @@ +// +// 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.DataBoxEdge.Models +{ + + /// + /// Defines values for JobStatus. + /// + public static class JobStatus + { + public const string Invalid = "Invalid"; + public const string Running = "Running"; + public const string Succeeded = "Succeeded"; + public const string Failed = "Failed"; + public const string Canceled = "Canceled"; + public const string Paused = "Paused"; + public const string Scheduled = "Scheduled"; + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/JobType.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/JobType.cs new file mode 100644 index 0000000000000..d4cca1910e137 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/JobType.cs @@ -0,0 +1,26 @@ +// +// 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.DataBoxEdge.Models +{ + + /// + /// Defines values for JobType. + /// + public static class JobType + { + public const string Invalid = "Invalid"; + public const string ScanForUpdates = "ScanForUpdates"; + public const string DownloadUpdates = "DownloadUpdates"; + public const string InstallUpdates = "InstallUpdates"; + public const string RefreshShare = "RefreshShare"; + public const string RefreshContainer = "RefreshContainer"; + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/MetricAggregationType.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/MetricAggregationType.cs new file mode 100644 index 0000000000000..108f86e53ddda --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/MetricAggregationType.cs @@ -0,0 +1,27 @@ +// +// 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.DataBoxEdge.Models +{ + + /// + /// Defines values for MetricAggregationType. + /// + public static class MetricAggregationType + { + public const string NotSpecified = "NotSpecified"; + public const string None = "None"; + public const string Average = "Average"; + public const string Minimum = "Minimum"; + public const string Maximum = "Maximum"; + public const string Total = "Total"; + public const string Count = "Count"; + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/MetricCategory.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/MetricCategory.cs new file mode 100644 index 0000000000000..85358da08afa3 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/MetricCategory.cs @@ -0,0 +1,22 @@ +// +// 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.DataBoxEdge.Models +{ + + /// + /// Defines values for MetricCategory. + /// + public static class MetricCategory + { + public const string Capacity = "Capacity"; + public const string Transaction = "Transaction"; + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/MetricDimensionV1.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/MetricDimensionV1.cs new file mode 100644 index 0000000000000..b8cdddf64c1eb --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/MetricDimensionV1.cs @@ -0,0 +1,69 @@ +// +// 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.DataBoxEdge.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Metric Dimension v1. + /// + public partial class MetricDimensionV1 + { + /// + /// Initializes a new instance of the MetricDimensionV1 class. + /// + public MetricDimensionV1() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MetricDimensionV1 class. + /// + /// Name of the metrics dimension. + /// Display name of the metrics + /// dimension. + /// To be exported to shoe + /// box. + public MetricDimensionV1(string name = default(string), string displayName = default(string), bool? toBeExportedForShoebox = default(bool?)) + { + Name = name; + DisplayName = displayName; + ToBeExportedForShoebox = toBeExportedForShoebox; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of the metrics dimension. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets display name of the metrics dimension. + /// + [JsonProperty(PropertyName = "displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets to be exported to shoe box. + /// + [JsonProperty(PropertyName = "toBeExportedForShoebox")] + public bool? ToBeExportedForShoebox { get; set; } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/MetricSpecificationV1.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/MetricSpecificationV1.cs new file mode 100644 index 0000000000000..c63cd9e74b9cf --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/MetricSpecificationV1.cs @@ -0,0 +1,150 @@ +// +// 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.DataBoxEdge.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Metric specification version 1. + /// + public partial class MetricSpecificationV1 + { + /// + /// Initializes a new instance of the MetricSpecificationV1 class. + /// + public MetricSpecificationV1() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MetricSpecificationV1 class. + /// + /// Name of the metric. + /// Display name of the metric. + /// Description of the metric to be + /// displayed. + /// Metric units. Possible values include: + /// 'NotSpecified', 'Percent', 'Count', 'Seconds', 'Milliseconds', + /// 'Bytes', 'BytesPerSecond', 'CountPerSecond' + /// Metric aggregation type. Possible + /// values include: 'NotSpecified', 'None', 'Average', 'Minimum', + /// 'Maximum', 'Total', 'Count' + /// Metric dimensions, other than default + /// dimension which is resource. + /// Set true to fill the gaps with + /// zero. + /// Metric category. Possible values include: + /// 'Capacity', 'Transaction' + /// Resource name + /// override. + /// Support granularity of + /// metrics. + /// Support metric aggregation + /// type. + public MetricSpecificationV1(string name = default(string), string displayName = default(string), string displayDescription = default(string), string unit = default(string), string aggregationType = default(string), IList dimensions = default(IList), bool? fillGapWithZero = default(bool?), string category = default(string), string resourceIdDimensionNameOverride = default(string), IList supportedTimeGrainTypes = default(IList), IList supportedAggregationTypes = default(IList)) + { + Name = name; + DisplayName = displayName; + DisplayDescription = displayDescription; + Unit = unit; + AggregationType = aggregationType; + Dimensions = dimensions; + FillGapWithZero = fillGapWithZero; + Category = category; + ResourceIdDimensionNameOverride = resourceIdDimensionNameOverride; + SupportedTimeGrainTypes = supportedTimeGrainTypes; + SupportedAggregationTypes = supportedAggregationTypes; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of the metric. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets display name of the metric. + /// + [JsonProperty(PropertyName = "displayName")] + public string DisplayName { get; set; } + + /// + /// Gets or sets description of the metric to be displayed. + /// + [JsonProperty(PropertyName = "displayDescription")] + public string DisplayDescription { get; set; } + + /// + /// Gets or sets metric units. Possible values include: 'NotSpecified', + /// 'Percent', 'Count', 'Seconds', 'Milliseconds', 'Bytes', + /// 'BytesPerSecond', 'CountPerSecond' + /// + [JsonProperty(PropertyName = "unit")] + public string Unit { get; set; } + + /// + /// Gets or sets metric aggregation type. Possible values include: + /// 'NotSpecified', 'None', 'Average', 'Minimum', 'Maximum', 'Total', + /// 'Count' + /// + [JsonProperty(PropertyName = "aggregationType")] + public string AggregationType { get; set; } + + /// + /// Gets or sets metric dimensions, other than default dimension which + /// is resource. + /// + [JsonProperty(PropertyName = "dimensions")] + public IList Dimensions { get; set; } + + /// + /// Gets or sets set true to fill the gaps with zero. + /// + [JsonProperty(PropertyName = "fillGapWithZero")] + public bool? FillGapWithZero { get; set; } + + /// + /// Gets or sets metric category. Possible values include: 'Capacity', + /// 'Transaction' + /// + [JsonProperty(PropertyName = "category")] + public string Category { get; set; } + + /// + /// Gets or sets resource name override. + /// + [JsonProperty(PropertyName = "resourceIdDimensionNameOverride")] + public string ResourceIdDimensionNameOverride { get; set; } + + /// + /// Gets or sets support granularity of metrics. + /// + [JsonProperty(PropertyName = "supportedTimeGrainTypes")] + public IList SupportedTimeGrainTypes { get; set; } + + /// + /// Gets or sets support metric aggregation type. + /// + [JsonProperty(PropertyName = "supportedAggregationTypes")] + public IList SupportedAggregationTypes { get; set; } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/MetricUnit.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/MetricUnit.cs new file mode 100644 index 0000000000000..2e7ec24b55531 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/MetricUnit.cs @@ -0,0 +1,28 @@ +// +// 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.DataBoxEdge.Models +{ + + /// + /// Defines values for MetricUnit. + /// + public static class MetricUnit + { + public const string NotSpecified = "NotSpecified"; + public const string Percent = "Percent"; + public const string Count = "Count"; + public const string Seconds = "Seconds"; + public const string Milliseconds = "Milliseconds"; + public const string Bytes = "Bytes"; + public const string BytesPerSecond = "BytesPerSecond"; + public const string CountPerSecond = "CountPerSecond"; + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/MonitoringStatus.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/MonitoringStatus.cs new file mode 100644 index 0000000000000..3ffb35ef72999 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/MonitoringStatus.cs @@ -0,0 +1,22 @@ +// +// 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.DataBoxEdge.Models +{ + + /// + /// Defines values for MonitoringStatus. + /// + public static class MonitoringStatus + { + public const string Enabled = "Enabled"; + public const string Disabled = "Disabled"; + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/MountPointMap.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/MountPointMap.cs new file mode 100644 index 0000000000000..add08712e4b4c --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/MountPointMap.cs @@ -0,0 +1,93 @@ +// +// 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.DataBoxEdge.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The share mount point. + /// + public partial class MountPointMap + { + /// + /// Initializes a new instance of the MountPointMap class. + /// + public MountPointMap() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MountPointMap class. + /// + /// ID of the share mounted to the role + /// VM. + /// ID of the role to which share is + /// mounted. + /// Mount point for the share. + /// Role type. Possible values include: 'IOT', + /// 'ASA', 'Functions', 'Cognitive' + public MountPointMap(string shareId, string roleId = default(string), string mountPoint = default(string), string roleType = default(string)) + { + ShareId = shareId; + RoleId = roleId; + MountPoint = mountPoint; + RoleType = roleType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets ID of the share mounted to the role VM. + /// + [JsonProperty(PropertyName = "shareId")] + public string ShareId { get; set; } + + /// + /// Gets ID of the role to which share is mounted. + /// + [JsonProperty(PropertyName = "roleId")] + public string RoleId { get; private set; } + + /// + /// Gets mount point for the share. + /// + [JsonProperty(PropertyName = "mountPoint")] + public string MountPoint { get; private set; } + + /// + /// Gets role type. Possible values include: 'IOT', 'ASA', 'Functions', + /// 'Cognitive' + /// + [JsonProperty(PropertyName = "roleType")] + public string RoleType { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ShareId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ShareId"); + } + } + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/NetworkAdapter.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/NetworkAdapter.cs new file mode 100644 index 0000000000000..f37c73b67b430 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/NetworkAdapter.cs @@ -0,0 +1,177 @@ +// +// 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.DataBoxEdge.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Represents the networkAdapter on a device. + /// + public partial class NetworkAdapter + { + /// + /// Initializes a new instance of the NetworkAdapter class. + /// + public NetworkAdapter() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NetworkAdapter class. + /// + /// Instance ID of network adapter. + /// Hardware position of network + /// adapter. + /// Logical index of the adapter. + /// Node ID of the network adapter. + /// Network adapter name. + /// Hardware label for the adapter. + /// MAC address. + /// Link speed. + /// Value indicating whether this adapter is + /// valid. Possible values include: 'Inactive', 'Active' + /// Value indicating whether this adapter is + /// RDMA capable. Possible values include: 'Incapable', + /// 'Capable' + /// Value indicating whether this adapter has + /// DHCP enabled. Possible values include: 'Disabled', + /// 'Enabled' + /// The IPv4 configuration of the + /// network adapter. + /// The IPv6 configuration of the + /// network adapter. + /// The IPv6 local address. + /// The list of DNS Servers of the + /// device. + public NetworkAdapter(string adapterId = default(string), NetworkAdapterPosition adapterPosition = default(NetworkAdapterPosition), int? index = default(int?), string nodeId = default(string), string networkAdapterName = default(string), string label = default(string), string macAddress = default(string), long? linkSpeed = default(long?), string status = default(string), string rdmaStatus = default(string), string dhcpStatus = default(string), Ipv4Config ipv4Configuration = default(Ipv4Config), Ipv6Config ipv6Configuration = default(Ipv6Config), string ipv6LinkLocalAddress = default(string), IList dnsServers = default(IList)) + { + AdapterId = adapterId; + AdapterPosition = adapterPosition; + Index = index; + NodeId = nodeId; + NetworkAdapterName = networkAdapterName; + Label = label; + MacAddress = macAddress; + LinkSpeed = linkSpeed; + Status = status; + RdmaStatus = rdmaStatus; + DhcpStatus = dhcpStatus; + Ipv4Configuration = ipv4Configuration; + Ipv6Configuration = ipv6Configuration; + Ipv6LinkLocalAddress = ipv6LinkLocalAddress; + DnsServers = dnsServers; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets instance ID of network adapter. + /// + [JsonProperty(PropertyName = "adapterId")] + public string AdapterId { get; private set; } + + /// + /// Gets hardware position of network adapter. + /// + [JsonProperty(PropertyName = "adapterPosition")] + public NetworkAdapterPosition AdapterPosition { get; private set; } + + /// + /// Gets logical index of the adapter. + /// + [JsonProperty(PropertyName = "index")] + public int? Index { get; private set; } + + /// + /// Gets node ID of the network adapter. + /// + [JsonProperty(PropertyName = "nodeId")] + public string NodeId { get; private set; } + + /// + /// Gets network adapter name. + /// + [JsonProperty(PropertyName = "networkAdapterName")] + public string NetworkAdapterName { get; private set; } + + /// + /// Gets hardware label for the adapter. + /// + [JsonProperty(PropertyName = "label")] + public string Label { get; private set; } + + /// + /// Gets MAC address. + /// + [JsonProperty(PropertyName = "macAddress")] + public string MacAddress { get; private set; } + + /// + /// Gets link speed. + /// + [JsonProperty(PropertyName = "linkSpeed")] + public long? LinkSpeed { get; private set; } + + /// + /// Gets value indicating whether this adapter is valid. Possible + /// values include: 'Inactive', 'Active' + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; private set; } + + /// + /// Gets or sets value indicating whether this adapter is RDMA capable. + /// Possible values include: 'Incapable', 'Capable' + /// + [JsonProperty(PropertyName = "rdmaStatus")] + public string RdmaStatus { get; set; } + + /// + /// Gets or sets value indicating whether this adapter has DHCP + /// enabled. Possible values include: 'Disabled', 'Enabled' + /// + [JsonProperty(PropertyName = "dhcpStatus")] + public string DhcpStatus { get; set; } + + /// + /// Gets the IPv4 configuration of the network adapter. + /// + [JsonProperty(PropertyName = "ipv4Configuration")] + public Ipv4Config Ipv4Configuration { get; private set; } + + /// + /// Gets the IPv6 configuration of the network adapter. + /// + [JsonProperty(PropertyName = "ipv6Configuration")] + public Ipv6Config Ipv6Configuration { get; private set; } + + /// + /// Gets the IPv6 local address. + /// + [JsonProperty(PropertyName = "ipv6LinkLocalAddress")] + public string Ipv6LinkLocalAddress { get; private set; } + + /// + /// Gets the list of DNS Servers of the device. + /// + [JsonProperty(PropertyName = "dnsServers")] + public IList DnsServers { get; private set; } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/NetworkAdapterDHCPStatus.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/NetworkAdapterDHCPStatus.cs new file mode 100644 index 0000000000000..6ebce55265a6a --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/NetworkAdapterDHCPStatus.cs @@ -0,0 +1,22 @@ +// +// 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.DataBoxEdge.Models +{ + + /// + /// Defines values for NetworkAdapterDHCPStatus. + /// + public static class NetworkAdapterDHCPStatus + { + public const string Disabled = "Disabled"; + public const string Enabled = "Enabled"; + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/NetworkAdapterPosition.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/NetworkAdapterPosition.cs new file mode 100644 index 0000000000000..fa49472a69348 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/NetworkAdapterPosition.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.DataBoxEdge.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The network adapter position. + /// + public partial class NetworkAdapterPosition + { + /// + /// Initializes a new instance of the NetworkAdapterPosition class. + /// + public NetworkAdapterPosition() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NetworkAdapterPosition class. + /// + /// The network group. Possible values + /// include: 'None', 'NonRDMA', 'RDMA' + /// The port. + public NetworkAdapterPosition(string networkGroup = default(string), int? port = default(int?)) + { + NetworkGroup = networkGroup; + Port = port; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the network group. Possible values include: 'None', 'NonRDMA', + /// 'RDMA' + /// + [JsonProperty(PropertyName = "networkGroup")] + public string NetworkGroup { get; private set; } + + /// + /// Gets the port. + /// + [JsonProperty(PropertyName = "port")] + public int? Port { get; private set; } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/NetworkAdapterRDMAStatus.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/NetworkAdapterRDMAStatus.cs new file mode 100644 index 0000000000000..a2666f7875a81 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/NetworkAdapterRDMAStatus.cs @@ -0,0 +1,22 @@ +// +// 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.DataBoxEdge.Models +{ + + /// + /// Defines values for NetworkAdapterRDMAStatus. + /// + public static class NetworkAdapterRDMAStatus + { + public const string Incapable = "Incapable"; + public const string Capable = "Capable"; + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/NetworkAdapterStatus.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/NetworkAdapterStatus.cs new file mode 100644 index 0000000000000..f28d87ede35e0 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/NetworkAdapterStatus.cs @@ -0,0 +1,22 @@ +// +// 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.DataBoxEdge.Models +{ + + /// + /// Defines values for NetworkAdapterStatus. + /// + public static class NetworkAdapterStatus + { + public const string Inactive = "Inactive"; + public const string Active = "Active"; + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/NetworkGroup.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/NetworkGroup.cs new file mode 100644 index 0000000000000..5fe37e24d7b82 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/NetworkGroup.cs @@ -0,0 +1,23 @@ +// +// 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.DataBoxEdge.Models +{ + + /// + /// Defines values for NetworkGroup. + /// + public static class NetworkGroup + { + public const string None = "None"; + public const string NonRDMA = "NonRDMA"; + public const string RDMA = "RDMA"; + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/NetworkSettings.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/NetworkSettings.cs new file mode 100644 index 0000000000000..5bd47f3808139 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/NetworkSettings.cs @@ -0,0 +1,62 @@ +// +// 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.DataBoxEdge.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The network settings of a device. + /// + [Rest.Serialization.JsonTransformation] + public partial class NetworkSettings : ARMBaseModel + { + /// + /// Initializes a new instance of the NetworkSettings class. + /// + public NetworkSettings() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NetworkSettings class. + /// + /// The path ID that uniquely identifies the + /// object. + /// The object name. + /// The hierarchical type of the object. + /// The network adapter list on the + /// device. + public NetworkSettings(string id = default(string), string name = default(string), string type = default(string), IList networkAdapters = default(IList)) + : base(id, name, type) + { + NetworkAdapters = networkAdapters; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the network adapter list on the device. + /// + [JsonProperty(PropertyName = "properties.networkAdapters")] + public IList NetworkAdapters { get; private set; } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/Node.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/Node.cs new file mode 100644 index 0000000000000..55b74f2c1d67a --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/Node.cs @@ -0,0 +1,119 @@ +// +// 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.DataBoxEdge.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Represents a single node in a Data box Edge/Gateway device + /// Gateway devices, standalone Edge devices and a single node cluster Edge + /// device will all have 1 node + /// Multi-node Edge devices will have more than 1 nodes + /// + [Rest.Serialization.JsonTransformation] + public partial class Node : ARMBaseModel + { + /// + /// Initializes a new instance of the Node class. + /// + public Node() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Node class. + /// + /// The path ID that uniquely identifies the + /// object. + /// The object name. + /// The hierarchical type of the object. + /// The current status of the individual node. + /// Possible values include: 'Unknown', 'Up', 'Down', 'Rebooting', + /// 'ShuttingDown' + /// Serial number of the + /// Chassis + /// Serial number of the individual + /// node + /// Display Name of the individual + /// node + /// Friendly software version + /// name that is currently installed on the node + /// HCS version that is currently + /// installed on the node + /// Guid instance id of the node + public Node(string id = default(string), string name = default(string), string type = default(string), string nodeStatus = default(string), string nodeChassisSerialNumber = default(string), string nodeSerialNumber = default(string), string nodeDisplayName = default(string), string nodeFriendlySoftwareVersion = default(string), string nodeHcsVersion = default(string), string nodeInstanceId = default(string)) + : base(id, name, type) + { + NodeStatus = nodeStatus; + NodeChassisSerialNumber = nodeChassisSerialNumber; + NodeSerialNumber = nodeSerialNumber; + NodeDisplayName = nodeDisplayName; + NodeFriendlySoftwareVersion = nodeFriendlySoftwareVersion; + NodeHcsVersion = nodeHcsVersion; + NodeInstanceId = nodeInstanceId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the current status of the individual node. Possible values + /// include: 'Unknown', 'Up', 'Down', 'Rebooting', 'ShuttingDown' + /// + [JsonProperty(PropertyName = "properties.nodeStatus")] + public string NodeStatus { get; private set; } + + /// + /// Gets serial number of the Chassis + /// + [JsonProperty(PropertyName = "properties.nodeChassisSerialNumber")] + public string NodeChassisSerialNumber { get; private set; } + + /// + /// Gets serial number of the individual node + /// + [JsonProperty(PropertyName = "properties.nodeSerialNumber")] + public string NodeSerialNumber { get; private set; } + + /// + /// Gets display Name of the individual node + /// + [JsonProperty(PropertyName = "properties.nodeDisplayName")] + public string NodeDisplayName { get; private set; } + + /// + /// Gets friendly software version name that is currently installed on + /// the node + /// + [JsonProperty(PropertyName = "properties.nodeFriendlySoftwareVersion")] + public string NodeFriendlySoftwareVersion { get; private set; } + + /// + /// Gets HCS version that is currently installed on the node + /// + [JsonProperty(PropertyName = "properties.nodeHcsVersion")] + public string NodeHcsVersion { get; private set; } + + /// + /// Gets guid instance id of the node + /// + [JsonProperty(PropertyName = "properties.nodeInstanceId")] + public string NodeInstanceId { get; private set; } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/NodeStatus.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/NodeStatus.cs new file mode 100644 index 0000000000000..d362f8f12ec93 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/NodeStatus.cs @@ -0,0 +1,25 @@ +// +// 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.DataBoxEdge.Models +{ + + /// + /// Defines values for NodeStatus. + /// + public static class NodeStatus + { + public const string Unknown = "Unknown"; + public const string Up = "Up"; + public const string Down = "Down"; + public const string Rebooting = "Rebooting"; + public const string ShuttingDown = "ShuttingDown"; + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/Operation.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/Operation.cs new file mode 100644 index 0000000000000..48745c6705ce5 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/Operation.cs @@ -0,0 +1,79 @@ +// +// 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.DataBoxEdge.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Operations. + /// + [Rest.Serialization.JsonTransformation] + public partial class Operation + { + /// + /// Initializes a new instance of the Operation class. + /// + public Operation() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Operation class. + /// + /// Name of the operation. + /// Properties displayed for the + /// operation. + /// Origin of the operation. + /// Service specification. + public Operation(string name = default(string), OperationDisplay display = default(OperationDisplay), string origin = default(string), ServiceSpecification serviceSpecification = default(ServiceSpecification)) + { + Name = name; + Display = display; + Origin = origin; + ServiceSpecification = serviceSpecification; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets name of the operation. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets properties displayed for the operation. + /// + [JsonProperty(PropertyName = "display")] + public OperationDisplay Display { get; set; } + + /// + /// Gets or sets origin of the operation. + /// + [JsonProperty(PropertyName = "origin")] + public string Origin { get; set; } + + /// + /// Gets or sets service specification. + /// + [JsonProperty(PropertyName = "properties.serviceSpecification")] + public ServiceSpecification ServiceSpecification { get; set; } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/OperationDisplay.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/OperationDisplay.cs new file mode 100644 index 0000000000000..8bd056150003f --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/OperationDisplay.cs @@ -0,0 +1,79 @@ +// +// 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.DataBoxEdge.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Operation display properties. + /// + public partial class OperationDisplay + { + /// + /// Initializes a new instance of the OperationDisplay class. + /// + public OperationDisplay() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OperationDisplay class. + /// + /// Provider name. + /// The type of resource in which the operation + /// is performed. + /// Operation to be performed on the + /// resource. + /// Description of the operation to be + /// performed. + public OperationDisplay(string provider = default(string), string resource = default(string), string operation = default(string), string description = default(string)) + { + Provider = provider; + Resource = resource; + Operation = operation; + Description = description; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets provider name. + /// + [JsonProperty(PropertyName = "provider")] + public string Provider { get; set; } + + /// + /// Gets or sets the type of resource in which the operation is + /// performed. + /// + [JsonProperty(PropertyName = "resource")] + public string Resource { get; set; } + + /// + /// Gets or sets operation to be performed on the resource. + /// + [JsonProperty(PropertyName = "operation")] + public string Operation { get; set; } + + /// + /// Gets or sets description of the operation to be performed. + /// + [JsonProperty(PropertyName = "description")] + public string Description { get; set; } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/Order.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/Order.cs new file mode 100644 index 0000000000000..7d865c04d7857 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/Order.cs @@ -0,0 +1,155 @@ +// +// 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.DataBoxEdge.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The order details. + /// + [Rest.Serialization.JsonTransformation] + public partial class Order : ARMBaseModel + { + /// + /// Initializes a new instance of the Order class. + /// + public Order() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Order class. + /// + /// The contact details. + /// The shipping address. + /// The path ID that uniquely identifies the + /// object. + /// The object name. + /// The hierarchical type of the object. + /// Current status of the order. + /// List of status changes in the + /// order. + /// Serial number of the device. + /// Tracking information for the + /// package delivered to the customer whether it has an original or a + /// replacement device. + /// Tracking information for the + /// package returned from the customer whether it has an original or a + /// replacement device. + public Order(ContactDetails contactInformation, Address shippingAddress, string id = default(string), string name = default(string), string type = default(string), OrderStatus currentStatus = default(OrderStatus), IList orderHistory = default(IList), string serialNumber = default(string), IList deliveryTrackingInfo = default(IList), IList returnTrackingInfo = default(IList)) + : base(id, name, type) + { + ContactInformation = contactInformation; + ShippingAddress = shippingAddress; + CurrentStatus = currentStatus; + OrderHistory = orderHistory; + SerialNumber = serialNumber; + DeliveryTrackingInfo = deliveryTrackingInfo; + ReturnTrackingInfo = returnTrackingInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the contact details. + /// + [JsonProperty(PropertyName = "properties.contactInformation")] + public ContactDetails ContactInformation { get; set; } + + /// + /// Gets or sets the shipping address. + /// + [JsonProperty(PropertyName = "properties.shippingAddress")] + public Address ShippingAddress { get; set; } + + /// + /// Gets or sets current status of the order. + /// + [JsonProperty(PropertyName = "properties.currentStatus")] + public OrderStatus CurrentStatus { get; set; } + + /// + /// Gets list of status changes in the order. + /// + [JsonProperty(PropertyName = "properties.orderHistory")] + public IList OrderHistory { get; private set; } + + /// + /// Gets serial number of the device. + /// + [JsonProperty(PropertyName = "properties.serialNumber")] + public string SerialNumber { get; private set; } + + /// + /// Gets tracking information for the package delivered to the customer + /// whether it has an original or a replacement device. + /// + [JsonProperty(PropertyName = "properties.deliveryTrackingInfo")] + public IList DeliveryTrackingInfo { get; private set; } + + /// + /// Gets tracking information for the package returned from the + /// customer whether it has an original or a replacement device. + /// + [JsonProperty(PropertyName = "properties.returnTrackingInfo")] + public IList ReturnTrackingInfo { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ContactInformation == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ContactInformation"); + } + if (ShippingAddress == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ShippingAddress"); + } + if (ContactInformation != null) + { + ContactInformation.Validate(); + } + if (ShippingAddress != null) + { + ShippingAddress.Validate(); + } + if (CurrentStatus != null) + { + CurrentStatus.Validate(); + } + if (OrderHistory != null) + { + foreach (var element in OrderHistory) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/OrderState.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/OrderState.cs new file mode 100644 index 0000000000000..bee9de653830d --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/OrderState.cs @@ -0,0 +1,34 @@ +// +// 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.DataBoxEdge.Models +{ + + /// + /// Defines values for OrderState. + /// + public static class OrderState + { + public const string Untracked = "Untracked"; + public const string AwaitingFulfilment = "AwaitingFulfilment"; + public const string AwaitingPreparation = "AwaitingPreparation"; + public const string AwaitingShipment = "AwaitingShipment"; + public const string Shipped = "Shipped"; + public const string Arriving = "Arriving"; + public const string Delivered = "Delivered"; + public const string ReplacementRequested = "ReplacementRequested"; + public const string LostDevice = "LostDevice"; + public const string Declined = "Declined"; + public const string ReturnInitiated = "ReturnInitiated"; + public const string AwaitingReturnShipment = "AwaitingReturnShipment"; + public const string ShippedBack = "ShippedBack"; + public const string CollectedAtMicrosoft = "CollectedAtMicrosoft"; + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/OrderStatus.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/OrderStatus.cs new file mode 100644 index 0000000000000..be4f936dc57b7 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/OrderStatus.cs @@ -0,0 +1,105 @@ +// +// 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.DataBoxEdge.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Represents a single status change. + /// + public partial class OrderStatus + { + /// + /// Initializes a new instance of the OrderStatus class. + /// + public OrderStatus() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the OrderStatus class. + /// + /// Status of the order as per the allowed status + /// types. Possible values include: 'Untracked', 'AwaitingFulfilment', + /// 'AwaitingPreparation', 'AwaitingShipment', 'Shipped', 'Arriving', + /// 'Delivered', 'ReplacementRequested', 'LostDevice', 'Declined', + /// 'ReturnInitiated', 'AwaitingReturnShipment', 'ShippedBack', + /// 'CollectedAtMicrosoft' + /// Time of status update. + /// Comments related to this status + /// change. + /// Dictionary to hold generic + /// information which is not stored + /// by the already existing properties + public OrderStatus(string status, System.DateTime? updateDateTime = default(System.DateTime?), string comments = default(string), IDictionary additionalOrderDetails = default(IDictionary)) + { + Status = status; + UpdateDateTime = updateDateTime; + Comments = comments; + AdditionalOrderDetails = additionalOrderDetails; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets status of the order as per the allowed status types. + /// Possible values include: 'Untracked', 'AwaitingFulfilment', + /// 'AwaitingPreparation', 'AwaitingShipment', 'Shipped', 'Arriving', + /// 'Delivered', 'ReplacementRequested', 'LostDevice', 'Declined', + /// 'ReturnInitiated', 'AwaitingReturnShipment', 'ShippedBack', + /// 'CollectedAtMicrosoft' + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; set; } + + /// + /// Gets time of status update. + /// + [JsonProperty(PropertyName = "updateDateTime")] + public System.DateTime? UpdateDateTime { get; private set; } + + /// + /// Gets or sets comments related to this status change. + /// + [JsonProperty(PropertyName = "comments")] + public string Comments { get; set; } + + /// + /// Gets dictionary to hold generic information which is not stored + /// by the already existing properties + /// + [JsonProperty(PropertyName = "additionalOrderDetails")] + public IDictionary AdditionalOrderDetails { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Status == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Status"); + } + } + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/Page.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/Page.cs new file mode 100644 index 0000000000000..4295ab0628f44 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/Page.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.DataBoxEdge.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + + /// + /// Defines a page in Azure responses. + /// + /// Type of the page content items + [JsonObject] + public class Page : IPage + { + /// + /// Gets the link to the next page. + /// + [JsonProperty("nextLink")] + public string NextPageLink { get; private set; } + + [JsonProperty("value")] + private IList Items{ get; set; } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + public IEnumerator GetEnumerator() + { + return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/Page1.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/Page1.cs new file mode 100644 index 0000000000000..6f772b479e321 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/Page1.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.DataBoxEdge.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + + /// + /// Defines a page in Azure responses. + /// + /// Type of the page content items + [JsonObject] + public class Page1 : IPage + { + /// + /// Gets the link to the next page. + /// + [JsonProperty("")] + public string NextPageLink { get; private set; } + + [JsonProperty("value")] + private IList Items{ get; set; } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + public IEnumerator GetEnumerator() + { + return Items == null ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); + } + + /// + /// Returns an enumerator that iterates through the collection. + /// + /// A an enumerator that can be used to iterate through the collection. + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/PeriodicTimerEventTrigger.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/PeriodicTimerEventTrigger.cs new file mode 100644 index 0000000000000..140fef6d505a9 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/PeriodicTimerEventTrigger.cs @@ -0,0 +1,108 @@ +// +// 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.DataBoxEdge.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Trigger details. + /// + [Newtonsoft.Json.JsonObject("PeriodicTimerEvent")] + [Rest.Serialization.JsonTransformation] + public partial class PeriodicTimerEventTrigger : Trigger + { + /// + /// Initializes a new instance of the PeriodicTimerEventTrigger class. + /// + public PeriodicTimerEventTrigger() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PeriodicTimerEventTrigger class. + /// + /// Periodic timer details. + /// Role Sink information. + /// The path ID that uniquely identifies the + /// object. + /// The object name. + /// The hierarchical type of the object. + /// A custom context tag typically used + /// to correlate the trigger against its usage. For example, if a + /// periodic timer trigger is intended for certain specific IoT modules + /// in the device, the tag can be the name or the image URL of the + /// module. + public PeriodicTimerEventTrigger(PeriodicTimerSourceInfo sourceInfo, RoleSinkInfo sinkInfo, string id = default(string), string name = default(string), string type = default(string), string customContextTag = default(string)) + : base(id, name, type) + { + SourceInfo = sourceInfo; + SinkInfo = sinkInfo; + CustomContextTag = customContextTag; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets periodic timer details. + /// + [JsonProperty(PropertyName = "properties.sourceInfo")] + public PeriodicTimerSourceInfo SourceInfo { get; set; } + + /// + /// Gets or sets role Sink information. + /// + [JsonProperty(PropertyName = "properties.sinkInfo")] + public RoleSinkInfo SinkInfo { get; set; } + + /// + /// Gets or sets a custom context tag typically used to correlate the + /// trigger against its usage. For example, if a periodic timer trigger + /// is intended for certain specific IoT modules in the device, the tag + /// can be the name or the image URL of the module. + /// + [JsonProperty(PropertyName = "properties.customContextTag")] + public string CustomContextTag { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (SourceInfo == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "SourceInfo"); + } + if (SinkInfo == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "SinkInfo"); + } + if (SourceInfo != null) + { + SourceInfo.Validate(); + } + if (SinkInfo != null) + { + SinkInfo.Validate(); + } + } + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/PeriodicTimerSourceInfo.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/PeriodicTimerSourceInfo.cs new file mode 100644 index 0000000000000..7116360158ecb --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/PeriodicTimerSourceInfo.cs @@ -0,0 +1,94 @@ +// +// 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.DataBoxEdge.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Periodic timer event source. + /// + public partial class PeriodicTimerSourceInfo + { + /// + /// Initializes a new instance of the PeriodicTimerSourceInfo class. + /// + public PeriodicTimerSourceInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PeriodicTimerSourceInfo class. + /// + /// The time of the day that results in a valid + /// trigger. Schedule is computed with reference to the time specified + /// upto seconds. If timezone is not specified the time will considered + /// to be in device timezone. The value will always be returned as UTC + /// time. + /// Periodic frequency at which timer event + /// needs to be raised. Supports daily, hourly, minutes, and + /// seconds. + /// Topic where periodic events are published to + /// IoT device. + public PeriodicTimerSourceInfo(System.DateTime startTime, string schedule, string topic = default(string)) + { + StartTime = startTime; + Schedule = schedule; + Topic = topic; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the time of the day that results in a valid trigger. + /// Schedule is computed with reference to the time specified upto + /// seconds. If timezone is not specified the time will considered to + /// be in device timezone. The value will always be returned as UTC + /// time. + /// + [JsonProperty(PropertyName = "startTime")] + public System.DateTime StartTime { get; set; } + + /// + /// Gets or sets periodic frequency at which timer event needs to be + /// raised. Supports daily, hourly, minutes, and seconds. + /// + [JsonProperty(PropertyName = "schedule")] + public string Schedule { get; set; } + + /// + /// Gets or sets topic where periodic events are published to IoT + /// device. + /// + [JsonProperty(PropertyName = "topic")] + public string Topic { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Schedule == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Schedule"); + } + } + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/PlatformType.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/PlatformType.cs new file mode 100644 index 0000000000000..bf5fc563c4637 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/PlatformType.cs @@ -0,0 +1,22 @@ +// +// 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.DataBoxEdge.Models +{ + + /// + /// Defines values for PlatformType. + /// + public static class PlatformType + { + public const string Windows = "Windows"; + public const string Linux = "Linux"; + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/RefreshDetails.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/RefreshDetails.cs new file mode 100644 index 0000000000000..a87ac13e25a94 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/RefreshDetails.cs @@ -0,0 +1,94 @@ +// +// 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.DataBoxEdge.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Fields for tracking refresh job on the share or container. + /// + public partial class RefreshDetails + { + /// + /// Initializes a new instance of the RefreshDetails class. + /// + public RefreshDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RefreshDetails class. + /// + /// If a refresh job is currently + /// in progress on this share or container, this field indicates the + /// ARM resource ID of that job. The field is empty if no job is in + /// progress. + /// Indicates the + /// completed time for the last refresh job on this particular share or + /// container, if any.This could be a failed job or a successful + /// job. + /// Indicates the relative path of the + /// error xml for the last refresh job on this particular share or + /// container, if any. This could be a failed job or a successful + /// job. + /// Indicates the id of the last refresh job on + /// this particular share or container,if any. This could be a failed + /// job or a successful job. + public RefreshDetails(string inProgressRefreshJobId = default(string), System.DateTime? lastCompletedRefreshJobTimeInUTC = default(System.DateTime?), string errorManifestFile = default(string), string lastJob = default(string)) + { + InProgressRefreshJobId = inProgressRefreshJobId; + LastCompletedRefreshJobTimeInUTC = lastCompletedRefreshJobTimeInUTC; + ErrorManifestFile = errorManifestFile; + LastJob = lastJob; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets if a refresh job is currently in progress on this + /// share or container, this field indicates the ARM resource ID of + /// that job. The field is empty if no job is in progress. + /// + [JsonProperty(PropertyName = "inProgressRefreshJobId")] + public string InProgressRefreshJobId { get; set; } + + /// + /// Gets or sets indicates the completed time for the last refresh job + /// on this particular share or container, if any.This could be a + /// failed job or a successful job. + /// + [JsonProperty(PropertyName = "lastCompletedRefreshJobTimeInUTC")] + public System.DateTime? LastCompletedRefreshJobTimeInUTC { get; set; } + + /// + /// Gets or sets indicates the relative path of the error xml for the + /// last refresh job on this particular share or container, if any. + /// This could be a failed job or a successful job. + /// + [JsonProperty(PropertyName = "errorManifestFile")] + public string ErrorManifestFile { get; set; } + + /// + /// Gets or sets indicates the id of the last refresh job on this + /// particular share or container,if any. This could be a failed job or + /// a successful job. + /// + [JsonProperty(PropertyName = "lastJob")] + public string LastJob { get; set; } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/ResourceTypeSku.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/ResourceTypeSku.cs new file mode 100644 index 0000000000000..ec0186fe7c3ba --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/ResourceTypeSku.cs @@ -0,0 +1,136 @@ +// +// 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.DataBoxEdge.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// SkuInformation object + /// + public partial class ResourceTypeSku + { + /// + /// Initializes a new instance of the ResourceTypeSku class. + /// + public ResourceTypeSku() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ResourceTypeSku class. + /// + /// The type of the resource + /// The Sku name. Possible values include: + /// 'Gateway', 'Edge', 'TEA_1Node', 'TEA_1Node_UPS', + /// 'TEA_1Node_Heater', 'TEA_1Node_UPS_Heater', 'TEA_4Node_Heater', + /// 'TEA_4Node_UPS_Heater', 'TMA' + /// The Sku kind + /// The Sku tier. Possible values include: + /// 'Standard' + /// The Sku family + /// Availability of the SKU for the + /// region + /// The API versions in which SKU is + /// available + /// Availability of the SKU for the + /// location/zone + /// The pricing info of the Sku. + /// Restrictions of the SKU + /// availability. + public ResourceTypeSku(string resourceType = default(string), string name = default(string), string kind = default(string), string tier = default(string), string family = default(string), IList locations = default(IList), IList apiVersions = default(IList), IList locationInfo = default(IList), IList costs = default(IList), IList restrictions = default(IList)) + { + ResourceType = resourceType; + Name = name; + Kind = kind; + Tier = tier; + Family = family; + Locations = locations; + ApiVersions = apiVersions; + LocationInfo = locationInfo; + Costs = costs; + Restrictions = restrictions; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the type of the resource + /// + [JsonProperty(PropertyName = "resourceType")] + public string ResourceType { get; private set; } + + /// + /// Gets the Sku name. Possible values include: 'Gateway', 'Edge', + /// 'TEA_1Node', 'TEA_1Node_UPS', 'TEA_1Node_Heater', + /// 'TEA_1Node_UPS_Heater', 'TEA_4Node_Heater', 'TEA_4Node_UPS_Heater', + /// 'TMA' + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets the Sku kind + /// + [JsonProperty(PropertyName = "kind")] + public string Kind { get; private set; } + + /// + /// Gets the Sku tier. Possible values include: 'Standard' + /// + [JsonProperty(PropertyName = "tier")] + public string Tier { get; private set; } + + /// + /// Gets the Sku family + /// + [JsonProperty(PropertyName = "family")] + public string Family { get; private set; } + + /// + /// Gets availability of the SKU for the region + /// + [JsonProperty(PropertyName = "locations")] + public IList Locations { get; private set; } + + /// + /// Gets the API versions in which SKU is available + /// + [JsonProperty(PropertyName = "apiVersions")] + public IList ApiVersions { get; private set; } + + /// + /// Gets availability of the SKU for the location/zone + /// + [JsonProperty(PropertyName = "locationInfo")] + public IList LocationInfo { get; private set; } + + /// + /// Gets the pricing info of the Sku. + /// + [JsonProperty(PropertyName = "costs")] + public IList Costs { get; private set; } + + /// + /// Gets restrictions of the SKU availability. + /// + [JsonProperty(PropertyName = "restrictions")] + public IList Restrictions { get; private set; } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/Role.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/Role.cs new file mode 100644 index 0000000000000..440e7fc12d3ed --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/Role.cs @@ -0,0 +1,47 @@ +// +// 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.DataBoxEdge.Models +{ + using System.Linq; + + /// + /// Compute role. + /// + public partial class Role : ARMBaseModel + { + /// + /// Initializes a new instance of the Role class. + /// + public Role() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Role class. + /// + /// The path ID that uniquely identifies the + /// object. + /// The object name. + /// The hierarchical type of the object. + public Role(string id = default(string), string name = default(string), string type = default(string)) + : base(id, name, type) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/RoleSinkInfo.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/RoleSinkInfo.cs new file mode 100644 index 0000000000000..d63c3af106ccd --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/RoleSinkInfo.cs @@ -0,0 +1,65 @@ +// +// 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.DataBoxEdge.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Compute role against which events will be raised. + /// + public partial class RoleSinkInfo + { + /// + /// Initializes a new instance of the RoleSinkInfo class. + /// + public RoleSinkInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RoleSinkInfo class. + /// + /// Compute role ID. + public RoleSinkInfo(string roleId) + { + RoleId = roleId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets compute role ID. + /// + [JsonProperty(PropertyName = "roleId")] + public string RoleId { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (RoleId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "RoleId"); + } + } + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/RoleStatus.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/RoleStatus.cs new file mode 100644 index 0000000000000..dfcbef6ff91a4 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/RoleStatus.cs @@ -0,0 +1,22 @@ +// +// 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.DataBoxEdge.Models +{ + + /// + /// Defines values for RoleStatus. + /// + public static class RoleStatus + { + public const string Enabled = "Enabled"; + public const string Disabled = "Disabled"; + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/RoleTypes.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/RoleTypes.cs new file mode 100644 index 0000000000000..94034e2a2f0ce --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/RoleTypes.cs @@ -0,0 +1,24 @@ +// +// 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.DataBoxEdge.Models +{ + + /// + /// Defines values for RoleTypes. + /// + public static class RoleTypes + { + public const string IOT = "IOT"; + public const string ASA = "ASA"; + public const string Functions = "Functions"; + public const string Cognitive = "Cognitive"; + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/SSLStatus.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/SSLStatus.cs new file mode 100644 index 0000000000000..ad26d23d97cd7 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/SSLStatus.cs @@ -0,0 +1,22 @@ +// +// 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.DataBoxEdge.Models +{ + + /// + /// Defines values for SSLStatus. + /// + public static class SSLStatus + { + public const string Enabled = "Enabled"; + public const string Disabled = "Disabled"; + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/SecuritySettings.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/SecuritySettings.cs new file mode 100644 index 0000000000000..1b53675fec695 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/SecuritySettings.cs @@ -0,0 +1,84 @@ +// +// 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.DataBoxEdge.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The security settings of a device. + /// + [Rest.Serialization.JsonTransformation] + public partial class SecuritySettings : ARMBaseModel + { + /// + /// Initializes a new instance of the SecuritySettings class. + /// + public SecuritySettings() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SecuritySettings class. + /// + /// Device administrator password as + /// an encrypted string (encrypted using RSA PKCS #1) is used to sign + /// into the local web UI of the device. The Actual password should + /// have at least 8 characters that are a combination of uppercase, + /// lowercase, numeric, and special characters. + /// The path ID that uniquely identifies the + /// object. + /// The object name. + /// The hierarchical type of the object. + public SecuritySettings(AsymmetricEncryptedSecret deviceAdminPassword, string id = default(string), string name = default(string), string type = default(string)) + : base(id, name, type) + { + DeviceAdminPassword = deviceAdminPassword; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets device administrator password as an encrypted string + /// (encrypted using RSA PKCS #1) is used to sign into the local web + /// UI of the device. The Actual password should have at least 8 + /// characters that are a combination of uppercase, lowercase, + /// numeric, and special characters. + /// + [JsonProperty(PropertyName = "properties.deviceAdminPassword")] + public AsymmetricEncryptedSecret DeviceAdminPassword { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (DeviceAdminPassword == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "DeviceAdminPassword"); + } + if (DeviceAdminPassword != null) + { + DeviceAdminPassword.Validate(); + } + } + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/ServiceSpecification.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/ServiceSpecification.cs new file mode 100644 index 0000000000000..545d0851e59d4 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/ServiceSpecification.cs @@ -0,0 +1,54 @@ +// +// 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.DataBoxEdge.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Service specification. + /// + public partial class ServiceSpecification + { + /// + /// Initializes a new instance of the ServiceSpecification class. + /// + public ServiceSpecification() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ServiceSpecification class. + /// + /// Metric specification as defined + /// by shoebox. + public ServiceSpecification(IList metricSpecifications = default(IList)) + { + MetricSpecifications = metricSpecifications; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets metric specification as defined by shoebox. + /// + [JsonProperty(PropertyName = "metricSpecifications")] + public IList MetricSpecifications { get; set; } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/Share.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/Share.cs new file mode 100644 index 0000000000000..63b1742b7504b --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/Share.cs @@ -0,0 +1,204 @@ +// +// 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.DataBoxEdge.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Represents a share on the Data Box Edge/Gateway device. + /// + [Rest.Serialization.JsonTransformation] + public partial class Share : ARMBaseModel + { + /// + /// Initializes a new instance of the Share class. + /// + public Share() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Share class. + /// + /// Current status of the share. Possible + /// values include: 'Offline', 'Unknown', 'OK', 'Updating', + /// 'NeedsAttention' + /// Current monitoring status of the + /// share. Possible values include: 'Enabled', 'Disabled' + /// Access protocol to be used by the + /// share. Possible values include: 'SMB', 'NFS' + /// The path ID that uniquely identifies the + /// object. + /// The object name. + /// The hierarchical type of the object. + /// Description for the share. + /// Azure container mapping for the + /// share. + /// Mapping of users and corresponding + /// access rights on the share (required for SMB protocol). + /// List of IP addresses and + /// corresponding access rights on the share(required for NFS + /// protocol). + /// Details of the refresh job on this + /// share. + /// Share mount point to the role. + /// Data policy of the share. Possible values + /// include: 'Cloud', 'Local' + public Share(string shareStatus, string monitoringStatus, string accessProtocol, string id = default(string), string name = default(string), string type = default(string), string description = default(string), AzureContainerInfo azureContainerInfo = default(AzureContainerInfo), IList userAccessRights = default(IList), IList clientAccessRights = default(IList), RefreshDetails refreshDetails = default(RefreshDetails), IList shareMappings = default(IList), string dataPolicy = default(string)) + : base(id, name, type) + { + Description = description; + ShareStatus = shareStatus; + MonitoringStatus = monitoringStatus; + AzureContainerInfo = azureContainerInfo; + AccessProtocol = accessProtocol; + UserAccessRights = userAccessRights; + ClientAccessRights = clientAccessRights; + RefreshDetails = refreshDetails; + ShareMappings = shareMappings; + DataPolicy = dataPolicy; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets description for the share. + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; set; } + + /// + /// Gets or sets current status of the share. Possible values include: + /// 'Offline', 'Unknown', 'OK', 'Updating', 'NeedsAttention' + /// + [JsonProperty(PropertyName = "properties.shareStatus")] + public string ShareStatus { get; set; } + + /// + /// Gets or sets current monitoring status of the share. Possible + /// values include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "properties.monitoringStatus")] + public string MonitoringStatus { get; set; } + + /// + /// Gets or sets azure container mapping for the share. + /// + [JsonProperty(PropertyName = "properties.azureContainerInfo")] + public AzureContainerInfo AzureContainerInfo { get; set; } + + /// + /// Gets or sets access protocol to be used by the share. Possible + /// values include: 'SMB', 'NFS' + /// + [JsonProperty(PropertyName = "properties.accessProtocol")] + public string AccessProtocol { get; set; } + + /// + /// Gets or sets mapping of users and corresponding access rights on + /// the share (required for SMB protocol). + /// + [JsonProperty(PropertyName = "properties.userAccessRights")] + public IList UserAccessRights { get; set; } + + /// + /// Gets or sets list of IP addresses and corresponding access rights + /// on the share(required for NFS protocol). + /// + [JsonProperty(PropertyName = "properties.clientAccessRights")] + public IList ClientAccessRights { get; set; } + + /// + /// Gets or sets details of the refresh job on this share. + /// + [JsonProperty(PropertyName = "properties.refreshDetails")] + public RefreshDetails RefreshDetails { get; set; } + + /// + /// Gets share mount point to the role. + /// + [JsonProperty(PropertyName = "properties.shareMappings")] + public IList ShareMappings { get; private set; } + + /// + /// Gets or sets data policy of the share. Possible values include: + /// 'Cloud', 'Local' + /// + [JsonProperty(PropertyName = "properties.dataPolicy")] + public string DataPolicy { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ShareStatus == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ShareStatus"); + } + if (MonitoringStatus == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "MonitoringStatus"); + } + if (AccessProtocol == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "AccessProtocol"); + } + if (AzureContainerInfo != null) + { + AzureContainerInfo.Validate(); + } + if (UserAccessRights != null) + { + foreach (var element in UserAccessRights) + { + if (element != null) + { + element.Validate(); + } + } + } + if (ClientAccessRights != null) + { + foreach (var element1 in ClientAccessRights) + { + if (element1 != null) + { + element1.Validate(); + } + } + } + if (ShareMappings != null) + { + foreach (var element2 in ShareMappings) + { + if (element2 != null) + { + element2.Validate(); + } + } + } + } + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/ShareAccessProtocol.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/ShareAccessProtocol.cs new file mode 100644 index 0000000000000..fc1c4e137e32f --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/ShareAccessProtocol.cs @@ -0,0 +1,22 @@ +// +// 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.DataBoxEdge.Models +{ + + /// + /// Defines values for ShareAccessProtocol. + /// + public static class ShareAccessProtocol + { + public const string SMB = "SMB"; + public const string NFS = "NFS"; + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/ShareAccessRight.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/ShareAccessRight.cs new file mode 100644 index 0000000000000..5bdd4b2e7e1b9 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/ShareAccessRight.cs @@ -0,0 +1,81 @@ +// +// 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.DataBoxEdge.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Specifies the mapping between this particular user and the type of + /// access he has on shares on this device. + /// + public partial class ShareAccessRight + { + /// + /// Initializes a new instance of the ShareAccessRight class. + /// + public ShareAccessRight() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ShareAccessRight class. + /// + /// The share ID. + /// Type of access to be allowed on the share + /// for this user. Possible values include: 'Change', 'Read', + /// 'Custom' + public ShareAccessRight(string shareId, string accessType) + { + ShareId = shareId; + AccessType = accessType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the share ID. + /// + [JsonProperty(PropertyName = "shareId")] + public string ShareId { get; set; } + + /// + /// Gets or sets type of access to be allowed on the share for this + /// user. Possible values include: 'Change', 'Read', 'Custom' + /// + [JsonProperty(PropertyName = "accessType")] + public string AccessType { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ShareId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ShareId"); + } + if (AccessType == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "AccessType"); + } + } + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/ShareAccessType.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/ShareAccessType.cs new file mode 100644 index 0000000000000..b12ba9bab2f23 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/ShareAccessType.cs @@ -0,0 +1,23 @@ +// +// 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.DataBoxEdge.Models +{ + + /// + /// Defines values for ShareAccessType. + /// + public static class ShareAccessType + { + public const string Change = "Change"; + public const string Read = "Read"; + public const string Custom = "Custom"; + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/ShareStatus.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/ShareStatus.cs new file mode 100644 index 0000000000000..bb4fe1eed47f0 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/ShareStatus.cs @@ -0,0 +1,25 @@ +// +// 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.DataBoxEdge.Models +{ + + /// + /// Defines values for ShareStatus. + /// + public static class ShareStatus + { + public const string Offline = "Offline"; + public const string Unknown = "Unknown"; + public const string OK = "OK"; + public const string Updating = "Updating"; + public const string NeedsAttention = "NeedsAttention"; + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/Sku.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/Sku.cs new file mode 100644 index 0000000000000..2472861f8aa89 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/Sku.cs @@ -0,0 +1,67 @@ +// +// 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.DataBoxEdge.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The SKU type. + /// + public partial class Sku + { + /// + /// Initializes a new instance of the Sku class. + /// + public Sku() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Sku class. + /// + /// SKU name. Possible values include: 'Gateway', + /// 'Edge', 'TEA_1Node', 'TEA_1Node_UPS', 'TEA_1Node_Heater', + /// 'TEA_1Node_UPS_Heater', 'TEA_4Node_Heater', 'TEA_4Node_UPS_Heater', + /// 'TMA' + /// The SKU tier. This is based on the SKU name. + /// Possible values include: 'Standard' + public Sku(string name = default(string), string tier = default(string)) + { + Name = name; + Tier = tier; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets SKU name. Possible values include: 'Gateway', 'Edge', + /// 'TEA_1Node', 'TEA_1Node_UPS', 'TEA_1Node_Heater', + /// 'TEA_1Node_UPS_Heater', 'TEA_4Node_Heater', 'TEA_4Node_UPS_Heater', + /// 'TMA' + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the SKU tier. This is based on the SKU name. Possible + /// values include: 'Standard' + /// + [JsonProperty(PropertyName = "tier")] + public string Tier { get; set; } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/SkuCost.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/SkuCost.cs new file mode 100644 index 0000000000000..6c73419da186b --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/SkuCost.cs @@ -0,0 +1,69 @@ +// +// 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.DataBoxEdge.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The metadata for retrieving price info. + /// + public partial class SkuCost + { + /// + /// Initializes a new instance of the SkuCost class. + /// + public SkuCost() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SkuCost class. + /// + /// Used for querying price from + /// commerce. + /// The cost quantity. + /// Restriction of the SKU for the + /// location/zone + public SkuCost(string meterId = default(string), long? quantity = default(long?), string extendedUnit = default(string)) + { + MeterId = meterId; + Quantity = quantity; + ExtendedUnit = extendedUnit; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets used for querying price from commerce. + /// + [JsonProperty(PropertyName = "meterId")] + public string MeterId { get; private set; } + + /// + /// Gets the cost quantity. + /// + [JsonProperty(PropertyName = "quantity")] + public long? Quantity { get; private set; } + + /// + /// Gets restriction of the SKU for the location/zone + /// + [JsonProperty(PropertyName = "extendedUnit")] + public string ExtendedUnit { get; private set; } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/SkuLocationInfo.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/SkuLocationInfo.cs new file mode 100644 index 0000000000000..8a82a1a22d783 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/SkuLocationInfo.cs @@ -0,0 +1,69 @@ +// +// 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.DataBoxEdge.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The location info. + /// + public partial class SkuLocationInfo + { + /// + /// Initializes a new instance of the SkuLocationInfo class. + /// + public SkuLocationInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SkuLocationInfo class. + /// + /// The location. + /// The zones. + /// The sites. + public SkuLocationInfo(string location = default(string), IList zones = default(IList), IList sites = default(IList)) + { + Location = location; + Zones = zones; + Sites = sites; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the location. + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; private set; } + + /// + /// Gets the zones. + /// + [JsonProperty(PropertyName = "zones")] + public IList Zones { get; private set; } + + /// + /// Gets the sites. + /// + [JsonProperty(PropertyName = "sites")] + public IList Sites { get; private set; } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/SkuName.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/SkuName.cs new file mode 100644 index 0000000000000..2df1b968f4a60 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/SkuName.cs @@ -0,0 +1,29 @@ +// +// 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.DataBoxEdge.Models +{ + + /// + /// Defines values for SkuName. + /// + public static class SkuName + { + public const string Gateway = "Gateway"; + public const string Edge = "Edge"; + public const string TEA1Node = "TEA_1Node"; + public const string TEA1NodeUPS = "TEA_1Node_UPS"; + public const string TEA1NodeHeater = "TEA_1Node_Heater"; + public const string TEA1NodeUPSHeater = "TEA_1Node_UPS_Heater"; + public const string TEA4NodeHeater = "TEA_4Node_Heater"; + public const string TEA4NodeUPSHeater = "TEA_4Node_UPS_Heater"; + public const string TMA = "TMA"; + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/SkuRestriction.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/SkuRestriction.cs new file mode 100644 index 0000000000000..35efc64e0170f --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/SkuRestriction.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.DataBoxEdge.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The restrictions because of which SKU cannot be used. + /// + public partial class SkuRestriction + { + /// + /// Initializes a new instance of the SkuRestriction class. + /// + public SkuRestriction() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SkuRestriction class. + /// + /// The type of the restriction. + /// The locations where sku is restricted. + /// The SKU restriction reason. Possible + /// values include: 'NotAvailableForSubscription', 'QuotaId' + /// Restriction of the SKU for the + /// location/zone + public SkuRestriction(string type = default(string), IList values = default(IList), string reasonCode = default(string), SkuRestrictionInfo restrictionInfo = default(SkuRestrictionInfo)) + { + Type = type; + Values = values; + ReasonCode = reasonCode; + RestrictionInfo = restrictionInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the type of the restriction. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets the locations where sku is restricted. + /// + [JsonProperty(PropertyName = "values")] + public IList Values { get; private set; } + + /// + /// Gets the SKU restriction reason. Possible values include: + /// 'NotAvailableForSubscription', 'QuotaId' + /// + [JsonProperty(PropertyName = "reasonCode")] + public string ReasonCode { get; private set; } + + /// + /// Gets restriction of the SKU for the location/zone + /// + [JsonProperty(PropertyName = "restrictionInfo")] + public SkuRestrictionInfo RestrictionInfo { get; private set; } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/SkuRestrictionInfo.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/SkuRestrictionInfo.cs new file mode 100644 index 0000000000000..95b79b1d1a35c --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/SkuRestrictionInfo.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.DataBoxEdge.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The restriction info with locations and zones. + /// + public partial class SkuRestrictionInfo + { + /// + /// Initializes a new instance of the SkuRestrictionInfo class. + /// + public SkuRestrictionInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SkuRestrictionInfo class. + /// + /// The locations. + /// The zones. + public SkuRestrictionInfo(IList locations = default(IList), IList zones = default(IList)) + { + Locations = locations; + Zones = zones; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the locations. + /// + [JsonProperty(PropertyName = "locations")] + public IList Locations { get; private set; } + + /// + /// Gets the zones. + /// + [JsonProperty(PropertyName = "zones")] + public IList Zones { get; private set; } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/SkuRestrictionReasonCode.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/SkuRestrictionReasonCode.cs new file mode 100644 index 0000000000000..dd75a573f58f6 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/SkuRestrictionReasonCode.cs @@ -0,0 +1,22 @@ +// +// 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.DataBoxEdge.Models +{ + + /// + /// Defines values for SkuRestrictionReasonCode. + /// + public static class SkuRestrictionReasonCode + { + public const string NotAvailableForSubscription = "NotAvailableForSubscription"; + public const string QuotaId = "QuotaId"; + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/SkuTier.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/SkuTier.cs new file mode 100644 index 0000000000000..8088f70155bc0 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/SkuTier.cs @@ -0,0 +1,21 @@ +// +// 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.DataBoxEdge.Models +{ + + /// + /// Defines values for SkuTier. + /// + public static class SkuTier + { + public const string Standard = "Standard"; + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/StorageAccount.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/StorageAccount.cs new file mode 100644 index 0000000000000..22cb6a5623ffd --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/StorageAccount.cs @@ -0,0 +1,108 @@ +// +// 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.DataBoxEdge.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Represents a Storage Account on the Data Box Edge/Gateway device. + /// + [Rest.Serialization.JsonTransformation] + public partial class StorageAccount : ARMBaseModel + { + /// + /// Initializes a new instance of the StorageAccount class. + /// + public StorageAccount() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the StorageAccount class. + /// + /// The path ID that uniquely identifies the + /// object. + /// The object name. + /// The hierarchical type of the object. + /// Description for the storage + /// Account. + /// Current status of the storage + /// account. Possible values include: 'OK', 'Offline', 'Unknown', + /// 'Updating', 'NeedsAttention' + /// Data policy of the storage Account. + /// Possible values include: 'Cloud', 'Local' + /// Storage Account Credential + /// Id + /// BlobEndpoint of Storage Account + /// The Container Count. Present only for + /// Storage Accounts with DataPolicy set to Cloud. + public StorageAccount(string id = default(string), string name = default(string), string type = default(string), string description = default(string), string storageAccountStatus = default(string), string dataPolicy = default(string), string storageAccountCredentialId = default(string), string blobEndpoint = default(string), int? containerCount = default(int?)) + : base(id, name, type) + { + Description = description; + StorageAccountStatus = storageAccountStatus; + DataPolicy = dataPolicy; + StorageAccountCredentialId = storageAccountCredentialId; + BlobEndpoint = blobEndpoint; + ContainerCount = containerCount; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets description for the storage Account. + /// + [JsonProperty(PropertyName = "properties.description")] + public string Description { get; set; } + + /// + /// Gets or sets current status of the storage account. Possible values + /// include: 'OK', 'Offline', 'Unknown', 'Updating', 'NeedsAttention' + /// + [JsonProperty(PropertyName = "properties.storageAccountStatus")] + public string StorageAccountStatus { get; set; } + + /// + /// Gets or sets data policy of the storage Account. Possible values + /// include: 'Cloud', 'Local' + /// + [JsonProperty(PropertyName = "properties.dataPolicy")] + public string DataPolicy { get; set; } + + /// + /// Gets or sets storage Account Credential Id + /// + [JsonProperty(PropertyName = "properties.storageAccountCredentialId")] + public string StorageAccountCredentialId { get; set; } + + /// + /// Gets blobEndpoint of Storage Account + /// + [JsonProperty(PropertyName = "properties.blobEndpoint")] + public string BlobEndpoint { get; private set; } + + /// + /// Gets the Container Count. Present only for Storage Accounts with + /// DataPolicy set to Cloud. + /// + [JsonProperty(PropertyName = "properties.containerCount")] + public int? ContainerCount { get; private set; } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/StorageAccountCredential.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/StorageAccountCredential.cs new file mode 100644 index 0000000000000..6262294f65dc0 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/StorageAccountCredential.cs @@ -0,0 +1,149 @@ +// +// 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.DataBoxEdge.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The storage account credential. + /// + [Rest.Serialization.JsonTransformation] + public partial class StorageAccountCredential : ARMBaseModel + { + /// + /// Initializes a new instance of the StorageAccountCredential class. + /// + public StorageAccountCredential() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the StorageAccountCredential class. + /// + /// Alias for the storage account. + /// Signifies whether SSL needs to be enabled + /// or not. Possible values include: 'Enabled', 'Disabled' + /// Type of storage accessed on the storage + /// account. Possible values include: 'GeneralPurposeStorage', + /// 'BlobStorage' + /// The path ID that uniquely identifies the + /// object. + /// The object name. + /// The hierarchical type of the object. + /// Username for the storage account. + /// Encrypted storage key. + /// Connection string for the storage + /// account. Use this string if username and account key are not + /// specified. + /// Blob end point for private + /// clouds. + /// Id of the storage account. + public StorageAccountCredential(string alias, string sslStatus, string accountType, string id = default(string), string name = default(string), string type = default(string), string userName = default(string), AsymmetricEncryptedSecret accountKey = default(AsymmetricEncryptedSecret), string connectionString = default(string), string blobDomainName = default(string), string storageAccountId = default(string)) + : base(id, name, type) + { + Alias = alias; + UserName = userName; + AccountKey = accountKey; + ConnectionString = connectionString; + SslStatus = sslStatus; + BlobDomainName = blobDomainName; + AccountType = accountType; + StorageAccountId = storageAccountId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets alias for the storage account. + /// + [JsonProperty(PropertyName = "properties.alias")] + public string Alias { get; set; } + + /// + /// Gets or sets username for the storage account. + /// + [JsonProperty(PropertyName = "properties.userName")] + public string UserName { get; set; } + + /// + /// Gets or sets encrypted storage key. + /// + [JsonProperty(PropertyName = "properties.accountKey")] + public AsymmetricEncryptedSecret AccountKey { get; set; } + + /// + /// Gets or sets connection string for the storage account. Use this + /// string if username and account key are not specified. + /// + [JsonProperty(PropertyName = "properties.connectionString")] + public string ConnectionString { get; set; } + + /// + /// Gets or sets signifies whether SSL needs to be enabled or not. + /// Possible values include: 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "properties.sslStatus")] + public string SslStatus { get; set; } + + /// + /// Gets or sets blob end point for private clouds. + /// + [JsonProperty(PropertyName = "properties.blobDomainName")] + public string BlobDomainName { get; set; } + + /// + /// Gets or sets type of storage accessed on the storage account. + /// Possible values include: 'GeneralPurposeStorage', 'BlobStorage' + /// + [JsonProperty(PropertyName = "properties.accountType")] + public string AccountType { get; set; } + + /// + /// Gets or sets id of the storage account. + /// + [JsonProperty(PropertyName = "properties.storageAccountId")] + public string StorageAccountId { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Alias == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Alias"); + } + if (SslStatus == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "SslStatus"); + } + if (AccountType == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "AccountType"); + } + if (AccountKey != null) + { + AccountKey.Validate(); + } + } + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/StorageAccountStatus.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/StorageAccountStatus.cs new file mode 100644 index 0000000000000..a0882ac754214 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/StorageAccountStatus.cs @@ -0,0 +1,25 @@ +// +// 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.DataBoxEdge.Models +{ + + /// + /// Defines values for StorageAccountStatus. + /// + public static class StorageAccountStatus + { + public const string OK = "OK"; + public const string Offline = "Offline"; + public const string Unknown = "Unknown"; + public const string Updating = "Updating"; + public const string NeedsAttention = "NeedsAttention"; + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/SymmetricKey.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/SymmetricKey.cs new file mode 100644 index 0000000000000..5414dea493d8b --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/SymmetricKey.cs @@ -0,0 +1,65 @@ +// +// 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.DataBoxEdge.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Symmetric key for authentication. + /// + public partial class SymmetricKey + { + /// + /// Initializes a new instance of the SymmetricKey class. + /// + public SymmetricKey() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SymmetricKey class. + /// + /// Connection string based on the + /// symmetric key. + public SymmetricKey(AsymmetricEncryptedSecret connectionString = default(AsymmetricEncryptedSecret)) + { + ConnectionString = connectionString; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets connection string based on the symmetric key. + /// + [JsonProperty(PropertyName = "connectionString")] + public AsymmetricEncryptedSecret ConnectionString { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ConnectionString != null) + { + ConnectionString.Validate(); + } + } + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/TimeGrain.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/TimeGrain.cs new file mode 100644 index 0000000000000..bde19b8070e06 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/TimeGrain.cs @@ -0,0 +1,28 @@ +// +// 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.DataBoxEdge.Models +{ + + /// + /// Defines values for TimeGrain. + /// + public static class TimeGrain + { + public const string PT1M = "PT1M"; + public const string PT5M = "PT5M"; + public const string PT15M = "PT15M"; + public const string PT30M = "PT30M"; + public const string PT1H = "PT1H"; + public const string PT6H = "PT6H"; + public const string PT12H = "PT12H"; + public const string PT1D = "PT1D"; + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/TrackingInfo.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/TrackingInfo.cs new file mode 100644 index 0000000000000..ddad5c7ba8881 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/TrackingInfo.cs @@ -0,0 +1,77 @@ +// +// 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.DataBoxEdge.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Tracking courier information. + /// + public partial class TrackingInfo + { + /// + /// Initializes a new instance of the TrackingInfo class. + /// + public TrackingInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the TrackingInfo class. + /// + /// Serial number of the device being + /// tracked. + /// Name of the carrier used in the + /// delivery. + /// Tracking ID of the shipment. + /// Tracking URL of the shipment. + public TrackingInfo(string serialNumber = default(string), string carrierName = default(string), string trackingId = default(string), string trackingUrl = default(string)) + { + SerialNumber = serialNumber; + CarrierName = carrierName; + TrackingId = trackingId; + TrackingUrl = trackingUrl; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets serial number of the device being tracked. + /// + [JsonProperty(PropertyName = "serialNumber")] + public string SerialNumber { get; set; } + + /// + /// Gets or sets name of the carrier used in the delivery. + /// + [JsonProperty(PropertyName = "carrierName")] + public string CarrierName { get; set; } + + /// + /// Gets or sets tracking ID of the shipment. + /// + [JsonProperty(PropertyName = "trackingId")] + public string TrackingId { get; set; } + + /// + /// Gets or sets tracking URL of the shipment. + /// + [JsonProperty(PropertyName = "trackingUrl")] + public string TrackingUrl { get; set; } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/Trigger.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/Trigger.cs new file mode 100644 index 0000000000000..0e9f6ce28dc76 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/Trigger.cs @@ -0,0 +1,47 @@ +// +// 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.DataBoxEdge.Models +{ + using System.Linq; + + /// + /// Trigger details. + /// + public partial class Trigger : ARMBaseModel + { + /// + /// Initializes a new instance of the Trigger class. + /// + public Trigger() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Trigger class. + /// + /// The path ID that uniquely identifies the + /// object. + /// The object name. + /// The hierarchical type of the object. + public Trigger(string id = default(string), string name = default(string), string type = default(string)) + : base(id, name, type) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/UpdateDownloadProgress.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/UpdateDownloadProgress.cs new file mode 100644 index 0000000000000..01e9c735ca908 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/UpdateDownloadProgress.cs @@ -0,0 +1,96 @@ +// +// 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.DataBoxEdge.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Details about the download progress of update. + /// + public partial class UpdateDownloadProgress + { + /// + /// Initializes a new instance of the UpdateDownloadProgress class. + /// + public UpdateDownloadProgress() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the UpdateDownloadProgress class. + /// + /// The download phase. Possible values + /// include: 'Unknown', 'Initializing', 'Downloading', + /// 'Verifying' + /// Percentage of completion. + /// Total bytes to download. + /// Total bytes downloaded. + /// Number of updates to + /// download. + /// Number of updates + /// downloaded. + public UpdateDownloadProgress(string downloadPhase = default(string), int? percentComplete = default(int?), double? totalBytesToDownload = default(double?), double? totalBytesDownloaded = default(double?), int? numberOfUpdatesToDownload = default(int?), int? numberOfUpdatesDownloaded = default(int?)) + { + DownloadPhase = downloadPhase; + PercentComplete = percentComplete; + TotalBytesToDownload = totalBytesToDownload; + TotalBytesDownloaded = totalBytesDownloaded; + NumberOfUpdatesToDownload = numberOfUpdatesToDownload; + NumberOfUpdatesDownloaded = numberOfUpdatesDownloaded; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the download phase. Possible values include: 'Unknown', + /// 'Initializing', 'Downloading', 'Verifying' + /// + [JsonProperty(PropertyName = "downloadPhase")] + public string DownloadPhase { get; private set; } + + /// + /// Gets percentage of completion. + /// + [JsonProperty(PropertyName = "percentComplete")] + public int? PercentComplete { get; private set; } + + /// + /// Gets total bytes to download. + /// + [JsonProperty(PropertyName = "totalBytesToDownload")] + public double? TotalBytesToDownload { get; private set; } + + /// + /// Gets total bytes downloaded. + /// + [JsonProperty(PropertyName = "totalBytesDownloaded")] + public double? TotalBytesDownloaded { get; private set; } + + /// + /// Gets number of updates to download. + /// + [JsonProperty(PropertyName = "numberOfUpdatesToDownload")] + public int? NumberOfUpdatesToDownload { get; private set; } + + /// + /// Gets number of updates downloaded. + /// + [JsonProperty(PropertyName = "numberOfUpdatesDownloaded")] + public int? NumberOfUpdatesDownloaded { get; private set; } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/UpdateInstallProgress.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/UpdateInstallProgress.cs new file mode 100644 index 0000000000000..af2ee9cd04204 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/UpdateInstallProgress.cs @@ -0,0 +1,69 @@ +// +// 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.DataBoxEdge.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Progress details during installation of updates. + /// + public partial class UpdateInstallProgress + { + /// + /// Initializes a new instance of the UpdateInstallProgress class. + /// + public UpdateInstallProgress() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the UpdateInstallProgress class. + /// + /// Percentage completed. + /// Number of updates to + /// install. + /// Number of updates + /// installed. + public UpdateInstallProgress(int? percentComplete = default(int?), int? numberOfUpdatesToInstall = default(int?), int? numberOfUpdatesInstalled = default(int?)) + { + PercentComplete = percentComplete; + NumberOfUpdatesToInstall = numberOfUpdatesToInstall; + NumberOfUpdatesInstalled = numberOfUpdatesInstalled; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets percentage completed. + /// + [JsonProperty(PropertyName = "percentComplete")] + public int? PercentComplete { get; private set; } + + /// + /// Gets number of updates to install. + /// + [JsonProperty(PropertyName = "numberOfUpdatesToInstall")] + public int? NumberOfUpdatesToInstall { get; private set; } + + /// + /// Gets number of updates installed. + /// + [JsonProperty(PropertyName = "numberOfUpdatesInstalled")] + public int? NumberOfUpdatesInstalled { get; private set; } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/UpdateOperation.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/UpdateOperation.cs new file mode 100644 index 0000000000000..d801a3f12fc6b --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/UpdateOperation.cs @@ -0,0 +1,24 @@ +// +// 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.DataBoxEdge.Models +{ + + /// + /// Defines values for UpdateOperation. + /// + public static class UpdateOperation + { + public const string None = "None"; + public const string Scan = "Scan"; + public const string Download = "Download"; + public const string Install = "Install"; + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/UpdateOperationStage.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/UpdateOperationStage.cs new file mode 100644 index 0000000000000..1a4c48a9c4bdb --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/UpdateOperationStage.cs @@ -0,0 +1,37 @@ +// +// 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.DataBoxEdge.Models +{ + + /// + /// Defines values for UpdateOperationStage. + /// + public static class UpdateOperationStage + { + public const string Unknown = "Unknown"; + public const string Initial = "Initial"; + public const string ScanStarted = "ScanStarted"; + public const string ScanComplete = "ScanComplete"; + public const string ScanFailed = "ScanFailed"; + public const string DownloadStarted = "DownloadStarted"; + public const string DownloadComplete = "DownloadComplete"; + public const string DownloadFailed = "DownloadFailed"; + public const string InstallStarted = "InstallStarted"; + public const string InstallComplete = "InstallComplete"; + public const string InstallFailed = "InstallFailed"; + public const string RebootInitiated = "RebootInitiated"; + public const string Success = "Success"; + public const string Failure = "Failure"; + public const string RescanStarted = "RescanStarted"; + public const string RescanComplete = "RescanComplete"; + public const string RescanFailed = "RescanFailed"; + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/UpdateSummary.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/UpdateSummary.cs new file mode 100644 index 0000000000000..e58f849d38a36 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/UpdateSummary.cs @@ -0,0 +1,221 @@ +// +// 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.DataBoxEdge.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Details about ongoing updates and availability of updates on the + /// device. + /// + [Rest.Serialization.JsonTransformation] + public partial class UpdateSummary : ARMBaseModel + { + /// + /// Initializes a new instance of the UpdateSummary class. + /// + public UpdateSummary() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the UpdateSummary class. + /// + /// The path ID that uniquely identifies the + /// object. + /// The object name. + /// The hierarchical type of the object. + /// The current version of the device + /// in format: 1.2.17312.13.", + /// The current version of the + /// device in text format. + /// The last time when a scan + /// was done on the device. + /// The time when the last + /// scan job was completed (success/cancelled/failed) on the + /// appliance. + /// The time when the + /// last Download job was completed (success/cancelled/failed) on the + /// appliance. + /// The time when the + /// last Install job was completed (success/cancelled/failed) on the + /// appliance. + /// The number of updates + /// available for the current device version as per the last device + /// scan. + /// The total number + /// of items pending download. + /// The total number + /// of items pending install. + /// Indicates if updates are available and + /// at least one of the updates needs a reboot. Possible values + /// include: 'NeverReboots', 'RequiresReboot', 'RequestReboot' + /// The current update operation. + /// Possible values include: 'None', 'Scan', 'Download', + /// 'Install' + /// The job ID of the download + /// job in progress. + /// The job ID of the install job + /// in progress. + /// The time when + /// the currently running download (if any) started. + /// The time when the + /// currently running install (if any) started. + /// The list of updates available for + /// install. + /// The total size of updates + /// available for download in bytes. + public UpdateSummary(string id = default(string), string name = default(string), string type = default(string), string deviceVersionNumber = default(string), string friendlyDeviceVersionName = default(string), System.DateTime? deviceLastScannedDateTime = default(System.DateTime?), System.DateTime? lastCompletedScanJobDateTime = default(System.DateTime?), System.DateTime? lastCompletedDownloadJobDateTime = default(System.DateTime?), System.DateTime? lastCompletedInstallJobDateTime = default(System.DateTime?), int? totalNumberOfUpdatesAvailable = default(int?), int? totalNumberOfUpdatesPendingDownload = default(int?), int? totalNumberOfUpdatesPendingInstall = default(int?), string rebootBehavior = default(string), string ongoingUpdateOperation = default(string), string inProgressDownloadJobId = default(string), string inProgressInstallJobId = default(string), System.DateTime? inProgressDownloadJobStartedDateTime = default(System.DateTime?), System.DateTime? inProgressInstallJobStartedDateTime = default(System.DateTime?), IList updateTitles = default(IList), double? totalUpdateSizeInBytes = default(double?)) + : base(id, name, type) + { + DeviceVersionNumber = deviceVersionNumber; + FriendlyDeviceVersionName = friendlyDeviceVersionName; + DeviceLastScannedDateTime = deviceLastScannedDateTime; + LastCompletedScanJobDateTime = lastCompletedScanJobDateTime; + LastCompletedDownloadJobDateTime = lastCompletedDownloadJobDateTime; + LastCompletedInstallJobDateTime = lastCompletedInstallJobDateTime; + TotalNumberOfUpdatesAvailable = totalNumberOfUpdatesAvailable; + TotalNumberOfUpdatesPendingDownload = totalNumberOfUpdatesPendingDownload; + TotalNumberOfUpdatesPendingInstall = totalNumberOfUpdatesPendingInstall; + RebootBehavior = rebootBehavior; + OngoingUpdateOperation = ongoingUpdateOperation; + InProgressDownloadJobId = inProgressDownloadJobId; + InProgressInstallJobId = inProgressInstallJobId; + InProgressDownloadJobStartedDateTime = inProgressDownloadJobStartedDateTime; + InProgressInstallJobStartedDateTime = inProgressInstallJobStartedDateTime; + UpdateTitles = updateTitles; + TotalUpdateSizeInBytes = totalUpdateSizeInBytes; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the current version of the device in format: + /// 1.2.17312.13.", + /// + [JsonProperty(PropertyName = "properties.deviceVersionNumber")] + public string DeviceVersionNumber { get; set; } + + /// + /// Gets or sets the current version of the device in text format. + /// + [JsonProperty(PropertyName = "properties.friendlyDeviceVersionName")] + public string FriendlyDeviceVersionName { get; set; } + + /// + /// Gets or sets the last time when a scan was done on the device. + /// + [JsonProperty(PropertyName = "properties.deviceLastScannedDateTime")] + public System.DateTime? DeviceLastScannedDateTime { get; set; } + + /// + /// Gets or sets the time when the last scan job was completed + /// (success/cancelled/failed) on the appliance. + /// + [JsonProperty(PropertyName = "properties.lastCompletedScanJobDateTime")] + public System.DateTime? LastCompletedScanJobDateTime { get; set; } + + /// + /// Gets the time when the last Download job was completed + /// (success/cancelled/failed) on the appliance. + /// + [JsonProperty(PropertyName = "properties.lastCompletedDownloadJobDateTime")] + public System.DateTime? LastCompletedDownloadJobDateTime { get; private set; } + + /// + /// Gets the time when the last Install job was completed + /// (success/cancelled/failed) on the appliance. + /// + [JsonProperty(PropertyName = "properties.lastCompletedInstallJobDateTime")] + public System.DateTime? LastCompletedInstallJobDateTime { get; private set; } + + /// + /// Gets the number of updates available for the current device version + /// as per the last device scan. + /// + [JsonProperty(PropertyName = "properties.totalNumberOfUpdatesAvailable")] + public int? TotalNumberOfUpdatesAvailable { get; private set; } + + /// + /// Gets the total number of items pending download. + /// + [JsonProperty(PropertyName = "properties.totalNumberOfUpdatesPendingDownload")] + public int? TotalNumberOfUpdatesPendingDownload { get; private set; } + + /// + /// Gets the total number of items pending install. + /// + [JsonProperty(PropertyName = "properties.totalNumberOfUpdatesPendingInstall")] + public int? TotalNumberOfUpdatesPendingInstall { get; private set; } + + /// + /// Gets indicates if updates are available and at least one of the + /// updates needs a reboot. Possible values include: 'NeverReboots', + /// 'RequiresReboot', 'RequestReboot' + /// + [JsonProperty(PropertyName = "properties.rebootBehavior")] + public string RebootBehavior { get; private set; } + + /// + /// Gets the current update operation. Possible values include: 'None', + /// 'Scan', 'Download', 'Install' + /// + [JsonProperty(PropertyName = "properties.ongoingUpdateOperation")] + public string OngoingUpdateOperation { get; private set; } + + /// + /// Gets the job ID of the download job in progress. + /// + [JsonProperty(PropertyName = "properties.inProgressDownloadJobId")] + public string InProgressDownloadJobId { get; private set; } + + /// + /// Gets the job ID of the install job in progress. + /// + [JsonProperty(PropertyName = "properties.inProgressInstallJobId")] + public string InProgressInstallJobId { get; private set; } + + /// + /// Gets the time when the currently running download (if any) started. + /// + [JsonProperty(PropertyName = "properties.inProgressDownloadJobStartedDateTime")] + public System.DateTime? InProgressDownloadJobStartedDateTime { get; private set; } + + /// + /// Gets the time when the currently running install (if any) started. + /// + [JsonProperty(PropertyName = "properties.inProgressInstallJobStartedDateTime")] + public System.DateTime? InProgressInstallJobStartedDateTime { get; private set; } + + /// + /// Gets the list of updates available for install. + /// + [JsonProperty(PropertyName = "properties.updateTitles")] + public IList UpdateTitles { get; private set; } + + /// + /// Gets the total size of updates available for download in bytes. + /// + [JsonProperty(PropertyName = "properties.totalUpdateSizeInBytes")] + public double? TotalUpdateSizeInBytes { get; private set; } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/UploadCertificateRequest.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/UploadCertificateRequest.cs new file mode 100644 index 0000000000000..3e6628c633deb --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/UploadCertificateRequest.cs @@ -0,0 +1,78 @@ +// +// 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.DataBoxEdge.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The upload certificate request. + /// + [Rest.Serialization.JsonTransformation] + public partial class UploadCertificateRequest + { + /// + /// Initializes a new instance of the UploadCertificateRequest class. + /// + public UploadCertificateRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the UploadCertificateRequest class. + /// + /// The base64 encoded certificate raw + /// data. + /// The authentication type. Possible + /// values include: 'Invalid', 'AzureActiveDirectory' + public UploadCertificateRequest(string certificate, string authenticationType = default(string)) + { + AuthenticationType = authenticationType; + Certificate = certificate; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the authentication type. Possible values include: + /// 'Invalid', 'AzureActiveDirectory' + /// + [JsonProperty(PropertyName = "properties.authenticationType")] + public string AuthenticationType { get; set; } + + /// + /// Gets or sets the base64 encoded certificate raw data. + /// + [JsonProperty(PropertyName = "properties.certificate")] + public string Certificate { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Certificate == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Certificate"); + } + } + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/UploadCertificateResponse.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/UploadCertificateResponse.cs new file mode 100644 index 0000000000000..62f8a34e034ff --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/UploadCertificateResponse.cs @@ -0,0 +1,116 @@ +// +// 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.DataBoxEdge.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The upload registration certificate response. + /// + public partial class UploadCertificateResponse + { + /// + /// Initializes a new instance of the UploadCertificateResponse class. + /// + public UploadCertificateResponse() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the UploadCertificateResponse class. + /// + /// Specifies authentication type. Possible + /// values include: 'Invalid', 'AzureActiveDirectory' + /// The resource ID of the Data Box + /// Edge/Gateway device. + /// Azure Active Directory tenant + /// authority. + /// Azure Active Directory tenant ID. + /// Azure Active Directory + /// service principal client ID. + /// Azure Active Directory + /// service principal object ID. + /// The azure management + /// endpoint audience. + /// Identifier of the target resource that is + /// the recipient of the requested token. + public UploadCertificateResponse(string authType = default(string), string resourceId = default(string), string aadAuthority = default(string), string aadTenantId = default(string), string servicePrincipalClientId = default(string), string servicePrincipalObjectId = default(string), string azureManagementEndpointAudience = default(string), string aadAudience = default(string)) + { + AuthType = authType; + ResourceId = resourceId; + AadAuthority = aadAuthority; + AadTenantId = aadTenantId; + ServicePrincipalClientId = servicePrincipalClientId; + ServicePrincipalObjectId = servicePrincipalObjectId; + AzureManagementEndpointAudience = azureManagementEndpointAudience; + AadAudience = aadAudience; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets specifies authentication type. Possible values + /// include: 'Invalid', 'AzureActiveDirectory' + /// + [JsonProperty(PropertyName = "authType")] + public string AuthType { get; set; } + + /// + /// Gets the resource ID of the Data Box Edge/Gateway device. + /// + [JsonProperty(PropertyName = "resourceId")] + public string ResourceId { get; private set; } + + /// + /// Gets azure Active Directory tenant authority. + /// + [JsonProperty(PropertyName = "aadAuthority")] + public string AadAuthority { get; private set; } + + /// + /// Gets azure Active Directory tenant ID. + /// + [JsonProperty(PropertyName = "aadTenantId")] + public string AadTenantId { get; private set; } + + /// + /// Gets azure Active Directory service principal client ID. + /// + [JsonProperty(PropertyName = "servicePrincipalClientId")] + public string ServicePrincipalClientId { get; private set; } + + /// + /// Gets azure Active Directory service principal object ID. + /// + [JsonProperty(PropertyName = "servicePrincipalObjectId")] + public string ServicePrincipalObjectId { get; private set; } + + /// + /// Gets the azure management endpoint audience. + /// + [JsonProperty(PropertyName = "azureManagementEndpointAudience")] + public string AzureManagementEndpointAudience { get; private set; } + + /// + /// Gets identifier of the target resource that is the recipient of the + /// requested token. + /// + [JsonProperty(PropertyName = "aadAudience")] + public string AadAudience { get; private set; } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/User.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/User.cs new file mode 100644 index 0000000000000..696494aef4473 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/User.cs @@ -0,0 +1,110 @@ +// +// 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.DataBoxEdge.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Represents a user who has access to one or more shares on the Data Box + /// Edge/Gateway device. + /// + [Rest.Serialization.JsonTransformation] + public partial class User : ARMBaseModel + { + /// + /// Initializes a new instance of the User class. + /// + public User() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the User class. + /// + /// Type of the user. Possible values include: + /// 'Share', 'LocalManagement', 'ARM' + /// The path ID that uniquely identifies the + /// object. + /// The object name. + /// The hierarchical type of the object. + /// The password details. + /// List of shares that the user has + /// rights on. This field should not be specified during user + /// creation. + public User(string userType, string id = default(string), string name = default(string), string type = default(string), AsymmetricEncryptedSecret encryptedPassword = default(AsymmetricEncryptedSecret), IList shareAccessRights = default(IList)) + : base(id, name, type) + { + EncryptedPassword = encryptedPassword; + ShareAccessRights = shareAccessRights; + UserType = userType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the password details. + /// + [JsonProperty(PropertyName = "properties.encryptedPassword")] + public AsymmetricEncryptedSecret EncryptedPassword { get; set; } + + /// + /// Gets or sets list of shares that the user has rights on. This field + /// should not be specified during user creation. + /// + [JsonProperty(PropertyName = "properties.shareAccessRights")] + public IList ShareAccessRights { get; set; } + + /// + /// Gets or sets type of the user. Possible values include: 'Share', + /// 'LocalManagement', 'ARM' + /// + [JsonProperty(PropertyName = "properties.userType")] + public string UserType { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (UserType == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "UserType"); + } + if (EncryptedPassword != null) + { + EncryptedPassword.Validate(); + } + if (ShareAccessRights != null) + { + foreach (var element in ShareAccessRights) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/UserAccessRight.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/UserAccessRight.cs new file mode 100644 index 0000000000000..21b0c3968e88f --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/UserAccessRight.cs @@ -0,0 +1,81 @@ +// +// 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.DataBoxEdge.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The mapping between a particular user and the access type on the SMB + /// share. + /// + public partial class UserAccessRight + { + /// + /// Initializes a new instance of the UserAccessRight class. + /// + public UserAccessRight() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the UserAccessRight class. + /// + /// User ID (already existing in the + /// device). + /// Type of access to be allowed for the user. + /// Possible values include: 'Change', 'Read', 'Custom' + public UserAccessRight(string userId, string accessType) + { + UserId = userId; + AccessType = accessType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets user ID (already existing in the device). + /// + [JsonProperty(PropertyName = "userId")] + public string UserId { get; set; } + + /// + /// Gets or sets type of access to be allowed for the user. Possible + /// values include: 'Change', 'Read', 'Custom' + /// + [JsonProperty(PropertyName = "accessType")] + public string AccessType { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (UserId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "UserId"); + } + if (AccessType == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "AccessType"); + } + } + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/UserType.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/UserType.cs new file mode 100644 index 0000000000000..5c8bc0507cd78 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Models/UserType.cs @@ -0,0 +1,23 @@ +// +// 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.DataBoxEdge.Models +{ + + /// + /// Defines values for UserType. + /// + public static class UserType + { + public const string Share = "Share"; + public const string LocalManagement = "LocalManagement"; + public const string ARM = "ARM"; + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/NodesOperations.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/NodesOperations.cs new file mode 100644 index 0000000000000..c9e7528f5fd07 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/NodesOperations.cs @@ -0,0 +1,250 @@ +// +// 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.DataBoxEdge +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// NodesOperations operations. + /// + internal partial class NodesOperations : IServiceOperations, INodesOperations + { + /// + /// Initializes a new instance of the NodesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal NodesOperations(DataBoxEdgeManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the DataBoxEdgeManagementClient + /// + public DataBoxEdgeManagementClient Client { get; private set; } + + /// + /// Gets all the nodes currently configured under this Data Box Edge device + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// 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>> ListByDataBoxEdgeDeviceWithHttpMessagesAsync(string deviceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByDataBoxEdgeDevice", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/nodes").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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("GET"); + _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/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/NodesOperationsExtensions.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/NodesOperationsExtensions.cs new file mode 100644 index 0000000000000..5146a92b07307 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/NodesOperationsExtensions.cs @@ -0,0 +1,67 @@ +// +// 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.DataBoxEdge +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for NodesOperations. + /// + public static partial class NodesOperationsExtensions + { + /// + /// Gets all the nodes currently configured under this Data Box Edge device + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + public static IEnumerable ListByDataBoxEdgeDevice(this INodesOperations operations, string deviceName, string resourceGroupName) + { + return operations.ListByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Gets all the nodes currently configured under this Data Box Edge device + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByDataBoxEdgeDeviceAsync(this INodesOperations operations, string deviceName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByDataBoxEdgeDeviceWithHttpMessagesAsync(deviceName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Operations.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Operations.cs new file mode 100644 index 0000000000000..8af794a6cb076 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/Operations.cs @@ -0,0 +1,400 @@ +// +// 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.DataBoxEdge +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Operations operations. + /// + internal partial class Operations : IServiceOperations, IOperations + { + /// + /// Initializes a new instance of the Operations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal Operations(DataBoxEdgeManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the DataBoxEdgeManagementClient + /// + public DataBoxEdgeManagementClient Client { get; private set; } + + /// + /// List all the supported operations. + /// + /// + /// 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>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.DataBoxEdge/operations").ToString(); + 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("GET"); + _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; + } + + /// + /// List all the supported operations. + /// + /// + /// 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>> ListNextWithHttpMessagesAsync(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, "ListNext", 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("GET"); + _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/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/OperationsExtensions.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/OperationsExtensions.cs new file mode 100644 index 0000000000000..38d45a8348065 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/OperationsExtensions.cs @@ -0,0 +1,87 @@ +// +// 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.DataBoxEdge +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for Operations. + /// + public static partial class OperationsExtensions + { + /// + /// List all the supported operations. + /// + /// + /// The operations group for this extension method. + /// + public static IPage List(this IOperations operations) + { + return operations.ListAsync().GetAwaiter().GetResult(); + } + + /// + /// List all the supported operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List all the supported operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List all the supported operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this IOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/OperationsStatus.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/OperationsStatus.cs new file mode 100644 index 0000000000000..f1125ebfce9fb --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/OperationsStatus.cs @@ -0,0 +1,260 @@ +// +// 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.DataBoxEdge +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// OperationsStatus operations. + /// + internal partial class OperationsStatus : IServiceOperations, IOperationsStatus + { + /// + /// Initializes a new instance of the OperationsStatus class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal OperationsStatus(DataBoxEdgeManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the DataBoxEdgeManagementClient + /// + public DataBoxEdgeManagementClient Client { get; private set; } + + /// + /// Gets the details of a specified job on a Data Box Edge/Data Box Gateway + /// device. + /// + /// + /// The device name. + /// + /// + /// The job name. + /// + /// + /// The resource group name. + /// + /// + /// 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> GetWithHttpMessagesAsync(string deviceName, string name, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("name", name); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/operationsStatus/{name}").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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("GET"); + _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/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/OperationsStatusExtensions.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/OperationsStatusExtensions.cs new file mode 100644 index 0000000000000..d78cc5d01c7bb --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/OperationsStatusExtensions.cs @@ -0,0 +1,73 @@ +// +// 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.DataBoxEdge +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for OperationsStatus. + /// + public static partial class OperationsStatusExtensions + { + /// + /// Gets the details of a specified job on a Data Box Edge/Data Box Gateway + /// device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The job name. + /// + /// + /// The resource group name. + /// + public static Job Get(this IOperationsStatus operations, string deviceName, string name, string resourceGroupName) + { + return operations.GetAsync(deviceName, name, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Gets the details of a specified job on a Data Box Edge/Data Box Gateway + /// device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The job name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IOperationsStatus operations, string deviceName, string name, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(deviceName, name, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/OrdersOperations.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/OrdersOperations.cs new file mode 100644 index 0000000000000..e0848931ce234 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/OrdersOperations.cs @@ -0,0 +1,1055 @@ +// +// 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.DataBoxEdge +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// OrdersOperations operations. + /// + internal partial class OrdersOperations : IServiceOperations, IOrdersOperations + { + /// + /// Initializes a new instance of the OrdersOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal OrdersOperations(DataBoxEdgeManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the DataBoxEdgeManagementClient + /// + public DataBoxEdgeManagementClient Client { get; private set; } + + /// + /// Lists all the orders related to a Data Box Edge/Data Box Gateway device. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// 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>> ListByDataBoxEdgeDeviceWithHttpMessagesAsync(string deviceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByDataBoxEdgeDevice", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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("GET"); + _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; + } + + /// + /// Gets a specific order by name. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// 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> GetWithHttpMessagesAsync(string deviceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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("GET"); + _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; + } + + /// + /// Creates or updates an order. + /// + /// + /// The order details of a device. + /// + /// + /// The order to be created or updated. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string deviceName, Order order, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(deviceName, order, resourceGroupName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes the order related to the device. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string deviceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(deviceName, resourceGroupName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Creates or updates an order. + /// + /// + /// The order details of a device. + /// + /// + /// The order to be created or updated. + /// + /// + /// The resource group name. + /// + /// + /// 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> BeginCreateOrUpdateWithHttpMessagesAsync(string deviceName, Order order, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (order == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "order"); + } + if (order != null) + { + order.Validate(); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("order", order); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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("PUT"); + _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(order != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(order, 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 && (int)_statusCode != 202) + { + 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; + } + + /// + /// Deletes the order related to the device. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 BeginDeleteWithHttpMessagesAsync(string deviceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/orders/default").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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("DELETE"); + _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 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + 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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists all the orders related to a Data Box Edge/Data Box Gateway device. + /// + /// + /// 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>> ListByDataBoxEdgeDeviceNextWithHttpMessagesAsync(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, "ListByDataBoxEdgeDeviceNext", 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("GET"); + _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/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/OrdersOperationsExtensions.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/OrdersOperationsExtensions.cs new file mode 100644 index 0000000000000..034c72e55275a --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/OrdersOperationsExtensions.cs @@ -0,0 +1,305 @@ +// +// 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.DataBoxEdge +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for OrdersOperations. + /// + public static partial class OrdersOperationsExtensions + { + /// + /// Lists all the orders related to a Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + public static IPage ListByDataBoxEdgeDevice(this IOrdersOperations operations, string deviceName, string resourceGroupName) + { + return operations.ListByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Lists all the orders related to a Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByDataBoxEdgeDeviceAsync(this IOrdersOperations operations, string deviceName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByDataBoxEdgeDeviceWithHttpMessagesAsync(deviceName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a specific order by name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + public static Order Get(this IOrdersOperations operations, string deviceName, string resourceGroupName) + { + return operations.GetAsync(deviceName, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Gets a specific order by name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IOrdersOperations operations, string deviceName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(deviceName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates an order. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The order details of a device. + /// + /// + /// The order to be created or updated. + /// + /// + /// The resource group name. + /// + public static Order CreateOrUpdate(this IOrdersOperations operations, string deviceName, Order order, string resourceGroupName) + { + return operations.CreateOrUpdateAsync(deviceName, order, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates an order. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The order details of a device. + /// + /// + /// The order to be created or updated. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IOrdersOperations operations, string deviceName, Order order, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(deviceName, order, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the order related to the device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + public static void Delete(this IOrdersOperations operations, string deviceName, string resourceGroupName) + { + operations.DeleteAsync(deviceName, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the order related to the device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IOrdersOperations operations, string deviceName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(deviceName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Creates or updates an order. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The order details of a device. + /// + /// + /// The order to be created or updated. + /// + /// + /// The resource group name. + /// + public static Order BeginCreateOrUpdate(this IOrdersOperations operations, string deviceName, Order order, string resourceGroupName) + { + return operations.BeginCreateOrUpdateAsync(deviceName, order, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates an order. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The order details of a device. + /// + /// + /// The order to be created or updated. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this IOrdersOperations operations, string deviceName, Order order, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(deviceName, order, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the order related to the device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + public static void BeginDelete(this IOrdersOperations operations, string deviceName, string resourceGroupName) + { + operations.BeginDeleteAsync(deviceName, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the order related to the device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IOrdersOperations operations, string deviceName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(deviceName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Lists all the orders related to a Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByDataBoxEdgeDeviceNext(this IOrdersOperations operations, string nextPageLink) + { + return operations.ListByDataBoxEdgeDeviceNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all the orders related to a Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByDataBoxEdgeDeviceNextAsync(this IOrdersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByDataBoxEdgeDeviceNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/RolesOperations.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/RolesOperations.cs new file mode 100644 index 0000000000000..3961220c09316 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/RolesOperations.cs @@ -0,0 +1,1084 @@ +// +// 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.DataBoxEdge +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// RolesOperations operations. + /// + internal partial class RolesOperations : IServiceOperations, IRolesOperations + { + /// + /// Initializes a new instance of the RolesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal RolesOperations(DataBoxEdgeManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the DataBoxEdgeManagementClient + /// + public DataBoxEdgeManagementClient Client { get; private set; } + + /// + /// Lists all the roles configured in a Data Box Edge/Data Box Gateway device. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// 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>> ListByDataBoxEdgeDeviceWithHttpMessagesAsync(string deviceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByDataBoxEdgeDevice", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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("GET"); + _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; + } + + /// + /// Gets a specific role by name. + /// + /// + /// The device name. + /// + /// + /// The role name. + /// + /// + /// The resource group name. + /// + /// + /// 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> GetWithHttpMessagesAsync(string deviceName, string name, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("name", name); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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("GET"); + _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; + } + + /// + /// Create or update a role. + /// + /// + /// The device name. + /// + /// + /// The role name. + /// + /// + /// The role properties. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string deviceName, string name, Role role, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(deviceName, name, role, resourceGroupName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes the role on the device. + /// + /// + /// The device name. + /// + /// + /// The role name. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string deviceName, string name, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(deviceName, name, resourceGroupName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Create or update a role. + /// + /// + /// The device name. + /// + /// + /// The role name. + /// + /// + /// The role properties. + /// + /// + /// The resource group name. + /// + /// + /// 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> BeginCreateOrUpdateWithHttpMessagesAsync(string deviceName, string name, Role role, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (role == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "role"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("name", name); + tracingParameters.Add("role", role); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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("PUT"); + _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(role != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(role, 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 && (int)_statusCode != 202) + { + 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; + } + + /// + /// Deletes the role on the device. + /// + /// + /// The device name. + /// + /// + /// The role name. + /// + /// + /// The resource group name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 BeginDeleteWithHttpMessagesAsync(string deviceName, string name, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("name", name); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/roles/{name}").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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("DELETE"); + _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 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + 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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists all the roles configured in a Data Box Edge/Data Box Gateway device. + /// + /// + /// 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>> ListByDataBoxEdgeDeviceNextWithHttpMessagesAsync(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, "ListByDataBoxEdgeDeviceNext", 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("GET"); + _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/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/RolesOperationsExtensions.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/RolesOperationsExtensions.cs new file mode 100644 index 0000000000000..5d6b2e11e76bf --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/RolesOperationsExtensions.cs @@ -0,0 +1,335 @@ +// +// 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.DataBoxEdge +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for RolesOperations. + /// + public static partial class RolesOperationsExtensions + { + /// + /// Lists all the roles configured in a Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + public static IPage ListByDataBoxEdgeDevice(this IRolesOperations operations, string deviceName, string resourceGroupName) + { + return operations.ListByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Lists all the roles configured in a Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByDataBoxEdgeDeviceAsync(this IRolesOperations operations, string deviceName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByDataBoxEdgeDeviceWithHttpMessagesAsync(deviceName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a specific role by name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The role name. + /// + /// + /// The resource group name. + /// + public static Role Get(this IRolesOperations operations, string deviceName, string name, string resourceGroupName) + { + return operations.GetAsync(deviceName, name, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Gets a specific role by name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The role name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IRolesOperations operations, string deviceName, string name, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(deviceName, name, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Create or update a role. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The role name. + /// + /// + /// The role properties. + /// + /// + /// The resource group name. + /// + public static Role CreateOrUpdate(this IRolesOperations operations, string deviceName, string name, Role role, string resourceGroupName) + { + return operations.CreateOrUpdateAsync(deviceName, name, role, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Create or update a role. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The role name. + /// + /// + /// The role properties. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IRolesOperations operations, string deviceName, string name, Role role, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(deviceName, name, role, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the role on the device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The role name. + /// + /// + /// The resource group name. + /// + public static void Delete(this IRolesOperations operations, string deviceName, string name, string resourceGroupName) + { + operations.DeleteAsync(deviceName, name, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the role on the device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The role name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IRolesOperations operations, string deviceName, string name, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(deviceName, name, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Create or update a role. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The role name. + /// + /// + /// The role properties. + /// + /// + /// The resource group name. + /// + public static Role BeginCreateOrUpdate(this IRolesOperations operations, string deviceName, string name, Role role, string resourceGroupName) + { + return operations.BeginCreateOrUpdateAsync(deviceName, name, role, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Create or update a role. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The role name. + /// + /// + /// The role properties. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this IRolesOperations operations, string deviceName, string name, Role role, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(deviceName, name, role, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the role on the device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The role name. + /// + /// + /// The resource group name. + /// + public static void BeginDelete(this IRolesOperations operations, string deviceName, string name, string resourceGroupName) + { + operations.BeginDeleteAsync(deviceName, name, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the role on the device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The role name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IRolesOperations operations, string deviceName, string name, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(deviceName, name, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Lists all the roles configured in a Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByDataBoxEdgeDeviceNext(this IRolesOperations operations, string nextPageLink) + { + return operations.ListByDataBoxEdgeDeviceNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all the roles configured in a Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByDataBoxEdgeDeviceNextAsync(this IRolesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByDataBoxEdgeDeviceNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/SdkInfo_DataBoxEdgeManagementClient.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/SdkInfo_DataBoxEdgeManagementClient.cs new file mode 100644 index 0000000000000..a9d05ff76087e --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/SdkInfo_DataBoxEdgeManagementClient.cs @@ -0,0 +1,53 @@ + +// +// 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.DataBoxEdge +{ + using System; + using System.Collections.Generic; + using System.Linq; + + internal static partial class SdkInfo + { + public static IEnumerable> ApiInfo_DataBoxEdgeManagementClient + { + get + { + return new Tuple[] + { + new Tuple("DataBoxEdge", "Alerts", "2019-08-01"), + new Tuple("DataBoxEdge", "BandwidthSchedules", "2019-08-01"), + new Tuple("DataBoxEdge", "Containers", "2019-08-01"), + new Tuple("DataBoxEdge", "Devices", "2019-08-01"), + new Tuple("DataBoxEdge", "Jobs", "2019-08-01"), + new Tuple("DataBoxEdge", "Nodes", "2019-08-01"), + new Tuple("DataBoxEdge", "Operations", "2019-08-01"), + new Tuple("DataBoxEdge", "OperationsStatus", "2019-08-01"), + new Tuple("DataBoxEdge", "Orders", "2019-08-01"), + new Tuple("DataBoxEdge", "Roles", "2019-08-01"), + new Tuple("DataBoxEdge", "Shares", "2019-08-01"), + new Tuple("DataBoxEdge", "Skus", "2019-08-01"), + new Tuple("DataBoxEdge", "StorageAccountCredentials", "2019-08-01"), + new Tuple("DataBoxEdge", "StorageAccounts", "2019-08-01"), + new Tuple("DataBoxEdge", "Triggers", "2019-08-01"), + new Tuple("DataBoxEdge", "Users", "2019-08-01"), + }.AsEnumerable(); + } + } + // BEGIN: Code Generation Metadata Section + public static readonly String AutoRestVersion = "latest"; + public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4407"; + public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/databoxedge/resource-manager/readme.md --csharp --version=latest --reflect-api-versions --csharp-sdks-folder=D:\\Code\\azure-sdk-for-net\\azure-sdk-for-net\\sdk"; + public static readonly String GithubForkName = "Azure"; + public static readonly String GithubBranchName = "master"; + public static readonly String GithubCommidId = "ef354ec8d6580227707ed935684e533b898beabe"; + public static readonly String CodeGenerationErrors = ""; + public static readonly String GithubRepoName = "azure-rest-api-specs"; + // END: Code Generation Metadata Section + } +} + diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/SharesOperations.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/SharesOperations.cs new file mode 100644 index 0000000000000..f510fdcd4a97c --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/SharesOperations.cs @@ -0,0 +1,1297 @@ +// +// 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.DataBoxEdge +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// SharesOperations operations. + /// + internal partial class SharesOperations : IServiceOperations, ISharesOperations + { + /// + /// Initializes a new instance of the SharesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal SharesOperations(DataBoxEdgeManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the DataBoxEdgeManagementClient + /// + public DataBoxEdgeManagementClient Client { get; private set; } + + /// + /// Lists all the shares in a Data Box Edge/Data Box Gateway device. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// 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>> ListByDataBoxEdgeDeviceWithHttpMessagesAsync(string deviceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByDataBoxEdgeDevice", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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("GET"); + _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; + } + + /// + /// Gets a share by name. + /// + /// + /// The device name. + /// + /// + /// The share name. + /// + /// + /// The resource group name. + /// + /// + /// 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> GetWithHttpMessagesAsync(string deviceName, string name, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("name", name); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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("GET"); + _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; + } + + /// + /// Creates a new share or updates an existing share on the device. + /// + /// + /// The device name. + /// + /// + /// The share name. + /// + /// + /// The share properties. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string deviceName, string name, Share share, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(deviceName, name, share, resourceGroupName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes the share on the Data Box Edge/Data Box Gateway device. + /// + /// + /// The device name. + /// + /// + /// The share name. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string deviceName, string name, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(deviceName, name, resourceGroupName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Refreshes the share metadata with the data from the cloud. + /// + /// + /// The device name. + /// + /// + /// The share name. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task RefreshWithHttpMessagesAsync(string deviceName, string name, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginRefreshWithHttpMessagesAsync(deviceName, name, resourceGroupName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Creates a new share or updates an existing share on the device. + /// + /// + /// The device name. + /// + /// + /// The share name. + /// + /// + /// The share properties. + /// + /// + /// The resource group name. + /// + /// + /// 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> BeginCreateOrUpdateWithHttpMessagesAsync(string deviceName, string name, Share share, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (share == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "share"); + } + if (share != null) + { + share.Validate(); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("name", name); + tracingParameters.Add("share", share); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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("PUT"); + _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(share != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(share, 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 && (int)_statusCode != 202) + { + 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; + } + + /// + /// Deletes the share on the Data Box Edge/Data Box Gateway device. + /// + /// + /// The device name. + /// + /// + /// The share name. + /// + /// + /// The resource group name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 BeginDeleteWithHttpMessagesAsync(string deviceName, string name, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("name", name); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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("DELETE"); + _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 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + 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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Refreshes the share metadata with the data from the cloud. + /// + /// + /// The device name. + /// + /// + /// The share name. + /// + /// + /// The resource group name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 BeginRefreshWithHttpMessagesAsync(string deviceName, string name, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("name", name); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginRefresh", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/shares/{name}/refresh").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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; + // 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 && (int)_statusCode != 202) + { + 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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists all the shares in a Data Box Edge/Data Box Gateway device. + /// + /// + /// 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>> ListByDataBoxEdgeDeviceNextWithHttpMessagesAsync(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, "ListByDataBoxEdgeDeviceNext", 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("GET"); + _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/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/SharesOperationsExtensions.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/SharesOperationsExtensions.cs new file mode 100644 index 0000000000000..a777ef2340a6e --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/SharesOperationsExtensions.cs @@ -0,0 +1,421 @@ +// +// 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.DataBoxEdge +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for SharesOperations. + /// + public static partial class SharesOperationsExtensions + { + /// + /// Lists all the shares in a Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + public static IPage ListByDataBoxEdgeDevice(this ISharesOperations operations, string deviceName, string resourceGroupName) + { + return operations.ListByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Lists all the shares in a Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByDataBoxEdgeDeviceAsync(this ISharesOperations operations, string deviceName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByDataBoxEdgeDeviceWithHttpMessagesAsync(deviceName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a share by name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The share name. + /// + /// + /// The resource group name. + /// + public static Share Get(this ISharesOperations operations, string deviceName, string name, string resourceGroupName) + { + return operations.GetAsync(deviceName, name, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Gets a share by name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The share name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this ISharesOperations operations, string deviceName, string name, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(deviceName, name, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates a new share or updates an existing share on the device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The share name. + /// + /// + /// The share properties. + /// + /// + /// The resource group name. + /// + public static Share CreateOrUpdate(this ISharesOperations operations, string deviceName, string name, Share share, string resourceGroupName) + { + return operations.CreateOrUpdateAsync(deviceName, name, share, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Creates a new share or updates an existing share on the device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The share name. + /// + /// + /// The share properties. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this ISharesOperations operations, string deviceName, string name, Share share, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(deviceName, name, share, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the share on the Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The share name. + /// + /// + /// The resource group name. + /// + public static void Delete(this ISharesOperations operations, string deviceName, string name, string resourceGroupName) + { + operations.DeleteAsync(deviceName, name, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the share on the Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The share name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this ISharesOperations operations, string deviceName, string name, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(deviceName, name, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Refreshes the share metadata with the data from the cloud. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The share name. + /// + /// + /// The resource group name. + /// + public static void Refresh(this ISharesOperations operations, string deviceName, string name, string resourceGroupName) + { + operations.RefreshAsync(deviceName, name, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Refreshes the share metadata with the data from the cloud. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The share name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task RefreshAsync(this ISharesOperations operations, string deviceName, string name, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.RefreshWithHttpMessagesAsync(deviceName, name, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Creates a new share or updates an existing share on the device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The share name. + /// + /// + /// The share properties. + /// + /// + /// The resource group name. + /// + public static Share BeginCreateOrUpdate(this ISharesOperations operations, string deviceName, string name, Share share, string resourceGroupName) + { + return operations.BeginCreateOrUpdateAsync(deviceName, name, share, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Creates a new share or updates an existing share on the device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The share name. + /// + /// + /// The share properties. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this ISharesOperations operations, string deviceName, string name, Share share, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(deviceName, name, share, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the share on the Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The share name. + /// + /// + /// The resource group name. + /// + public static void BeginDelete(this ISharesOperations operations, string deviceName, string name, string resourceGroupName) + { + operations.BeginDeleteAsync(deviceName, name, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the share on the Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The share name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this ISharesOperations operations, string deviceName, string name, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(deviceName, name, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Refreshes the share metadata with the data from the cloud. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The share name. + /// + /// + /// The resource group name. + /// + public static void BeginRefresh(this ISharesOperations operations, string deviceName, string name, string resourceGroupName) + { + operations.BeginRefreshAsync(deviceName, name, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Refreshes the share metadata with the data from the cloud. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The share name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task BeginRefreshAsync(this ISharesOperations operations, string deviceName, string name, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginRefreshWithHttpMessagesAsync(deviceName, name, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Lists all the shares in a Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByDataBoxEdgeDeviceNext(this ISharesOperations operations, string nextPageLink) + { + return operations.ListByDataBoxEdgeDeviceNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all the shares in a Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByDataBoxEdgeDeviceNextAsync(this ISharesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByDataBoxEdgeDeviceNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/SkusOperations.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/SkusOperations.cs new file mode 100644 index 0000000000000..254642d4b1c7b --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/SkusOperations.cs @@ -0,0 +1,240 @@ +// +// 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.DataBoxEdge +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// SkusOperations operations. + /// + internal partial class SkusOperations : IServiceOperations, ISkusOperations + { + /// + /// Initializes a new instance of the SkusOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal SkusOperations(DataBoxEdgeManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the DataBoxEdgeManagementClient + /// + public DataBoxEdgeManagementClient Client { get; private set; } + + /// + /// List all the available Skus in the region and information related to them + /// + /// + /// Specify $filter='location eq <location>' to filter on location. + /// + /// + /// 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>> ListWithHttpMessagesAsync(string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("filter", filter); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DataBoxEdge/skus").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } + 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("GET"); + _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/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/SkusOperationsExtensions.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/SkusOperationsExtensions.cs new file mode 100644 index 0000000000000..85c568596188b --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/SkusOperationsExtensions.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.DataBoxEdge +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for SkusOperations. + /// + public static partial class SkusOperationsExtensions + { + /// + /// List all the available Skus in the region and information related to them + /// + /// + /// The operations group for this extension method. + /// + /// + /// Specify $filter='location eq <location>' to filter on location. + /// + public static IEnumerable List(this ISkusOperations operations, string filter = default(string)) + { + return operations.ListAsync(filter).GetAwaiter().GetResult(); + } + + /// + /// List all the available Skus in the region and information related to them + /// + /// + /// The operations group for this extension method. + /// + /// + /// Specify $filter='location eq <location>' to filter on location. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this ISkusOperations operations, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(filter, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/StorageAccountCredentialsOperations.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/StorageAccountCredentialsOperations.cs new file mode 100644 index 0000000000000..e9a8655ba4f09 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/StorageAccountCredentialsOperations.cs @@ -0,0 +1,1090 @@ +// +// 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.DataBoxEdge +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// StorageAccountCredentialsOperations operations. + /// + internal partial class StorageAccountCredentialsOperations : IServiceOperations, IStorageAccountCredentialsOperations + { + /// + /// Initializes a new instance of the StorageAccountCredentialsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal StorageAccountCredentialsOperations(DataBoxEdgeManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the DataBoxEdgeManagementClient + /// + public DataBoxEdgeManagementClient Client { get; private set; } + + /// + /// Gets all the storage account credentials in a Data Box Edge/Data Box + /// Gateway device. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// 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>> ListByDataBoxEdgeDeviceWithHttpMessagesAsync(string deviceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByDataBoxEdgeDevice", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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("GET"); + _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; + } + + /// + /// Gets the properties of the specified storage account credential. + /// + /// + /// The device name. + /// + /// + /// The storage account credential name. + /// + /// + /// The resource group name. + /// + /// + /// 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> GetWithHttpMessagesAsync(string deviceName, string name, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("name", name); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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("GET"); + _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; + } + + /// + /// Creates or updates the storage account credential. + /// + /// + /// The device name. + /// + /// + /// The storage account credential name. + /// + /// + /// The storage account credential. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string deviceName, string name, StorageAccountCredential storageAccountCredential, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(deviceName, name, storageAccountCredential, resourceGroupName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes the storage account credential. + /// + /// + /// The device name. + /// + /// + /// The storage account credential name. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string deviceName, string name, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(deviceName, name, resourceGroupName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Creates or updates the storage account credential. + /// + /// + /// The device name. + /// + /// + /// The storage account credential name. + /// + /// + /// The storage account credential. + /// + /// + /// The resource group name. + /// + /// + /// 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> BeginCreateOrUpdateWithHttpMessagesAsync(string deviceName, string name, StorageAccountCredential storageAccountCredential, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (storageAccountCredential == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "storageAccountCredential"); + } + if (storageAccountCredential != null) + { + storageAccountCredential.Validate(); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("name", name); + tracingParameters.Add("storageAccountCredential", storageAccountCredential); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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("PUT"); + _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(storageAccountCredential != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(storageAccountCredential, 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 && (int)_statusCode != 202) + { + 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; + } + + /// + /// Deletes the storage account credential. + /// + /// + /// The device name. + /// + /// + /// The storage account credential name. + /// + /// + /// The resource group name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 BeginDeleteWithHttpMessagesAsync(string deviceName, string name, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("name", name); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccountCredentials/{name}").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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("DELETE"); + _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 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + 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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets all the storage account credentials in a Data Box Edge/Data Box + /// Gateway device. + /// + /// + /// 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>> ListByDataBoxEdgeDeviceNextWithHttpMessagesAsync(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, "ListByDataBoxEdgeDeviceNext", 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("GET"); + _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/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/StorageAccountCredentialsOperationsExtensions.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/StorageAccountCredentialsOperationsExtensions.cs new file mode 100644 index 0000000000000..fe3e8be423a24 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/StorageAccountCredentialsOperationsExtensions.cs @@ -0,0 +1,339 @@ +// +// 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.DataBoxEdge +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for StorageAccountCredentialsOperations. + /// + public static partial class StorageAccountCredentialsOperationsExtensions + { + /// + /// Gets all the storage account credentials in a Data Box Edge/Data Box + /// Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + public static IPage ListByDataBoxEdgeDevice(this IStorageAccountCredentialsOperations operations, string deviceName, string resourceGroupName) + { + return operations.ListByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Gets all the storage account credentials in a Data Box Edge/Data Box + /// Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByDataBoxEdgeDeviceAsync(this IStorageAccountCredentialsOperations operations, string deviceName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByDataBoxEdgeDeviceWithHttpMessagesAsync(deviceName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the properties of the specified storage account credential. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The storage account credential name. + /// + /// + /// The resource group name. + /// + public static StorageAccountCredential Get(this IStorageAccountCredentialsOperations operations, string deviceName, string name, string resourceGroupName) + { + return operations.GetAsync(deviceName, name, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Gets the properties of the specified storage account credential. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The storage account credential name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IStorageAccountCredentialsOperations operations, string deviceName, string name, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(deviceName, name, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates the storage account credential. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The storage account credential name. + /// + /// + /// The storage account credential. + /// + /// + /// The resource group name. + /// + public static StorageAccountCredential CreateOrUpdate(this IStorageAccountCredentialsOperations operations, string deviceName, string name, StorageAccountCredential storageAccountCredential, string resourceGroupName) + { + return operations.CreateOrUpdateAsync(deviceName, name, storageAccountCredential, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates the storage account credential. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The storage account credential name. + /// + /// + /// The storage account credential. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IStorageAccountCredentialsOperations operations, string deviceName, string name, StorageAccountCredential storageAccountCredential, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(deviceName, name, storageAccountCredential, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the storage account credential. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The storage account credential name. + /// + /// + /// The resource group name. + /// + public static void Delete(this IStorageAccountCredentialsOperations operations, string deviceName, string name, string resourceGroupName) + { + operations.DeleteAsync(deviceName, name, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the storage account credential. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The storage account credential name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IStorageAccountCredentialsOperations operations, string deviceName, string name, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(deviceName, name, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Creates or updates the storage account credential. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The storage account credential name. + /// + /// + /// The storage account credential. + /// + /// + /// The resource group name. + /// + public static StorageAccountCredential BeginCreateOrUpdate(this IStorageAccountCredentialsOperations operations, string deviceName, string name, StorageAccountCredential storageAccountCredential, string resourceGroupName) + { + return operations.BeginCreateOrUpdateAsync(deviceName, name, storageAccountCredential, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates the storage account credential. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The storage account credential name. + /// + /// + /// The storage account credential. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this IStorageAccountCredentialsOperations operations, string deviceName, string name, StorageAccountCredential storageAccountCredential, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(deviceName, name, storageAccountCredential, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the storage account credential. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The storage account credential name. + /// + /// + /// The resource group name. + /// + public static void BeginDelete(this IStorageAccountCredentialsOperations operations, string deviceName, string name, string resourceGroupName) + { + operations.BeginDeleteAsync(deviceName, name, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the storage account credential. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The storage account credential name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IStorageAccountCredentialsOperations operations, string deviceName, string name, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(deviceName, name, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets all the storage account credentials in a Data Box Edge/Data Box + /// Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByDataBoxEdgeDeviceNext(this IStorageAccountCredentialsOperations operations, string nextPageLink) + { + return operations.ListByDataBoxEdgeDeviceNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all the storage account credentials in a Data Box Edge/Data Box + /// Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByDataBoxEdgeDeviceNextAsync(this IStorageAccountCredentialsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByDataBoxEdgeDeviceNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/StorageAccountsOperations.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/StorageAccountsOperations.cs new file mode 100644 index 0000000000000..f9c78df13e9ba --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/StorageAccountsOperations.cs @@ -0,0 +1,1086 @@ +// +// 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.DataBoxEdge +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// StorageAccountsOperations operations. + /// + internal partial class StorageAccountsOperations : IServiceOperations, IStorageAccountsOperations + { + /// + /// Initializes a new instance of the StorageAccountsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal StorageAccountsOperations(DataBoxEdgeManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the DataBoxEdgeManagementClient + /// + public DataBoxEdgeManagementClient Client { get; private set; } + + /// + /// Lists all the storage accounts in a Data Box Edge/Data Box Gateway device. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// 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>> ListByDataBoxEdgeDeviceWithHttpMessagesAsync(string deviceName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByDataBoxEdgeDevice", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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("GET"); + _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; + } + + /// + /// Gets a StorageAccount by name. + /// + /// + /// The device name. + /// + /// + /// The storage account name. + /// + /// + /// The resource group name. + /// + /// + /// 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> GetWithHttpMessagesAsync(string deviceName, string storageAccountName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (storageAccountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "storageAccountName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("storageAccountName", storageAccountName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{storageAccountName}", System.Uri.EscapeDataString(storageAccountName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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("GET"); + _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; + } + + /// + /// Creates a new StorageAccount or updates an existing StorageAccount on the + /// device. + /// + /// + /// The device name. + /// + /// + /// The StorageAccount name. + /// + /// + /// The StorageAccount properties. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string deviceName, string storageAccountName, StorageAccount storageAccount, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(deviceName, storageAccountName, storageAccount, resourceGroupName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. + /// + /// + /// The device name. + /// + /// + /// The StorageAccount name. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string deviceName, string storageAccountName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(deviceName, storageAccountName, resourceGroupName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Creates a new StorageAccount or updates an existing StorageAccount on the + /// device. + /// + /// + /// The device name. + /// + /// + /// The StorageAccount name. + /// + /// + /// The StorageAccount properties. + /// + /// + /// The resource group name. + /// + /// + /// 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> BeginCreateOrUpdateWithHttpMessagesAsync(string deviceName, string storageAccountName, StorageAccount storageAccount, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (storageAccountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "storageAccountName"); + } + if (storageAccount == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "storageAccount"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("storageAccountName", storageAccountName); + tracingParameters.Add("storageAccount", storageAccount); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{storageAccountName}", System.Uri.EscapeDataString(storageAccountName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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("PUT"); + _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(storageAccount != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(storageAccount, 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 && (int)_statusCode != 202) + { + 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; + } + + /// + /// Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. + /// + /// + /// The device name. + /// + /// + /// The StorageAccount name. + /// + /// + /// The resource group name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 BeginDeleteWithHttpMessagesAsync(string deviceName, string storageAccountName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (storageAccountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "storageAccountName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("storageAccountName", storageAccountName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{storageAccountName}", System.Uri.EscapeDataString(storageAccountName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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("DELETE"); + _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 != 202 && (int)_statusCode != 204) + { + 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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists all the storage accounts in a Data Box Edge/Data Box Gateway device. + /// + /// + /// 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>> ListByDataBoxEdgeDeviceNextWithHttpMessagesAsync(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, "ListByDataBoxEdgeDeviceNext", 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("GET"); + _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/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/StorageAccountsOperationsExtensions.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/StorageAccountsOperationsExtensions.cs new file mode 100644 index 0000000000000..6f1f0ed7555e0 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/StorageAccountsOperationsExtensions.cs @@ -0,0 +1,339 @@ +// +// 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.DataBoxEdge +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for StorageAccountsOperations. + /// + public static partial class StorageAccountsOperationsExtensions + { + /// + /// Lists all the storage accounts in a Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + public static IPage ListByDataBoxEdgeDevice(this IStorageAccountsOperations operations, string deviceName, string resourceGroupName) + { + return operations.ListByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Lists all the storage accounts in a Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByDataBoxEdgeDeviceAsync(this IStorageAccountsOperations operations, string deviceName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByDataBoxEdgeDeviceWithHttpMessagesAsync(deviceName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a StorageAccount by name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The storage account name. + /// + /// + /// The resource group name. + /// + public static StorageAccount Get(this IStorageAccountsOperations operations, string deviceName, string storageAccountName, string resourceGroupName) + { + return operations.GetAsync(deviceName, storageAccountName, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Gets a StorageAccount by name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The storage account name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IStorageAccountsOperations operations, string deviceName, string storageAccountName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(deviceName, storageAccountName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates a new StorageAccount or updates an existing StorageAccount on the + /// device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The StorageAccount name. + /// + /// + /// The StorageAccount properties. + /// + /// + /// The resource group name. + /// + public static StorageAccount CreateOrUpdate(this IStorageAccountsOperations operations, string deviceName, string storageAccountName, StorageAccount storageAccount, string resourceGroupName) + { + return operations.CreateOrUpdateAsync(deviceName, storageAccountName, storageAccount, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Creates a new StorageAccount or updates an existing StorageAccount on the + /// device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The StorageAccount name. + /// + /// + /// The StorageAccount properties. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IStorageAccountsOperations operations, string deviceName, string storageAccountName, StorageAccount storageAccount, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(deviceName, storageAccountName, storageAccount, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The StorageAccount name. + /// + /// + /// The resource group name. + /// + public static void Delete(this IStorageAccountsOperations operations, string deviceName, string storageAccountName, string resourceGroupName) + { + operations.DeleteAsync(deviceName, storageAccountName, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The StorageAccount name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IStorageAccountsOperations operations, string deviceName, string storageAccountName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(deviceName, storageAccountName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Creates a new StorageAccount or updates an existing StorageAccount on the + /// device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The StorageAccount name. + /// + /// + /// The StorageAccount properties. + /// + /// + /// The resource group name. + /// + public static StorageAccount BeginCreateOrUpdate(this IStorageAccountsOperations operations, string deviceName, string storageAccountName, StorageAccount storageAccount, string resourceGroupName) + { + return operations.BeginCreateOrUpdateAsync(deviceName, storageAccountName, storageAccount, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Creates a new StorageAccount or updates an existing StorageAccount on the + /// device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The StorageAccount name. + /// + /// + /// The StorageAccount properties. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this IStorageAccountsOperations operations, string deviceName, string storageAccountName, StorageAccount storageAccount, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(deviceName, storageAccountName, storageAccount, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The StorageAccount name. + /// + /// + /// The resource group name. + /// + public static void BeginDelete(this IStorageAccountsOperations operations, string deviceName, string storageAccountName, string resourceGroupName) + { + operations.BeginDeleteAsync(deviceName, storageAccountName, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the StorageAccount on the Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The StorageAccount name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IStorageAccountsOperations operations, string deviceName, string storageAccountName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(deviceName, storageAccountName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Lists all the storage accounts in a Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByDataBoxEdgeDeviceNext(this IStorageAccountsOperations operations, string nextPageLink) + { + return operations.ListByDataBoxEdgeDeviceNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all the storage accounts in a Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByDataBoxEdgeDeviceNextAsync(this IStorageAccountsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByDataBoxEdgeDeviceNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/TriggersOperations.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/TriggersOperations.cs new file mode 100644 index 0000000000000..68a17ee641577 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/TriggersOperations.cs @@ -0,0 +1,1093 @@ +// +// 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.DataBoxEdge +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// TriggersOperations operations. + /// + internal partial class TriggersOperations : IServiceOperations, ITriggersOperations + { + /// + /// Initializes a new instance of the TriggersOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal TriggersOperations(DataBoxEdgeManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the DataBoxEdgeManagementClient + /// + public DataBoxEdgeManagementClient Client { get; private set; } + + /// + /// Lists all the triggers configured in the device. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// Specify $filter='CustomContextTag eq <tag>' to filter on custom + /// context tag property + /// + /// + /// 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>> ListByDataBoxEdgeDeviceWithHttpMessagesAsync(string deviceName, string resourceGroupName, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("filter", filter); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByDataBoxEdgeDevice", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } + 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("GET"); + _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; + } + + /// + /// Get a specific trigger by name. + /// + /// + /// The device name. + /// + /// + /// The trigger name. + /// + /// + /// The resource group name. + /// + /// + /// 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> GetWithHttpMessagesAsync(string deviceName, string name, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("name", name); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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("GET"); + _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; + } + + /// + /// Creates or updates a trigger. + /// + /// + /// Creates or updates a trigger + /// + /// + /// The trigger name. + /// + /// + /// The trigger. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string deviceName, string name, Trigger trigger, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(deviceName, name, trigger, resourceGroupName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes the trigger on the gateway device. + /// + /// + /// The device name. + /// + /// + /// The trigger name. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string deviceName, string name, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(deviceName, name, resourceGroupName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Creates or updates a trigger. + /// + /// + /// Creates or updates a trigger + /// + /// + /// The trigger name. + /// + /// + /// The trigger. + /// + /// + /// The resource group name. + /// + /// + /// 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> BeginCreateOrUpdateWithHttpMessagesAsync(string deviceName, string name, Trigger trigger, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (trigger == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "trigger"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("name", name); + tracingParameters.Add("trigger", trigger); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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("PUT"); + _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(trigger != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(trigger, 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 && (int)_statusCode != 202) + { + 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; + } + + /// + /// Deletes the trigger on the gateway device. + /// + /// + /// The device name. + /// + /// + /// The trigger name. + /// + /// + /// The resource group name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 BeginDeleteWithHttpMessagesAsync(string deviceName, string name, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("name", name); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/triggers/{name}").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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("DELETE"); + _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 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + 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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Lists all the triggers configured in the device. + /// + /// + /// 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>> ListByDataBoxEdgeDeviceNextWithHttpMessagesAsync(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, "ListByDataBoxEdgeDeviceNext", 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("GET"); + _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/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/TriggersOperationsExtensions.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/TriggersOperationsExtensions.cs new file mode 100644 index 0000000000000..243d128230615 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/TriggersOperationsExtensions.cs @@ -0,0 +1,343 @@ +// +// 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.DataBoxEdge +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for TriggersOperations. + /// + public static partial class TriggersOperationsExtensions + { + /// + /// Lists all the triggers configured in the device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// Specify $filter='CustomContextTag eq <tag>' to filter on custom + /// context tag property + /// + public static IPage ListByDataBoxEdgeDevice(this ITriggersOperations operations, string deviceName, string resourceGroupName, string filter = default(string)) + { + return operations.ListByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName, filter).GetAwaiter().GetResult(); + } + + /// + /// Lists all the triggers configured in the device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// Specify $filter='CustomContextTag eq <tag>' to filter on custom + /// context tag property + /// + /// + /// The cancellation token. + /// + public static async Task> ListByDataBoxEdgeDeviceAsync(this ITriggersOperations operations, string deviceName, string resourceGroupName, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByDataBoxEdgeDeviceWithHttpMessagesAsync(deviceName, resourceGroupName, filter, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Get a specific trigger by name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The trigger name. + /// + /// + /// The resource group name. + /// + public static Trigger Get(this ITriggersOperations operations, string deviceName, string name, string resourceGroupName) + { + return operations.GetAsync(deviceName, name, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Get a specific trigger by name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The trigger name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this ITriggersOperations operations, string deviceName, string name, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(deviceName, name, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates a trigger. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Creates or updates a trigger + /// + /// + /// The trigger name. + /// + /// + /// The trigger. + /// + /// + /// The resource group name. + /// + public static Trigger CreateOrUpdate(this ITriggersOperations operations, string deviceName, string name, Trigger trigger, string resourceGroupName) + { + return operations.CreateOrUpdateAsync(deviceName, name, trigger, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a trigger. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Creates or updates a trigger + /// + /// + /// The trigger name. + /// + /// + /// The trigger. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this ITriggersOperations operations, string deviceName, string name, Trigger trigger, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(deviceName, name, trigger, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the trigger on the gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The trigger name. + /// + /// + /// The resource group name. + /// + public static void Delete(this ITriggersOperations operations, string deviceName, string name, string resourceGroupName) + { + operations.DeleteAsync(deviceName, name, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the trigger on the gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The trigger name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this ITriggersOperations operations, string deviceName, string name, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(deviceName, name, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Creates or updates a trigger. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Creates or updates a trigger + /// + /// + /// The trigger name. + /// + /// + /// The trigger. + /// + /// + /// The resource group name. + /// + public static Trigger BeginCreateOrUpdate(this ITriggersOperations operations, string deviceName, string name, Trigger trigger, string resourceGroupName) + { + return operations.BeginCreateOrUpdateAsync(deviceName, name, trigger, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a trigger. + /// + /// + /// The operations group for this extension method. + /// + /// + /// Creates or updates a trigger + /// + /// + /// The trigger name. + /// + /// + /// The trigger. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this ITriggersOperations operations, string deviceName, string name, Trigger trigger, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(deviceName, name, trigger, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the trigger on the gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The trigger name. + /// + /// + /// The resource group name. + /// + public static void BeginDelete(this ITriggersOperations operations, string deviceName, string name, string resourceGroupName) + { + operations.BeginDeleteAsync(deviceName, name, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the trigger on the gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The trigger name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this ITriggersOperations operations, string deviceName, string name, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(deviceName, name, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Lists all the triggers configured in the device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByDataBoxEdgeDeviceNext(this ITriggersOperations operations, string nextPageLink) + { + return operations.ListByDataBoxEdgeDeviceNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists all the triggers configured in the device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByDataBoxEdgeDeviceNextAsync(this ITriggersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByDataBoxEdgeDeviceNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/UsersOperations.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/UsersOperations.cs new file mode 100644 index 0000000000000..4976bc38e2cdd --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/UsersOperations.cs @@ -0,0 +1,1098 @@ +// +// 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.DataBoxEdge +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// UsersOperations operations. + /// + internal partial class UsersOperations : IServiceOperations, IUsersOperations + { + /// + /// Initializes a new instance of the UsersOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal UsersOperations(DataBoxEdgeManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the DataBoxEdgeManagementClient + /// + public DataBoxEdgeManagementClient Client { get; private set; } + + /// + /// Gets all the users registered on a Data Box Edge/Data Box Gateway device. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// Specify $filter='UserType eq <type>' to filter on user type property + /// + /// + /// 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>> ListByDataBoxEdgeDeviceWithHttpMessagesAsync(string deviceName, string resourceGroupName, string filter = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("filter", filter); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByDataBoxEdgeDevice", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } + 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("GET"); + _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; + } + + /// + /// Gets the properties of the specified user. + /// + /// + /// The device name. + /// + /// + /// The user name. + /// + /// + /// The resource group name. + /// + /// + /// 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> GetWithHttpMessagesAsync(string deviceName, string name, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("name", name); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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("GET"); + _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; + } + + /// + /// Creates a new user or updates an existing user's information on a Data Box + /// Edge/Data Box Gateway device. + /// + /// + /// The device name. + /// + /// + /// The user name. + /// + /// + /// The user details. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string deviceName, string name, User user, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(deviceName, name, user, resourceGroupName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes the user on a databox edge/gateway device. + /// + /// + /// The device name. + /// + /// + /// The user name. + /// + /// + /// The resource group name. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string deviceName, string name, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(deviceName, name, resourceGroupName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Creates a new user or updates an existing user's information on a Data Box + /// Edge/Data Box Gateway device. + /// + /// + /// The device name. + /// + /// + /// The user name. + /// + /// + /// The user details. + /// + /// + /// The resource group name. + /// + /// + /// 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> BeginCreateOrUpdateWithHttpMessagesAsync(string deviceName, string name, User user, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (user == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "user"); + } + if (user != null) + { + user.Validate(); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("name", name); + tracingParameters.Add("user", user); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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("PUT"); + _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(user != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(user, 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 && (int)_statusCode != 202) + { + 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; + } + + /// + /// Deletes the user on a databox edge/gateway device. + /// + /// + /// The device name. + /// + /// + /// The user name. + /// + /// + /// The resource group name. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// 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 BeginDeleteWithHttpMessagesAsync(string deviceName, string name, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (deviceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "deviceName"); + } + if (name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "name"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("deviceName", deviceName); + tracingParameters.Add("name", name); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", 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.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/users/{name}").ToString(); + _url = _url.Replace("{deviceName}", System.Uri.EscapeDataString(deviceName)); + _url = _url.Replace("{name}", System.Uri.EscapeDataString(name)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + 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("DELETE"); + _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 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + 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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets all the users registered on a Data Box Edge/Data Box Gateway device. + /// + /// + /// 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>> ListByDataBoxEdgeDeviceNextWithHttpMessagesAsync(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, "ListByDataBoxEdgeDeviceNext", 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("GET"); + _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/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/UsersOperationsExtensions.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/UsersOperationsExtensions.cs new file mode 100644 index 0000000000000..2db1900b1e554 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Generated/UsersOperationsExtensions.cs @@ -0,0 +1,345 @@ +// +// 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.DataBoxEdge +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for UsersOperations. + /// + public static partial class UsersOperationsExtensions + { + /// + /// Gets all the users registered on a Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// Specify $filter='UserType eq <type>' to filter on user type property + /// + public static IPage ListByDataBoxEdgeDevice(this IUsersOperations operations, string deviceName, string resourceGroupName, string filter = default(string)) + { + return operations.ListByDataBoxEdgeDeviceAsync(deviceName, resourceGroupName, filter).GetAwaiter().GetResult(); + } + + /// + /// Gets all the users registered on a Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The resource group name. + /// + /// + /// Specify $filter='UserType eq <type>' to filter on user type property + /// + /// + /// The cancellation token. + /// + public static async Task> ListByDataBoxEdgeDeviceAsync(this IUsersOperations operations, string deviceName, string resourceGroupName, string filter = default(string), CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByDataBoxEdgeDeviceWithHttpMessagesAsync(deviceName, resourceGroupName, filter, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the properties of the specified user. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The user name. + /// + /// + /// The resource group name. + /// + public static User Get(this IUsersOperations operations, string deviceName, string name, string resourceGroupName) + { + return operations.GetAsync(deviceName, name, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Gets the properties of the specified user. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The user name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IUsersOperations operations, string deviceName, string name, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(deviceName, name, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates a new user or updates an existing user's information on a Data Box + /// Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The user name. + /// + /// + /// The user details. + /// + /// + /// The resource group name. + /// + public static User CreateOrUpdate(this IUsersOperations operations, string deviceName, string name, User user, string resourceGroupName) + { + return operations.CreateOrUpdateAsync(deviceName, name, user, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Creates a new user or updates an existing user's information on a Data Box + /// Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The user name. + /// + /// + /// The user details. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IUsersOperations operations, string deviceName, string name, User user, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(deviceName, name, user, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the user on a databox edge/gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The user name. + /// + /// + /// The resource group name. + /// + public static void Delete(this IUsersOperations operations, string deviceName, string name, string resourceGroupName) + { + operations.DeleteAsync(deviceName, name, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the user on a databox edge/gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The user name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IUsersOperations operations, string deviceName, string name, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(deviceName, name, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Creates a new user or updates an existing user's information on a Data Box + /// Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The user name. + /// + /// + /// The user details. + /// + /// + /// The resource group name. + /// + public static User BeginCreateOrUpdate(this IUsersOperations operations, string deviceName, string name, User user, string resourceGroupName) + { + return operations.BeginCreateOrUpdateAsync(deviceName, name, user, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Creates a new user or updates an existing user's information on a Data Box + /// Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The user name. + /// + /// + /// The user details. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this IUsersOperations operations, string deviceName, string name, User user, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(deviceName, name, user, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes the user on a databox edge/gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The user name. + /// + /// + /// The resource group name. + /// + public static void BeginDelete(this IUsersOperations operations, string deviceName, string name, string resourceGroupName) + { + operations.BeginDeleteAsync(deviceName, name, resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Deletes the user on a databox edge/gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The device name. + /// + /// + /// The user name. + /// + /// + /// The resource group name. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IUsersOperations operations, string deviceName, string name, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(deviceName, name, resourceGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets all the users registered on a Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByDataBoxEdgeDeviceNext(this IUsersOperations operations, string nextPageLink) + { + return operations.ListByDataBoxEdgeDeviceNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets all the users registered on a Data Box Edge/Data Box Gateway device. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByDataBoxEdgeDeviceNextAsync(this IUsersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByDataBoxEdgeDeviceNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Microsoft.Azure.Management.DataBoxEdge.csproj b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Microsoft.Azure.Management.DataBoxEdge.csproj index 828ff43c20c44..20ca4a421d7a2 100644 --- a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Microsoft.Azure.Management.DataBoxEdge.csproj +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Microsoft.Azure.Management.DataBoxEdge.csproj @@ -7,9 +7,12 @@ Microsoft.Azure.Management.DataBoxEdge Microsoft Azure Management DataBoxEdge library Microsoft.Azure.Management.DataBoxEdge - 0.9.0-preview + 1.0.0 AzureDataBoxEdge;DataBox; + diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Properties/AssemblyInfo.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Properties/AssemblyInfo.cs index 7ec4b63ed2063..7ae81a7d70201 100644 --- a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Properties/AssemblyInfo.cs +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/Properties/AssemblyInfo.cs @@ -4,12 +4,11 @@ using System.Reflection; using System.Resources; -[assembly: AssemblyTitle("Microsoft Azure DataBox Edge Management Library")] -[assembly: AssemblyDescription("Provides Microsoft Azure DataBox management functions for managing the Microsoft Azure DataBox Edge service.")] - -[assembly: AssemblyVersion("0.9.0")] -[assembly: AssemblyFileVersion("0.9.0")] +[assembly: AssemblyTitle("Microsoft Azure DataBox Edge Gateway Management Library")] +[assembly: AssemblyDescription("Provides management functionality for Microsoft Azure DataBox Edge Gateway Management Resources.")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("Microsoft")] [assembly: AssemblyProduct("Microsoft Azure .NET SDK")] diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/generate.ps1 b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/generate.ps1 index 072308c33796b..44edc3569fc1e 100644 --- a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/generate.ps1 +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/src/generate.ps1 @@ -1 +1 @@ -Start-AutoRestCodeGeneration -ResourceProvider "edgegateway/resource-manager" -AutoRestVersion "latest" +Start-AutoRestCodeGeneration -ResourceProvider "databoxedge/resource-manager" -AutoRestVersion "latest" diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Helpers/AlertHelper.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Helpers/AlertHelper.cs new file mode 100644 index 0000000000000..714d025fcad80 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Helpers/AlertHelper.cs @@ -0,0 +1,51 @@ +using Microsoft.Azure.Management.DataBoxEdge; +using Microsoft.Azure.Management.DataBoxEdge.Models; +using Microsoft.Rest.Azure; +using System.Collections.Generic; + +namespace DataBoxEdge.Tests +{ + /// + /// Contains the test helper methods + /// + public static partial class TestUtilities + { + /// + /// Gets alerts int the device + /// + /// + /// + /// + /// + /// + public static IEnumerable ListAlerts( + DataBoxEdgeManagementClient client, + string deviceName, + string resourceGroupName, + out string continuationToken) + { + //Create a databox edge/gateway device + IPage alertList = client.Alerts.ListByDataBoxEdgeDevice(deviceName, resourceGroupName); + continuationToken = alertList.NextPageLink; + return alertList; + } + + /// + /// Gets next page of alerts in device + /// + /// + /// + /// + /// + public static IEnumerable ListAlertsNext( + DataBoxEdgeManagementClient client, + string nextLink, + out string continuationToken) + { + // Gets the alert list + IPage alertList = client.Alerts.ListByDataBoxEdgeDeviceNext(nextLink); + continuationToken = alertList.NextPageLink; + return alertList; + } + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Helpers/BandwidthScheduleHelper.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Helpers/BandwidthScheduleHelper.cs new file mode 100644 index 0000000000000..3f0e56e40ac1d --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Helpers/BandwidthScheduleHelper.cs @@ -0,0 +1,65 @@ +using Microsoft.Azure.Management.DataBoxEdge; +using Microsoft.Azure.Management.DataBoxEdge.Models; +using Microsoft.Rest.Azure; +using System.Collections.Generic; + +namespace DataBoxEdge.Tests +{ + public static partial class TestUtilities + { + + /// + /// Gets a bandwidth schedule object + /// + /// BandwidthSchedule + public static BandwidthSchedule GetBWSObject() + { + + string start = string.Format("{0}:{1}:{2}", 0, 0, 0); + string stopTime = string.Format("{0}:{1}:{2}", 13, 59, 0); + List days = new List { "Sunday", "Monday" }; + + BandwidthSchedule bws = new BandwidthSchedule(start, stopTime, 100, days); + return bws; + } + + /// + /// Gets the bandwidth schedules in device + /// + /// + /// + /// + /// + /// + public static IEnumerable ListBandwidthSchedules( + DataBoxEdgeManagementClient client, + string deviceName, + string resourceGroupName, + out string continuationToken) + { + //Create a databox edge/gateway device + IPage scheduleList = client.BandwidthSchedules.ListByDataBoxEdgeDevice(deviceName, resourceGroupName); + continuationToken = scheduleList.NextPageLink; + return scheduleList; + } + + /// + /// Gets next page of bandwidth schedules in device + /// + /// + /// + /// + /// + public static IEnumerable ListBandwidthSchedulesNext( + DataBoxEdgeManagementClient client, + string nextLink, + out string continuationToken) + { + //Create a databox edge/gateway device + IPage scheduleList = client.BandwidthSchedules.ListByDataBoxEdgeDeviceNext(nextLink); + continuationToken = scheduleList.NextPageLink; + return scheduleList; + } + } +} + diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Helpers/ContainerHelper.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Helpers/ContainerHelper.cs new file mode 100644 index 0000000000000..35e416b01fff1 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Helpers/ContainerHelper.cs @@ -0,0 +1,31 @@ +using Microsoft.Azure.Management.DataBoxEdge; +using Microsoft.Azure.Management.DataBoxEdge.Models; +using Microsoft.Rest.Azure; +using System.Collections.Generic; + +namespace DataBoxEdge.Tests +{ + public static partial class TestUtilities + { + + /// + /// Gets containers in the storage account + /// + /// + /// + /// + /// + /// List of shares + public static IEnumerable ListContainers( + DataBoxEdgeManagementClient client, + string deviceName, + string storageAccountName, + string resourceGroupName, + out string continuationToken) + { + IPage containers = client.Containers.ListByStorageAccount(deviceName, storageAccountName, resourceGroupName); + continuationToken = containers.NextPageLink; + return containers; + } + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Helpers/DeviceHelper.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Helpers/DeviceHelper.cs new file mode 100644 index 0000000000000..7ef24e1bd3c2d --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Helpers/DeviceHelper.cs @@ -0,0 +1,134 @@ +using Microsoft.Azure.Management.DataBoxEdge; +using Microsoft.Azure.Management.DataBoxEdge.Models; +using Microsoft.Rest.Azure; +using System.Collections.Generic; + +namespace DataBoxEdge.Tests +{ + public static partial class TestUtilities + { + + /// + /// Creates or updates given edge resource + /// + /// + /// + /// + /// + /// + public static DataBoxEdgeDevice CreateOrUpdate( + this DataBoxEdgeDevice device, + string deviceName, + DataBoxEdgeManagementClient client, + string resourceGroupName) + { + //Create a databox edge/gateway device + client.Devices.CreateOrUpdate(deviceName, + device, + resourceGroupName + ); + + //Returns a databox edge/gateway device + return client.Devices.Get(deviceName, resourceGroupName); + } + + /// + /// Populates the values of a gateway device + /// + /// + /// + public static void PopulateGatewayDeviceProperties(this DataBoxEdgeDevice device) + { + device.Location = TestConstants.DefaultResourceLocation; + device.Sku = new Sku("Gateway", "standard"); + device.Tags = new Dictionary(); + device.Tags.Add("tag1", "value1"); + device.Tags.Add("tag2", "value2"); + } + + /// + /// Populates the values of a edge device + /// + /// + /// + public static void PopulateEdgeDeviceProperties(this DataBoxEdgeDevice device) + { + device.Location = TestConstants.DefaultResourceLocation; + device.Sku = new Sku("Edge", "standard"); + device.Tags = new Dictionary(); + device.Tags.Add("tag1", "value1"); + device.Tags.Add("tag2", "value2"); + } + + + /// + /// Gets resources by resource group + /// + /// + /// + /// + /// + public static IEnumerable GetResourcesByResourceGroup( + DataBoxEdgeManagementClient client, + string resourceGroupName, + out string continuationToken) + { + //Create a databox edge/gateway device + IPage resourceList = client.Devices.ListByResourceGroup(resourceGroupName); + continuationToken = resourceList.NextPageLink; + return resourceList; + } + + /// + /// Gets next page in resource group + /// + /// + /// + /// + /// + public static IEnumerable GetResourcesByResourceGroupNext( + DataBoxEdgeManagementClient client, + string nextLink, + out string continuationToken) + { + //Create a databox edge/gateway device + IPage resourceList = client.Devices.ListByResourceGroupNext(nextLink); + continuationToken = resourceList.NextPageLink; + return resourceList; + } + + /// + /// Gets resources by subscription + /// + /// + /// + /// + public static IEnumerable GetResourcesBySubscription( + DataBoxEdgeManagementClient client, + out string continuationToken) + { + //Create a databox edge/gateway device + IPage resourceList = client.Devices.ListBySubscription(); + continuationToken = resourceList.NextPageLink; + return resourceList; + } + + /// + /// Gets next page of resources in subscription + /// + /// + /// + /// + /// + public static IEnumerable GetResourcesBySubscriptionNext( + DataBoxEdgeManagementClient client, + string nextLink, + out string continuationToken) + { + //Create a databox edge/gateway device + IPage resourceList = client.Devices.ListBySubscriptionNext(nextLink); + continuationToken = resourceList.NextPageLink; + return resourceList; + } + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Helpers/DevicePatchHelper.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Helpers/DevicePatchHelper.cs new file mode 100644 index 0000000000000..ba11158943dac --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Helpers/DevicePatchHelper.cs @@ -0,0 +1,28 @@ +using Microsoft.Azure.Management.DataBoxEdge; +using Microsoft.Azure.Management.DataBoxEdge.Models; +using System.Collections.Generic; +using System.Linq; + +namespace DataBoxEdge.Tests +{ + public static partial class TestUtilities + { + /// + /// Gets the tags. + /// + /// + /// + public static Dictionary GetTags(this DataBoxEdgeDevice device) + { + var Tags = new Dictionary(); + if (device.Tags != null) + { + Tags = device.Tags.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + } + Tags.Add("tag3", "value3"); + Tags.Add("tag4", "value4"); + + return Tags; + } + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Helpers/OrderHelper.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Helpers/OrderHelper.cs new file mode 100644 index 0000000000000..ce05bd47e99ee --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Helpers/OrderHelper.cs @@ -0,0 +1,46 @@ +using Microsoft.Azure.Management.DataBoxEdge; +using Microsoft.Azure.Management.DataBoxEdge.Models; +using Microsoft.Rest.Azure; +using System; +using System.Collections.Generic; +using System.Text; + +namespace DataBoxEdge.Tests +{ + public static partial class TestUtilities + { + /// + /// Gets an order object + /// + /// Order + public static Order GetOrderObject() + { + ContactDetails contactDetails = new ContactDetails("John Mcclane", "Microsoft", "8004269400", new List() { "example@microsoft.com" }); + + Address shippingAddress = new Address("Microsoft Corporation", "98052", "Redmond", "WA", "United States"); + Order order = new Order(contactDetails, shippingAddress); + return order; + } + + /// + /// Gets storage account credentials in the device + /// + /// + /// + /// + /// + /// List of order + public static IEnumerable ListOrders( + DataBoxEdgeManagementClient client, + string deviceName, + string resourceGroupName, + out string continuationToken) + { + //Create a databox edge/gateway device + IPage orderList = client.Orders.ListByDataBoxEdgeDevice(deviceName, resourceGroupName); + continuationToken = orderList.NextPageLink; + return orderList; + } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Helpers/RoleHelper.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Helpers/RoleHelper.cs new file mode 100644 index 0000000000000..224a0c54968c7 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Helpers/RoleHelper.cs @@ -0,0 +1,52 @@ +using Microsoft.Azure.Management.DataBoxEdge; +using Microsoft.Azure.Management.DataBoxEdge.Models; +using Microsoft.Rest.Azure; +using System; +using System.Collections.Generic; +using System.Text; + +namespace DataBoxEdge.Tests +{ + public static partial class TestUtilities + { + /// + /// Gets an iot role object + /// + /// + /// + /// IoTRole + public static IoTRole GetIoTRoleObject(AsymmetricEncryptedSecret iotDeviceSecret, AsymmetricEncryptedSecret iotEdgeDeviceSecret) + { + Authentication authentication = new Authentication() { SymmetricKey = new SymmetricKey(iotDeviceSecret) }; + IoTDeviceInfo ioTDeviceInfo = new IoTDeviceInfo("iotdevice", "iothub.azure-devices.net", authentication: authentication); + + Authentication edgeAuthentication = new Authentication() { SymmetricKey = new SymmetricKey(iotEdgeDeviceSecret) }; + IoTDeviceInfo ioTEdgeDeviceInfo = new IoTDeviceInfo("iotdevice", "iothub.azure-devices.net", authentication: edgeAuthentication); + + IoTRole ioTRole = new IoTRole("Linux", ioTDeviceInfo, ioTEdgeDeviceInfo, "Enabled"); + return ioTRole; + + } + + /// + /// Gets roles in the device + /// + /// + /// + /// + /// + /// List of roles + public static IEnumerable ListRoles( + DataBoxEdgeManagementClient client, + string deviceName, + string resourceGroupName, + out string continuationToken) + { + //Create a databox edge/gateway device + IPage roles = client.Roles.ListByDataBoxEdgeDevice(deviceName, resourceGroupName); + continuationToken = roles.NextPageLink; + return roles; + } + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Helpers/SacHelper.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Helpers/SacHelper.cs new file mode 100644 index 0000000000000..93375d08c1573 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Helpers/SacHelper.cs @@ -0,0 +1,61 @@ +using Microsoft.Azure.Management.DataBoxEdge; +using Microsoft.Azure.Management.DataBoxEdge.Models; +using Microsoft.Rest.Azure; +using System.Collections.Generic; + +namespace DataBoxEdge.Tests +{ + public static partial class TestUtilities + { + /// + /// Gets a sac object + /// + /// + /// + /// StorageAccountCredential + public static StorageAccountCredential GetSACObject(AsymmetricEncryptedSecret secret,string sacName) + { + StorageAccountCredential sac = new StorageAccountCredential(sacName, "Disabled", "BlobStorage", userName: sacName, accountKey: secret); + + return sac; + } + + /// + /// Gets storage account credentials in the device + /// + /// + /// + /// + /// + /// List of SACs + public static IEnumerable ListStorageAccountCredentials( + DataBoxEdgeManagementClient client, + string deviceName, + string resourceGroupName, + out string continuationToken) + { + //Create a databox edge/gateway device + IPage sacList = client.StorageAccountCredentials.ListByDataBoxEdgeDevice(deviceName, resourceGroupName); + continuationToken = sacList.NextPageLink; + return sacList; + } + + /// + /// Gets next page of storage account credentials + /// + /// + /// + /// + /// + public static IEnumerable ListStorageAccountCredentialsNext( + DataBoxEdgeManagementClient client, + string nextLink, + out string continuationToken) + { + //Create a databox edge/gateway device + IPage sacList = client.StorageAccountCredentials.ListByDataBoxEdgeDeviceNext(nextLink); + continuationToken = sacList.NextPageLink; + return sacList; + } + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Helpers/ShareHelper.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Helpers/ShareHelper.cs new file mode 100644 index 0000000000000..9f825a2bba0a4 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Helpers/ShareHelper.cs @@ -0,0 +1,80 @@ +using Microsoft.Azure.Management.DataBoxEdge; +using Microsoft.Azure.Management.DataBoxEdge.Models; +using Microsoft.Rest.Azure; +using System.Collections.Generic; + +namespace DataBoxEdge.Tests +{ + public static partial class TestUtilities + { + /// + /// Gets an smb share object + /// + /// + /// + /// Share + public static Share GetSMBShareObject(string sacId, string userId, string dataPolicy = DataPolicy.Cloud) + { + Share share = new Share(ShareStatus.OK, MonitoringStatus.Enabled, ShareAccessProtocol.SMB, dataPolicy: DataPolicy.Cloud); + if (dataPolicy != DataPolicy.Local) + share.AzureContainerInfo = new AzureContainerInfo(sacId, "testContainersmb", AzureContainerDataFormat.BlockBlob); + share.UserAccessRights = new List(); + share.UserAccessRights.Add(new UserAccessRight(userId, ShareAccessType.Change)); + return share; + } + + /// + /// Gets an nfs share object + /// + /// + /// + /// Share + public static Share GetNFSShareObject(string sacId, string clientId, string dataPolicy = DataPolicy.Cloud) + { + Share share = new Share(ShareStatus.OK, MonitoringStatus.Enabled, ShareAccessProtocol.NFS, dataPolicy: dataPolicy); + if (dataPolicy != DataPolicy.Local) + share.AzureContainerInfo = new AzureContainerInfo(sacId, "testContainernfs", AzureContainerDataFormat.BlockBlob); + share.ClientAccessRights = new List(); + share.ClientAccessRights.Add(new ClientAccessRight(clientId, ClientPermissionType.ReadWrite)); + + return share; + } + + /// + /// Gets shares in the device + /// + /// + /// + /// + /// + /// List of shares + public static IEnumerable ListShares( + DataBoxEdgeManagementClient client, + string deviceName, + string resourceGroupName, + out string continuationToken) + { + //Create a databox edge/gateway device + IPage shares = client.Shares.ListByDataBoxEdgeDevice(deviceName, resourceGroupName); + continuationToken = shares.NextPageLink; + return shares; + } + + /// + /// Gets next page of shares + /// + /// + /// + /// + /// List of shares + public static IEnumerable ListSharesNext( + DataBoxEdgeManagementClient client, + string nextLink, + out string continuationToken) + { + IPage shares = client.Shares.ListByDataBoxEdgeDeviceNext(nextLink); + continuationToken = shares.NextPageLink; + return shares; + } + } +} \ No newline at end of file diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Helpers/StorageAccountHelper.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Helpers/StorageAccountHelper.cs new file mode 100644 index 0000000000000..f10b6baf3716d --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Helpers/StorageAccountHelper.cs @@ -0,0 +1,30 @@ +using Microsoft.Azure.Management.DataBoxEdge; +using Microsoft.Azure.Management.DataBoxEdge.Models; +using Microsoft.Rest.Azure; +using System.Collections.Generic; + +namespace DataBoxEdge.Tests +{ + public static partial class TestUtilities + { + + /// + /// Gets storage accounts in the device + /// + /// + /// + /// + /// + /// List of shares + public static IEnumerable ListStorageAccounts( + DataBoxEdgeManagementClient client, + string deviceName, + string resourceGroupName, + out string continuationToken) + { + IPage storageAccounts = client.StorageAccounts.ListByDataBoxEdgeDevice(deviceName, resourceGroupName); + continuationToken = storageAccounts.NextPageLink; + return storageAccounts; + } + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Helpers/TriggerHelper.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Helpers/TriggerHelper.cs new file mode 100644 index 0000000000000..87c203c389c2a --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Helpers/TriggerHelper.cs @@ -0,0 +1,54 @@ +using Microsoft.Azure.Management.DataBoxEdge; +using Microsoft.Azure.Management.DataBoxEdge.Models; +using Microsoft.Rest.Azure; +using System; +using System.Collections.Generic; + +namespace DataBoxEdge.Tests +{ + public static partial class TestUtilities + { + /// + /// Gets a file event trigger object + /// + + /// FileEventTrigger + public static FileEventTrigger GetFileTriggerObject(string localShareId, string roleId) + { + FileEventTrigger fileEventTrigger = new FileEventTrigger(new FileSourceInfo(localShareId), new RoleSinkInfo(roleId), customContextTag: "fileEventTrigger"); + return fileEventTrigger; + } + + /// + /// Gets a periodic event trigger object + /// + + /// PeriodicTimerEventTrigger + public static PeriodicTimerEventTrigger GetPeriodicTriggerObject(string roleId) + { + PeriodicTimerSourceInfo sourceInfo = new PeriodicTimerSourceInfo(DateTime.UtcNow.Date.AddDays(1), "0.1:0:0", "trigger-periodicTrigger"); + PeriodicTimerEventTrigger periodicTimerEventTrigger = new PeriodicTimerEventTrigger(sourceInfo, new RoleSinkInfo(roleId), customContextTag: "periodicTrigger"); + return periodicTimerEventTrigger; + } + + /// + /// Gets triggers in the device + /// + /// + /// + /// + /// + /// List of roles + public static IEnumerable ListTriggers( + DataBoxEdgeManagementClient client, + string deviceName, + string resourceGroupName, + out string continuationToken) + { + //Create a databox edge/gateway device + IPage triggers = client.Triggers.ListByDataBoxEdgeDevice(deviceName, resourceGroupName); + continuationToken = triggers.NextPageLink; + return triggers; + } + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Helpers/UserHelper.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Helpers/UserHelper.cs new file mode 100644 index 0000000000000..eeab534196770 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Helpers/UserHelper.cs @@ -0,0 +1,49 @@ +using Microsoft.Azure.Management.DataBoxEdge; +using Microsoft.Azure.Management.DataBoxEdge.Models; +using Microsoft.Rest.Azure; +using System.Collections.Generic; + +namespace DataBoxEdge.Tests +{ + public static partial class TestUtilities + { + + /// + /// Gets users in the device + /// + /// + /// + /// + /// + /// + public static IEnumerable ListUsers( + DataBoxEdgeManagementClient client, + string deviceName, + string resourceGroupName, + out string continuationToken) + { + //Create a databox edge/gateway device + IPage userList = client.Users.ListByDataBoxEdgeDevice(deviceName, resourceGroupName); + continuationToken = userList.NextPageLink; + return userList; + } + + /// + /// Gets next page of users + /// + /// + /// + /// + /// + public static IEnumerable ListUsersNext( + DataBoxEdgeManagementClient client, + string nextLink, + out string continuationToken) + { + //Create a databox edge/gateway device + IPage userList = client.Users.ListByDataBoxEdgeDeviceNext(nextLink); + continuationToken = userList.NextPageLink; + return userList; + } + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Microsoft.Azure.Management.DataBoxEdge.Tests.csproj b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Microsoft.Azure.Management.DataBoxEdge.Tests.csproj index 4b773c01a9acb..53a59599c6808 100644 --- a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Microsoft.Azure.Management.DataBoxEdge.Tests.csproj +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Microsoft.Azure.Management.DataBoxEdge.Tests.csproj @@ -16,7 +16,7 @@ netcoreapp2.0 - + diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Properties/AssemblyInfo.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000000..84ffbc5c33c3b --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Properties/AssemblyInfo.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using Xunit; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("DataBoxEdge.Tests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("DataBoxEdge.Tests")] +[assembly: AssemblyCopyright("Copyright © 2015")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("21567887-498f-4e84-95a8-41dec0516598")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/AlertTests/Test_Alerts.json b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/AlertTests/Test_Alerts.json new file mode 100644 index 0000000000000..28788f20873ac --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/AlertTests/Test_Alerts.json @@ -0,0 +1,141 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/alerts?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2UvYWxlcnRzP2FwaS12ZXJzaW9uPTIwMTktMDgtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "40695bb8-cd24-4ae9-adb0-36113953fe44" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "5d70553f-5b6d-4c55-80a3-83c0509cb40a" + ], + "x-ms-client-request-id": [ + "40695bb8-cd24-4ae9-adb0-36113953fe44" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11990" + ], + "x-ms-correlation-request-id": [ + "56ccfbf9-5bc4-4073-bcfd-92df5d49543c" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T143503Z:56ccfbf9-5bc4-4073-bcfd-92df5d49543c" + ], + "Date": [ + "Thu, 05 Dec 2019 14:35:02 GMT" + ], + "Content-Length": [ + "1255" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"properties\": {\r\n \"title\": \"Edge compute couldn’t access data on share argus-nfs-cloud-share.\",\r\n \"alertType\": \"EdgeCompute.StorageEndpointsInaccessible\",\r\n \"appearedAtTime\": \"2019-07-15T06:10:38.6199662Z\",\r\n \"appearedAtDateTime\": \"2019-07-15T06:10:38.6199662Z\",\r\n \"recommendation\": \"Verify that you can access share argus-nfs-cloud-share. If you can access the share, it indicates an issue with Edge compute.
\\r\\n\\r\\nTo resolve the issue, restart your device. In the local web UI of your device, go to Maintenance > Power settings and click Restart.
If the problem persists, contact Microsoft Support.\",\r\n \"severity\": \"Warning\",\r\n \"errorDetails\": {\r\n \"errorCode\": \"\",\r\n \"errorMessage\": \"\",\r\n \"occurrences\": 1,\r\n \"occurences\": 1\r\n },\r\n \"detailedInformation\": {}\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/alerts/c66615ff-0000-8888-b204-9e9f348a887a\",\r\n \"name\": \"c66615ff-0000-8888-b204-9e9f348a887a\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/alerts\"\r\n }\r\n ]\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/alerts/c66615ff-0000-8888-b204-9e9f348a887a?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2UvYWxlcnRzL2M2NjYxNWZmLTAwMDAtODg4OC1iMjA0LTllOWYzNDhhODg3YT9hcGktdmVyc2lvbj0yMDE5LTA4LTAx", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "d10dccb3-2246-4e96-826d-609862da1c62" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "2170ddd2-8b22-468d-bccb-b15cfce58760" + ], + "x-ms-client-request-id": [ + "d10dccb3-2246-4e96-826d-609862da1c62" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11989" + ], + "x-ms-correlation-request-id": [ + "3e528d8c-9b25-4f36-b0dd-659c996aa1e4" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T143504Z:3e528d8c-9b25-4f36-b0dd-659c996aa1e4" + ], + "Date": [ + "Thu, 05 Dec 2019 14:35:03 GMT" + ], + "Content-Length": [ + "1150" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"title\": \"Edge compute couldn’t access data on share argus-nfs-cloud-share.\",\r\n \"alertType\": \"EdgeCompute.StorageEndpointsInaccessible\",\r\n \"appearedAtTime\": \"2019-07-15T06:10:38.6199662Z\",\r\n \"appearedAtDateTime\": \"2019-07-15T06:10:38.6199662Z\",\r\n \"recommendation\": \"Verify that you can access share argus-nfs-cloud-share. If you can access the share, it indicates an issue with Edge compute.
\\r\\n\\r\\nTo resolve the issue, restart your device. In the local web UI of your device, go to Maintenance > Power settings and click Restart.
If the problem persists, contact Microsoft Support.\",\r\n \"severity\": \"Warning\",\r\n \"errorDetails\": {\r\n \"errorCode\": \"\",\r\n \"errorMessage\": \"\",\r\n \"occurrences\": 1,\r\n \"occurences\": 1\r\n },\r\n \"detailedInformation\": {}\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/alerts/c66615ff-0000-8888-b204-9e9f348a887a\",\r\n \"name\": \"c66615ff-0000-8888-b204-9e9f348a887a\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/alerts\"\r\n}", + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "db4e2fdb-6d80-4e6e-b7cd-736098270664", + "SubId": "db4e2fdb-6d80-4e6e-b7cd-736098270664" + } +} \ No newline at end of file diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/BandwidthScheduleTests/Test_BandwidthSchedule.json b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/BandwidthScheduleTests/Test_BandwidthSchedule.json new file mode 100644 index 0000000000000..7817329481c0e --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/BandwidthScheduleTests/Test_BandwidthSchedule.json @@ -0,0 +1,513 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/bandwidthSchedules/schedule-1?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2UvYmFuZHdpZHRoU2NoZWR1bGVzL3NjaGVkdWxlLTE/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"start\": \"0:0:0\",\r\n \"stop\": \"13:59:0\",\r\n \"rateInMbps\": 100,\r\n \"days\": [\r\n \"Sunday\",\r\n \"Monday\"\r\n ]\r\n }\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "bf9eef70-fea3-4105-ad2a-813688b2c4b8" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "154" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/bandwidthSchedules/schedule-1/operationResults/787391a9-7671-4003-b90c-fb46e719c534?api-version=2019-08-01" + ], + "Retry-After": [ + "30" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "0c4a81b7-8802-4669-9a01-02bfe45128c2" + ], + "x-ms-client-request-id": [ + "bf9eef70-fea3-4105-ad2a-813688b2c4b8" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1198" + ], + "x-ms-correlation-request-id": [ + "6321d310-0adc-458a-b677-3933285c16cc" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T093037Z:6321d310-0adc-458a-b677-3933285c16cc" + ], + "Date": [ + "Thu, 05 Dec 2019 09:30:37 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/bandwidthSchedules/schedule-1/operationResults/787391a9-7671-4003-b90c-fb46e719c534?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2UvYmFuZHdpZHRoU2NoZWR1bGVzL3NjaGVkdWxlLTEvb3BlcmF0aW9uUmVzdWx0cy83ODczOTFhOS03NjcxLTQwMDMtYjkwYy1mYjQ2ZTcxOWM1MzQ/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/bandwidthSchedules/schedule-1?api-version=2019-08-01" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "4716e2d0-0ec7-4323-b2e4-7530be286285" + ], + "x-ms-client-request-id": [ + "8ec8c9c2-78e3-4c47-aaaf-eedc0540ea0a" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11997" + ], + "x-ms-correlation-request-id": [ + "d3dddbe5-68c2-4e9e-bf48-8f51956edb72" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T093109Z:d3dddbe5-68c2-4e9e-bf48-8f51956edb72" + ], + "Date": [ + "Thu, 05 Dec 2019 09:31:08 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/bandwidthSchedules/schedule-1?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2UvYmFuZHdpZHRoU2NoZWR1bGVzL3NjaGVkdWxlLTE/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "708aacc4-10bf-490d-b0e7-46a6197dac53" + ], + "x-ms-client-request-id": [ + "2419de09-0f20-4032-8b89-013c9238d5be" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11996" + ], + "x-ms-correlation-request-id": [ + "99653a3f-0fc9-438d-be97-5d55961f542a" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T093139Z:99653a3f-0fc9-438d-be97-5d55961f542a" + ], + "Date": [ + "Thu, 05 Dec 2019 09:31:39 GMT" + ], + "Content-Length": [ + "449" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"start\": \"00:00:00\",\r\n \"stop\": \"13:59:00\",\r\n \"rateInMbps\": 100,\r\n \"days\": [\r\n \"Sunday\",\r\n \"Monday\"\r\n ]\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/bandwidthSchedules/schedule-1\",\r\n \"name\": \"schedule-1\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/bandwidthSchedules\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/bandwidthSchedules/schedule-1?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2UvYmFuZHdpZHRoU2NoZWR1bGVzL3NjaGVkdWxlLTE/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "a20e7ced-2b75-4f35-9d15-b5fc3265f0fd" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "66c2d1b2-30a7-46d1-ae41-425f6e873883" + ], + "x-ms-client-request-id": [ + "a20e7ced-2b75-4f35-9d15-b5fc3265f0fd" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11995" + ], + "x-ms-correlation-request-id": [ + "159ebff2-0f70-4c52-8340-58c8960ded44" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T093140Z:159ebff2-0f70-4c52-8340-58c8960ded44" + ], + "Date": [ + "Thu, 05 Dec 2019 09:31:39 GMT" + ], + "Content-Length": [ + "449" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"start\": \"00:00:00\",\r\n \"stop\": \"13:59:00\",\r\n \"rateInMbps\": 100,\r\n \"days\": [\r\n \"Sunday\",\r\n \"Monday\"\r\n ]\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/bandwidthSchedules/schedule-1\",\r\n \"name\": \"schedule-1\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/bandwidthSchedules\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/bandwidthSchedules?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2UvYmFuZHdpZHRoU2NoZWR1bGVzP2FwaS12ZXJzaW9uPTIwMTktMDgtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "e77ebcd2-b687-4faa-8ba6-c7d498302b31" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "6b8857ea-ddaa-482f-b5e4-a5c0452d2824" + ], + "x-ms-client-request-id": [ + "e77ebcd2-b687-4faa-8ba6-c7d498302b31" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11994" + ], + "x-ms-correlation-request-id": [ + "c79d7244-06a8-40db-a8a2-a1a18717c073" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T093140Z:c79d7244-06a8-40db-a8a2-a1a18717c073" + ], + "Date": [ + "Thu, 05 Dec 2019 09:31:40 GMT" + ], + "Content-Length": [ + "530" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"properties\": {\r\n \"start\": \"00:00:00\",\r\n \"stop\": \"13:59:00\",\r\n \"rateInMbps\": 100,\r\n \"days\": [\r\n \"Sunday\",\r\n \"Monday\"\r\n ]\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/bandwidthSchedules/schedule-1\",\r\n \"name\": \"schedule-1\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/bandwidthSchedules\"\r\n }\r\n ]\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/bandwidthSchedules/schedule-1?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2UvYmFuZHdpZHRoU2NoZWR1bGVzL3NjaGVkdWxlLTE/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "35098756-d949-4f98-93e2-32b7be680eca" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/bandwidthSchedules/schedule-1/operationResults/8a0ba4ff-5df9-40f6-b08c-ac3577c202ff?api-version=2019-08-01" + ], + "Retry-After": [ + "30" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "0767ac44-111d-42a0-8ff5-6694d95bfb7c" + ], + "x-ms-client-request-id": [ + "35098756-d949-4f98-93e2-32b7be680eca" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-deletes": [ + "14999" + ], + "x-ms-correlation-request-id": [ + "5f28e40b-b20f-42f4-a05a-2e941bb5abd6" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T093141Z:5f28e40b-b20f-42f4-a05a-2e941bb5abd6" + ], + "Date": [ + "Thu, 05 Dec 2019 09:31:41 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/bandwidthSchedules/schedule-1/operationResults/8a0ba4ff-5df9-40f6-b08c-ac3577c202ff?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2UvYmFuZHdpZHRoU2NoZWR1bGVzL3NjaGVkdWxlLTEvb3BlcmF0aW9uUmVzdWx0cy84YTBiYTRmZi01ZGY5LTQwZjYtYjA4Yy1hYzM1NzdjMjAyZmY/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "e170fb7d-e7a5-4746-ab5f-023f6859951d" + ], + "x-ms-client-request-id": [ + "6de805db-e7f2-45a4-a4af-670b88f57112" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11993" + ], + "x-ms-correlation-request-id": [ + "084f4c1e-40c6-425a-87b3-3e18bb933ac6" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T093213Z:084f4c1e-40c6-425a-87b3-3e18bb933ac6" + ], + "Date": [ + "Thu, 05 Dec 2019 09:32:12 GMT" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "", + "StatusCode": 204 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/bandwidthSchedules/schedule-1/operationResults/8a0ba4ff-5df9-40f6-b08c-ac3577c202ff?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2UvYmFuZHdpZHRoU2NoZWR1bGVzL3NjaGVkdWxlLTEvb3BlcmF0aW9uUmVzdWx0cy84YTBiYTRmZi01ZGY5LTQwZjYtYjA4Yy1hYzM1NzdjMjAyZmY/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "b455c04f-4f66-4df1-84cf-15995877ba25" + ], + "x-ms-client-request-id": [ + "dffbe4c4-f25c-4bbc-9675-c4e765ebdf56" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11992" + ], + "x-ms-correlation-request-id": [ + "f6188f64-20d4-41d9-b6db-5d894048f751" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T093213Z:f6188f64-20d4-41d9-b6db-5d894048f751" + ], + "Date": [ + "Thu, 05 Dec 2019 09:32:12 GMT" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "", + "StatusCode": 204 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "db4e2fdb-6d80-4e6e-b7cd-736098270664", + "SubId": "db4e2fdb-6d80-4e6e-b7cd-736098270664" + } +} \ No newline at end of file diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/ContainerTests/Test_ContainerOperations.json b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/ContainerTests/Test_ContainerOperations.json new file mode 100644 index 0000000000000..9be947a97f7fd --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/ContainerTests/Test_ContainerOperations.json @@ -0,0 +1,579 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccounts/storageaccount2?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc3RvcmFnZUFjY291bnRzL3N0b3JhZ2VhY2NvdW50Mj9hcGktdmVyc2lvbj0yMDE5LTA4LTAx", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "d4f5abe1-8196-4b43-9db9-0b457da2eead" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "02b3d238-82cb-4cb0-8046-b75d1db0e645" + ], + "x-ms-client-request-id": [ + "d4f5abe1-8196-4b43-9db9-0b457da2eead" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11998" + ], + "x-ms-correlation-request-id": [ + "f3e35d3d-5375-454f-8e8a-a1e3115882d8" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T142043Z:f3e35d3d-5375-454f-8e8a-a1e3115882d8" + ], + "Date": [ + "Thu, 05 Dec 2019 14:20:43 GMT" + ], + "Content-Length": [ + "765" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"description\": \"It is a simple storage account\",\r\n \"storageAccountStatus\": \"OK\",\r\n \"dataPolicy\": \"Cloud\",\r\n \"storageAccountCredentialId\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccountCredentials/databoxedgeutdst\",\r\n \"blobEndpoint\": \"http://storageaccount2.blob.core.windows.net\",\r\n \"containerCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccounts/storageaccount2\",\r\n \"name\": \"storageaccount2\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/storageAccounts\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccounts/storageaccount2/containers/container1?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc3RvcmFnZUFjY291bnRzL3N0b3JhZ2VhY2NvdW50Mi9jb250YWluZXJzL2NvbnRhaW5lcjE/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"dataFormat\": \"BlockBlob\"\r\n }\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "d88445be-3c29-4e32-bf47-a95fa8a7b25d" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "59" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccounts/storageaccount2/containers/container1/operationResults/e70067b9-097e-4113-a31d-a2863f77266b?api-version=2019-08-01" + ], + "Retry-After": [ + "30" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "1aca2417-9997-4cc6-be62-97706682eba6" + ], + "x-ms-client-request-id": [ + "d88445be-3c29-4e32-bf47-a95fa8a7b25d" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1198" + ], + "x-ms-correlation-request-id": [ + "e41a4c61-cfca-4ce8-a1a1-ee2666411dd7" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T142044Z:e41a4c61-cfca-4ce8-a1a1-ee2666411dd7" + ], + "Date": [ + "Thu, 05 Dec 2019 14:20:44 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccounts/storageaccount2/containers/container1/operationResults/e70067b9-097e-4113-a31d-a2863f77266b?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc3RvcmFnZUFjY291bnRzL3N0b3JhZ2VhY2NvdW50Mi9jb250YWluZXJzL2NvbnRhaW5lcjEvb3BlcmF0aW9uUmVzdWx0cy9lNzAwNjdiOS0wOTdlLTQxMTMtYTMxZC1hMjg2M2Y3NzI2NmI/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccounts/storageaccount2/containers/container1?api-version=2019-08-01" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "55df85db-1cba-43e3-b7cb-68da685a56e9" + ], + "x-ms-client-request-id": [ + "ca668099-6f5f-4b20-bb98-aad2b787b0d7" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11997" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-correlation-request-id": [ + "bc5117de-e564-49c0-a1b4-5bbef8ea8ebf" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T142115Z:bc5117de-e564-49c0-a1b4-5bbef8ea8ebf" + ], + "Date": [ + "Thu, 05 Dec 2019 14:21:14 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccounts/storageaccount2/containers/container1?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc3RvcmFnZUFjY291bnRzL3N0b3JhZ2VhY2NvdW50Mi9jb250YWluZXJzL2NvbnRhaW5lcjE/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "d7bf009e-b6e6-4971-87bc-b76ff605ac9c" + ], + "x-ms-client-request-id": [ + "059ad429-3fda-4bd8-b0eb-c9f5e0c23128" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11996" + ], + "x-ms-correlation-request-id": [ + "aa605c67-5a4b-41f5-b367-3b5371275fdf" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T142146Z:aa605c67-5a4b-41f5-b367-3b5371275fdf" + ], + "Date": [ + "Thu, 05 Dec 2019 14:21:46 GMT" + ], + "Content-Length": [ + "495" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"containerStatus\": \"OK\",\r\n \"dataFormat\": \"BlockBlob\",\r\n \"refreshDetails\": {},\r\n \"createdDateTime\": \"2019-12-05T14:20:45.0165848Z\"\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccounts/storageaccount2/containers/container1\",\r\n \"name\": \"container1\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/storageAccounts/containers\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccounts/storageaccount2/containers/container1?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc3RvcmFnZUFjY291bnRzL3N0b3JhZ2VhY2NvdW50Mi9jb250YWluZXJzL2NvbnRhaW5lcjE/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "d7e57ee8-4934-4a8a-b51e-b0cb92d31d47" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "30bb5efe-028e-41ad-a6c6-875657c0a18d" + ], + "x-ms-client-request-id": [ + "d7e57ee8-4934-4a8a-b51e-b0cb92d31d47" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11995" + ], + "x-ms-correlation-request-id": [ + "8d2b8d42-752a-461b-b977-b80bf78870cf" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T142147Z:8d2b8d42-752a-461b-b977-b80bf78870cf" + ], + "Date": [ + "Thu, 05 Dec 2019 14:21:46 GMT" + ], + "Content-Length": [ + "495" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"containerStatus\": \"OK\",\r\n \"dataFormat\": \"BlockBlob\",\r\n \"refreshDetails\": {},\r\n \"createdDateTime\": \"2019-12-05T14:20:45.0165848Z\"\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccounts/storageaccount2/containers/container1\",\r\n \"name\": \"container1\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/storageAccounts/containers\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccounts/storageaccount2/containers?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc3RvcmFnZUFjY291bnRzL3N0b3JhZ2VhY2NvdW50Mi9jb250YWluZXJzP2FwaS12ZXJzaW9uPTIwMTktMDgtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "acc675b0-53cf-4509-9368-6dee35705cb2" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "638d9a55-2f4a-4160-ac0d-25446c242a1b" + ], + "x-ms-client-request-id": [ + "acc675b0-53cf-4509-9368-6dee35705cb2" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11994" + ], + "x-ms-correlation-request-id": [ + "d5977d33-d73c-48b0-95d6-4d884528fe3b" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T142148Z:d5977d33-d73c-48b0-95d6-4d884528fe3b" + ], + "Date": [ + "Thu, 05 Dec 2019 14:21:47 GMT" + ], + "Content-Length": [ + "564" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"properties\": {\r\n \"containerStatus\": \"OK\",\r\n \"dataFormat\": \"BlockBlob\",\r\n \"refreshDetails\": {},\r\n \"createdDateTime\": \"2019-12-05T14:20:45.0165848Z\"\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccounts/storageaccount2/containers/container1\",\r\n \"name\": \"container1\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/storageAccounts/containers\"\r\n }\r\n ]\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccounts/storageaccount2/containers/container1?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc3RvcmFnZUFjY291bnRzL3N0b3JhZ2VhY2NvdW50Mi9jb250YWluZXJzL2NvbnRhaW5lcjE/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "17e60262-be0a-416c-8c8d-fd9ff96e47ef" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccounts/storageaccount2/containers/container1/operationResults/aba682ce-6ad3-429b-88dd-e6028e51b87a?api-version=2019-08-01" + ], + "Retry-After": [ + "30" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "f5dd4600-e4a9-4bd8-8b3c-4e1097e528b7" + ], + "x-ms-client-request-id": [ + "17e60262-be0a-416c-8c8d-fd9ff96e47ef" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-deletes": [ + "14999" + ], + "x-ms-correlation-request-id": [ + "0b61e24c-daf2-4463-895b-42eaa1b160a7" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T142149Z:0b61e24c-daf2-4463-895b-42eaa1b160a7" + ], + "Date": [ + "Thu, 05 Dec 2019 14:21:48 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccounts/storageaccount2/containers/container1/operationResults/aba682ce-6ad3-429b-88dd-e6028e51b87a?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc3RvcmFnZUFjY291bnRzL3N0b3JhZ2VhY2NvdW50Mi9jb250YWluZXJzL2NvbnRhaW5lcjEvb3BlcmF0aW9uUmVzdWx0cy9hYmE2ODJjZS02YWQzLTQyOWItODhkZC1lNjAyOGU1MWI4N2E/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "f36a8bdf-1aff-401b-b059-a64ff2c4e2a0" + ], + "x-ms-client-request-id": [ + "fae8767c-a651-47b6-9bd0-3ddd144b8794" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11993" + ], + "x-ms-correlation-request-id": [ + "581d08d7-6656-42dc-86d2-ec871c57696f" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T142219Z:581d08d7-6656-42dc-86d2-ec871c57696f" + ], + "Date": [ + "Thu, 05 Dec 2019 14:22:19 GMT" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "", + "StatusCode": 204 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccounts/storageaccount2/containers/container1/operationResults/aba682ce-6ad3-429b-88dd-e6028e51b87a?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc3RvcmFnZUFjY291bnRzL3N0b3JhZ2VhY2NvdW50Mi9jb250YWluZXJzL2NvbnRhaW5lcjEvb3BlcmF0aW9uUmVzdWx0cy9hYmE2ODJjZS02YWQzLTQyOWItODhkZC1lNjAyOGU1MWI4N2E/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "1223982e-c852-48b8-bde2-53f34df2e479" + ], + "x-ms-client-request-id": [ + "fe1b166c-8131-4b70-975f-9a1b9771d7b3" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11992" + ], + "x-ms-correlation-request-id": [ + "d8847e77-d2ca-4fed-a22d-176106571eb1" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T142219Z:d8847e77-d2ca-4fed-a22d-176106571eb1" + ], + "Date": [ + "Thu, 05 Dec 2019 14:22:19 GMT" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "", + "StatusCode": 204 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "db4e2fdb-6d80-4e6e-b7cd-736098270664", + "SubId": "db4e2fdb-6d80-4e6e-b7cd-736098270664" + } +} \ No newline at end of file diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/DeviceExtendedInfoTests/Test_GetExtendedInformation.json b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/DeviceExtendedInfoTests/Test_GetExtendedInformation.json new file mode 100644 index 0000000000000..76ae64524fe1c --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/DeviceExtendedInfoTests/Test_GetExtendedInformation.json @@ -0,0 +1,75 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/getExtendedInformation?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2UvZ2V0RXh0ZW5kZWRJbmZvcm1hdGlvbj9hcGktdmVyc2lvbj0yMDE5LTA4LTAx", + "RequestMethod": "POST", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "b13dd7ea-6970-40e9-8e00-6d486d646d49" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "b528d7f0-dd02-4be6-be83-69739ea17309" + ], + "x-ms-client-request-id": [ + "b13dd7ea-6970-40e9-8e00-6d486d646d49" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1198" + ], + "x-ms-correlation-request-id": [ + "375f34e5-f7b0-44ac-8154-579193bfc589" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T093320Z:375f34e5-f7b0-44ac-8154-579193bfc589" + ], + "Date": [ + "Thu, 05 Dec 2019 09:33:20 GMT" + ], + "Content-Length": [ + "1964" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"encryptionKeyThumbprint\": \"FF27EF016674E5A2801B50362ACE4E82E43CBE0E\",\r\n \"encryptionKey\": \"EAAAAOmCAAaQPDb4mYfmhZccBg06QaeYEPS6knXaQITR/GLP9fhpNGvj8PhFr4k/8sZ16sLrNIlzHqIO5ZLqeiAar3pk/W0yBOeTKPRiLkKJ6p1+NoJ3ynpwTfkH3fLf+5/r8j7utB6KnOtGqMXISyACXf3MiNsjqEUV6OkGiv6SuQifo5UTFnifb9XFKNkGfx30epdwSL4+DO79U+gIjZtWm1c0q0D7l1M7d2CEV1HRMX6L3csU9z2qbY/GS5tDcITb2F+LXvKbMIjKklKjaHPWDB2bGd+RQg3sq+JhL5BK8/YeM0cpqLmkEDwnjSaRIl2StJYvQdl1QwPYx7EzO172h/7U6ZhMtatI1543tOTEc8ytJtVFt5i/mtq3Q2xUX92YoRQShqe1m+LZGsmuBSCOTA4OIXDN2BFNYUcExo8m6ZLUlFlbyK5ILNm6gvzdQ3L59fy4FRSFzuCmCEg2XvjZ2E+tml30zGg4cZO9TIcxUcDRn8Ij3ItUseXCKWxNsjHNqZb6h3qAotYjqAhFRHkeeD1IsleGVd5Ws1P05f/IvKZrPEkvOFuHzkR/BlUYuyvq84GbbCe3GyEMue09HytXgVCLKl7yQjCalHICRnIcBfSs4+niQAF5Y3NaUU1VKtDcumvXZT/pZfVyJl+qvDPipicp9Yd1Hk7zCv+i0SO5G1wsep1Mnsj8reApWzKs604zx6qtpQLXQBva0IsGtad+j9KcNd8kSk/o7jBvCp7ckK+3yxxD6yxsXzToZysO+DnCvfEbWVyboqLFnO6QEhw1aDr0m3LHZIXOJ0/00VrOEosC4FcNYaz126gvWPzyTk/wj5GwWOaU1SFHVESCc54j/jMmmr0+8V0QPMWRJgNEE6TQxLFNTheJbJ1fdBNZSLkyF06Y9nB3dER85w3a0Oq4jZDABS3c6JJkOBBMJ2Z45MZHlaeByBk3qESD4xe7qlmyq3QnptVwnLFxvgGCy+8TWcyLjEoQW+Pbu/TFpLK8MitAwgHd/FUvwbIUipLwyt8NIS1NBiI4Sc3Ow06Jpwq68QvSRvlJsRi80tZxhiZQOz7hIJCt8Tg/NAFfiqrGJJnauju3fEZT9SX58MFN4WKRkmGwq8/3F9paxchytZlSQh3wwAwmcJxrXLusWgFqpaNERk32kkSuHHmOdw//VhKh4ZhM5ni8WQx7AaEQtRSfIFpXT8975KGnuYM7/iheQtpH4hzwYeWeCmKE4M5eeiky9QUEtjDw+br9Y6NisT3LlgjmmDT9cYUbbB5G5KpQRSWZL7CqV0mK4o5/53zxUIk6Q0XJJI4eTa0kn+4mfKwSpRItMtx6AskfUJsbjxN31cIJwEh17KMYTr4b0Rs9F/FMVcuQtH17tTDq19PQ5hZa6ZJ6SNHtzpxyICN7orpIS3zv3anaVHwT/bZB/T7zRn2lOoaW6YL2dcJKbQx5BW6XkZhF1RrQOgJVlS17Lnip/5o5acEq3HiJYSlsNzo9/u7Jq5M+PY3qR9A05YHbh6S9dNEbBbES8RYc8nMwwgQ6aduVFQ==\",\r\n \"resourceKey\": \"7915524720635494902\"\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device\",\r\n \"name\": \"demo-edge-device\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n}", + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "db4e2fdb-6d80-4e6e-b7cd-736098270664", + "SubId": "db4e2fdb-6d80-4e6e-b7cd-736098270664" + } +} \ No newline at end of file diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/DeviceTests/Test_DevicePasswordUpdate.json b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/DeviceTests/Test_DevicePasswordUpdate.json new file mode 100644 index 0000000000000..0c6a76150acf4 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/DeviceTests/Test_DevicePasswordUpdate.json @@ -0,0 +1,258 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/getExtendedInformation?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2UvZ2V0RXh0ZW5kZWRJbmZvcm1hdGlvbj9hcGktdmVyc2lvbj0yMDE5LTA4LTAx", + "RequestMethod": "POST", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "9c3ba002-e337-4159-9dd7-7f2383da827f" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "f09bd728-c244-4be5-9bfd-389a7697004a" + ], + "x-ms-client-request-id": [ + "9c3ba002-e337-4159-9dd7-7f2383da827f" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-correlation-request-id": [ + "5431020c-0e8e-4e9d-baef-8dd1401696ab" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T092407Z:5431020c-0e8e-4e9d-baef-8dd1401696ab" + ], + "Date": [ + "Thu, 05 Dec 2019 09:24:07 GMT" + ], + "Content-Length": [ + "1964" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"encryptionKeyThumbprint\": \"FF27EF016674E5A2801B50362ACE4E82E43CBE0E\",\r\n \"encryptionKey\": \"EAAAAOmCAAaQPDb4mYfmhZccBg06QaeYEPS6knXaQITR/GLP9fhpNGvj8PhFr4k/8sZ16sLrNIlzHqIO5ZLqeiAar3pk/W0yBOeTKPRiLkKJ6p1+NoJ3ynpwTfkH3fLf+5/r8j7utB6KnOtGqMXISyACXf3MiNsjqEUV6OkGiv6SuQifo5UTFnifb9XFKNkGfx30epdwSL4+DO79U+gIjZtWm1c0q0D7l1M7d2CEV1HRMX6L3csU9z2qbY/GS5tDcITb2F+LXvKbMIjKklKjaHPWDB2bGd+RQg3sq+JhL5BK8/YeM0cpqLmkEDwnjSaRIl2StJYvQdl1QwPYx7EzO172h/7U6ZhMtatI1543tOTEc8ytJtVFt5i/mtq3Q2xUX92YoRQShqe1m+LZGsmuBSCOTA4OIXDN2BFNYUcExo8m6ZLUlFlbyK5ILNm6gvzdQ3L59fy4FRSFzuCmCEg2XvjZ2E+tml30zGg4cZO9TIcxUcDRn8Ij3ItUseXCKWxNsjHNqZb6h3qAotYjqAhFRHkeeD1IsleGVd5Ws1P05f/IvKZrPEkvOFuHzkR/BlUYuyvq84GbbCe3GyEMue09HytXgVCLKl7yQjCalHICRnIcBfSs4+niQAF5Y3NaUU1VKtDcumvXZT/pZfVyJl+qvDPipicp9Yd1Hk7zCv+i0SO5G1wsep1Mnsj8reApWzKs604zx6qtpQLXQBva0IsGtad+j9KcNd8kSk/o7jBvCp7ckK+3yxxD6yxsXzToZysO+DnCvfEbWVyboqLFnO6QEhw1aDr0m3LHZIXOJ0/00VrOEosC4FcNYaz126gvWPzyTk/wj5GwWOaU1SFHVESCc54j/jMmmr0+8V0QPMWRJgNEE6TQxLFNTheJbJ1fdBNZSLkyF06Y9nB3dER85w3a0Oq4jZDABS3c6JJkOBBMJ2Z45MZHlaeByBk3qESD4xe7qlmyq3QnptVwnLFxvgGCy+8TWcyLjEoQW+Pbu/TFpLK8MitAwgHd/FUvwbIUipLwyt8NIS1NBiI4Sc3Ow06Jpwq68QvSRvlJsRi80tZxhiZQOz7hIJCt8Tg/NAFfiqrGJJnauju3fEZT9SX58MFN4WKRkmGwq8/3F9paxchytZlSQh3wwAwmcJxrXLusWgFqpaNERk32kkSuHHmOdw//VhKh4ZhM5ni8WQx7AaEQtRSfIFpXT8975KGnuYM7/iheQtpH4hzwYeWeCmKE4M5eeiky9QUEtjDw+br9Y6NisT3LlgjmmDT9cYUbbB5G5KpQRSWZL7CqV0mK4o5/53zxUIk6Q0XJJI4eTa0kn+4mfKwSpRItMtx6AskfUJsbjxN31cIJwEh17KMYTr4b0Rs9F/FMVcuQtH17tTDq19PQ5hZa6ZJ6SNHtzpxyICN7orpIS3zv3anaVHwT/bZB/T7zRn2lOoaW6YL2dcJKbQx5BW6XkZhF1RrQOgJVlS17Lnip/5o5acEq3HiJYSlsNzo9/u7Jq5M+PY3qR9A05YHbh6S9dNEbBbES8RYc8nMwwgQ6aduVFQ==\",\r\n \"resourceKey\": \"7915524720635494902\"\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device\",\r\n \"name\": \"demo-edge-device\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/securitySettings/default/update?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc2VjdXJpdHlTZXR0aW5ncy9kZWZhdWx0L3VwZGF0ZT9hcGktdmVyc2lvbj0yMDE5LTA4LTAx", + "RequestMethod": "POST", + "RequestBody": "{\r\n \"properties\": {\r\n \"deviceAdminPassword\": {\r\n \"value\": \"aAh3nHxFIdxuxCiSuGj/Hdfm66kY47QhKykNImmVxLhEb6ez5w1q3PCtz67wuxjWKRHbJOo77eP4wU8wTA7yDAf7rNhPT+uqTZe8SeL+PlL84hsGsFWa7NduTCaqyjCXiCZcQHa4v2kcbZFaTCj5Y9wtKQ5mPP+qugup6mhCV6nkm8JslrFGy3gevTH1jdXZoQipTDxHW6BbXtyEfBk/FJkSalNHzzXtozMTmG+ZjwUx957qPjwkZ3nuC4KPc4rRK7xVIoDTsOuLQs9YpC44x8dJPL+4fukKLgCY8rxQKBcrLuIvdySMpbboR4IJAIWJtlSeddOFFWLq10yR7BGFTA==\",\r\n \"encryptionCertThumbprint\": \"FF27EF016674E5A2801B50362ACE4E82E43CBE0E\",\r\n \"encryptionAlgorithm\": \"AES256\"\r\n }\r\n }\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "ae6d9e86-d1f6-4a30-8af2-2aaf854743b0" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "547" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/securitySettings/default/operationResults/725782ec-b43a-44aa-96ba-97deda3baada?api-version=2019-08-01" + ], + "Retry-After": [ + "30" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "9782cb5a-e1ec-45e4-89b3-1b3a8f35941f" + ], + "x-ms-client-request-id": [ + "ae6d9e86-d1f6-4a30-8af2-2aaf854743b0" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1198" + ], + "x-ms-correlation-request-id": [ + "3f3c752e-1adf-457d-b5da-7b14548f1024" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T092408Z:3f3c752e-1adf-457d-b5da-7b14548f1024" + ], + "Date": [ + "Thu, 05 Dec 2019 09:24:08 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/securitySettings/default/operationResults/725782ec-b43a-44aa-96ba-97deda3baada?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc2VjdXJpdHlTZXR0aW5ncy9kZWZhdWx0L29wZXJhdGlvblJlc3VsdHMvNzI1NzgyZWMtYjQzYS00NGFhLTk2YmEtOTdkZWRhM2JhYWRhP2FwaS12ZXJzaW9uPTIwMTktMDgtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "8ba495a4-a8e3-47ef-aceb-ccf47502f7e5" + ], + "x-ms-client-request-id": [ + "94a8af6d-5283-4ea7-8bbb-aaaa4bfe4cc3" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11996" + ], + "x-ms-correlation-request-id": [ + "bf1089e3-33bf-4ff5-ac87-752442152c59" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T092438Z:bf1089e3-33bf-4ff5-ac87-752442152c59" + ], + "Date": [ + "Thu, 05 Dec 2019 09:24:38 GMT" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "", + "StatusCode": 204 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/securitySettings/default/operationResults/725782ec-b43a-44aa-96ba-97deda3baada?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc2VjdXJpdHlTZXR0aW5ncy9kZWZhdWx0L29wZXJhdGlvblJlc3VsdHMvNzI1NzgyZWMtYjQzYS00NGFhLTk2YmEtOTdkZWRhM2JhYWRhP2FwaS12ZXJzaW9uPTIwMTktMDgtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "0bf1a08d-7d0b-4ce4-ae1a-71468a112aca" + ], + "x-ms-client-request-id": [ + "764e9035-d996-452b-8c5c-d69afeda6a36" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11995" + ], + "x-ms-correlation-request-id": [ + "72c2e420-4474-4244-988e-c6f43e02b2b7" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T092439Z:72c2e420-4474-4244-988e-c6f43e02b2b7" + ], + "Date": [ + "Thu, 05 Dec 2019 09:24:38 GMT" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "", + "StatusCode": 204 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "db4e2fdb-6d80-4e6e-b7cd-736098270664", + "SubId": "db4e2fdb-6d80-4e6e-b7cd-736098270664" + } +} \ No newline at end of file diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/DeviceTests/Test_ManageDeviceOperations.json b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/DeviceTests/Test_ManageDeviceOperations.json new file mode 100644 index 0000000000000..cc79a254d3c37 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/DeviceTests/Test_ManageDeviceOperations.json @@ -0,0 +1,675 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-gateway-device?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZ2F0ZXdheS1kZXZpY2U/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {\r\n \"tag1\": \"value1\",\r\n \"tag2\": \"value2\"\r\n },\r\n \"sku\": {\r\n \"name\": \"Gateway\",\r\n \"tier\": \"standard\"\r\n }\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "c53b36ba-5d63-4448-b590-aec7a3510d77" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "165" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "c2e58e45-72e5-4578-a26a-3f061a9c60a4" + ], + "x-ms-client-request-id": [ + "c53b36ba-5d63-4448-b590-aec7a3510d77" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-correlation-request-id": [ + "e09f9b49-145a-4e6c-ac70-947131880d45" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T092000Z:e09f9b49-145a-4e6c-ac70-947131880d45" + ], + "Date": [ + "Thu, 05 Dec 2019 09:20:00 GMT" + ], + "Content-Length": [ + "695" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {\r\n \"tag1\": \"value1\",\r\n \"tag2\": \"value2\"\r\n },\r\n \"sku\": {\r\n \"name\": \"Gateway\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A19%3A59.3493506Z'\\\"_W/\\\"datetime'2019-12-05T09%3A19%3A59.3558516Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-gateway-device\",\r\n \"name\": \"demo-gateway-device\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-gateway-device?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZ2F0ZXdheS1kZXZpY2U/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "e597deb0-59c7-4f5c-970f-cb951ce9d142" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "3c017d3a-182e-4c10-bbbf-5bf2ff747cda" + ], + "x-ms-client-request-id": [ + "e597deb0-59c7-4f5c-970f-cb951ce9d142" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11998" + ], + "x-ms-correlation-request-id": [ + "54d1c943-6c65-452b-81a7-271e996bfd5e" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T092001Z:54d1c943-6c65-452b-81a7-271e996bfd5e" + ], + "Date": [ + "Thu, 05 Dec 2019 09:20:01 GMT" + ], + "Content-Length": [ + "695" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {\r\n \"tag1\": \"value1\",\r\n \"tag2\": \"value2\"\r\n },\r\n \"sku\": {\r\n \"name\": \"Gateway\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A19%3A59.3493506Z'\\\"_W/\\\"datetime'2019-12-05T09%3A19%3A59.3558516Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-gateway-device\",\r\n \"name\": \"demo-gateway-device\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-gateway-device?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZ2F0ZXdheS1kZXZpY2U/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "f5ee6251-065f-4c14-94fe-843470589a0b" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "23ec7a7a-7543-4e53-8cfd-a1d73a2bea99" + ], + "x-ms-client-request-id": [ + "f5ee6251-065f-4c14-94fe-843470589a0b" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11997" + ], + "x-ms-correlation-request-id": [ + "168180ba-4ff6-4557-b9dc-5a9f3ac4d653" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T092002Z:168180ba-4ff6-4557-b9dc-5a9f3ac4d653" + ], + "Date": [ + "Thu, 05 Dec 2019 09:20:01 GMT" + ], + "Content-Length": [ + "695" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {\r\n \"tag1\": \"value1\",\r\n \"tag2\": \"value2\"\r\n },\r\n \"sku\": {\r\n \"name\": \"Gateway\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A19%3A59.3493506Z'\\\"_W/\\\"datetime'2019-12-05T09%3A19%3A59.3558516Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-gateway-device\",\r\n \"name\": \"demo-gateway-device\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzP2FwaS12ZXJzaW9uPTIwMTktMDgtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "34472507-788b-4ab6-957d-e0d35a85e94c" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-original-request-ids": [ + "d86ae826-fa2b-4f21-8498-944f6c3acca6", + "67af0cc0-db80-4b3d-898b-b50f5e23e687" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11996" + ], + "x-ms-request-id": [ + "46d7e0c1-a1c4-4fd9-8b1e-a4b8e9ec6671" + ], + "x-ms-correlation-request-id": [ + "46d7e0c1-a1c4-4fd9-8b1e-a4b8e9ec6671" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T092002Z:46d7e0c1-a1c4-4fd9-8b1e-a4b8e9ec6671" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Thu, 05 Dec 2019 09:20:02 GMT" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "4593" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {\r\n \"tag1\": \"value1\",\r\n \"tag2\": \"value2\"\r\n },\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-03-07T07%3A30%3A42.7082477Z'\\\"_W/\\\"datetime'2019-03-07T07%3A30%3A42.7633005Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/edge-demo-device-1\",\r\n \"name\": \"edge-demo-device-1\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {\r\n \"tag1\": \"value1\",\r\n \"tag2\": \"value2\"\r\n },\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A14%3A12.6126556Z'\\\"_W/\\\"datetime'2019-12-05T09%3A14%3A12.6176608Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/edge-demo-device-2\",\r\n \"name\": \"edge-demo-device-2\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {\r\n \"tag1\": \"value1\",\r\n \"tag2\": \"value2\"\r\n },\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-03-07T07%3A30%3A47.1349009Z'\\\"_W/\\\"datetime'2019-03-07T07%3A30%3A47.1949108Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/gateway-demo-device-1\",\r\n \"name\": \"gateway-demo-device-1\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {\r\n \"tag1\": \"value1\",\r\n \"tag2\": \"value2\"\r\n },\r\n \"sku\": {\r\n \"name\": \"Gateway\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A19%3A59.3493506Z'\\\"_W/\\\"datetime'2019-12-05T09%3A19%3A59.3558516Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-gateway-device\",\r\n \"name\": \"demo-gateway-device\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Gateway\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-02-20T14%3A15%3A51.1279651Z'\\\"_W/\\\"datetime'2019-02-20T14%3A15%3A51.132969Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-resource\",\r\n \"name\": \"demo-resource\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {\r\n \"tag1\": \"value1\",\r\n \"tag2\": \"value2\"\r\n },\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A18%3A43.7728164Z'\\\"_W/\\\"datetime'2019-12-05T09%3A18%3A43.77782Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/edge-demo-device\",\r\n \"name\": \"edge-demo-device\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {\r\n \"tag1\": \"value1\",\r\n \"tag2\": \"value2\"\r\n },\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-04-10T08%3A10%3A03.4773057Z'\\\"_W/\\\"datetime'2019-04-10T08%3A10%3A03.4833121Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/edge-demo-device-5\",\r\n \"name\": \"edge-demo-device-5\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Gateway\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A18%3A29.3274639Z'\\\"_W/\\\"datetime'2019-12-05T09%3A18%3A29.3324675Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/gateway-demo-device\",\r\n \"name\": \"gateway-demo-device\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n }\r\n ]\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzP2FwaS12ZXJzaW9uPTIwMTktMDgtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "7d90ae55-fead-498a-8aa6-96bb18685864" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-original-request-ids": [ + "eaf0dc6b-06e6-48d1-8aff-0a1ea78ec5d7", + "56472259-69d5-4a1b-b4a0-369eb933f6f1" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11995" + ], + "x-ms-request-id": [ + "aa2ccc83-4bb1-4cb1-bba3-b73c79651f7a" + ], + "x-ms-correlation-request-id": [ + "aa2ccc83-4bb1-4cb1-bba3-b73c79651f7a" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T092004Z:aa2ccc83-4bb1-4cb1-bba3-b73c79651f7a" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Thu, 05 Dec 2019 09:20:03 GMT" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "28495" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A15%3A15.7650886Z'\\\"_W/\\\"datetime'2019-12-05T09%3A15%3A15.7700928Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/AllBugBashNovGAEdge1\",\r\n \"name\": \"AllBugBashNovGAEdge1\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A15%3A12.4159346Z'\\\"_W/\\\"datetime'2019-12-05T09%3A15%3A12.4219402Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 1\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/arja-objectstore-edge\",\r\n \"name\": \"arja-objectstore-edge\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {\r\n \"addingtag1\": \"tag1\",\r\n \"addingtag2\": \"tag2\"\r\n },\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A15%3A05.6395599Z'\\\"_W/\\\"datetime'2019-12-05T09%3A15%3A05.6445655Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 4\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/DevidasEdgeDevice\",\r\n \"name\": \"DevidasEdgeDevice\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A14%3A43.649868Z'\\\"_W/\\\"datetime'2019-12-05T09%3A14%3A43.6558732Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 4\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/DevidasEdgeDevice2\",\r\n \"name\": \"DevidasEdgeDevice2\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A14%3A11.7278225Z'\\\"_W/\\\"datetime'2019-12-05T09%3A14%3A11.7328276Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/drain2\",\r\n \"name\": \"drain2\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-10-31T16%3A05%3A40.7836038Z'\\\"_W/\\\"datetime'2019-10-31T16%3A05%3A40.7896095Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/FinalApplianceBuild1\",\r\n \"name\": \"FinalApplianceBuild1\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Gateway\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A14%3A29.6246682Z'\\\"_W/\\\"datetime'2019-12-05T09%3A14%3A29.6356782Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/GediDemoTest-Taala\",\r\n \"name\": \"GediDemoTest-Taala\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A14%3A27.8139628Z'\\\"_W/\\\"datetime'2019-12-05T09%3A14%3A27.8229713Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/HAClusterTest1\",\r\n \"name\": \"HAClusterTest1\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Gateway\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-07-05T05%3A20%3A54.3650758Z'\\\"_W/\\\"datetime'2019-07-05T05%3A20%3A54.3690796Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/HARelease-DBG1-GA\",\r\n \"name\": \"HARelease-DBG1-GA\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Gateway\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A14%3A31.3102554Z'\\\"_W/\\\"datetime'2019-12-05T09%3A14%3A31.3182625Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/kupa-databox-py\",\r\n \"name\": \"kupa-databox-py\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A14%3A31.6956178Z'\\\"_W/\\\"datetime'2019-12-05T09%3A14%3A31.7046263Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/kupa-edge-py\",\r\n \"name\": \"kupa-edge-py\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Gateway\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-05-02T12%3A25%3A49.3424822Z'\\\"_W/\\\"datetime'2019-05-02T12%3A25%3A49.3464489Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/kupa-gateway-py\",\r\n \"name\": \"kupa-gateway-py\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-03-31T19%3A53%3A21.0215742Z'\\\"_W/\\\"datetime'2019-03-31T19%3A53%3A21.0255785Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/RajTestingResource\",\r\n \"name\": \"RajTestingResource\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"East US 2 EUAP\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Gateway\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-03-22T04%3A51%3A54.0382342Z'\\\"_W/\\\"datetime'2019-03-22T04%3A51%3A54.0412374Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testActivationKey\",\r\n \"name\": \"testActivationKey\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A14%3A47.1211297Z'\\\"_W/\\\"datetime'2019-12-05T09%3A14%3A47.1261344Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 2\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/twonodecluster\",\r\n \"name\": \"twonodecluster\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Gateway\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-10-23T08%3A24%3A25.2664072Z'\\\"_W/\\\"datetime'2019-10-23T08%3A24%3A25.2734147Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/TZLUnregisteredGateway\",\r\n \"name\": \"TZLUnregisteredGateway\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A14%3A59.4537361Z'\\\"_W/\\\"datetime'2019-12-05T09%3A14%3A59.4597414Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 1\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/yasaini-nw-fix\",\r\n \"name\": \"yasaini-nw-fix\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Gateway\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A14%3A49.8537027Z'\\\"_W/\\\"datetime'2019-12-05T09%3A14%3A49.8587074Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 1\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/YashveerHA-VA-1\",\r\n \"name\": \"YashveerHA-VA-1\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A14%3A21.3759018Z'\\\"_W/\\\"datetime'2019-12-05T09%3A14%3A21.380906Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/YashveerHA1\",\r\n \"name\": \"YashveerHA1\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A14%3A34.0458244Z'\\\"_W/\\\"datetime'2019-12-05T09%3A14%3A34.0528314Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 1\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/YashveerHA2\",\r\n \"name\": \"YashveerHA2\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A14%3A22.7742174Z'\\\"_W/\\\"datetime'2019-12-05T09%3A14%3A22.7822249Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 2\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/YashveerHA3\",\r\n \"name\": \"YashveerHA3\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A15%3A32.2786318Z'\\\"_W/\\\"datetime'2019-12-05T09%3A15%3A32.2836361Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 2\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/YashveerHA5\",\r\n \"name\": \"YashveerHA5\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-07-25T07%3A25%3A15.9712508Z'\\\"_W/\\\"datetime'2019-07-25T07%3A25%3A15.9762551Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/YashveerHA6\",\r\n \"name\": \"YashveerHA6\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A14%3A11.5916943Z'\\\"_W/\\\"datetime'2019-12-05T09%3A14%3A11.596699Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 2\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/YashveerHA7\",\r\n \"name\": \"YashveerHA7\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A15%3A07.6454491Z'\\\"_W/\\\"datetime'2019-12-05T09%3A15%3A07.6504533Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 2\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/YashveerHa8\",\r\n \"name\": \"YashveerHa8\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {\r\n \"test\": \"val\"\r\n },\r\n \"sku\": {\r\n \"name\": \"Gateway\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A17%3A46.6577811Z'\\\"_W/\\\"datetime'2019-12-05T09%3A17%3A46.661784Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/abbharTestres\",\r\n \"name\": \"abbharTestres\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A18%3A44.8906175Z'\\\"_W/\\\"datetime'2019-12-05T09%3A18%3A44.8976225Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/aigccytest\",\r\n \"name\": \"aigccytest\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A18%3A27.3790675Z'\\\"_W/\\\"datetime'2019-12-05T09%3A18%3A27.3830704Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/AIGTestApplication01\",\r\n \"name\": \"AIGTestApplication01\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A17%3A22.6935044Z'\\\"_W/\\\"datetime'2019-12-05T09%3A17%3A22.7045128Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/AIGTestApplication02\",\r\n \"name\": \"AIGTestApplication02\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Gateway\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A18%3A32.2945903Z'\\\"_W/\\\"datetime'2019-12-05T09%3A18%3A32.300595Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/benedemon123Gateway\",\r\n \"name\": \"benedemon123Gateway\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A19%3A02.095948Z'\\\"_W/\\\"datetime'2019-12-05T09%3A19%3A02.1019527Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dkEdge1\",\r\n \"name\": \"dkEdge1\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-02-08T09%3A48%3A04.033153Z'\\\"_W/\\\"datetime'2019-02-08T09%3A48%3A04.0411587Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/feb8-testpass-ordering\",\r\n \"name\": \"feb8-testpass-ordering\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-02-08T10%3A06%3A02.2284408Z'\\\"_W/\\\"datetime'2019-02-08T10%3A06%3A02.2394486Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/feb8-testpass-ordering2\",\r\n \"name\": \"feb8-testpass-ordering2\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A18%3A08.0932294Z'\\\"_W/\\\"datetime'2019-12-05T09%3A18%3A08.1012356Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/fleetmock3\",\r\n \"name\": \"fleetmock3\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A18%3A46.9520953Z'\\\"_W/\\\"datetime'2019-12-05T09%3A18%3A46.9570984Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/fleetmock4\",\r\n \"name\": \"fleetmock4\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Gateway\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-05-28T09%3A36%3A37.3967077Z'\\\"_W/\\\"datetime'2019-05-28T09%3A36%3A37.4167219Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/MuskanDemo2\",\r\n \"name\": \"MuskanDemo2\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-09-10T12%3A46%3A22.8713361Z'\\\"_W/\\\"datetime'2019-09-10T12%3A46%3A22.8843462Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/NewCountry3\",\r\n \"name\": \"NewCountry3\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Gateway\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-02-13T09%3A25%3A28.6256138Z'\\\"_W/\\\"datetime'2019-02-13T09%3A25%3A28.6306173Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/oldportalnewserviceresource02\",\r\n \"name\": \"oldportalnewserviceresource02\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A18%3A19.1561749Z'\\\"_W/\\\"datetime'2019-12-05T09%3A18%3A19.161178Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/OrderignTestOrderDoesNotExist\",\r\n \"name\": \"OrderignTestOrderDoesNotExist\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-02-11T04%3A44%3A57.8982208Z'\\\"_W/\\\"datetime'2019-02-11T04%3A44%3A57.9022237Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/OrderingTestRamya\",\r\n \"name\": \"OrderingTestRamya\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-02-11T08%3A45%3A11.6132317Z'\\\"_W/\\\"datetime'2019-02-11T08%3A45%3A11.6322459Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/OrderTestPassResource\",\r\n \"name\": \"OrderTestPassResource\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-02-11T09%3A20%3A35.1952769Z'\\\"_W/\\\"datetime'2019-02-11T09%3A20%3A35.2152911Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/ordertestpassresource02\",\r\n \"name\": \"ordertestpassresource02\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-02-11T05%3A35%3A23.0989162Z'\\\"_W/\\\"datetime'2019-02-11T05%3A35%3A23.1049208Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/OrderTestRamya1\",\r\n \"name\": \"OrderTestRamya1\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Gateway\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-02-21T09%3A15%3A22.1744041Z'\\\"_W/\\\"datetime'2019-02-21T09%3A15%3A22.1794081Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/precious\",\r\n \"name\": \"precious\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Gateway\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A18%3A21.1816265Z'\\\"_W/\\\"datetime'2019-12-05T09%3A18%3A21.18663Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/RamyaTest123\",\r\n \"name\": \"RamyaTest123\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-02-11T08%3A54%3A12.1292495Z'\\\"_W/\\\"datetime'2019-02-11T08%3A54%3A12.1332524Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/sdfdfgdfg\",\r\n \"name\": \"sdfdfgdfg\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Gateway\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-03-22T05%3A14%3A15.9960468Z'\\\"_W/\\\"datetime'2019-03-22T05%3A14%3A16.0020489Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testactivationKey3\",\r\n \"name\": \"testactivationKey3\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Gateway\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A17%3A56.4268196Z'\\\"_W/\\\"datetime'2019-12-05T09%3A17%3A56.4318228Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testCIK1\",\r\n \"name\": \"testCIK1\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Gateway\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-03-11T11%3A41%3A29.9516741Z'\\\"_W/\\\"datetime'2019-03-11T11%3A41%3A29.9576802Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testCik2\",\r\n \"name\": \"testCik2\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Gateway\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-02-20T14%3A03%3A59.3197101Z'\\\"_W/\\\"datetime'2019-02-20T14%3A03%3A59.3247141Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testRegisterRP\",\r\n \"name\": \"testRegisterRP\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n }\r\n ],\r\n \"nextLink\": \"https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices?api-version=2019-08-01&%24skiptoken=7ZNLc9owEMe%2fC9P2VIJssAOZyXQAP4BgAzZ%2b6WZZql%2bSrWLzzOS7VwmT5NLccughN3l%2f2v2v1vt%2f7FTk1C7zqmw6d48dfexuPVfWvfG6c9fJ2pY3d70ei6s4JYxU7U182e%2fITVKzXrNHTbLLeZvXVdPDaEDk3xh1VTwE3QFRSRfdJrh721fBaCjfAlUd9PiuPuSY7JqelSe7uql%2ftzda3MaT%2bqTjlPTw%2b1kjhzwhza%2bY592DyBAi9zKQRl0w7ALpx7emzPm2Lkl1v9ZGAxQcU8z8cyLTAypAbrmD4zyfUMTsAzTpHl5AjkOHLbe6PC%2bG32WkberhRh7tsaA4MEAcjPa%2bOdrBYHCl6Vw7aUhWBFGkKHS4OHtIbikqBvY0H6fz6Xjov2kOzstiPFxKkCaVLe6%2bVZmO07XhKInpibq%2baeTI9MS914jo47lSutYVSmbOJgoXIL6qLWFYihzL1U%2bWlmZBiReWwT2XSbEDKNgyybF1SbO0SewbvNkagkvl2QudFSnBees5O8H%2fRH28iml5DGZ8CtkiRCYv0JaqUbGILf3UeiwrHQB5VNg1MvgMmqeIlAsm9EzLoKFbQepIcBcUiyCWeBRUE2hRqK6noxUMM%2bCZxllM8WWCruwr6xQ8PL9IzO%2fK2aj%2fEi%2f0zL7Ms0iWAsLmF7%2biz3VA4GdTLBuhHSgvuoKXsJTMVZBB5PGD4A%2bI0shjp8KSFn3xvSI0UzcM0kCXQMSUAhu8RZpj%2bbrXvvX1qvvejyemW8HQsZBsZ6JnsSvKJmG0FXFF5P2DX%2f%2b1YB%2fvQnE8fLxJnZ%2bdqW5vnfHSc79cJXb9y1Wf7qqVtvlMV5XC7SrUheuM%2boxmvHR1XkMdN5gt9q5wIT6D%2f81lT09%2fAQ%3d%3d\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices?api-version=2019-08-01&%24skiptoken=7ZNLc9owEMe%2fC9P2VIJssAOZyXQAP4BgAzZ%2b6WZZql%2bSrWLzzOS7VwmT5NLccughN3l%2f2v2v1vt%2f7FTk1C7zqmw6d48dfexuPVfWvfG6c9fJ2pY3d70ei6s4JYxU7U182e%2fITVKzXrNHTbLLeZvXVdPDaEDk3xh1VTwE3QFRSRfdJrh721fBaCjfAlUd9PiuPuSY7JqelSe7uql%2ftzda3MaT%2bqTjlPTw%2b1kjhzwhza%2bY592DyBAi9zKQRl0w7ALpx7emzPm2Lkl1v9ZGAxQcU8z8cyLTAypAbrmD4zyfUMTsAzTpHl5AjkOHLbe6PC%2bG32WkberhRh7tsaA4MEAcjPa%2bOdrBYHCl6Vw7aUhWBFGkKHS4OHtIbikqBvY0H6fz6Xjov2kOzstiPFxKkCaVLe6%2bVZmO07XhKInpibq%2baeTI9MS914jo47lSutYVSmbOJgoXIL6qLWFYihzL1U%2bWlmZBiReWwT2XSbEDKNgyybF1SbO0SewbvNkagkvl2QudFSnBees5O8H%2fRH28iml5DGZ8CtkiRCYv0JaqUbGILf3UeiwrHQB5VNg1MvgMmqeIlAsm9EzLoKFbQepIcBcUiyCWeBRUE2hRqK6noxUMM%2bCZxllM8WWCruwr6xQ8PL9IzO%2fK2aj%2fEi%2f0zL7Ms0iWAsLmF7%2biz3VA4GdTLBuhHSgvuoKXsJTMVZBB5PGD4A%2bI0shjp8KSFn3xvSI0UzcM0kCXQMSUAhu8RZpj%2bbrXvvX1qvvejyemW8HQsZBsZ6JnsSvKJmG0FXFF5P2DX%2f%2b1YB%2fvQnE8fLxJnZ%2bdqW5vnfHSc79cJXb9y1Wf7qqVtvlMV5XC7SrUheuM%2boxmvHR1XkMdN5gt9q5wIT6D%2f81lT09%2fAQ%3d%3d", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzP2FwaS12ZXJzaW9uPTIwMTktMDgtMDEmJTI0c2tpcHRva2VuPTdaTkxjOW93RU1lJTJmQzlQMlZJSnNzQU9aeVhRQVA0QmdBelolMmI2V1pacWwlMmJTcldMenpPUzdWd21UNU5MY2N1Z2hOM2wlMmYydjJ2MXZ0JTJmN0ZUazFDN3pxbXc2ZDQ4ZGZleHVQVmZXdmZHNmM5ZkoycFkzZDcwZWk2czRKWXhVN1UxODJlJTJmSVRWS3pYck5IVGJMTGVadlhWZFBEYUVEazN4aDFWVHdFM1FGUlNSZmRKcmg3MjFmQmFDamZBbFVkOVBpdVB1U1k3SnFlbFNlN3VxbCUyZnR6ZGEzTWFUJTJicVRqbFBUdyUyYjFramh6d2h6YSUyYlk1OTJEeUJBaTl6S1FSbDB3N0FMcHg3ZW16UG0yTGtsMXY5WkdBeFFjVTh6OGN5TFRBeXBBYnJtRDR6eWZVTVRzQXpUcEhsNUFqa09ITGJlNlBDJTJiRzMyV2tiZXJoUmg3dHNhQTRNRUFjalBhJTJiT2RyQllIQ2w2Vnc3YVVoV0JGR2tLSFM0T0h0SWJpa3FCdlkwSDZmejZYam92MmtPenN0aVBGeEtrQ2FWTGU2JTJiVlptTzA3WGhLSW5waWJxJTJiYWVUSTlNUzkxNGpvNDdsU3V0WVZTbWJPSmdvWElMNnFMV0ZZaWh6TDFVJTJiV2xtWkJpUmVXd1QyWFNiRURLTmd5eWJGMVNiTzBTZXdidk5rYWdrdmwyUXVkRlNuQmVlczVPOEglMmZSSDI4aW1sNURHWjhDdGtpUkNZdjBKYXFVYkdJTGYzVWVpd3JIUUI1Vk5nMU12Z01tcWVJbEFzbTlFekxvS0ZiUWVwSWNCY1VpeUNXZUJSVUUyaFJxSzZub3hVTU0lMmJDWnhsbE04V1dDcnV3cjZ4UThQTDlJek8lMmZLMmFqJTJmRWklMmYwekw3TXMwaVdBc0xtRjclMmJpejNWQTRHZFRMQnVoSFNndnVvS1hzSlRNVlpCQjVQR0Q0QSUyYkkwc2hqcDhLU0ZuM3h2U0kwVXpjTTBrQ1hRTVNVQWh1OFJacGolMmJiclh2dlgxcXZ2ZWp5ZW1XOEhRc1pCc1o2Sm5zU3ZLSm1HMEZYRkY1UDJEWCUyZiUyYjFZQiUyZnZRbkU4Zkx4Sm5aJTJiZHFXNXZuZkhTYzc5Y0pYYjl5MVdmN3FxVnR2bE1WNVhDN1NyVWhldU0lMmJveG12SFIxWGtNZE41Z3Q5cTV3SVQ2RCUyZjgxbFQwOSUyZkFRJTNkJTNk", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "a0118d66-7d9f-4193-8474-43ddcb8a11ef" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-original-request-ids": [ + "ccd2bbd5-680b-405a-bb42-d3b628e96d04", + "267acae5-6a64-4ac3-9da3-c1aa9a8d609c" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11994" + ], + "x-ms-request-id": [ + "c4c95619-2b8c-4cc8-ae98-cdd2edc2e6ae" + ], + "x-ms-correlation-request-id": [ + "c4c95619-2b8c-4cc8-ae98-cdd2edc2e6ae" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T092005Z:c4c95619-2b8c-4cc8-ae98-cdd2edc2e6ae" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Thu, 05 Dec 2019 09:20:05 GMT" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "28276" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A15%3A00.0012513Z'\\\"_W/\\\"datetime'2019-12-05T09%3A15%3A00.006256Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 1\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/ys-nw-fix-1\",\r\n \"name\": \"ys-nw-fix-1\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A14%3A17.3611272Z'\\\"_W/\\\"datetime'2019-12-05T09%3A14%3A17.3681334Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 2\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/ys-nw-fix-3\",\r\n \"name\": \"ys-nw-fix-3\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A14%3A56.9974261Z'\\\"_W/\\\"datetime'2019-12-05T09%3A14%3A57.0034317Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharTest/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/HAEdge2\",\r\n \"name\": \"HAEdge2\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Gateway\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A14%3A51.5743228Z'\\\"_W/\\\"datetime'2019-12-05T09%3A14%3A51.5793276Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharTest/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/JulyTestPass\",\r\n \"name\": \"JulyTestPass\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"TMA\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-11-27T08%3A55%3A06.6128886Z'\\\"_W/\\\"datetime'2019-11-27T08%3A55%3A06.6178934Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharTest/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/RuggedKSeries1\",\r\n \"name\": \"RuggedKSeries1\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Gateway\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-11-07T14%3A23%3A39.7411629Z'\\\"_W/\\\"datetime'2019-11-07T14%3A23%3A39.7471686Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharTest/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testgatewayarja\",\r\n \"name\": \"testgatewayarja\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Gateway\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-06-10T08%3A25%3A53.9965407Z'\\\"_W/\\\"datetime'2019-06-10T08%3A25%3A54.0005445Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharTest/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/ttsmsmns\",\r\n \"name\": \"ttsmsmns\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A14%3A57.3837879Z'\\\"_W/\\\"datetime'2019-12-05T09%3A14%3A57.3897935Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 1\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/accessibillity-test-resource/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/accessibillity-test-resource\",\r\n \"name\": \"accessibillity-test-resource\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Gateway\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-11-27T07%3A34%3A14.7552553Z'\\\"_W/\\\"datetime'2019-11-27T07%3A34%3A14.7602601Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/accessibillity-test-resource/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testPass\",\r\n \"name\": \"testPass\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-11-25T05%3A13%3A00.5698371Z'\\\"_W/\\\"datetime'2019-11-25T05%3A13%3A00.5748419Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/adbharad-test/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/adbharad-test-edge\",\r\n \"name\": \"adbharad-test-edge\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Gateway\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A14%3A44.4105839Z'\\\"_W/\\\"datetime'2019-12-05T09%3A14%3A44.4165891Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/adgarTest/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/adgarresource\",\r\n \"name\": \"adgarresource\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A14%3A21.7772791Z'\\\"_W/\\\"datetime'2019-12-05T09%3A14%3A21.7852862Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/AIGDemo/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/AIGECYApp03\",\r\n \"name\": \"AIGECYApp03\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A14%3A15.9858318Z'\\\"_W/\\\"datetime'2019-12-05T09%3A14%3A15.9918375Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/AIGDemo/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/AIGECYTest02\",\r\n \"name\": \"AIGECYTest02\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {\r\n \"test\": \"val\"\r\n },\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-03-06T06%3A02%3A38.2187431Z'\\\"_W/\\\"datetime'2019-03-06T06%3A02%3A38.2597818Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/amrawatRG/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/12-12\",\r\n \"name\": \"12-12\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Gateway\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A14%3A30.07309Z'\\\"_W/\\\"datetime'2019-12-05T09%3A14%3A30.0830999Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/amrawatRG/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/AIG-TestPass\",\r\n \"name\": \"AIG-TestPass\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Gateway\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A14%3A16.9357267Z'\\\"_W/\\\"datetime'2019-12-05T09%3A14%3A16.9457357Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/amrawatRG/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/amrawawat-ga-tp4\",\r\n \"name\": \"amrawawat-ga-tp4\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Gateway\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A15%3A22.7336433Z'\\\"_W/\\\"datetime'2019-12-05T09%3A15%3A22.7386481Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/amrawatRG/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/AprilRefresh2TP\",\r\n \"name\": \"AprilRefresh2TP\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A15%3A16.071377Z'\\\"_W/\\\"datetime'2019-12-05T09%3A15%3A16.0773822Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 2\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/amrawatRG/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/HADemo\",\r\n \"name\": \"HADemo\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A15%3A00.9901824Z'\\\"_W/\\\"datetime'2019-12-05T09%3A15%3A00.9951872Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 2\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/amrawatRG/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/HADemoTest1\",\r\n \"name\": \"HADemoTest1\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A14%3A42.1724764Z'\\\"_W/\\\"datetime'2019-12-05T09%3A14%3A42.178483Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 2\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/amrawatRG/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/HAMock\",\r\n \"name\": \"HAMock\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A14%3A47.4594483Z'\\\"_W/\\\"datetime'2019-12-05T09%3A14%3A47.4654544Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 2\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/amrawatRG/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/HATest\",\r\n \"name\": \"HATest\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A15%3A04.7877583Z'\\\"_W/\\\"datetime'2019-12-05T09%3A15%3A04.7967672Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 2\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/amrawatRG/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/HATestPass\",\r\n \"name\": \"HATestPass\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Gateway\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A15%3A21.4864693Z'\\\"_W/\\\"datetime'2019-12-05T09%3A15%3A21.4924749Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/amrawatRG/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/NovTPMock\",\r\n \"name\": \"NovTPMock\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A15%3A11.0076085Z'\\\"_W/\\\"datetime'2019-12-05T09%3A15%3A11.015616Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/amrawatRG/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/RajTestCase\",\r\n \"name\": \"RajTestCase\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"eastus2euap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-10-24T20%3A37%3A05.5085807Z'\\\"_W/\\\"datetime'2019-10-24T20%3A37%3A05.5215939Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/amrawatRG/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/SampleResource\",\r\n \"name\": \"SampleResource\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"Central US EUAP\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Gateway\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-03-22T02%3A50%3A25.9096346Z'\\\"_W/\\\"datetime'2019-03-22T02%3A50%3A25.9176403Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testregistrationRes\",\r\n \"name\": \"testregistrationRes\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-03-05T09%3A29%3A57.2061794Z'\\\"_W/\\\"datetime'2019-03-05T09%3A29%3A57.2141851Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testresource123\",\r\n \"name\": \"testresource123\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"Central US EUAP\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-03-26T02%3A50%3A01.3155205Z'\\\"_W/\\\"datetime'2019-03-26T02%3A50%3A01.3195238Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testresourcepostgallerypackageupload\",\r\n \"name\": \"testresourcepostgallerypackageupload\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-08-07T08%3A32%3A54.9446802Z'\\\"_W/\\\"datetime'2019-08-07T08%3A32%3A54.9536867Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharGATestPass/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/TZLtest\",\r\n \"name\": \"TZLtest\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A18%3A49.3167896Z'\\\"_W/\\\"datetime'2019-12-05T09%3A18%3A49.3227939Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 1\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/abbharTest/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/ObjectStoreTest\",\r\n \"name\": \"ObjectStoreTest\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A18%3A12.8546588Z'\\\"_W/\\\"datetime'2019-12-05T09%3A18%3A12.8606627Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 1\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/accessibility-testing/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/Test-resource\",\r\n \"name\": \"Test-resource\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A18%3A54.8927857Z'\\\"_W/\\\"datetime'2019-12-05T09%3A18%3A54.8977893Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/AIGDemo/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/AIGDemoEdgeDevice\",\r\n \"name\": \"AIGDemoEdgeDevice\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A18%3A58.5363969Z'\\\"_W/\\\"datetime'2019-12-05T09%3A18%3A58.5424012Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 1\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/AIGDemo/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/alertsdemoedge\",\r\n \"name\": \"alertsdemoedge\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {\r\n \"test\": \"val\"\r\n },\r\n \"sku\": {\r\n \"name\": \"Gateway\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A17%3A17.4897545Z'\\\"_W/\\\"datetime'2019-12-05T09%3A17%3A17.4947585Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/amrawatRG/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/amrawat-alert-mock\",\r\n \"name\": \"amrawat-alert-mock\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {\r\n \"test\": \"val\"\r\n },\r\n \"sku\": {\r\n \"name\": \"Gateway\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A18%3A02.6853322Z'\\\"_W/\\\"datetime'2019-12-05T09%3A18%3A02.6903354Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/amrawatRG/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/amrawat-ga-tp3\",\r\n \"name\": \"amrawat-ga-tp3\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-11-27T07%3A49%3A40.4479974Z'\\\"_W/\\\"datetime'2019-11-27T07%3A49%3A40.4540012Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/amrawatRG/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/amrawat-powershell-test\",\r\n \"name\": \"amrawat-powershell-test\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A18%3A48.84245Z'\\\"_W/\\\"datetime'2019-12-05T09%3A18%3A48.8474536Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/amrawatRG/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/amrawat-powershell-test2\",\r\n \"name\": \"amrawat-powershell-test2\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Gateway\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A17%3A44.0549054Z'\\\"_W/\\\"datetime'2019-12-05T09%3A17%3A44.0659138Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/amrawatRG/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/dummy\",\r\n \"name\": \"dummy\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A18%3A30.4622776Z'\\\"_W/\\\"datetime'2019-12-05T09%3A18%3A30.4682815Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/amrawatRG/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/ga-physical-back-compat-tp-nov\",\r\n \"name\": \"ga-physical-back-compat-tp-nov\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Gateway\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A18%3A54.0381736Z'\\\"_W/\\\"datetime'2019-12-05T09%3A18%3A54.0451782Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/amrawatRG/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/GATestPassDisconnectedTest\",\r\n \"name\": \"GATestPassDisconnectedTest\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Gateway\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A17%3A35.2235381Z'\\\"_W/\\\"datetime'2019-12-05T09%3A17%3A35.2345464Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/amrawatRG/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/mockAppliance\",\r\n \"name\": \"mockAppliance\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A19%3A04.5487062Z'\\\"_W/\\\"datetime'2019-12-05T09%3A19%3A04.5537093Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/amrawatRG/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/SampleResource2\",\r\n \"name\": \"SampleResource2\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Gateway\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-04-24T10%3A10%3A45.1724138Z'\\\"_W/\\\"datetime'2019-04-24T10%3A10%3A45.1934293Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/amrawatRG/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/testresource123\",\r\n \"name\": \"testresource123\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"TMA\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-11-21T06%3A19%3A01.8212528Z'\\\"_W/\\\"datetime'2019-11-21T06%3A19%3A01.8262563Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/anbacker/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/anbackertma01\",\r\n \"name\": \"anbackertma01\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Gateway\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A18%3A18.806925Z'\\\"_W/\\\"datetime'2019-12-05T09%3A18%3A18.8119282Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/anponnet-rg/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/anponnet-0508-1\",\r\n \"name\": \"anponnet-0508-1\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A17%3A20.9482493Z'\\\"_W/\\\"datetime'2019-12-05T09%3A17%3A20.9562546Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/anponnet-rg/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/anponnet-0508-2\",\r\n \"name\": \"anponnet-0508-2\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A18%3A58.8876495Z'\\\"_W/\\\"datetime'2019-12-05T09%3A18%3A58.8926527Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/anponnet-rg/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/anponnet-0509-1\",\r\n \"name\": \"anponnet-0509-1\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A17%3A20.3968506Z'\\\"_W/\\\"datetime'2019-12-05T09%3A17%3A20.4018542Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/anponnet-rg/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/anponnet-0521-1\",\r\n \"name\": \"anponnet-0521-1\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Gateway\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A17%3A28.5036928Z'\\\"_W/\\\"datetime'2019-12-05T09%3A17%3A28.5086968Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/anponnet-rg/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/anponnet-0905-2\",\r\n \"name\": \"anponnet-0905-2\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n },\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {},\r\n \"sku\": {\r\n \"name\": \"Gateway\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A18%3A11.7308534Z'\\\"_W/\\\"datetime'2019-12-05T09%3A18%3A11.735857Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourcegroups/anponnet-rg/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/anponnet-ccy-0531\",\r\n \"name\": \"anponnet-ccy-0531\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n }\r\n ],\r\n \"nextLink\": \"https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices?api-version=2019-08-01&%24skiptoken=7VRbj9o4GP0vaNunZXBCYMhI1QrIBVISmNyc%2bC2O3dycS0kIZEb97zXQzq7UbqWV9rFvls%2fn8%2fk79jmvo4peul1WFe3o6XWkLh3Xc0TVWx5GT6O065r2aTIpoypKaEmr7iF6OR3pQ1yXk%2faE2%2fiYNV1WV%2b2EYImKnwgez8kCjCU6p2P8GJPx43QO5IX4COZzadIc6z4j9NhOzCw%2b1m39qXtQoi5a1ReVJHRC%2fl4rtM9i2v4VNdm45yd4kw8iEOQxWIyB8P6Ptsgaty5o9eGgyBKG54SU%2fhCLrMc5yExHOm%2bzFcOl1SOdndALyEhglztXFbf54p2Iled68SzKJ8JRAjUQQfnk6%2fIRQemOJlvlomBxxpGZEAZ2w9ceFjuGc8laZ8tku14u%2fLee0rDLl4udgFhcWbz2jWW9TA6aPYt1j%2fP6upZh3eN133f4Pa5MyUGdMbqxn8PAANG92w4FBT9jOurFVJIUFsQwtcZzSiGyAQNuKdiWKiimsop8rWldjeNCMXiBvacFGFzPPnL8czgl%2b4gVZ7hp1qg0Aqw3OXbZPMyNyFQvnVemhQ1QE%2bZWjbVmg%2fRLSAuj5P10U2OBUyFmC%2bgIcwNGQhPCaoVMhuaHtbxHQQo8XRu4ijcFHdGfHRLw8ToR1%2b%2bOl%2fL0tp%2brqeWGaSgKkJbbF79iVx4A%2fXRNRC2w4OzWl%2bMFKgR9D9MMqk2NFEM3datDOrLsvDiHIL4QVgzxABY7cFPNwVPyTa03PTU7jUvCiHrpQ%2fH%2bvge2GiIopHFVXF%2fgR%2fx%2bc85q9bjiL175KZ%2bsx8zuI9E%2fXSfjU%2f%2fbr3g3JaM%2fR2vVcu3lznN%2be4j%2f7N8e%2bv89lD%2f%2fJw%2fhwhDDEghYtxUzYJHpplPIPUWgtdkHfob98Myzo4iUc%2b%2bWvkQ0oyegY9T9R85xjyPRB64u5%2fcsvOabtzEaDLWBuueeJ9tPKm5u5Ly%2fTNpf%2bI1b6uqqL1%2b%2bAg%3d%3d\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-gateway-device?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZ2F0ZXdheS1kZXZpY2U/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "PATCH", + "RequestBody": "{\r\n \"tags\": {\r\n \"tag1\": \"value1\",\r\n \"tag2\": \"value2\",\r\n \"tag3\": \"value3\",\r\n \"tag4\": \"value4\"\r\n }\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "94208e57-d7c3-4790-9a37-d7cec7f6ab30" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "113" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "1d338c2a-e2a9-4428-b913-66bd0f738bfa" + ], + "x-ms-client-request-id": [ + "94208e57-d7c3-4790-9a37-d7cec7f6ab30" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1198" + ], + "x-ms-correlation-request-id": [ + "f4580e6b-d425-4f80-811f-9323654bbd6d" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T092009Z:f4580e6b-d425-4f80-811f-9323654bbd6d" + ], + "Date": [ + "Thu, 05 Dec 2019 09:20:08 GMT" + ], + "Content-Length": [ + "741" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {\r\n \"tag1\": \"value1\",\r\n \"tag2\": \"value2\",\r\n \"tag3\": \"value3\",\r\n \"tag4\": \"value4\"\r\n },\r\n \"sku\": {\r\n \"name\": \"Gateway\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A20%3A07.3230497Z'\\\"_W/\\\"datetime'2019-12-05T09%3A20%3A07.3280529Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-gateway-device\",\r\n \"name\": \"demo-gateway-device\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-gateway-device?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZ2F0ZXdheS1kZXZpY2U/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "de546b6e-073c-444a-84e1-5e23c0f43140" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "24d2075a-352f-496c-b898-91ef8559bb58" + ], + "x-ms-client-request-id": [ + "de546b6e-073c-444a-84e1-5e23c0f43140" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-deletes": [ + "14999" + ], + "x-ms-correlation-request-id": [ + "4ec78510-640f-46c6-9312-a2deeb7b6cdc" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T092013Z:4ec78510-640f-46c6-9312-a2deeb7b6cdc" + ], + "Date": [ + "Thu, 05 Dec 2019 09:20:12 GMT" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "", + "StatusCode": 204 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2U/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {\r\n \"tag1\": \"value1\",\r\n \"tag2\": \"value2\"\r\n },\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"standard\"\r\n }\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "35b3b4da-53ef-44a5-ae45-385da1abf8ca" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "162" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "6c8e3778-8899-47b9-8692-f5c90baa98ec" + ], + "x-ms-client-request-id": [ + "35b3b4da-53ef-44a5-ae45-385da1abf8ca" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1197" + ], + "x-ms-correlation-request-id": [ + "8a9b3354-38c7-4564-889f-3d8554246f96" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T092016Z:8a9b3354-38c7-4564-889f-3d8554246f96" + ], + "Date": [ + "Thu, 05 Dec 2019 09:20:15 GMT" + ], + "Content-Length": [ + "686" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {\r\n \"tag1\": \"value1\",\r\n \"tag2\": \"value2\"\r\n },\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A20%3A15.3417961Z'\\\"_W/\\\"datetime'2019-12-05T09%3A20%3A15.3476922Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device\",\r\n \"name\": \"demo-edge-device\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2U/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "ef0e0ddc-8872-4ada-857f-b8650ea8de80" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "87d14e97-1e68-4998-bf16-f287bcfdd233" + ], + "x-ms-client-request-id": [ + "ef0e0ddc-8872-4ada-857f-b8650ea8de80" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11993" + ], + "x-ms-correlation-request-id": [ + "0676d50a-4a87-44a3-9694-818c3843778c" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T092017Z:0676d50a-4a87-44a3-9694-818c3843778c" + ], + "Date": [ + "Thu, 05 Dec 2019 09:20:16 GMT" + ], + "Content-Length": [ + "686" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"location\": \"centraluseuap\",\r\n \"tags\": {\r\n \"tag1\": \"value1\",\r\n \"tag2\": \"value2\"\r\n },\r\n \"sku\": {\r\n \"name\": \"Edge\",\r\n \"tier\": \"Standard\"\r\n },\r\n \"etag\": \"W/\\\"datetime'2019-12-05T09%3A20%3A15.3417961Z'\\\"_W/\\\"datetime'2019-12-05T09%3A20%3A15.3476922Z'\\\"\",\r\n \"properties\": {\r\n \"dataBoxEdgeDeviceStatus\": \"ReadyToSetup\",\r\n \"deviceType\": \"DataBoxEdgeDevice\",\r\n \"deviceLocalCapacity\": 0,\r\n \"nodeCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device\",\r\n \"name\": \"demo-edge-device\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n}", + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "db4e2fdb-6d80-4e6e-b7cd-736098270664", + "SubId": "db4e2fdb-6d80-4e6e-b7cd-736098270664" + } +} \ No newline at end of file diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/DeviceUpdatesTests/Test_GetAndDownloadUpdates.json b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/DeviceUpdatesTests/Test_GetAndDownloadUpdates.json new file mode 100644 index 0000000000000..b123b6bd97294 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/DeviceUpdatesTests/Test_GetAndDownloadUpdates.json @@ -0,0 +1,936 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/updateSummary/default?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2UvdXBkYXRlU3VtbWFyeS9kZWZhdWx0P2FwaS12ZXJzaW9uPTIwMTktMDgtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "aa21bd3d-f4ec-4548-a82b-7f44e8079c3f" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "0a6692f2-7d44-4153-be1e-48e434375640" + ], + "x-ms-client-request-id": [ + "aa21bd3d-f4ec-4548-a82b-7f44e8079c3f" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11988" + ], + "x-ms-correlation-request-id": [ + "d2e8f346-b542-4dfd-be28-d4c8cc36e7d8" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T143526Z:d2e8f346-b542-4dfd-be28-d4c8cc36e7d8" + ], + "Date": [ + "Thu, 05 Dec 2019 14:35:26 GMT" + ], + "Content-Length": [ + "689" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"deviceVersionNumber\": \"2.1.998.537\",\r\n \"friendlyDeviceVersionName\": \"Data Box Edge Mock\",\r\n \"totalNumberOfUpdatesAvailable\": 0,\r\n \"totalNumberOfUpdatesPendingDownload\": 0,\r\n \"totalNumberOfUpdatesPendingInstall\": 0,\r\n \"rebootRequiredForInstall\": false,\r\n \"rebootBehavior\": \"NeverReboots\",\r\n \"ongoingUpdateOperation\": \"None\",\r\n \"totalUpdateSizeInBytes\": 0.0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/updateSummary/default\",\r\n \"name\": \"default\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/updateSummary\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/updateSummary/default?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2UvdXBkYXRlU3VtbWFyeS9kZWZhdWx0P2FwaS12ZXJzaW9uPTIwMTktMDgtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "9777a7be-0860-42d9-80db-57365afaa25b" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "c13e2a6e-d8f7-48fc-aac3-cb1a52df6d43" + ], + "x-ms-client-request-id": [ + "9777a7be-0860-42d9-80db-57365afaa25b" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11976" + ], + "x-ms-correlation-request-id": [ + "b652b6c8-9180-4dd0-a39b-f003a456434b" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T143747Z:b652b6c8-9180-4dd0-a39b-f003a456434b" + ], + "Date": [ + "Thu, 05 Dec 2019 14:37:46 GMT" + ], + "Content-Length": [ + "1177" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"deviceVersionNumber\": \"2.1.998.537\",\r\n \"friendlyDeviceVersionName\": \"Data Box Edge Mock\",\r\n \"deviceLastScannedTimeInUTC\": \"2018-03-16T08:47:48.9496534Z\",\r\n \"deviceLastScannedDateTime\": \"2018-03-16T08:47:48.9496534Z\",\r\n \"lastCompletedScanJobTime\": \"2019-12-05T14:40:31Z\",\r\n \"lastCompletedScanJobDateTime\": \"2019-12-05T14:40:31Z\",\r\n \"lastCompletedDownloadJobTime\": \"2019-12-05T14:41:04Z\",\r\n \"lastCompletedDownloadJobDateTime\": \"2019-12-05T14:41:04Z\",\r\n \"totalNumberOfUpdatesAvailable\": 1,\r\n \"totalNumberOfUpdatesPendingDownload\": 0,\r\n \"totalNumberOfUpdatesPendingInstall\": 1,\r\n \"rebootRequiredForInstall\": true,\r\n \"rebootBehavior\": \"RequiresReboot\",\r\n \"ongoingUpdateOperation\": \"None\",\r\n \"updateTitles\": [\r\n \"[Internal][No Publish] Microsoft Azure Edge Guest Update 1.0\"\r\n ],\r\n \"totalUpdateSizeInBytes\": 3333084456.0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/updateSummary/default\",\r\n \"name\": \"default\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/updateSummary\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/scanForUpdates?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc2NhbkZvclVwZGF0ZXM/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "POST", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "8dc727ed-e3fa-4bdd-a3af-534cadaed8a0" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/operationResults/6991d285-ad4e-4645-bbaa-1d15000b22eb?api-version=2019-08-01" + ], + "Retry-After": [ + "30" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "9a2dd9d6-9022-435e-a03b-a0feef20cb25" + ], + "x-ms-client-request-id": [ + "8dc727ed-e3fa-4bdd-a3af-534cadaed8a0" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-correlation-request-id": [ + "f79cc247-262b-4344-8b87-3126c26f4893" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T143528Z:f79cc247-262b-4344-8b87-3126c26f4893" + ], + "Date": [ + "Thu, 05 Dec 2019 14:35:27 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/operationResults/6991d285-ad4e-4645-bbaa-1d15000b22eb?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvb3BlcmF0aW9uUmVzdWx0cy82OTkxZDI4NS1hZDRlLTQ2NDUtYmJhYS0xZDE1MDAwYjIyZWI/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/operationsStatus/6991d285-ad4e-4645-bbaa-1d15000b22eb?api-version=2019-03-01" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "4c965929-f52f-47d7-86ed-f07b152363d9" + ], + "x-ms-client-request-id": [ + "cd08e7dd-1290-4e30-bbfb-eaf9f227f23d" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11987" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-correlation-request-id": [ + "e5712a13-ff62-413a-8f53-8a9b301b216a" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T143558Z:e5712a13-ff62-413a-8f53-8a9b301b216a" + ], + "Date": [ + "Thu, 05 Dec 2019 14:35:58 GMT" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "", + "StatusCode": 204 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/operationResults/6991d285-ad4e-4645-bbaa-1d15000b22eb?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvb3BlcmF0aW9uUmVzdWx0cy82OTkxZDI4NS1hZDRlLTQ2NDUtYmJhYS0xZDE1MDAwYjIyZWI/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/operationsStatus/6991d285-ad4e-4645-bbaa-1d15000b22eb?api-version=2019-03-01" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "906f3b96-7c83-4fb1-b307-c97369cb976d" + ], + "x-ms-client-request-id": [ + "94c8b168-4187-4c46-a445-75dc1bc9a87f" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11986" + ], + "x-ms-correlation-request-id": [ + "fc4e11a0-39fb-4c19-bb3e-d1bc7e9de8b9" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T143600Z:fc4e11a0-39fb-4c19-bb3e-d1bc7e9de8b9" + ], + "Date": [ + "Thu, 05 Dec 2019 14:36:00 GMT" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "", + "StatusCode": 204 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/downloadUpdates?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2UvZG93bmxvYWRVcGRhdGVzP2FwaS12ZXJzaW9uPTIwMTktMDgtMDE=", + "RequestMethod": "POST", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "8de49712-b66e-4d05-a2f6-8e97489611a6" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/operationResults/f08cae4a-a876-4d8b-be2f-4fd8fc62521a?api-version=2019-08-01" + ], + "Retry-After": [ + "30" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "79d897c0-8202-4a25-9a2b-6cdb139d08b7" + ], + "x-ms-client-request-id": [ + "8de49712-b66e-4d05-a2f6-8e97489611a6" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1198" + ], + "x-ms-correlation-request-id": [ + "34102dd5-3a33-4b0c-91a6-f9643ebd410f" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T143601Z:34102dd5-3a33-4b0c-91a6-f9643ebd410f" + ], + "Date": [ + "Thu, 05 Dec 2019 14:36:01 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/operationResults/f08cae4a-a876-4d8b-be2f-4fd8fc62521a?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvb3BlcmF0aW9uUmVzdWx0cy9mMDhjYWU0YS1hODc2LTRkOGItYmUyZi00ZmQ4ZmM2MjUyMWE/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/operationResults/f08cae4a-a876-4d8b-be2f-4fd8fc62521a?api-version=2019-08-01" + ], + "Retry-After": [ + "10" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/operationsStatus/f08cae4a-a876-4d8b-be2f-4fd8fc62521a?api-version=2019-03-01" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "382122f0-01eb-4edd-9948-f41fba7fb810" + ], + "x-ms-client-request-id": [ + "7af4508d-1d68-4748-a870-5faee0d42983" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11985" + ], + "x-ms-correlation-request-id": [ + "4b4c09bc-e3fb-48b6-a032-5675dcdeee07" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T143631Z:4b4c09bc-e3fb-48b6-a032-5675dcdeee07" + ], + "Date": [ + "Thu, 05 Dec 2019 14:36:31 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/operationResults/f08cae4a-a876-4d8b-be2f-4fd8fc62521a?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvb3BlcmF0aW9uUmVzdWx0cy9mMDhjYWU0YS1hODc2LTRkOGItYmUyZi00ZmQ4ZmM2MjUyMWE/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/operationsStatus/f08cae4a-a876-4d8b-be2f-4fd8fc62521a?api-version=2019-03-01" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "14e8f43f-a128-4569-8f34-e4d21546297b" + ], + "x-ms-client-request-id": [ + "c2cc86e5-f174-4af1-9b95-8bd49382266b" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11977" + ], + "x-ms-correlation-request-id": [ + "65c7a03d-757c-4955-9225-977505571a26" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T143746Z:65c7a03d-757c-4955-9225-977505571a26" + ], + "Date": [ + "Thu, 05 Dec 2019 14:37:46 GMT" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "", + "StatusCode": 204 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/operationsStatus/f08cae4a-a876-4d8b-be2f-4fd8fc62521a?api-version=2019-03-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvb3BlcmF0aW9uc1N0YXR1cy9mMDhjYWU0YS1hODc2LTRkOGItYmUyZi00ZmQ4ZmM2MjUyMWE/YXBpLXZlcnNpb249MjAxOS0wMy0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "3b47c89c-04ba-41c9-97e9-2588dfebe19e" + ], + "x-ms-client-request-id": [ + "008c5b10-4b14-4791-b87b-f4775645298c" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11984" + ], + "x-ms-correlation-request-id": [ + "57ba1367-485a-4d37-bbdc-c00b437a0031" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T143642Z:57ba1367-485a-4d37-bbdc-c00b437a0031" + ], + "Date": [ + "Thu, 05 Dec 2019 14:36:41 GMT" + ], + "Content-Length": [ + "954" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/operationsStatus/f08cae4a-a876-4d8b-be2f-4fd8fc62521a\",\r\n \"name\": \"f08cae4a-a876-4d8b-be2f-4fd8fc62521a\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/jobs\",\r\n \"status\": \"Running\",\r\n \"startTime\": \"2019-12-05T14:36:04Z\",\r\n \"percentComplete\": 2,\r\n \"properties\": {\r\n \"jobType\": \"DownloadUpdates\",\r\n \"currentStage\": \"DownloadStarted\",\r\n \"downloadProgress\": {\r\n \"downloadPhase\": \"Downloading\",\r\n \"percentComplete\": 2,\r\n \"totalBytesToDownload\": 3333084456.0,\r\n \"totalBytesDownloaded\": 79691776.0,\r\n \"numberOfUpdatesToDownload\": 1,\r\n \"numberOfUpdatesDownloaded\": 0\r\n },\r\n \"installProgress\": {\r\n \"percentComplete\": 0,\r\n \"numberOfUpdatesToInstall\": 0,\r\n \"numberOfUpdatesInstalled\": 0\r\n },\r\n \"totalRefreshErrors\": 0\r\n }\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/operationsStatus/f08cae4a-a876-4d8b-be2f-4fd8fc62521a?api-version=2019-03-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvb3BlcmF0aW9uc1N0YXR1cy9mMDhjYWU0YS1hODc2LTRkOGItYmUyZi00ZmQ4ZmM2MjUyMWE/YXBpLXZlcnNpb249MjAxOS0wMy0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "90d6bb1e-40de-4970-909d-bd1bb41ed442" + ], + "x-ms-client-request-id": [ + "9f711299-0270-4aae-9f6b-45c1c1594963" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11983" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-correlation-request-id": [ + "9bb856a4-0824-4674-9c3d-94f2d14a0687" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T143652Z:9bb856a4-0824-4674-9c3d-94f2d14a0687" + ], + "Date": [ + "Thu, 05 Dec 2019 14:36:52 GMT" + ], + "Content-Length": [ + "958" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/operationsStatus/f08cae4a-a876-4d8b-be2f-4fd8fc62521a\",\r\n \"name\": \"f08cae4a-a876-4d8b-be2f-4fd8fc62521a\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/jobs\",\r\n \"status\": \"Running\",\r\n \"startTime\": \"2019-12-05T14:36:04Z\",\r\n \"percentComplete\": 79,\r\n \"properties\": {\r\n \"jobType\": \"DownloadUpdates\",\r\n \"currentStage\": \"DownloadStarted\",\r\n \"downloadProgress\": {\r\n \"downloadPhase\": \"Downloading\",\r\n \"percentComplete\": 79,\r\n \"totalBytesToDownload\": 3333084456.0,\r\n \"totalBytesDownloaded\": 2665141544.0,\r\n \"numberOfUpdatesToDownload\": 1,\r\n \"numberOfUpdatesDownloaded\": 0\r\n },\r\n \"installProgress\": {\r\n \"percentComplete\": 0,\r\n \"numberOfUpdatesToInstall\": 0,\r\n \"numberOfUpdatesInstalled\": 0\r\n },\r\n \"totalRefreshErrors\": 0\r\n }\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/operationsStatus/f08cae4a-a876-4d8b-be2f-4fd8fc62521a?api-version=2019-03-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvb3BlcmF0aW9uc1N0YXR1cy9mMDhjYWU0YS1hODc2LTRkOGItYmUyZi00ZmQ4ZmM2MjUyMWE/YXBpLXZlcnNpb249MjAxOS0wMy0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "4f57b3e9-3bc2-4dd9-94b4-d31593124b9f" + ], + "x-ms-client-request-id": [ + "57d52ab6-4bf8-4677-9005-d6fed06af3e8" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11982" + ], + "x-ms-correlation-request-id": [ + "2574c3d2-8cf3-4d5b-a4b5-efed1894440a" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T143704Z:2574c3d2-8cf3-4d5b-a4b5-efed1894440a" + ], + "Date": [ + "Thu, 05 Dec 2019 14:37:03 GMT" + ], + "Content-Length": [ + "958" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/operationsStatus/f08cae4a-a876-4d8b-be2f-4fd8fc62521a\",\r\n \"name\": \"f08cae4a-a876-4d8b-be2f-4fd8fc62521a\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/jobs\",\r\n \"status\": \"Running\",\r\n \"startTime\": \"2019-12-05T14:36:04Z\",\r\n \"percentComplete\": 79,\r\n \"properties\": {\r\n \"jobType\": \"DownloadUpdates\",\r\n \"currentStage\": \"DownloadStarted\",\r\n \"downloadProgress\": {\r\n \"downloadPhase\": \"Downloading\",\r\n \"percentComplete\": 79,\r\n \"totalBytesToDownload\": 3333084456.0,\r\n \"totalBytesDownloaded\": 2665141544.0,\r\n \"numberOfUpdatesToDownload\": 1,\r\n \"numberOfUpdatesDownloaded\": 0\r\n },\r\n \"installProgress\": {\r\n \"percentComplete\": 0,\r\n \"numberOfUpdatesToInstall\": 0,\r\n \"numberOfUpdatesInstalled\": 0\r\n },\r\n \"totalRefreshErrors\": 0\r\n }\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/operationsStatus/f08cae4a-a876-4d8b-be2f-4fd8fc62521a?api-version=2019-03-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvb3BlcmF0aW9uc1N0YXR1cy9mMDhjYWU0YS1hODc2LTRkOGItYmUyZi00ZmQ4ZmM2MjUyMWE/YXBpLXZlcnNpb249MjAxOS0wMy0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "1a644ff0-03af-4183-bd6c-962c3db4445d" + ], + "x-ms-client-request-id": [ + "16da374b-debf-4892-a64f-b5da529fb65f" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11981" + ], + "x-ms-correlation-request-id": [ + "ec82fbbf-801b-49d6-a02f-3a774f21b7e9" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T143714Z:ec82fbbf-801b-49d6-a02f-3a774f21b7e9" + ], + "Date": [ + "Thu, 05 Dec 2019 14:37:13 GMT" + ], + "Content-Length": [ + "959" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/operationsStatus/f08cae4a-a876-4d8b-be2f-4fd8fc62521a\",\r\n \"name\": \"f08cae4a-a876-4d8b-be2f-4fd8fc62521a\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/jobs\",\r\n \"status\": \"Running\",\r\n \"startTime\": \"2019-12-05T14:36:04Z\",\r\n \"percentComplete\": 99,\r\n \"properties\": {\r\n \"jobType\": \"DownloadUpdates\",\r\n \"currentStage\": \"DownloadComplete\",\r\n \"downloadProgress\": {\r\n \"downloadPhase\": \"Downloading\",\r\n \"percentComplete\": 99,\r\n \"totalBytesToDownload\": 3333084456.0,\r\n \"totalBytesDownloaded\": 3332035880.0,\r\n \"numberOfUpdatesToDownload\": 1,\r\n \"numberOfUpdatesDownloaded\": 0\r\n },\r\n \"installProgress\": {\r\n \"percentComplete\": 0,\r\n \"numberOfUpdatesToInstall\": 0,\r\n \"numberOfUpdatesInstalled\": 0\r\n },\r\n \"totalRefreshErrors\": 0\r\n }\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/operationsStatus/f08cae4a-a876-4d8b-be2f-4fd8fc62521a?api-version=2019-03-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvb3BlcmF0aW9uc1N0YXR1cy9mMDhjYWU0YS1hODc2LTRkOGItYmUyZi00ZmQ4ZmM2MjUyMWE/YXBpLXZlcnNpb249MjAxOS0wMy0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "0828e6d0-24c2-4f65-a123-54e27e01f2d1" + ], + "x-ms-client-request-id": [ + "0d7e70f7-e0a2-4f8b-9825-5db6a56fb332" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11980" + ], + "x-ms-correlation-request-id": [ + "fdf53796-f0f3-4c19-82fb-064fc3769f47" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T143725Z:fdf53796-f0f3-4c19-82fb-064fc3769f47" + ], + "Date": [ + "Thu, 05 Dec 2019 14:37:25 GMT" + ], + "Content-Length": [ + "959" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/operationsStatus/f08cae4a-a876-4d8b-be2f-4fd8fc62521a\",\r\n \"name\": \"f08cae4a-a876-4d8b-be2f-4fd8fc62521a\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/jobs\",\r\n \"status\": \"Running\",\r\n \"startTime\": \"2019-12-05T14:36:04Z\",\r\n \"percentComplete\": 99,\r\n \"properties\": {\r\n \"jobType\": \"DownloadUpdates\",\r\n \"currentStage\": \"DownloadComplete\",\r\n \"downloadProgress\": {\r\n \"downloadPhase\": \"Downloading\",\r\n \"percentComplete\": 99,\r\n \"totalBytesToDownload\": 3333084456.0,\r\n \"totalBytesDownloaded\": 3332035880.0,\r\n \"numberOfUpdatesToDownload\": 1,\r\n \"numberOfUpdatesDownloaded\": 0\r\n },\r\n \"installProgress\": {\r\n \"percentComplete\": 0,\r\n \"numberOfUpdatesToInstall\": 0,\r\n \"numberOfUpdatesInstalled\": 0\r\n },\r\n \"totalRefreshErrors\": 0\r\n }\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/operationsStatus/f08cae4a-a876-4d8b-be2f-4fd8fc62521a?api-version=2019-03-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvb3BlcmF0aW9uc1N0YXR1cy9mMDhjYWU0YS1hODc2LTRkOGItYmUyZi00ZmQ4ZmM2MjUyMWE/YXBpLXZlcnNpb249MjAxOS0wMy0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "1469062a-6a4e-4946-9781-2223adbe1457" + ], + "x-ms-client-request-id": [ + "71a8241f-9f07-4cfd-947d-28ba7cd8de01" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11979" + ], + "x-ms-correlation-request-id": [ + "43c303e1-8981-42a7-9e77-57ce1d3992a5" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T143735Z:43c303e1-8981-42a7-9e77-57ce1d3992a5" + ], + "Date": [ + "Thu, 05 Dec 2019 14:37:35 GMT" + ], + "Content-Length": [ + "959" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/operationsStatus/f08cae4a-a876-4d8b-be2f-4fd8fc62521a\",\r\n \"name\": \"f08cae4a-a876-4d8b-be2f-4fd8fc62521a\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/jobs\",\r\n \"status\": \"Running\",\r\n \"startTime\": \"2019-12-05T14:36:04Z\",\r\n \"percentComplete\": 99,\r\n \"properties\": {\r\n \"jobType\": \"DownloadUpdates\",\r\n \"currentStage\": \"DownloadComplete\",\r\n \"downloadProgress\": {\r\n \"downloadPhase\": \"Downloading\",\r\n \"percentComplete\": 99,\r\n \"totalBytesToDownload\": 3333084456.0,\r\n \"totalBytesDownloaded\": 3332035880.0,\r\n \"numberOfUpdatesToDownload\": 1,\r\n \"numberOfUpdatesDownloaded\": 0\r\n },\r\n \"installProgress\": {\r\n \"percentComplete\": 0,\r\n \"numberOfUpdatesToInstall\": 0,\r\n \"numberOfUpdatesInstalled\": 0\r\n },\r\n \"totalRefreshErrors\": 0\r\n }\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/operationsStatus/f08cae4a-a876-4d8b-be2f-4fd8fc62521a?api-version=2019-03-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvb3BlcmF0aW9uc1N0YXR1cy9mMDhjYWU0YS1hODc2LTRkOGItYmUyZi00ZmQ4ZmM2MjUyMWE/YXBpLXZlcnNpb249MjAxOS0wMy0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "8f29af73-8e41-44dc-b153-e230e8b5d59c" + ], + "x-ms-client-request-id": [ + "226a8339-0c45-4a3c-8d73-38e6f8a6a8cf" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11978" + ], + "x-ms-correlation-request-id": [ + "e1ca8cb6-2371-458d-a849-84535f9703a2" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T143746Z:e1ca8cb6-2371-458d-a849-84535f9703a2" + ], + "Date": [ + "Thu, 05 Dec 2019 14:37:45 GMT" + ], + "Content-Length": [ + "991" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/operationsStatus/f08cae4a-a876-4d8b-be2f-4fd8fc62521a\",\r\n \"name\": \"f08cae4a-a876-4d8b-be2f-4fd8fc62521a\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/jobs\",\r\n \"status\": \"Succeeded\",\r\n \"startTime\": \"2019-12-05T14:36:04Z\",\r\n \"endTime\": \"2019-12-05T14:41:04Z\",\r\n \"percentComplete\": 100,\r\n \"properties\": {\r\n \"jobType\": \"DownloadUpdates\",\r\n \"currentStage\": \"Success\",\r\n \"downloadProgress\": {\r\n \"downloadPhase\": \"Downloading\",\r\n \"percentComplete\": 99,\r\n \"totalBytesToDownload\": 3333084456.0,\r\n \"totalBytesDownloaded\": 3332035880.0,\r\n \"numberOfUpdatesToDownload\": 1,\r\n \"numberOfUpdatesDownloaded\": 0\r\n },\r\n \"installProgress\": {\r\n \"percentComplete\": 0,\r\n \"numberOfUpdatesToInstall\": 0,\r\n \"numberOfUpdatesInstalled\": 0\r\n },\r\n \"totalRefreshErrors\": 0\r\n }\r\n}", + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "db4e2fdb-6d80-4e6e-b7cd-736098270664", + "SubId": "db4e2fdb-6d80-4e6e-b7cd-736098270664" + } +} \ No newline at end of file diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/NetworkSettingsTest/Test_GetNetworkSettings.json b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/NetworkSettingsTest/Test_GetNetworkSettings.json new file mode 100644 index 0000000000000..1d65e78f4a382 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/NetworkSettingsTest/Test_GetNetworkSettings.json @@ -0,0 +1,75 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/networkSettings/default?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2UvbmV0d29ya1NldHRpbmdzL2RlZmF1bHQ/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "0739609e-8edf-4ba1-b251-3eda992fa46f" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "9a76f0de-1380-45b3-afe9-0d62bba80cca" + ], + "x-ms-client-request-id": [ + "0739609e-8edf-4ba1-b251-3eda992fa46f" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11999" + ], + "x-ms-correlation-request-id": [ + "e6252bef-98d6-4cb2-8007-e26a24298b4e" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T093841Z:e6252bef-98d6-4cb2-8007-e26a24298b4e" + ], + "Date": [ + "Thu, 05 Dec 2019 09:38:41 GMT" + ], + "Content-Length": [ + "1370" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"networkAdapters\": [\r\n {\r\n \"adapterId\": \"{C497FD09-7E5D-4716-9428-8B9FC0AF5052}\",\r\n \"adapterPosition\": {\r\n \"networkGroup\": \"NonRDMA\",\r\n \"port\": 0\r\n },\r\n \"index\": 1,\r\n \"nodeId\": \"5c183aa7-8705-4867-ae96-4bedc5716d99\",\r\n \"networkAdapterName\": \"DATA1\",\r\n \"label\": \"DATA1\",\r\n \"macAddress\": \"00155D4E262B\",\r\n \"linkSpeed\": 10000000000,\r\n \"isActive\": false,\r\n \"status\": \"Inactive\",\r\n \"rdmaCapable\": false,\r\n \"rdmaStatus\": \"Incapable\",\r\n \"dhcpEnabled\": true,\r\n \"dhcpStatus\": \"Enabled\",\r\n \"ipv4Configuration\": {\r\n \"ipAddress\": \"10.150.76.82\",\r\n \"subnet\": \"255.255.252.0\",\r\n \"gateway\": \"10.150.76.1\"\r\n },\r\n \"ipv6Configuration\": {\r\n \"ipAddress\": \"2404:f801:4800:1e:8168:dca6:b3b9:d70\",\r\n \"prefixLength\": 64,\r\n \"gateway\": \"fe80::12f3:11ff:fe3b:55d3%4\"\r\n },\r\n \"dnsServers\": [\r\n \"10.50.50.50\",\r\n \"10.50.10.50\"\r\n ]\r\n }\r\n ]\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/networkSettings/default\",\r\n \"name\": \"default\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/networkSettings\"\r\n}", + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "db4e2fdb-6d80-4e6e-b7cd-736098270664", + "SubId": "db4e2fdb-6d80-4e6e-b7cd-736098270664" + } +} \ No newline at end of file diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/OrderTests/Test_DeviceOrders.json b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/OrderTests/Test_DeviceOrders.json new file mode 100644 index 0000000000000..43ec6b93224c7 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/OrderTests/Test_DeviceOrders.json @@ -0,0 +1,513 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/orders/default?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvb3JkZXJzL2RlZmF1bHQ/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"contactInformation\": {\r\n \"contactPerson\": \"John Mcclane\",\r\n \"companyName\": \"Microsoft\",\r\n \"phone\": \"8004269400\",\r\n \"emailList\": [\r\n \"example@microsoft.com\"\r\n ]\r\n },\r\n \"shippingAddress\": {\r\n \"addressLine1\": \"Microsoft Corporation\",\r\n \"postalCode\": \"98052\",\r\n \"city\": \"Redmond\",\r\n \"state\": \"WA\",\r\n \"country\": \"United States\"\r\n }\r\n }\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "13a7fc59-caaf-4d77-9fd3-325f5fc2449c" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "427" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/orders/default/operationResults/c11e7dde-226b-41cc-9db2-953d2a064877?api-version=2019-08-01" + ], + "Retry-After": [ + "30" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "ae3a598d-b719-4304-9656-8158598c1479" + ], + "x-ms-client-request-id": [ + "13a7fc59-caaf-4d77-9fd3-325f5fc2449c" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-correlation-request-id": [ + "1ddecab2-ccaa-4884-92a7-1907e56ecaec" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T094028Z:1ddecab2-ccaa-4884-92a7-1907e56ecaec" + ], + "Date": [ + "Thu, 05 Dec 2019 09:40:28 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/orders/default/operationResults/c11e7dde-226b-41cc-9db2-953d2a064877?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvb3JkZXJzL2RlZmF1bHQvb3BlcmF0aW9uUmVzdWx0cy9jMTFlN2RkZS0yMjZiLTQxY2MtOWRiMi05NTNkMmEwNjQ4Nzc/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/orders/default?api-version=2019-08-01" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "f9696037-c0e3-49e0-b43a-5702cba21348" + ], + "x-ms-client-request-id": [ + "14e08c89-4e2c-4251-808b-3ad8b360e17d" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11990" + ], + "x-ms-correlation-request-id": [ + "ce8246fe-f7f5-4e73-97de-0f5127bbe0d4" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T094059Z:ce8246fe-f7f5-4e73-97de-0f5127bbe0d4" + ], + "Date": [ + "Thu, 05 Dec 2019 09:40:59 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/orders/default?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvb3JkZXJzL2RlZmF1bHQ/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "6c9d4fd5-cb6e-4393-86a6-d180c4ee10f8" + ], + "x-ms-client-request-id": [ + "794259c3-8e40-44f6-98a7-afd2e702cf12" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11989" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-correlation-request-id": [ + "cfc2d53a-b0e9-4444-aab9-3982c65e03e9" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T094129Z:cfc2d53a-b0e9-4444-aab9-3982c65e03e9" + ], + "Date": [ + "Thu, 05 Dec 2019 09:41:28 GMT" + ], + "Content-Length": [ + "1195" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"contactInformation\": {\r\n \"contactPerson\": \"John Mcclane\",\r\n \"companyName\": \"Microsoft\",\r\n \"phone\": \"8004269400\",\r\n \"emailList\": [\r\n \"example@microsoft.com\"\r\n ]\r\n },\r\n \"shippingAddress\": {\r\n \"addressLine1\": \"Microsoft Corporation\",\r\n \"postalCode\": \"98052\",\r\n \"city\": \"Redmond\",\r\n \"state\": \"WA\",\r\n \"country\": \"United States\"\r\n },\r\n \"currentStatus\": {\r\n \"status\": \"Untracked\",\r\n \"updateDateTime\": \"0001-01-01T00:00:00\",\r\n \"comments\": \"Initialising Order with Untracked status\",\r\n \"additionalOrderDetails\": {}\r\n },\r\n \"orderHistory\": [\r\n {\r\n \"status\": \"Untracked\",\r\n \"updateDateTime\": \"0001-01-01T00:00:00\",\r\n \"comments\": \"Initialising Order with Untracked status\",\r\n \"additionalOrderDetails\": {}\r\n }\r\n ],\r\n \"deliveryTrackingInfo\": [],\r\n \"returnTrackingInfo\": []\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/orders/default\",\r\n \"name\": \"default\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/orders\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/orders/default?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvb3JkZXJzL2RlZmF1bHQ/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "3ba849b5-c1a3-409f-a8ba-a33a08f04df4" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "e97f1935-8b06-4fe7-923d-d6714865b9a4" + ], + "x-ms-client-request-id": [ + "3ba849b5-c1a3-409f-a8ba-a33a08f04df4" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11988" + ], + "x-ms-correlation-request-id": [ + "30d5f087-9ce8-4a9c-b1b1-0858a488b0da" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T094131Z:30d5f087-9ce8-4a9c-b1b1-0858a488b0da" + ], + "Date": [ + "Thu, 05 Dec 2019 09:41:30 GMT" + ], + "Content-Length": [ + "1195" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"contactInformation\": {\r\n \"contactPerson\": \"John Mcclane\",\r\n \"companyName\": \"Microsoft\",\r\n \"phone\": \"8004269400\",\r\n \"emailList\": [\r\n \"example@microsoft.com\"\r\n ]\r\n },\r\n \"shippingAddress\": {\r\n \"addressLine1\": \"Microsoft Corporation\",\r\n \"postalCode\": \"98052\",\r\n \"city\": \"Redmond\",\r\n \"state\": \"WA\",\r\n \"country\": \"United States\"\r\n },\r\n \"currentStatus\": {\r\n \"status\": \"Untracked\",\r\n \"updateDateTime\": \"0001-01-01T00:00:00\",\r\n \"comments\": \"Initialising Order with Untracked status\",\r\n \"additionalOrderDetails\": {}\r\n },\r\n \"orderHistory\": [\r\n {\r\n \"status\": \"Untracked\",\r\n \"updateDateTime\": \"0001-01-01T00:00:00\",\r\n \"comments\": \"Initialising Order with Untracked status\",\r\n \"additionalOrderDetails\": {}\r\n }\r\n ],\r\n \"deliveryTrackingInfo\": [],\r\n \"returnTrackingInfo\": []\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/orders/default\",\r\n \"name\": \"default\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/orders\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/orders?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvb3JkZXJzP2FwaS12ZXJzaW9uPTIwMTktMDgtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "3da79ee2-60e4-4d93-82d2-1b0d63b52093" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "352860dd-0f6f-409a-b88d-77dc8853c3b2" + ], + "x-ms-client-request-id": [ + "3da79ee2-60e4-4d93-82d2-1b0d63b52093" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11987" + ], + "x-ms-correlation-request-id": [ + "c46a9137-4f9c-4b0d-b81e-fac525fb79f3" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T094131Z:c46a9137-4f9c-4b0d-b81e-fac525fb79f3" + ], + "Date": [ + "Thu, 05 Dec 2019 09:41:31 GMT" + ], + "Content-Length": [ + "1372" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"properties\": {\r\n \"contactInformation\": {\r\n \"contactPerson\": \"John Mcclane\",\r\n \"companyName\": \"Microsoft\",\r\n \"phone\": \"8004269400\",\r\n \"emailList\": [\r\n \"example@microsoft.com\"\r\n ]\r\n },\r\n \"shippingAddress\": {\r\n \"addressLine1\": \"Microsoft Corporation\",\r\n \"postalCode\": \"98052\",\r\n \"city\": \"Redmond\",\r\n \"state\": \"WA\",\r\n \"country\": \"United States\"\r\n },\r\n \"currentStatus\": {\r\n \"status\": \"Untracked\",\r\n \"updateDateTime\": \"0001-01-01T00:00:00\",\r\n \"comments\": \"Initialising Order with Untracked status\",\r\n \"additionalOrderDetails\": {}\r\n },\r\n \"orderHistory\": [\r\n {\r\n \"status\": \"Untracked\",\r\n \"updateDateTime\": \"0001-01-01T00:00:00\",\r\n \"comments\": \"Initialising Order with Untracked status\",\r\n \"additionalOrderDetails\": {}\r\n }\r\n ],\r\n \"deliveryTrackingInfo\": [],\r\n \"returnTrackingInfo\": []\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/orders/default\",\r\n \"name\": \"default\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/orders\"\r\n }\r\n ]\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/orders/default?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvb3JkZXJzL2RlZmF1bHQ/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "c8715319-27b9-40d5-853b-f86c34e4a97e" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/orders/default/operationResults/cbacd1f7-6455-441a-8bab-f68f1aa5f9b6?api-version=2019-08-01" + ], + "Retry-After": [ + "30" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "0ce99eef-0d2e-48c4-97c1-042b15f85346" + ], + "x-ms-client-request-id": [ + "c8715319-27b9-40d5-853b-f86c34e4a97e" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-deletes": [ + "14999" + ], + "x-ms-correlation-request-id": [ + "b7800ff6-7468-4f13-9a8e-22cf548caf25" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T094132Z:b7800ff6-7468-4f13-9a8e-22cf548caf25" + ], + "Date": [ + "Thu, 05 Dec 2019 09:41:31 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/orders/default/operationResults/cbacd1f7-6455-441a-8bab-f68f1aa5f9b6?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvb3JkZXJzL2RlZmF1bHQvb3BlcmF0aW9uUmVzdWx0cy9jYmFjZDFmNy02NDU1LTQ0MWEtOGJhYi1mNjhmMWFhNWY5YjY/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "88769fac-58f7-4f63-a92a-7bc76e16d58a" + ], + "x-ms-client-request-id": [ + "48a229f9-f0fb-40e2-b26d-f614f6f95a2f" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11986" + ], + "x-ms-correlation-request-id": [ + "fe1df786-7fcd-4de7-933d-6423f4a39eb5" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T094203Z:fe1df786-7fcd-4de7-933d-6423f4a39eb5" + ], + "Date": [ + "Thu, 05 Dec 2019 09:42:02 GMT" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "", + "StatusCode": 204 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/orders/default/operationResults/cbacd1f7-6455-441a-8bab-f68f1aa5f9b6?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvb3JkZXJzL2RlZmF1bHQvb3BlcmF0aW9uUmVzdWx0cy9jYmFjZDFmNy02NDU1LTQ0MWEtOGJhYi1mNjhmMWFhNWY5YjY/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "335a4030-52e1-44d9-bbdb-db9ecab98273" + ], + "x-ms-client-request-id": [ + "394b1f65-e170-4e86-bc2a-f26270a610ed" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11985" + ], + "x-ms-correlation-request-id": [ + "c9686ca4-a87a-439e-a755-6f6411fd99ad" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T094203Z:c9686ca4-a87a-439e-a755-6f6411fd99ad" + ], + "Date": [ + "Thu, 05 Dec 2019 09:42:03 GMT" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "", + "StatusCode": 204 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "db4e2fdb-6d80-4e6e-b7cd-736098270664", + "SubId": "db4e2fdb-6d80-4e6e-b7cd-736098270664" + } +} \ No newline at end of file diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/RoleTests/Test_IoTRoles.json b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/RoleTests/Test_IoTRoles.json new file mode 100644 index 0000000000000..2047b8bcecac8 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/RoleTests/Test_IoTRoles.json @@ -0,0 +1,840 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/getExtendedInformation?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2UvZ2V0RXh0ZW5kZWRJbmZvcm1hdGlvbj9hcGktdmVyc2lvbj0yMDE5LTA4LTAx", + "RequestMethod": "POST", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "c19ccf15-9508-45f7-916c-56ce646d8bf2" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "3d53f50a-f7ec-4dbe-90e7-f5433b8cff48" + ], + "x-ms-client-request-id": [ + "c19ccf15-9508-45f7-916c-56ce646d8bf2" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-correlation-request-id": [ + "2782ae6f-6199-45e5-a5d7-f4db93a8ff78" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T103855Z:2782ae6f-6199-45e5-a5d7-f4db93a8ff78" + ], + "Date": [ + "Thu, 05 Dec 2019 10:38:54 GMT" + ], + "Content-Length": [ + "1964" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"encryptionKeyThumbprint\": \"FF27EF016674E5A2801B50362ACE4E82E43CBE0E\",\r\n \"encryptionKey\": \"EAAAAOmCAAaQPDb4mYfmhZccBg06QaeYEPS6knXaQITR/GLP9fhpNGvj8PhFr4k/8sZ16sLrNIlzHqIO5ZLqeiAar3pk/W0yBOeTKPRiLkKJ6p1+NoJ3ynpwTfkH3fLf+5/r8j7utB6KnOtGqMXISyACXf3MiNsjqEUV6OkGiv6SuQifo5UTFnifb9XFKNkGfx30epdwSL4+DO79U+gIjZtWm1c0q0D7l1M7d2CEV1HRMX6L3csU9z2qbY/GS5tDcITb2F+LXvKbMIjKklKjaHPWDB2bGd+RQg3sq+JhL5BK8/YeM0cpqLmkEDwnjSaRIl2StJYvQdl1QwPYx7EzO172h/7U6ZhMtatI1543tOTEc8ytJtVFt5i/mtq3Q2xUX92YoRQShqe1m+LZGsmuBSCOTA4OIXDN2BFNYUcExo8m6ZLUlFlbyK5ILNm6gvzdQ3L59fy4FRSFzuCmCEg2XvjZ2E+tml30zGg4cZO9TIcxUcDRn8Ij3ItUseXCKWxNsjHNqZb6h3qAotYjqAhFRHkeeD1IsleGVd5Ws1P05f/IvKZrPEkvOFuHzkR/BlUYuyvq84GbbCe3GyEMue09HytXgVCLKl7yQjCalHICRnIcBfSs4+niQAF5Y3NaUU1VKtDcumvXZT/pZfVyJl+qvDPipicp9Yd1Hk7zCv+i0SO5G1wsep1Mnsj8reApWzKs604zx6qtpQLXQBva0IsGtad+j9KcNd8kSk/o7jBvCp7ckK+3yxxD6yxsXzToZysO+DnCvfEbWVyboqLFnO6QEhw1aDr0m3LHZIXOJ0/00VrOEosC4FcNYaz126gvWPzyTk/wj5GwWOaU1SFHVESCc54j/jMmmr0+8V0QPMWRJgNEE6TQxLFNTheJbJ1fdBNZSLkyF06Y9nB3dER85w3a0Oq4jZDABS3c6JJkOBBMJ2Z45MZHlaeByBk3qESD4xe7qlmyq3QnptVwnLFxvgGCy+8TWcyLjEoQW+Pbu/TFpLK8MitAwgHd/FUvwbIUipLwyt8NIS1NBiI4Sc3Ow06Jpwq68QvSRvlJsRi80tZxhiZQOz7hIJCt8Tg/NAFfiqrGJJnauju3fEZT9SX58MFN4WKRkmGwq8/3F9paxchytZlSQh3wwAwmcJxrXLusWgFqpaNERk32kkSuHHmOdw//VhKh4ZhM5ni8WQx7AaEQtRSfIFpXT8975KGnuYM7/iheQtpH4hzwYeWeCmKE4M5eeiky9QUEtjDw+br9Y6NisT3LlgjmmDT9cYUbbB5G5KpQRSWZL7CqV0mK4o5/53zxUIk6Q0XJJI4eTa0kn+4mfKwSpRItMtx6AskfUJsbjxN31cIJwEh17KMYTr4b0Rs9F/FMVcuQtH17tTDq19PQ5hZa6ZJ6SNHtzpxyICN7orpIS3zv3anaVHwT/bZB/T7zRn2lOoaW6YL2dcJKbQx5BW6XkZhF1RrQOgJVlS17Lnip/5o5acEq3HiJYSlsNzo9/u7Jq5M+PY3qR9A05YHbh6S9dNEbBbES8RYc8nMwwgQ6aduVFQ==\",\r\n \"resourceKey\": \"7915524720635494902\"\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device\",\r\n \"name\": \"demo-edge-device\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/getExtendedInformation?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2UvZ2V0RXh0ZW5kZWRJbmZvcm1hdGlvbj9hcGktdmVyc2lvbj0yMDE5LTA4LTAx", + "RequestMethod": "POST", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "d2fa6ce3-5283-40a3-8a0c-f8f5b5c7bfd0" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "8db0ec1d-49eb-4c78-b236-f03d6dbd8a3d" + ], + "x-ms-client-request-id": [ + "d2fa6ce3-5283-40a3-8a0c-f8f5b5c7bfd0" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1198" + ], + "x-ms-correlation-request-id": [ + "286c1795-173c-48fa-b24d-24d56c8ba37f" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T103855Z:286c1795-173c-48fa-b24d-24d56c8ba37f" + ], + "Date": [ + "Thu, 05 Dec 2019 10:38:55 GMT" + ], + "Content-Length": [ + "1964" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"encryptionKeyThumbprint\": \"FF27EF016674E5A2801B50362ACE4E82E43CBE0E\",\r\n \"encryptionKey\": \"EAAAAOmCAAaQPDb4mYfmhZccBg06QaeYEPS6knXaQITR/GLP9fhpNGvj8PhFr4k/8sZ16sLrNIlzHqIO5ZLqeiAar3pk/W0yBOeTKPRiLkKJ6p1+NoJ3ynpwTfkH3fLf+5/r8j7utB6KnOtGqMXISyACXf3MiNsjqEUV6OkGiv6SuQifo5UTFnifb9XFKNkGfx30epdwSL4+DO79U+gIjZtWm1c0q0D7l1M7d2CEV1HRMX6L3csU9z2qbY/GS5tDcITb2F+LXvKbMIjKklKjaHPWDB2bGd+RQg3sq+JhL5BK8/YeM0cpqLmkEDwnjSaRIl2StJYvQdl1QwPYx7EzO172h/7U6ZhMtatI1543tOTEc8ytJtVFt5i/mtq3Q2xUX92YoRQShqe1m+LZGsmuBSCOTA4OIXDN2BFNYUcExo8m6ZLUlFlbyK5ILNm6gvzdQ3L59fy4FRSFzuCmCEg2XvjZ2E+tml30zGg4cZO9TIcxUcDRn8Ij3ItUseXCKWxNsjHNqZb6h3qAotYjqAhFRHkeeD1IsleGVd5Ws1P05f/IvKZrPEkvOFuHzkR/BlUYuyvq84GbbCe3GyEMue09HytXgVCLKl7yQjCalHICRnIcBfSs4+niQAF5Y3NaUU1VKtDcumvXZT/pZfVyJl+qvDPipicp9Yd1Hk7zCv+i0SO5G1wsep1Mnsj8reApWzKs604zx6qtpQLXQBva0IsGtad+j9KcNd8kSk/o7jBvCp7ckK+3yxxD6yxsXzToZysO+DnCvfEbWVyboqLFnO6QEhw1aDr0m3LHZIXOJ0/00VrOEosC4FcNYaz126gvWPzyTk/wj5GwWOaU1SFHVESCc54j/jMmmr0+8V0QPMWRJgNEE6TQxLFNTheJbJ1fdBNZSLkyF06Y9nB3dER85w3a0Oq4jZDABS3c6JJkOBBMJ2Z45MZHlaeByBk3qESD4xe7qlmyq3QnptVwnLFxvgGCy+8TWcyLjEoQW+Pbu/TFpLK8MitAwgHd/FUvwbIUipLwyt8NIS1NBiI4Sc3Ow06Jpwq68QvSRvlJsRi80tZxhiZQOz7hIJCt8Tg/NAFfiqrGJJnauju3fEZT9SX58MFN4WKRkmGwq8/3F9paxchytZlSQh3wwAwmcJxrXLusWgFqpaNERk32kkSuHHmOdw//VhKh4ZhM5ni8WQx7AaEQtRSfIFpXT8975KGnuYM7/iheQtpH4hzwYeWeCmKE4M5eeiky9QUEtjDw+br9Y6NisT3LlgjmmDT9cYUbbB5G5KpQRSWZL7CqV0mK4o5/53zxUIk6Q0XJJI4eTa0kn+4mfKwSpRItMtx6AskfUJsbjxN31cIJwEh17KMYTr4b0Rs9F/FMVcuQtH17tTDq19PQ5hZa6ZJ6SNHtzpxyICN7orpIS3zv3anaVHwT/bZB/T7zRn2lOoaW6YL2dcJKbQx5BW6XkZhF1RrQOgJVlS17Lnip/5o5acEq3HiJYSlsNzo9/u7Jq5M+PY3qR9A05YHbh6S9dNEbBbES8RYc8nMwwgQ6aduVFQ==\",\r\n \"resourceKey\": \"7915524720635494902\"\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device\",\r\n \"name\": \"demo-edge-device\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/roles/iot-1?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvcm9sZXMvaW90LTE/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"kind\": \"IOT\",\r\n \"properties\": {\r\n \"hostPlatform\": \"Linux\",\r\n \"ioTDeviceDetails\": {\r\n \"deviceId\": \"iotdevice\",\r\n \"ioTHostHub\": \"iothub.azure-devices.net\",\r\n \"authentication\": {\r\n \"symmetricKey\": {\r\n \"connectionString\": {\r\n \"value\": \"iTVQ+ADbZYRKGRSRXjAnbN8tSwUIdcNkfBCSiVtWK8yPHu/1Xi9GCDOwYA8vzy9lVqWZ+joUDZi4FPCkDNoq5GcH2JVat41MRcDIWaaJK3vp2xcQlbCUbGxmuiI8Jw2XzLIOOLpZUaOFhYP1W8KlUSRKnfS4WiYEFRLuLzG3o2JeUcNInjT9bSqow7h8K+NdqX02jGhOogMH1mkZIPs1QvN4p5XHPyaew7rKKXHAZHniN/fAy7/K6mff/bhF2Qfd1PHPK5dt/9PxA/dyBCjamwWMdjvYM201FOZ10JrM8a3stESTuWJx8TrdfB0d/WLwb7DSMz1acKHisl7hFmg+RA==\",\r\n \"encryptionCertThumbprint\": \"FF27EF016674E5A2801B50362ACE4E82E43CBE0E\",\r\n \"encryptionAlgorithm\": \"AES256\"\r\n }\r\n }\r\n }\r\n },\r\n \"ioTEdgeDeviceDetails\": {\r\n \"deviceId\": \"iotdevice\",\r\n \"ioTHostHub\": \"iothub.azure-devices.net\",\r\n \"authentication\": {\r\n \"symmetricKey\": {\r\n \"connectionString\": {\r\n \"value\": \"iK7iWOrs1FW0jrefr80CH0kFDMZwicYv7O3nzZoiRXgmsc68r35SSWmeHPtk5pM/cB41rUaPoAJa7TomlXT/QR8/OsnS7ItViir0oviktCiDbL9zi8RgyDgjcdBK50IR7ws6KHlvRxoGYnt19vt65a9XrmFii8pQ/O5foco10A62fxx7S6U3Vgj2yRpFaatQthXaIFKWvEDtbT1sLjecGHN71KQGbyxkFWsgWln2Pf4DjjZxttJ7iXLZPdE5pb4waTQGJzIMJKwDzSawKyscuSiCmfyRZ6QyqHc9rcSC2jOQyq6SEQZcSMoSicS5mqebLK6d82hhPUYv0GI5np3O+g==\",\r\n \"encryptionCertThumbprint\": \"FF27EF016674E5A2801B50362ACE4E82E43CBE0E\",\r\n \"encryptionAlgorithm\": \"AES256\"\r\n }\r\n }\r\n }\r\n },\r\n \"roleStatus\": \"Enabled\"\r\n }\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "748db0c9-6d00-47b1-980c-72176151e498" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "1581" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/roles/iot-1/operationResults/bfbceb18-3416-4070-8bc6-e66623328aab?api-version=2019-08-01" + ], + "Retry-After": [ + "30" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "335242d7-f9d1-4fb3-b447-126e914db9a0" + ], + "x-ms-client-request-id": [ + "748db0c9-6d00-47b1-980c-72176151e498" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-correlation-request-id": [ + "0d50e1d6-1b95-4a52-b45a-fd23ff1ac99e" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T103856Z:0d50e1d6-1b95-4a52-b45a-fd23ff1ac99e" + ], + "Date": [ + "Thu, 05 Dec 2019 10:38:56 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/roles/iot-1?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvcm9sZXMvaW90LTE/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"kind\": \"IOT\",\r\n \"properties\": {\r\n \"hostPlatform\": \"Linux\",\r\n \"ioTDeviceDetails\": {\r\n \"deviceId\": \"iotdevice\",\r\n \"ioTHostHub\": \"iothub.azure-devices.net\",\r\n \"authentication\": {\r\n \"symmetricKey\": {\r\n \"connectionString\": {\r\n \"value\": \"iTVQ+ADbZYRKGRSRXjAnbN8tSwUIdcNkfBCSiVtWK8yPHu/1Xi9GCDOwYA8vzy9lVqWZ+joUDZi4FPCkDNoq5GcH2JVat41MRcDIWaaJK3vp2xcQlbCUbGxmuiI8Jw2XzLIOOLpZUaOFhYP1W8KlUSRKnfS4WiYEFRLuLzG3o2JeUcNInjT9bSqow7h8K+NdqX02jGhOogMH1mkZIPs1QvN4p5XHPyaew7rKKXHAZHniN/fAy7/K6mff/bhF2Qfd1PHPK5dt/9PxA/dyBCjamwWMdjvYM201FOZ10JrM8a3stESTuWJx8TrdfB0d/WLwb7DSMz1acKHisl7hFmg+RA==\",\r\n \"encryptionCertThumbprint\": \"FF27EF016674E5A2801B50362ACE4E82E43CBE0E\",\r\n \"encryptionAlgorithm\": \"AES256\"\r\n }\r\n }\r\n }\r\n },\r\n \"ioTEdgeDeviceDetails\": {\r\n \"deviceId\": \"iotdevice\",\r\n \"ioTHostHub\": \"iothub.azure-devices.net\",\r\n \"authentication\": {\r\n \"symmetricKey\": {\r\n \"connectionString\": {\r\n \"value\": \"iK7iWOrs1FW0jrefr80CH0kFDMZwicYv7O3nzZoiRXgmsc68r35SSWmeHPtk5pM/cB41rUaPoAJa7TomlXT/QR8/OsnS7ItViir0oviktCiDbL9zi8RgyDgjcdBK50IR7ws6KHlvRxoGYnt19vt65a9XrmFii8pQ/O5foco10A62fxx7S6U3Vgj2yRpFaatQthXaIFKWvEDtbT1sLjecGHN71KQGbyxkFWsgWln2Pf4DjjZxttJ7iXLZPdE5pb4waTQGJzIMJKwDzSawKyscuSiCmfyRZ6QyqHc9rcSC2jOQyq6SEQZcSMoSicS5mqebLK6d82hhPUYv0GI5np3O+g==\",\r\n \"encryptionCertThumbprint\": \"FF27EF016674E5A2801B50362ACE4E82E43CBE0E\",\r\n \"encryptionAlgorithm\": \"AES256\"\r\n }\r\n }\r\n }\r\n },\r\n \"roleStatus\": \"Enabled\"\r\n }\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "8813463e-bb8e-401f-8db1-4a13baa727bf" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "1581" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/roles/iot-1/operationResults/b3249f1c-82d8-44df-b720-1753dd921598?api-version=2019-08-01" + ], + "Retry-After": [ + "30" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "cc4de642-f575-4e2f-a336-cbf5b50243f0" + ], + "x-ms-client-request-id": [ + "8813463e-bb8e-401f-8db1-4a13baa727bf" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1198" + ], + "x-ms-correlation-request-id": [ + "1fe8e082-12cb-413e-a90d-a865208c2d32" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T104032Z:1fe8e082-12cb-413e-a90d-a865208c2d32" + ], + "Date": [ + "Thu, 05 Dec 2019 10:40:31 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/roles/iot-1/operationResults/bfbceb18-3416-4070-8bc6-e66623328aab?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvcm9sZXMvaW90LTEvb3BlcmF0aW9uUmVzdWx0cy9iZmJjZWIxOC0zNDE2LTQwNzAtOGJjNi1lNjY2MjMzMjhhYWI/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/roles/iot-1?api-version=2019-08-01" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "81ec9bc1-30a9-4b17-a832-814fc484ab49" + ], + "x-ms-client-request-id": [ + "c1e48481-27d8-43d5-a18f-f41bad4ab8b5" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11980" + ], + "x-ms-correlation-request-id": [ + "6e8bf120-9b7a-4c42-8e75-421767607204" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T103927Z:6e8bf120-9b7a-4c42-8e75-421767607204" + ], + "Date": [ + "Thu, 05 Dec 2019 10:39:26 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/roles/iot-1?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvcm9sZXMvaW90LTE/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "a6ea9f00-f073-4054-b94d-69bd0bbe6a1e" + ], + "x-ms-client-request-id": [ + "4bc2130c-c16d-4437-8b68-64dd41814d97" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11978" + ], + "x-ms-correlation-request-id": [ + "0f5e26dc-b137-49d4-bfc5-953060a083e1" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T103958Z:0f5e26dc-b137-49d4-bfc5-953060a083e1" + ], + "Date": [ + "Thu, 05 Dec 2019 10:39:58 GMT" + ], + "Content-Length": [ + "750" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"hostPlatform\": \"Linux\",\r\n \"ioTDeviceDetails\": {\r\n \"deviceId\": \"iotdevice\",\r\n \"ioTHostHub\": \"iothub.azure-devices.net\",\r\n \"authentication\": {\r\n \"symmetricKey\": {}\r\n }\r\n },\r\n \"ioTEdgeDeviceDetails\": {\r\n \"deviceId\": \"iotdevice\",\r\n \"ioTHostHub\": \"iothub.azure-devices.net\",\r\n \"authentication\": {\r\n \"symmetricKey\": {}\r\n }\r\n },\r\n \"shareMappings\": [],\r\n \"roleStatus\": \"Enabled\"\r\n },\r\n \"kind\": \"IOT\",\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/roles/iot-1\",\r\n \"name\": \"iot-1\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/roles\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/roles/iot-1?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvcm9sZXMvaW90LTE/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "91f28c77-068f-4f42-a77e-91fa73917a06" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "c45e875e-d2f3-4153-8679-29e9730cc54e" + ], + "x-ms-client-request-id": [ + "91f28c77-068f-4f42-a77e-91fa73917a06" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11977" + ], + "x-ms-correlation-request-id": [ + "21d7189b-6ec1-4003-aeff-4390077d02ab" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T103959Z:21d7189b-6ec1-4003-aeff-4390077d02ab" + ], + "Date": [ + "Thu, 05 Dec 2019 10:39:59 GMT" + ], + "Content-Length": [ + "750" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"hostPlatform\": \"Linux\",\r\n \"ioTDeviceDetails\": {\r\n \"deviceId\": \"iotdevice\",\r\n \"ioTHostHub\": \"iothub.azure-devices.net\",\r\n \"authentication\": {\r\n \"symmetricKey\": {}\r\n }\r\n },\r\n \"ioTEdgeDeviceDetails\": {\r\n \"deviceId\": \"iotdevice\",\r\n \"ioTHostHub\": \"iothub.azure-devices.net\",\r\n \"authentication\": {\r\n \"symmetricKey\": {}\r\n }\r\n },\r\n \"shareMappings\": [],\r\n \"roleStatus\": \"Enabled\"\r\n },\r\n \"kind\": \"IOT\",\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/roles/iot-1\",\r\n \"name\": \"iot-1\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/roles\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/roles/iot-1?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvcm9sZXMvaW90LTE/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "9bdf871e-506a-4426-82f4-e9933d54f476" + ], + "x-ms-client-request-id": [ + "a6b6b29a-d6c5-4333-896f-914bb50a13c9" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11971" + ], + "x-ms-correlation-request-id": [ + "76e72499-aa07-4d2e-86bf-6a96a5ac922b" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T104134Z:76e72499-aa07-4d2e-86bf-6a96a5ac922b" + ], + "Date": [ + "Thu, 05 Dec 2019 10:41:34 GMT" + ], + "Content-Length": [ + "750" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"hostPlatform\": \"Linux\",\r\n \"ioTDeviceDetails\": {\r\n \"deviceId\": \"iotdevice\",\r\n \"ioTHostHub\": \"iothub.azure-devices.net\",\r\n \"authentication\": {\r\n \"symmetricKey\": {}\r\n }\r\n },\r\n \"ioTEdgeDeviceDetails\": {\r\n \"deviceId\": \"iotdevice\",\r\n \"ioTHostHub\": \"iothub.azure-devices.net\",\r\n \"authentication\": {\r\n \"symmetricKey\": {}\r\n }\r\n },\r\n \"shareMappings\": [],\r\n \"roleStatus\": \"Enabled\"\r\n },\r\n \"kind\": \"IOT\",\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/roles/iot-1\",\r\n \"name\": \"iot-1\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/roles\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/roles?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvcm9sZXM/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "12dddb40-295b-4b1b-991f-189290c69c06" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "2b5a790f-1757-4e90-be16-84549b7b1e04" + ], + "x-ms-client-request-id": [ + "12dddb40-295b-4b1b-991f-189290c69c06" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11976" + ], + "x-ms-correlation-request-id": [ + "b5c1d1ea-426f-43b4-9cd9-a7b43ccd9da1" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T103959Z:b5c1d1ea-426f-43b4-9cd9-a7b43ccd9da1" + ], + "Date": [ + "Thu, 05 Dec 2019 10:39:59 GMT" + ], + "Content-Length": [ + "875" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"properties\": {\r\n \"hostPlatform\": \"Linux\",\r\n \"ioTDeviceDetails\": {\r\n \"deviceId\": \"iotdevice\",\r\n \"ioTHostHub\": \"iothub.azure-devices.net\",\r\n \"authentication\": {\r\n \"symmetricKey\": {}\r\n }\r\n },\r\n \"ioTEdgeDeviceDetails\": {\r\n \"deviceId\": \"iotdevice\",\r\n \"ioTHostHub\": \"iothub.azure-devices.net\",\r\n \"authentication\": {\r\n \"symmetricKey\": {}\r\n }\r\n },\r\n \"shareMappings\": [],\r\n \"roleStatus\": \"Enabled\"\r\n },\r\n \"kind\": \"IOT\",\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/roles/iot-1\",\r\n \"name\": \"iot-1\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/roles\"\r\n }\r\n ]\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/roles/iot-1?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvcm9sZXMvaW90LTE/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "7e29a571-d5f9-4d90-94a8-70508da0f3a2" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/roles/iot-1/operationResults/9a5513d6-0d42-4910-930e-dc6a4ab36ff7?api-version=2019-08-01" + ], + "Retry-After": [ + "30" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "7dc454d7-097e-4d1f-9bfc-52254ec4fa35" + ], + "x-ms-client-request-id": [ + "7e29a571-d5f9-4d90-94a8-70508da0f3a2" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-deletes": [ + "14999" + ], + "x-ms-correlation-request-id": [ + "1ff8b5ff-fb84-4c47-b976-921a149c25dc" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T104000Z:1ff8b5ff-fb84-4c47-b976-921a149c25dc" + ], + "Date": [ + "Thu, 05 Dec 2019 10:40:00 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/roles/iot-1/operationResults/9a5513d6-0d42-4910-930e-dc6a4ab36ff7?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvcm9sZXMvaW90LTEvb3BlcmF0aW9uUmVzdWx0cy85YTU1MTNkNi0wZDQyLTQ5MTAtOTMwZS1kYzZhNGFiMzZmZjc/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "9488a178-522e-4c38-b4ca-cd26302cb9fe" + ], + "x-ms-client-request-id": [ + "8e082169-2d76-43f0-a7a7-d130c035622f" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11975" + ], + "x-ms-correlation-request-id": [ + "af783569-8fd6-4962-83b1-d9d743970905" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T104030Z:af783569-8fd6-4962-83b1-d9d743970905" + ], + "Date": [ + "Thu, 05 Dec 2019 10:40:30 GMT" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "", + "StatusCode": 204 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/roles/iot-1/operationResults/9a5513d6-0d42-4910-930e-dc6a4ab36ff7?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvcm9sZXMvaW90LTEvb3BlcmF0aW9uUmVzdWx0cy85YTU1MTNkNi0wZDQyLTQ5MTAtOTMwZS1kYzZhNGFiMzZmZjc/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "cd2e659d-396a-4c2b-bf7e-ea23dfeffa4d" + ], + "x-ms-client-request-id": [ + "c8ab8edd-8a7e-465b-a0d2-0809741ad2c0" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11974" + ], + "x-ms-correlation-request-id": [ + "ff1c6764-516a-4520-b8ab-4e661017eeec" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T104031Z:ff1c6764-516a-4520-b8ab-4e661017eeec" + ], + "Date": [ + "Thu, 05 Dec 2019 10:40:30 GMT" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "", + "StatusCode": 204 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/roles/iot-1/operationResults/b3249f1c-82d8-44df-b720-1753dd921598?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvcm9sZXMvaW90LTEvb3BlcmF0aW9uUmVzdWx0cy9iMzI0OWYxYy04MmQ4LTQ0ZGYtYjcyMC0xNzUzZGQ5MjE1OTg/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/roles/iot-1?api-version=2019-08-01" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "e15e091c-ad45-42b8-a2a1-2b430f3624fe" + ], + "x-ms-client-request-id": [ + "881cb949-9cd1-4d34-ab13-a6c52c057760" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11972" + ], + "x-ms-correlation-request-id": [ + "3734b8d2-fe98-4e5d-b79b-bf9a86f1e032" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T104103Z:3734b8d2-fe98-4e5d-b79b-bf9a86f1e032" + ], + "Date": [ + "Thu, 05 Dec 2019 10:41:03 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "db4e2fdb-6d80-4e6e-b7cd-736098270664", + "SubId": "db4e2fdb-6d80-4e6e-b7cd-736098270664" + } +} \ No newline at end of file diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/ShareTests/Test_RefreshShare.json b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/ShareTests/Test_RefreshShare.json new file mode 100644 index 0000000000000..26d20b97c14e2 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/ShareTests/Test_RefreshShare.json @@ -0,0 +1,441 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/shares/nfs1/refresh?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc2hhcmVzL25mczEvcmVmcmVzaD9hcGktdmVyc2lvbj0yMDE5LTA4LTAx", + "RequestMethod": "POST", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "ca4e531d-1999-4adf-8c78-443922e62bae" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/shares/nfs1/operationResults/25a3ae3c-75d0-402c-b52c-8b6fa31feeaa?api-version=2019-08-01" + ], + "Retry-After": [ + "30" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "3292884c-8441-46bf-8925-5b7731a5ef97" + ], + "x-ms-client-request-id": [ + "ca4e531d-1999-4adf-8c78-443922e62bae" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-correlation-request-id": [ + "326f5461-bf4a-4397-8da3-4ae5b1c9d586" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T101016Z:326f5461-bf4a-4397-8da3-4ae5b1c9d586" + ], + "Date": [ + "Thu, 05 Dec 2019 10:10:16 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/shares/nfs1/operationResults/25a3ae3c-75d0-402c-b52c-8b6fa31feeaa?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc2hhcmVzL25mczEvb3BlcmF0aW9uUmVzdWx0cy8yNWEzYWUzYy03NWQwLTQwMmMtYjUyYy04YjZmYTMxZmVlYWE/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/shares/nfs1/operationResults/25a3ae3c-75d0-402c-b52c-8b6fa31feeaa?api-version=2019-08-01" + ], + "Retry-After": [ + "10" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/operationsStatus/25a3ae3c-75d0-402c-b52c-8b6fa31feeaa?api-version=2019-03-01" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "bb6a64c6-0784-4b0e-bc9a-3a4451b383b2" + ], + "x-ms-client-request-id": [ + "80bf6bf8-520c-4aa9-bf31-d70e5310e8ea" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11992" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-correlation-request-id": [ + "b0cbf3b0-76ae-44b1-9971-9ce0a79e4c50" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T101047Z:b0cbf3b0-76ae-44b1-9971-9ce0a79e4c50" + ], + "Date": [ + "Thu, 05 Dec 2019 10:10:46 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/shares/nfs1/operationResults/25a3ae3c-75d0-402c-b52c-8b6fa31feeaa?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc2hhcmVzL25mczEvb3BlcmF0aW9uUmVzdWx0cy8yNWEzYWUzYy03NWQwLTQwMmMtYjUyYy04YjZmYTMxZmVlYWE/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Azure-AsyncOperation": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/operationsStatus/25a3ae3c-75d0-402c-b52c-8b6fa31feeaa?api-version=2019-03-01" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "64c7c8ef-6ec4-4afc-9fde-287532f3237f" + ], + "x-ms-client-request-id": [ + "6f0a46e1-e671-4309-bfe7-6be1b44d5cfb" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11987" + ], + "x-ms-correlation-request-id": [ + "49da55f6-ddf5-4164-8270-24b1107ba93c" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T101130Z:49da55f6-ddf5-4164-8270-24b1107ba93c" + ], + "Date": [ + "Thu, 05 Dec 2019 10:11:30 GMT" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "", + "StatusCode": 204 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/operationsStatus/25a3ae3c-75d0-402c-b52c-8b6fa31feeaa?api-version=2019-03-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvb3BlcmF0aW9uc1N0YXR1cy8yNWEzYWUzYy03NWQwLTQwMmMtYjUyYy04YjZmYTMxZmVlYWE/YXBpLXZlcnNpb249MjAxOS0wMy0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "a46f27d8-e435-43e3-b563-3fd42ef8328a" + ], + "x-ms-client-request-id": [ + "c3d129f1-4e4b-43cf-9df3-4a3ca9d5c2ef" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11991" + ], + "x-ms-correlation-request-id": [ + "ba84293f-12e5-4843-9144-da8b145ced7d" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T101059Z:ba84293f-12e5-4843-9144-da8b145ced7d" + ], + "Date": [ + "Thu, 05 Dec 2019 10:10:59 GMT" + ], + "Content-Length": [ + "737" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/operationsStatus/25a3ae3c-75d0-402c-b52c-8b6fa31feeaa\",\r\n \"name\": \"25a3ae3c-75d0-402c-b52c-8b6fa31feeaa\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/jobs\",\r\n \"status\": \"Running\",\r\n \"startTime\": \"2019-12-05T10:10:20Z\",\r\n \"percentComplete\": 0,\r\n \"properties\": {\r\n \"jobType\": \"RefreshShare\",\r\n \"currentStage\": \"Unknown\",\r\n \"totalRefreshErrors\": 0,\r\n \"shareId\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/shares/nfs1\",\r\n \"folder\": \"\"\r\n }\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/operationsStatus/25a3ae3c-75d0-402c-b52c-8b6fa31feeaa?api-version=2019-03-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvb3BlcmF0aW9uc1N0YXR1cy8yNWEzYWUzYy03NWQwLTQwMmMtYjUyYy04YjZmYTMxZmVlYWE/YXBpLXZlcnNpb249MjAxOS0wMy0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "59c9c299-d3ed-4df2-9902-f613d6f96a75" + ], + "x-ms-client-request-id": [ + "391a6bbd-95aa-4678-bf03-67983197c783" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11990" + ], + "x-ms-correlation-request-id": [ + "3e3a83d2-0c52-407b-979a-2c61f67cecba" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T101109Z:3e3a83d2-0c52-407b-979a-2c61f67cecba" + ], + "Date": [ + "Thu, 05 Dec 2019 10:11:09 GMT" + ], + "Content-Length": [ + "737" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/operationsStatus/25a3ae3c-75d0-402c-b52c-8b6fa31feeaa\",\r\n \"name\": \"25a3ae3c-75d0-402c-b52c-8b6fa31feeaa\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/jobs\",\r\n \"status\": \"Running\",\r\n \"startTime\": \"2019-12-05T10:10:20Z\",\r\n \"percentComplete\": 0,\r\n \"properties\": {\r\n \"jobType\": \"RefreshShare\",\r\n \"currentStage\": \"Unknown\",\r\n \"totalRefreshErrors\": 0,\r\n \"shareId\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/shares/nfs1\",\r\n \"folder\": \"\"\r\n }\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/operationsStatus/25a3ae3c-75d0-402c-b52c-8b6fa31feeaa?api-version=2019-03-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvb3BlcmF0aW9uc1N0YXR1cy8yNWEzYWUzYy03NWQwLTQwMmMtYjUyYy04YjZmYTMxZmVlYWE/YXBpLXZlcnNpb249MjAxOS0wMy0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "eeb89efd-2712-44f3-9f31-a6394b081897" + ], + "x-ms-client-request-id": [ + "9cb03d48-a94e-4e5a-bf68-9bd66e25a4a3" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11989" + ], + "x-ms-correlation-request-id": [ + "778f1288-4b20-4186-b8e6-0bb5946d3e3d" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T101120Z:778f1288-4b20-4186-b8e6-0bb5946d3e3d" + ], + "Date": [ + "Thu, 05 Dec 2019 10:11:19 GMT" + ], + "Content-Length": [ + "737" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/operationsStatus/25a3ae3c-75d0-402c-b52c-8b6fa31feeaa\",\r\n \"name\": \"25a3ae3c-75d0-402c-b52c-8b6fa31feeaa\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/jobs\",\r\n \"status\": \"Running\",\r\n \"startTime\": \"2019-12-05T10:10:20Z\",\r\n \"percentComplete\": 0,\r\n \"properties\": {\r\n \"jobType\": \"RefreshShare\",\r\n \"currentStage\": \"Unknown\",\r\n \"totalRefreshErrors\": 0,\r\n \"shareId\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/shares/nfs1\",\r\n \"folder\": \"\"\r\n }\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/operationsStatus/25a3ae3c-75d0-402c-b52c-8b6fa31feeaa?api-version=2019-03-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvb3BlcmF0aW9uc1N0YXR1cy8yNWEzYWUzYy03NWQwLTQwMmMtYjUyYy04YjZmYTMxZmVlYWE/YXBpLXZlcnNpb249MjAxOS0wMy0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "6961ea4f-aba7-4f69-ac8e-1aa5a7e0d653" + ], + "x-ms-client-request-id": [ + "56d60a85-96d7-4cb3-82df-92a9eebce180" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11988" + ], + "x-ms-correlation-request-id": [ + "ceb21627-db65-41a0-9c45-cd7a2270cd4a" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T101130Z:ceb21627-db65-41a0-9c45-cd7a2270cd4a" + ], + "Date": [ + "Thu, 05 Dec 2019 10:11:29 GMT" + ], + "Content-Length": [ + "857" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/operationsStatus/25a3ae3c-75d0-402c-b52c-8b6fa31feeaa\",\r\n \"name\": \"25a3ae3c-75d0-402c-b52c-8b6fa31feeaa\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/jobs\",\r\n \"status\": \"Succeeded\",\r\n \"startTime\": \"2019-12-05T10:10:20Z\",\r\n \"endTime\": \"2019-12-05T10:15:20Z\",\r\n \"percentComplete\": 100,\r\n \"properties\": {\r\n \"jobType\": \"RefreshShare\",\r\n \"currentStage\": \"Unknown\",\r\n \"totalRefreshErrors\": 0,\r\n \"errorManifestFile\": \"__Microsoft Data Box Edge__\\\\Refresh\\\\Errors.xml\",\r\n \"shareId\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/shares/nfs1\",\r\n \"folder\": \"\"\r\n }\r\n}", + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "db4e2fdb-6d80-4e6e-b7cd-736098270664", + "SubId": "db4e2fdb-6d80-4e6e-b7cd-736098270664" + } +} \ No newline at end of file diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/ShareTests/Test_ShareOperations.json b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/ShareTests/Test_ShareOperations.json new file mode 100644 index 0000000000000..ca62c01e18889 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/ShareTests/Test_ShareOperations.json @@ -0,0 +1,1035 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/users/user1?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2UvdXNlcnMvdXNlcjE/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "51453c61-3597-4738-8244-e855cbb77ef0" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "5a3c2c68-839b-40c7-a66f-d109ffb50f9d" + ], + "x-ms-client-request-id": [ + "51453c61-3597-4738-8244-e855cbb77ef0" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11999" + ], + "x-ms-correlation-request-id": [ + "241b12fa-b091-4d81-bffe-81352c8499c4" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T104146Z:241b12fa-b091-4d81-bffe-81352c8499c4" + ], + "Date": [ + "Thu, 05 Dec 2019 10:41:46 GMT" + ], + "Content-Length": [ + "579" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"shareAccessRights\": [\r\n {\r\n \"shareId\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/shares/smb1\",\r\n \"accessType\": \"Change\"\r\n }\r\n ],\r\n \"userType\": \"Share\"\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/users/user1\",\r\n \"name\": \"user1\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/users\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccountCredentials/databoxedgeutdst?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc3RvcmFnZUFjY291bnRDcmVkZW50aWFscy9kYXRhYm94ZWRnZXV0ZHN0P2FwaS12ZXJzaW9uPTIwMTktMDgtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "f5337464-f5f0-40b5-9523-9bbc82c43e63" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "16079e99-b2a0-4c02-a284-806ee7f891f0" + ], + "x-ms-client-request-id": [ + "f5337464-f5f0-40b5-9523-9bbc82c43e63" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11998" + ], + "x-ms-correlation-request-id": [ + "ce32cebd-86e8-4bde-9b63-3b313f596db5" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T104147Z:ce32cebd-86e8-4bde-9b63-3b313f596db5" + ], + "Date": [ + "Thu, 05 Dec 2019 10:41:46 GMT" + ], + "Content-Length": [ + "480" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"alias\": \"databoxedgeutdst\",\r\n \"userName\": \"databoxedgeutdst\",\r\n \"sslStatus\": \"Disabled\",\r\n \"accountType\": \"BlobStorage\"\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccountCredentials/databoxedgeutdst\",\r\n \"name\": \"databoxedgeutdst\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/storageAccountCredentials\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/shares/smb1?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc2hhcmVzL3NtYjE/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"shareStatus\": \"OK\",\r\n \"monitoringStatus\": \"Enabled\",\r\n \"azureContainerInfo\": {\r\n \"storageAccountCredentialId\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccountCredentials/databoxedgeutdst\",\r\n \"containerName\": \"testContainersmb\",\r\n \"dataFormat\": \"BlockBlob\"\r\n },\r\n \"accessProtocol\": \"SMB\",\r\n \"userAccessRights\": [\r\n {\r\n \"userId\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/users/user1\",\r\n \"accessType\": \"Change\"\r\n }\r\n ],\r\n \"dataPolicy\": \"Cloud\"\r\n }\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "c78f58a5-081d-4049-9fa9-c4573aa03ae9" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "763" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/shares/smb1/operationResults/862411c9-bed5-4299-ade3-6e144591213a?api-version=2019-08-01" + ], + "Retry-After": [ + "30" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "9c626884-6cdb-4a7f-a701-121ceb7b3ab2" + ], + "x-ms-client-request-id": [ + "c78f58a5-081d-4049-9fa9-c4573aa03ae9" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-correlation-request-id": [ + "ab974725-f736-4068-ac4b-445c1f942cf1" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T104148Z:ab974725-f736-4068-ac4b-445c1f942cf1" + ], + "Date": [ + "Thu, 05 Dec 2019 10:41:47 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/shares/smb1/operationResults/862411c9-bed5-4299-ade3-6e144591213a?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc2hhcmVzL3NtYjEvb3BlcmF0aW9uUmVzdWx0cy84NjI0MTFjOS1iZWQ1LTQyOTktYWRlMy02ZTE0NDU5MTIxM2E/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/shares/smb1?api-version=2019-08-01" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "eb7d0913-8c71-4078-b982-b416b0f72383" + ], + "x-ms-client-request-id": [ + "aa111b8c-7f80-481a-a72a-41e35bf9a4b9" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11997" + ], + "x-ms-correlation-request-id": [ + "837ab19a-cce6-4bf8-baef-bb85af87a420" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T104218Z:837ab19a-cce6-4bf8-baef-bb85af87a420" + ], + "Date": [ + "Thu, 05 Dec 2019 10:42:17 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/shares/smb1?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc2hhcmVzL3NtYjE/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "00e285d9-0de8-4804-940b-1251f822155c" + ], + "x-ms-client-request-id": [ + "ef361865-944a-4653-ad28-c521bc5a5c56" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11996" + ], + "x-ms-correlation-request-id": [ + "e069e8dc-bdf4-43e7-a00b-26d528bfb81b" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T104250Z:e069e8dc-bdf4-43e7-a00b-26d528bfb81b" + ], + "Date": [ + "Thu, 05 Dec 2019 10:42:50 GMT" + ], + "Content-Length": [ + "1102" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"shareStatus\": \"OK\",\r\n \"monitoringStatus\": \"Enabled\",\r\n \"azureContainerInfo\": {\r\n \"storageAccountCredentialId\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccountCredentials/databoxedgeutdst\",\r\n \"containerName\": \"testContainersmb\",\r\n \"dataFormat\": \"BlockBlob\"\r\n },\r\n \"accessProtocol\": \"SMB\",\r\n \"userAccessRights\": [\r\n {\r\n \"userId\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/users/user1\",\r\n \"accessType\": \"Change\"\r\n }\r\n ],\r\n \"clientAccessRights\": [],\r\n \"refreshDetails\": {},\r\n \"shareMappings\": [],\r\n \"dataPolicy\": \"Cloud\"\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/shares/smb1\",\r\n \"name\": \"smb1\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/shares\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/shares/smb1?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc2hhcmVzL3NtYjE/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "c6bdf2f1-b830-4722-9ee6-2b24629ba4f0" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "09e2b7f9-cc1f-47dd-aa95-b6590a49bc90" + ], + "x-ms-client-request-id": [ + "c6bdf2f1-b830-4722-9ee6-2b24629ba4f0" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11991" + ], + "x-ms-correlation-request-id": [ + "5be77e80-eb09-4332-83bd-991ab05ef7ef" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T104457Z:5be77e80-eb09-4332-83bd-991ab05ef7ef" + ], + "Date": [ + "Thu, 05 Dec 2019 10:44:56 GMT" + ], + "Content-Length": [ + "1102" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"shareStatus\": \"OK\",\r\n \"monitoringStatus\": \"Enabled\",\r\n \"azureContainerInfo\": {\r\n \"storageAccountCredentialId\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccountCredentials/databoxedgeutdst\",\r\n \"containerName\": \"testContainersmb\",\r\n \"dataFormat\": \"BlockBlob\"\r\n },\r\n \"accessProtocol\": \"SMB\",\r\n \"userAccessRights\": [\r\n {\r\n \"userId\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/users/user1\",\r\n \"accessType\": \"Change\"\r\n }\r\n ],\r\n \"clientAccessRights\": [],\r\n \"refreshDetails\": {},\r\n \"shareMappings\": [],\r\n \"dataPolicy\": \"Cloud\"\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/shares/smb1\",\r\n \"name\": \"smb1\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/shares\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/shares/nfs1?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc2hhcmVzL25mczE/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"shareStatus\": \"OK\",\r\n \"monitoringStatus\": \"Enabled\",\r\n \"azureContainerInfo\": {\r\n \"storageAccountCredentialId\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccountCredentials/databoxedgeutdst\",\r\n \"containerName\": \"testContainernfs\",\r\n \"dataFormat\": \"BlockBlob\"\r\n },\r\n \"accessProtocol\": \"NFS\",\r\n \"clientAccessRights\": [\r\n {\r\n \"client\": \"10.150.76.81\",\r\n \"accessPermission\": \"ReadWrite\"\r\n }\r\n ],\r\n \"dataPolicy\": \"Cloud\"\r\n }\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "8e255b10-fde9-4d0f-8e72-97c58c65e6f5" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "625" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/shares/nfs1/operationResults/cef4fde2-1ef9-4d84-869a-860d011d276a?api-version=2019-08-01" + ], + "Retry-After": [ + "30" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "26ba98d6-d7ee-40d7-ba50-14398458257c" + ], + "x-ms-client-request-id": [ + "8e255b10-fde9-4d0f-8e72-97c58c65e6f5" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1198" + ], + "x-ms-correlation-request-id": [ + "f137665d-2164-494e-acca-69f2e7bec9a1" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T104251Z:f137665d-2164-494e-acca-69f2e7bec9a1" + ], + "Date": [ + "Thu, 05 Dec 2019 10:42:51 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/shares/nfs1/operationResults/cef4fde2-1ef9-4d84-869a-860d011d276a?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc2hhcmVzL25mczEvb3BlcmF0aW9uUmVzdWx0cy9jZWY0ZmRlMi0xZWY5LTRkODQtODY5YS04NjBkMDExZDI3NmE/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/shares/nfs1?api-version=2019-08-01" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "f819ec86-2ae0-4d91-988e-9797b8921f63" + ], + "x-ms-client-request-id": [ + "c5239ceb-dcf3-4a21-91ce-6924061a9172" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11995" + ], + "x-ms-correlation-request-id": [ + "509ae1d2-42a4-4026-adeb-0bc452b671e9" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T104322Z:509ae1d2-42a4-4026-adeb-0bc452b671e9" + ], + "Date": [ + "Thu, 05 Dec 2019 10:43:21 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/shares/nfs1?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc2hhcmVzL25mczE/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "b831a145-9533-46de-91da-c4c78f21fd57" + ], + "x-ms-client-request-id": [ + "2c381ad8-434d-4695-bfc6-0a03b03d8034" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11994" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-correlation-request-id": [ + "996cbb5d-ac90-4db3-9a52-417e0cd88b5b" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T104352Z:996cbb5d-ac90-4db3-9a52-417e0cd88b5b" + ], + "Date": [ + "Thu, 05 Dec 2019 10:43:51 GMT" + ], + "Content-Length": [ + "1327" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"shareStatus\": \"OK\",\r\n \"monitoringStatus\": \"Enabled\",\r\n \"azureContainerInfo\": {\r\n \"storageAccountCredentialId\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccountCredentials/databoxedgeutdst\",\r\n \"containerName\": \"testContainernfs\",\r\n \"dataFormat\": \"BlockBlob\"\r\n },\r\n \"accessProtocol\": \"NFS\",\r\n \"userAccessRights\": [],\r\n \"clientAccessRights\": [\r\n {\r\n \"client\": \"10.150.76.81\",\r\n \"accessPermission\": \"ReadWrite\"\r\n }\r\n ],\r\n \"refreshDetails\": {\r\n \"lastCompletedRefreshJobTimeInUTC\": \"2019-12-05T10:15:20Z\",\r\n \"errorManifestFile\": \"__Microsoft Data Box Edge__\\\\Refresh\\\\Errors.xml\",\r\n \"lastJob\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/jobs/21c943d6-82f8-442a-bc85-262edf8ed411\"\r\n },\r\n \"shareMappings\": [],\r\n \"dataPolicy\": \"Cloud\"\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/shares/nfs1\",\r\n \"name\": \"nfs1\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/shares\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/shares/localshare?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc2hhcmVzL2xvY2Fsc2hhcmU/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"shareStatus\": \"OK\",\r\n \"monitoringStatus\": \"Enabled\",\r\n \"accessProtocol\": \"NFS\",\r\n \"clientAccessRights\": [\r\n {\r\n \"client\": \"10.150.76.81\",\r\n \"accessPermission\": \"ReadWrite\"\r\n }\r\n ],\r\n \"dataPolicy\": \"Local\"\r\n }\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "9c896718-c394-4d0c-b636-1452fdb52430" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "278" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/shares/localshare/operationResults/4333a6ce-8684-4a72-8bff-2b694eb74a29?api-version=2019-08-01" + ], + "Retry-After": [ + "30" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "211d8825-96a7-47c7-babe-401f1ae295b3" + ], + "x-ms-client-request-id": [ + "9c896718-c394-4d0c-b636-1452fdb52430" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1197" + ], + "x-ms-correlation-request-id": [ + "34a81166-8d05-4e0c-8cd5-355bd09cde41" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T104354Z:34a81166-8d05-4e0c-8cd5-355bd09cde41" + ], + "Date": [ + "Thu, 05 Dec 2019 10:43:53 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/shares/localshare/operationResults/4333a6ce-8684-4a72-8bff-2b694eb74a29?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc2hhcmVzL2xvY2Fsc2hhcmUvb3BlcmF0aW9uUmVzdWx0cy80MzMzYTZjZS04Njg0LTRhNzItOGJmZi0yYjY5NGViNzRhMjk/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/shares/localshare?api-version=2019-08-01" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "bdff19ec-af6a-4993-9dce-efc61d6ebbd2" + ], + "x-ms-client-request-id": [ + "67a23b9e-801e-4754-bfb6-ec9838e90ba2" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11993" + ], + "x-ms-correlation-request-id": [ + "795b2b13-3cc0-4d99-a8ae-dbfc8df4c96c" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T104424Z:795b2b13-3cc0-4d99-a8ae-dbfc8df4c96c" + ], + "Date": [ + "Thu, 05 Dec 2019 10:44:24 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/shares/localshare?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc2hhcmVzL2xvY2Fsc2hhcmU/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "f2cc321d-f117-42c0-a76e-550476945724" + ], + "x-ms-client-request-id": [ + "2df997ec-879b-4e2b-a502-88bf1cc5dfd0" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11992" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-correlation-request-id": [ + "63dc9be2-84a3-4ce2-9a3a-b1620791dcf0" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T104455Z:63dc9be2-84a3-4ce2-9a3a-b1620791dcf0" + ], + "Date": [ + "Thu, 05 Dec 2019 10:44:54 GMT" + ], + "Content-Length": [ + "627" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"shareStatus\": \"OK\",\r\n \"monitoringStatus\": \"Enabled\",\r\n \"accessProtocol\": \"NFS\",\r\n \"userAccessRights\": [],\r\n \"clientAccessRights\": [\r\n {\r\n \"client\": \"10.150.76.81\",\r\n \"accessPermission\": \"ReadWrite\"\r\n }\r\n ],\r\n \"refreshDetails\": {},\r\n \"shareMappings\": [],\r\n \"dataPolicy\": \"Local\"\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/shares/localshare\",\r\n \"name\": \"localshare\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/shares\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/shares?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc2hhcmVzP2FwaS12ZXJzaW9uPTIwMTktMDgtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "b8e4588d-31ac-425c-9d50-d3fcf9d13ae4" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "05682b0a-789f-4a04-8a45-536393b260b5" + ], + "x-ms-client-request-id": [ + "b8e4588d-31ac-425c-9d50-d3fcf9d13ae4" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11990" + ], + "x-ms-correlation-request-id": [ + "56e275b1-c246-4ac8-be4d-d7353ac18d9c" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T104457Z:56e275b1-c246-4ac8-be4d-d7353ac18d9c" + ], + "Date": [ + "Thu, 05 Dec 2019 10:44:57 GMT" + ], + "Content-Length": [ + "3383" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"properties\": {\r\n \"shareStatus\": \"OK\",\r\n \"monitoringStatus\": \"Enabled\",\r\n \"azureContainerInfo\": {\r\n \"storageAccountCredentialId\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccountCredentials/databoxedgeutdst\",\r\n \"containerName\": \"testContainernfs\",\r\n \"dataFormat\": \"BlockBlob\"\r\n },\r\n \"accessProtocol\": \"NFS\",\r\n \"userAccessRights\": [],\r\n \"clientAccessRights\": [\r\n {\r\n \"client\": \"10.150.76.81\",\r\n \"accessPermission\": \"ReadWrite\"\r\n }\r\n ],\r\n \"refreshDetails\": {\r\n \"lastCompletedRefreshJobTimeInUTC\": \"2019-12-05T10:15:20Z\",\r\n \"errorManifestFile\": \"__Microsoft Data Box Edge__\\\\Refresh\\\\Errors.xml\",\r\n \"lastJob\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/jobs/21c943d6-82f8-442a-bc85-262edf8ed411\"\r\n },\r\n \"shareMappings\": [],\r\n \"dataPolicy\": \"Cloud\"\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/shares/nfs1\",\r\n \"name\": \"nfs1\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/shares\"\r\n },\r\n {\r\n \"properties\": {\r\n \"shareStatus\": \"OK\",\r\n \"monitoringStatus\": \"Enabled\",\r\n \"accessProtocol\": \"NFS\",\r\n \"userAccessRights\": [],\r\n \"clientAccessRights\": [\r\n {\r\n \"client\": \"10.150.76.81\",\r\n \"accessPermission\": \"ReadWrite\"\r\n }\r\n ],\r\n \"refreshDetails\": {},\r\n \"shareMappings\": [],\r\n \"dataPolicy\": \"Local\"\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/shares/localshare\",\r\n \"name\": \"localshare\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/shares\"\r\n },\r\n {\r\n \"properties\": {\r\n \"shareStatus\": \"OK\",\r\n \"monitoringStatus\": \"Enabled\",\r\n \"azureContainerInfo\": {\r\n \"storageAccountCredentialId\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccountCredentials/databoxedgeutdst\",\r\n \"containerName\": \"testContainersmb\",\r\n \"dataFormat\": \"BlockBlob\"\r\n },\r\n \"accessProtocol\": \"SMB\",\r\n \"userAccessRights\": [\r\n {\r\n \"userId\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/users/user1\",\r\n \"accessType\": \"Change\"\r\n }\r\n ],\r\n \"clientAccessRights\": [],\r\n \"refreshDetails\": {},\r\n \"shareMappings\": [],\r\n \"dataPolicy\": \"Cloud\"\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/shares/smb1\",\r\n \"name\": \"smb1\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/shares\"\r\n }\r\n ]\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/shares/smb1?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc2hhcmVzL3NtYjE/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "49c4824d-74f3-4ea5-9196-e38a7029d2d5" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/shares/smb1/operationResults/8a22f56b-fd91-4a55-b3d4-d0def1b96d93?api-version=2019-08-01" + ], + "Retry-After": [ + "30" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "2586212e-6a28-47b3-9ce9-a0bcb145febd" + ], + "x-ms-client-request-id": [ + "49c4824d-74f3-4ea5-9196-e38a7029d2d5" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-deletes": [ + "14999" + ], + "x-ms-correlation-request-id": [ + "fc659a4c-14c0-44f2-ba34-c47b227a4ebf" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T104458Z:fc659a4c-14c0-44f2-ba34-c47b227a4ebf" + ], + "Date": [ + "Thu, 05 Dec 2019 10:44:57 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/shares/smb1/operationResults/8a22f56b-fd91-4a55-b3d4-d0def1b96d93?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc2hhcmVzL3NtYjEvb3BlcmF0aW9uUmVzdWx0cy84YTIyZjU2Yi1mZDkxLTRhNTUtYjNkNC1kMGRlZjFiOTZkOTM/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "a37bd539-d7aa-4c02-836c-c23d7fe1b20d" + ], + "x-ms-client-request-id": [ + "c0063895-c4ce-4b32-8a52-d270bff259c3" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11989" + ], + "x-ms-correlation-request-id": [ + "7d6e22cc-8358-49c1-9558-7dd723cf17c4" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T104529Z:7d6e22cc-8358-49c1-9558-7dd723cf17c4" + ], + "Date": [ + "Thu, 05 Dec 2019 10:45:29 GMT" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "", + "StatusCode": 204 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/shares/smb1/operationResults/8a22f56b-fd91-4a55-b3d4-d0def1b96d93?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc2hhcmVzL3NtYjEvb3BlcmF0aW9uUmVzdWx0cy84YTIyZjU2Yi1mZDkxLTRhNTUtYjNkNC1kMGRlZjFiOTZkOTM/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "4ca851c9-f91a-442c-ae8e-8760bbec1ffe" + ], + "x-ms-client-request-id": [ + "acc53786-d911-4ed1-9929-cbc7caedc590" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11988" + ], + "x-ms-correlation-request-id": [ + "cca995f7-d082-45e1-b0dd-044f7123451e" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T104529Z:cca995f7-d082-45e1-b0dd-044f7123451e" + ], + "Date": [ + "Thu, 05 Dec 2019 10:45:29 GMT" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "", + "StatusCode": 204 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "db4e2fdb-6d80-4e6e-b7cd-736098270664", + "SubId": "db4e2fdb-6d80-4e6e-b7cd-736098270664" + } +} \ No newline at end of file diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/SkuTests/Test_ListSku.json b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/SkuTests/Test_ListSku.json new file mode 100644 index 0000000000000..2e2c7536a4ce4 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/SkuTests/Test_ListSku.json @@ -0,0 +1,69 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/providers/Microsoft.DataBoxEdge/skus?api-version=2019-08-01&$filter=location%20eq%20%27centraluseuap%27", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2Uvc2t1cz9hcGktdmVyc2lvbj0yMDE5LTA4LTAxJiRmaWx0ZXI9bG9jYXRpb24lMjBlcSUyMCUyN2NlbnRyYWx1c2V1YXAlMjc=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "46ac1ef9-cac0-4e8a-a65a-88cf7fcdbc1c" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11999" + ], + "x-ms-request-id": [ + "fe252dfb-3648-4bb1-94ac-058485ec4a1e" + ], + "x-ms-correlation-request-id": [ + "fe252dfb-3648-4bb1-94ac-058485ec4a1e" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T091720Z:fe252dfb-3648-4bb1-94ac-058485ec4a1e" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Thu, 05 Dec 2019 09:17:19 GMT" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "1649" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"resourceType\": \"dataBoxEdgeDevices\",\r\n \"name\": \"Edge\",\r\n \"locations\": [\r\n \"centraluseuap\"\r\n ],\r\n \"locationInfo\": [\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"zones\": [],\r\n \"zoneDetails\": []\r\n }\r\n ],\r\n \"restrictions\": []\r\n },\r\n {\r\n \"resourceType\": \"dataBoxEdgeDevices\",\r\n \"name\": \"Gateway\",\r\n \"locations\": [\r\n \"centraluseuap\"\r\n ],\r\n \"locationInfo\": [\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"zones\": [],\r\n \"zoneDetails\": []\r\n }\r\n ],\r\n \"restrictions\": []\r\n },\r\n {\r\n \"resourceType\": \"dataBoxEdgeDevices\",\r\n \"name\": \"TEA_1Node\",\r\n \"locations\": [\r\n \"centraluseuap\"\r\n ],\r\n \"locationInfo\": [\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"zones\": [],\r\n \"zoneDetails\": []\r\n }\r\n ],\r\n \"restrictions\": []\r\n },\r\n {\r\n \"resourceType\": \"dataBoxEdgeDevices\",\r\n \"name\": \"TEA_1Node_Heater\",\r\n \"locations\": [\r\n \"centraluseuap\"\r\n ],\r\n \"locationInfo\": [\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"zones\": [],\r\n \"zoneDetails\": []\r\n }\r\n ],\r\n \"restrictions\": []\r\n },\r\n {\r\n \"resourceType\": \"dataBoxEdgeDevices\",\r\n \"name\": \"TEA_1Node_UPS\",\r\n \"locations\": [\r\n \"centraluseuap\"\r\n ],\r\n \"locationInfo\": [\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"zones\": [],\r\n \"zoneDetails\": []\r\n }\r\n ],\r\n \"restrictions\": []\r\n },\r\n {\r\n \"resourceType\": \"dataBoxEdgeDevices\",\r\n \"name\": \"TEA_1Node_UPS_Heater\",\r\n \"locations\": [\r\n \"centraluseuap\"\r\n ],\r\n \"locationInfo\": [\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"zones\": [],\r\n \"zoneDetails\": []\r\n }\r\n ],\r\n \"restrictions\": []\r\n },\r\n {\r\n \"resourceType\": \"dataBoxEdgeDevices\",\r\n \"name\": \"TEA_4Node_Heater\",\r\n \"locations\": [\r\n \"centraluseuap\"\r\n ],\r\n \"locationInfo\": [\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"zones\": [],\r\n \"zoneDetails\": []\r\n }\r\n ],\r\n \"restrictions\": []\r\n },\r\n {\r\n \"resourceType\": \"dataBoxEdgeDevices\",\r\n \"name\": \"TEA_4Node_UPS_Heater\",\r\n \"locations\": [\r\n \"centraluseuap\"\r\n ],\r\n \"locationInfo\": [\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"zones\": [],\r\n \"zoneDetails\": []\r\n }\r\n ],\r\n \"restrictions\": []\r\n },\r\n {\r\n \"resourceType\": \"dataBoxEdgeDevices\",\r\n \"name\": \"TMA\",\r\n \"locations\": [\r\n \"centraluseuap\"\r\n ],\r\n \"locationInfo\": [\r\n {\r\n \"location\": \"centraluseuap\",\r\n \"zones\": [],\r\n \"zoneDetails\": []\r\n }\r\n ],\r\n \"restrictions\": []\r\n }\r\n ]\r\n}", + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "db4e2fdb-6d80-4e6e-b7cd-736098270664", + "SubId": "db4e2fdb-6d80-4e6e-b7cd-736098270664" + } +} \ No newline at end of file diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/StorageAccountCredentialsTests/Test_SACManagement.json b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/StorageAccountCredentialsTests/Test_SACManagement.json new file mode 100644 index 0000000000000..d3e7cf509e667 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/StorageAccountCredentialsTests/Test_SACManagement.json @@ -0,0 +1,774 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/getExtendedInformation?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2UvZ2V0RXh0ZW5kZWRJbmZvcm1hdGlvbj9hcGktdmVyc2lvbj0yMDE5LTA4LTAx", + "RequestMethod": "POST", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "fe65c4ca-bda5-4d8b-b6ee-537632935808" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "df4daf7b-9552-4692-afe9-e3aea8e2403c" + ], + "x-ms-client-request-id": [ + "fe65c4ca-bda5-4d8b-b6ee-537632935808" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-correlation-request-id": [ + "8034e34f-08b9-4e7e-b251-5dfccd742df2" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T094817Z:8034e34f-08b9-4e7e-b251-5dfccd742df2" + ], + "Date": [ + "Thu, 05 Dec 2019 09:48:16 GMT" + ], + "Content-Length": [ + "1964" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"encryptionKeyThumbprint\": \"FF27EF016674E5A2801B50362ACE4E82E43CBE0E\",\r\n \"encryptionKey\": \"EAAAAOmCAAaQPDb4mYfmhZccBg06QaeYEPS6knXaQITR/GLP9fhpNGvj8PhFr4k/8sZ16sLrNIlzHqIO5ZLqeiAar3pk/W0yBOeTKPRiLkKJ6p1+NoJ3ynpwTfkH3fLf+5/r8j7utB6KnOtGqMXISyACXf3MiNsjqEUV6OkGiv6SuQifo5UTFnifb9XFKNkGfx30epdwSL4+DO79U+gIjZtWm1c0q0D7l1M7d2CEV1HRMX6L3csU9z2qbY/GS5tDcITb2F+LXvKbMIjKklKjaHPWDB2bGd+RQg3sq+JhL5BK8/YeM0cpqLmkEDwnjSaRIl2StJYvQdl1QwPYx7EzO172h/7U6ZhMtatI1543tOTEc8ytJtVFt5i/mtq3Q2xUX92YoRQShqe1m+LZGsmuBSCOTA4OIXDN2BFNYUcExo8m6ZLUlFlbyK5ILNm6gvzdQ3L59fy4FRSFzuCmCEg2XvjZ2E+tml30zGg4cZO9TIcxUcDRn8Ij3ItUseXCKWxNsjHNqZb6h3qAotYjqAhFRHkeeD1IsleGVd5Ws1P05f/IvKZrPEkvOFuHzkR/BlUYuyvq84GbbCe3GyEMue09HytXgVCLKl7yQjCalHICRnIcBfSs4+niQAF5Y3NaUU1VKtDcumvXZT/pZfVyJl+qvDPipicp9Yd1Hk7zCv+i0SO5G1wsep1Mnsj8reApWzKs604zx6qtpQLXQBva0IsGtad+j9KcNd8kSk/o7jBvCp7ckK+3yxxD6yxsXzToZysO+DnCvfEbWVyboqLFnO6QEhw1aDr0m3LHZIXOJ0/00VrOEosC4FcNYaz126gvWPzyTk/wj5GwWOaU1SFHVESCc54j/jMmmr0+8V0QPMWRJgNEE6TQxLFNTheJbJ1fdBNZSLkyF06Y9nB3dER85w3a0Oq4jZDABS3c6JJkOBBMJ2Z45MZHlaeByBk3qESD4xe7qlmyq3QnptVwnLFxvgGCy+8TWcyLjEoQW+Pbu/TFpLK8MitAwgHd/FUvwbIUipLwyt8NIS1NBiI4Sc3Ow06Jpwq68QvSRvlJsRi80tZxhiZQOz7hIJCt8Tg/NAFfiqrGJJnauju3fEZT9SX58MFN4WKRkmGwq8/3F9paxchytZlSQh3wwAwmcJxrXLusWgFqpaNERk32kkSuHHmOdw//VhKh4ZhM5ni8WQx7AaEQtRSfIFpXT8975KGnuYM7/iheQtpH4hzwYeWeCmKE4M5eeiky9QUEtjDw+br9Y6NisT3LlgjmmDT9cYUbbB5G5KpQRSWZL7CqV0mK4o5/53zxUIk6Q0XJJI4eTa0kn+4mfKwSpRItMtx6AskfUJsbjxN31cIJwEh17KMYTr4b0Rs9F/FMVcuQtH17tTDq19PQ5hZa6ZJ6SNHtzpxyICN7orpIS3zv3anaVHwT/bZB/T7zRn2lOoaW6YL2dcJKbQx5BW6XkZhF1RrQOgJVlS17Lnip/5o5acEq3HiJYSlsNzo9/u7Jq5M+PY3qR9A05YHbh6S9dNEbBbES8RYc8nMwwgQ6aduVFQ==\",\r\n \"resourceKey\": \"7915524720635494902\"\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device\",\r\n \"name\": \"demo-edge-device\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccountCredentials/databoxedgeutdst?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc3RvcmFnZUFjY291bnRDcmVkZW50aWFscy9kYXRhYm94ZWRnZXV0ZHN0P2FwaS12ZXJzaW9uPTIwMTktMDgtMDE=", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"alias\": \"databoxedgeutdst\",\r\n \"userName\": \"databoxedgeutdst\",\r\n \"accountKey\": {\r\n \"value\": \"pdrTQjlmZD1NlvkbsI/HlfHd6y92ZW+7wTdK66mWWKcTtMnhyx/wIg6DbfwuvO24wPojq4WqJwRM/cPVsvTPWX/7HykGRNpiOmE6RJcODL/6mpELbJu0UizeuZZnEIb9xZEiWccBhA3nIVGPlCsLPG+QWzkMh9Lg3ijvhnih0chzG4ICggjIoyY51vyloQrTt0pVkFDATZWn4Fo3bMu/cBFHdAjmziabrZQJqLpoZcgjWk/5wr0r1oHB0/BQBPfjeVUXqw3ipEXDyB4JVDHg3YuDYhlQCiHB+9uyfbbNBS5k2T7TJJbbo/9flgUThrujKzZUw1v1cF5GUNXk8hIFQg==\",\r\n \"encryptionCertThumbprint\": \"FF27EF016674E5A2801B50362ACE4E82E43CBE0E\",\r\n \"encryptionAlgorithm\": \"AES256\"\r\n },\r\n \"sslStatus\": \"Disabled\",\r\n \"accountType\": \"BlobStorage\"\r\n }\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "7e623ea8-2dd6-4a51-bb5d-18b72f6c5aed" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "674" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccountCredentials/databoxedgeutdst/operationResults/13f72f82-801f-4b24-9679-3dea9caf2f33?api-version=2019-08-01" + ], + "Retry-After": [ + "30" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "2758af7f-1a2c-4356-9fe2-a428612bdb24" + ], + "x-ms-client-request-id": [ + "7e623ea8-2dd6-4a51-bb5d-18b72f6c5aed" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-correlation-request-id": [ + "a58b9e85-2f5b-49be-a026-d2e7e37b3156" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T094818Z:a58b9e85-2f5b-49be-a026-d2e7e37b3156" + ], + "Date": [ + "Thu, 05 Dec 2019 09:48:17 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccountCredentials/databoxedgeutdst?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc3RvcmFnZUFjY291bnRDcmVkZW50aWFscy9kYXRhYm94ZWRnZXV0ZHN0P2FwaS12ZXJzaW9uPTIwMTktMDgtMDE=", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"alias\": \"databoxedgeutdst\",\r\n \"userName\": \"databoxedgeutdst\",\r\n \"accountKey\": {\r\n \"value\": \"pdrTQjlmZD1NlvkbsI/HlfHd6y92ZW+7wTdK66mWWKcTtMnhyx/wIg6DbfwuvO24wPojq4WqJwRM/cPVsvTPWX/7HykGRNpiOmE6RJcODL/6mpELbJu0UizeuZZnEIb9xZEiWccBhA3nIVGPlCsLPG+QWzkMh9Lg3ijvhnih0chzG4ICggjIoyY51vyloQrTt0pVkFDATZWn4Fo3bMu/cBFHdAjmziabrZQJqLpoZcgjWk/5wr0r1oHB0/BQBPfjeVUXqw3ipEXDyB4JVDHg3YuDYhlQCiHB+9uyfbbNBS5k2T7TJJbbo/9flgUThrujKzZUw1v1cF5GUNXk8hIFQg==\",\r\n \"encryptionCertThumbprint\": \"FF27EF016674E5A2801B50362ACE4E82E43CBE0E\",\r\n \"encryptionAlgorithm\": \"AES256\"\r\n },\r\n \"sslStatus\": \"Disabled\",\r\n \"accountType\": \"BlobStorage\"\r\n }\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "adc05090-839d-4a71-9b5a-e299cbc035ff" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "674" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccountCredentials/databoxedgeutdst/operationResults/525e6a0e-02c5-4414-9f65-187135aab017?api-version=2019-08-01" + ], + "Retry-After": [ + "30" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "0c844e1d-8b0f-4c5d-b0a6-c876d51f6bb3" + ], + "x-ms-client-request-id": [ + "adc05090-839d-4a71-9b5a-e299cbc035ff" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1198" + ], + "x-ms-correlation-request-id": [ + "5a814974-1146-4714-ab01-6eb494b00d80" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T094953Z:5a814974-1146-4714-ab01-6eb494b00d80" + ], + "Date": [ + "Thu, 05 Dec 2019 09:49:53 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccountCredentials/databoxedgeutdst/operationResults/13f72f82-801f-4b24-9679-3dea9caf2f33?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc3RvcmFnZUFjY291bnRDcmVkZW50aWFscy9kYXRhYm94ZWRnZXV0ZHN0L29wZXJhdGlvblJlc3VsdHMvMTNmNzJmODItODAxZi00YjI0LTk2NzktM2RlYTljYWYyZjMzP2FwaS12ZXJzaW9uPTIwMTktMDgtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccountCredentials/databoxedgeutdst?api-version=2019-08-01" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "8e94f907-51af-4f19-9117-0c73ec2f1dac" + ], + "x-ms-client-request-id": [ + "ec8322b2-3958-402d-a28e-edb9364e0d24" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11954" + ], + "x-ms-correlation-request-id": [ + "43d426d1-5891-43e1-9448-c3398afed506" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T094848Z:43d426d1-5891-43e1-9448-c3398afed506" + ], + "Date": [ + "Thu, 05 Dec 2019 09:48:48 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccountCredentials/databoxedgeutdst?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc3RvcmFnZUFjY291bnRDcmVkZW50aWFscy9kYXRhYm94ZWRnZXV0ZHN0P2FwaS12ZXJzaW9uPTIwMTktMDgtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "a4719508-79ef-40e0-a72d-d382e31f9ad3" + ], + "x-ms-client-request-id": [ + "06a23861-935b-4c4b-8adf-a63c3279b9c0" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11953" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-correlation-request-id": [ + "db70c175-f5d8-4efa-bc39-46b3e5cf3eb0" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T094919Z:db70c175-f5d8-4efa-bc39-46b3e5cf3eb0" + ], + "Date": [ + "Thu, 05 Dec 2019 09:49:18 GMT" + ], + "Content-Length": [ + "480" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"alias\": \"databoxedgeutdst\",\r\n \"userName\": \"databoxedgeutdst\",\r\n \"sslStatus\": \"Disabled\",\r\n \"accountType\": \"BlobStorage\"\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccountCredentials/databoxedgeutdst\",\r\n \"name\": \"databoxedgeutdst\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/storageAccountCredentials\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccountCredentials/databoxedgeutdst?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc3RvcmFnZUFjY291bnRDcmVkZW50aWFscy9kYXRhYm94ZWRnZXV0ZHN0P2FwaS12ZXJzaW9uPTIwMTktMDgtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "154674bf-9912-41cb-8778-26ff07272348" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "cd8a0945-4e9d-48bb-a440-9ac4158372e6" + ], + "x-ms-client-request-id": [ + "154674bf-9912-41cb-8778-26ff07272348" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11952" + ], + "x-ms-correlation-request-id": [ + "4aae9675-922a-4dcd-a23f-68c6b18eab11" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T094920Z:4aae9675-922a-4dcd-a23f-68c6b18eab11" + ], + "Date": [ + "Thu, 05 Dec 2019 09:49:20 GMT" + ], + "Content-Length": [ + "480" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"alias\": \"databoxedgeutdst\",\r\n \"userName\": \"databoxedgeutdst\",\r\n \"sslStatus\": \"Disabled\",\r\n \"accountType\": \"BlobStorage\"\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccountCredentials/databoxedgeutdst\",\r\n \"name\": \"databoxedgeutdst\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/storageAccountCredentials\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccountCredentials/databoxedgeutdst?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc3RvcmFnZUFjY291bnRDcmVkZW50aWFscy9kYXRhYm94ZWRnZXV0ZHN0P2FwaS12ZXJzaW9uPTIwMTktMDgtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "0697218e-1785-4b3c-a1e0-1616ec8dc359" + ], + "x-ms-client-request-id": [ + "8ed3dcd3-8ff1-4cba-ad90-8a81ee09487f" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11945" + ], + "x-ms-correlation-request-id": [ + "cb3c7ce0-b7db-4cc6-b168-d743f9da6261" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T095055Z:cb3c7ce0-b7db-4cc6-b168-d743f9da6261" + ], + "Date": [ + "Thu, 05 Dec 2019 09:50:55 GMT" + ], + "Content-Length": [ + "480" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"alias\": \"databoxedgeutdst\",\r\n \"userName\": \"databoxedgeutdst\",\r\n \"sslStatus\": \"Disabled\",\r\n \"accountType\": \"BlobStorage\"\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccountCredentials/databoxedgeutdst\",\r\n \"name\": \"databoxedgeutdst\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/storageAccountCredentials\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccountCredentials?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc3RvcmFnZUFjY291bnRDcmVkZW50aWFscz9hcGktdmVyc2lvbj0yMDE5LTA4LTAx", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "0585bcbc-567f-4a89-a1bc-9bcfa07338fb" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "61102c43-8a49-4ce4-b7b7-c7c2abea260e" + ], + "x-ms-client-request-id": [ + "0585bcbc-567f-4a89-a1bc-9bcfa07338fb" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11951" + ], + "x-ms-correlation-request-id": [ + "4056e958-b8c0-4c4c-87bf-e9373b61baf6" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T094921Z:4056e958-b8c0-4c4c-87bf-e9373b61baf6" + ], + "Date": [ + "Thu, 05 Dec 2019 09:49:20 GMT" + ], + "Content-Length": [ + "549" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"properties\": {\r\n \"alias\": \"databoxedgeutdst\",\r\n \"userName\": \"databoxedgeutdst\",\r\n \"sslStatus\": \"Disabled\",\r\n \"accountType\": \"BlobStorage\"\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccountCredentials/databoxedgeutdst\",\r\n \"name\": \"databoxedgeutdst\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/storageAccountCredentials\"\r\n }\r\n ]\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccountCredentials/databoxedgeutdst?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc3RvcmFnZUFjY291bnRDcmVkZW50aWFscy9kYXRhYm94ZWRnZXV0ZHN0P2FwaS12ZXJzaW9uPTIwMTktMDgtMDE=", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "12b76d1d-4241-430b-b5da-dce272f66f00" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccountCredentials/databoxedgeutdst/operationResults/6c94c140-cc7e-40cf-bcdb-306f22611d87?api-version=2019-08-01" + ], + "Retry-After": [ + "30" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "a5474049-c212-4cd3-b642-83397f6f4939" + ], + "x-ms-client-request-id": [ + "12b76d1d-4241-430b-b5da-dce272f66f00" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-deletes": [ + "14999" + ], + "x-ms-correlation-request-id": [ + "d6256fe0-5213-4207-9fcc-0bca30fba2b0" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T094922Z:d6256fe0-5213-4207-9fcc-0bca30fba2b0" + ], + "Date": [ + "Thu, 05 Dec 2019 09:49:21 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccountCredentials/databoxedgeutdst/operationResults/6c94c140-cc7e-40cf-bcdb-306f22611d87?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc3RvcmFnZUFjY291bnRDcmVkZW50aWFscy9kYXRhYm94ZWRnZXV0ZHN0L29wZXJhdGlvblJlc3VsdHMvNmM5NGMxNDAtY2M3ZS00MGNmLWJjZGItMzA2ZjIyNjExZDg3P2FwaS12ZXJzaW9uPTIwMTktMDgtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "2f0122a7-389d-4f0f-9861-23c82f299b83" + ], + "x-ms-client-request-id": [ + "d12f8cc0-a9a5-4300-b069-00a80dd3dc00" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11948" + ], + "x-ms-correlation-request-id": [ + "0745748f-3c4f-448f-b6ca-8221031b9339" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T094952Z:0745748f-3c4f-448f-b6ca-8221031b9339" + ], + "Date": [ + "Thu, 05 Dec 2019 09:49:52 GMT" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "", + "StatusCode": 204 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccountCredentials/databoxedgeutdst/operationResults/6c94c140-cc7e-40cf-bcdb-306f22611d87?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc3RvcmFnZUFjY291bnRDcmVkZW50aWFscy9kYXRhYm94ZWRnZXV0ZHN0L29wZXJhdGlvblJlc3VsdHMvNmM5NGMxNDAtY2M3ZS00MGNmLWJjZGItMzA2ZjIyNjExZDg3P2FwaS12ZXJzaW9uPTIwMTktMDgtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "6874a418-1b1a-4fe3-98de-f833d3f24d97" + ], + "x-ms-client-request-id": [ + "b04ef7ab-a439-40e8-ba5b-c06776c01813" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11947" + ], + "x-ms-correlation-request-id": [ + "684a5ead-3d21-4089-b484-ba8479b93a83" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T094952Z:684a5ead-3d21-4089-b484-ba8479b93a83" + ], + "Date": [ + "Thu, 05 Dec 2019 09:49:52 GMT" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "", + "StatusCode": 204 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccountCredentials/databoxedgeutdst/operationResults/525e6a0e-02c5-4414-9f65-187135aab017?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc3RvcmFnZUFjY291bnRDcmVkZW50aWFscy9kYXRhYm94ZWRnZXV0ZHN0L29wZXJhdGlvblJlc3VsdHMvNTI1ZTZhMGUtMDJjNS00NDE0LTlmNjUtMTg3MTM1YWFiMDE3P2FwaS12ZXJzaW9uPTIwMTktMDgtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccountCredentials/databoxedgeutdst?api-version=2019-08-01" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "018004d1-c8bf-4a90-a31c-08db3ad90140" + ], + "x-ms-client-request-id": [ + "5029b5aa-3b68-496a-9dde-4de3355a4a82" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11946" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-correlation-request-id": [ + "5b036985-a967-4527-b78c-1c049b9a1a1b" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T095024Z:5b036985-a967-4527-b78c-1c049b9a1a1b" + ], + "Date": [ + "Thu, 05 Dec 2019 09:50:23 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "db4e2fdb-6d80-4e6e-b7cd-736098270664", + "SubId": "db4e2fdb-6d80-4e6e-b7cd-736098270664" + } +} \ No newline at end of file diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/StorageAccountTests/Test_StorageOperations.json b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/StorageAccountTests/Test_StorageOperations.json new file mode 100644 index 0000000000000..ca699eb205613 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/StorageAccountTests/Test_StorageOperations.json @@ -0,0 +1,774 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccountCredentials/databoxedgeutdst?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc3RvcmFnZUFjY291bnRDcmVkZW50aWFscy9kYXRhYm94ZWRnZXV0ZHN0P2FwaS12ZXJzaW9uPTIwMTktMDgtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "f4af82a2-18d5-4034-a8d1-dabb907f6b13" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "9af185c0-2aea-4264-b23a-e6bbfc3b1c89" + ], + "x-ms-client-request-id": [ + "f4af82a2-18d5-4034-a8d1-dabb907f6b13" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11999" + ], + "x-ms-correlation-request-id": [ + "760a1375-e31d-419d-b974-e38af6a1f6be" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T141738Z:760a1375-e31d-419d-b974-e38af6a1f6be" + ], + "Date": [ + "Thu, 05 Dec 2019 14:17:37 GMT" + ], + "Content-Length": [ + "480" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"alias\": \"databoxedgeutdst\",\r\n \"userName\": \"databoxedgeutdst\",\r\n \"sslStatus\": \"Disabled\",\r\n \"accountType\": \"BlobStorage\"\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccountCredentials/databoxedgeutdst\",\r\n \"name\": \"databoxedgeutdst\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/storageAccountCredentials\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccounts/storageaccount1?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc3RvcmFnZUFjY291bnRzL3N0b3JhZ2VhY2NvdW50MT9hcGktdmVyc2lvbj0yMDE5LTA4LTAx", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"description\": \"It is a simple storage account\",\r\n \"storageAccountStatus\": \"OK\",\r\n \"dataPolicy\": \"Cloud\",\r\n \"storageAccountCredentialId\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccountCredentials/databoxedgeutdst\"\r\n }\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "bc03fbd2-0b6b-4df7-95aa-626b5a9af50a" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "375" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccounts/storageaccount1/operationResults/b024c379-fb43-4637-a38d-93b5d3f71a57?api-version=2019-08-01" + ], + "Retry-After": [ + "30" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "452142c4-f625-4ffd-a76c-b9113c4373fd" + ], + "x-ms-client-request-id": [ + "bc03fbd2-0b6b-4df7-95aa-626b5a9af50a" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-correlation-request-id": [ + "9cc09bf4-da11-41e3-964d-821a65c156f1" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T141739Z:9cc09bf4-da11-41e3-964d-821a65c156f1" + ], + "Date": [ + "Thu, 05 Dec 2019 14:17:38 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccounts/storageaccount1/operationResults/b024c379-fb43-4637-a38d-93b5d3f71a57?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc3RvcmFnZUFjY291bnRzL3N0b3JhZ2VhY2NvdW50MS9vcGVyYXRpb25SZXN1bHRzL2IwMjRjMzc5LWZiNDMtNDYzNy1hMzhkLTkzYjVkM2Y3MWE1Nz9hcGktdmVyc2lvbj0yMDE5LTA4LTAx", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccounts/storageaccount1?api-version=2019-08-01" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "70926f12-55e5-4c1a-ae95-e59b40999851" + ], + "x-ms-client-request-id": [ + "b3f78153-0a52-4705-a8ae-b7c10bb4708b" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11998" + ], + "x-ms-correlation-request-id": [ + "13ab75d2-bb2d-4ea7-bc4b-74d5383da75d" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T141809Z:13ab75d2-bb2d-4ea7-bc4b-74d5383da75d" + ], + "Date": [ + "Thu, 05 Dec 2019 14:18:09 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccounts/storageaccount1?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc3RvcmFnZUFjY291bnRzL3N0b3JhZ2VhY2NvdW50MT9hcGktdmVyc2lvbj0yMDE5LTA4LTAx", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "4dd28c35-e6e9-444e-a191-2a31bbe54a61" + ], + "x-ms-client-request-id": [ + "fddb2af6-90f3-4e99-9bfb-53e9827546b0" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11997" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-correlation-request-id": [ + "a9a13926-a9cb-4db1-aea3-ff1fedf39e09" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T141840Z:a9a13926-a9cb-4db1-aea3-ff1fedf39e09" + ], + "Date": [ + "Thu, 05 Dec 2019 14:18:39 GMT" + ], + "Content-Length": [ + "765" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"description\": \"It is a simple storage account\",\r\n \"storageAccountStatus\": \"OK\",\r\n \"dataPolicy\": \"Cloud\",\r\n \"storageAccountCredentialId\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccountCredentials/databoxedgeutdst\",\r\n \"blobEndpoint\": \"http://storageaccount1.blob.core.windows.net\",\r\n \"containerCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccounts/storageaccount1\",\r\n \"name\": \"storageaccount1\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/storageAccounts\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccounts/storageaccount1?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc3RvcmFnZUFjY291bnRzL3N0b3JhZ2VhY2NvdW50MT9hcGktdmVyc2lvbj0yMDE5LTA4LTAx", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "980a99d5-abfb-4061-bc9b-173de3f977f5" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "f3dc8d38-e564-4cbf-9b87-7815688a9bd9" + ], + "x-ms-client-request-id": [ + "980a99d5-abfb-4061-bc9b-173de3f977f5" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11996" + ], + "x-ms-correlation-request-id": [ + "b79b4da6-77e8-477f-9c4e-926337b05cbf" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T141841Z:b79b4da6-77e8-477f-9c4e-926337b05cbf" + ], + "Date": [ + "Thu, 05 Dec 2019 14:18:40 GMT" + ], + "Content-Length": [ + "765" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"description\": \"It is a simple storage account\",\r\n \"storageAccountStatus\": \"OK\",\r\n \"dataPolicy\": \"Cloud\",\r\n \"storageAccountCredentialId\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccountCredentials/databoxedgeutdst\",\r\n \"blobEndpoint\": \"http://storageaccount1.blob.core.windows.net\",\r\n \"containerCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccounts/storageaccount1\",\r\n \"name\": \"storageaccount1\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/storageAccounts\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccounts?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc3RvcmFnZUFjY291bnRzP2FwaS12ZXJzaW9uPTIwMTktMDgtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "3497f25f-bb9f-4f49-afa9-55f6b75c364a" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "1ec14ca4-e6f6-41b0-ae07-510124c0595a" + ], + "x-ms-client-request-id": [ + "3497f25f-bb9f-4f49-afa9-55f6b75c364a" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11995" + ], + "x-ms-correlation-request-id": [ + "f5e7d931-919d-499a-b3ee-6475bae310bc" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T141842Z:f5e7d931-919d-499a-b3ee-6475bae310bc" + ], + "Date": [ + "Thu, 05 Dec 2019 14:18:41 GMT" + ], + "Content-Length": [ + "842" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"properties\": {\r\n \"description\": \"It is a simple storage account\",\r\n \"storageAccountStatus\": \"OK\",\r\n \"dataPolicy\": \"Cloud\",\r\n \"storageAccountCredentialId\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccountCredentials/databoxedgeutdst\",\r\n \"blobEndpoint\": \"http://storageaccount1.blob.core.windows.net\",\r\n \"containerCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccounts/storageaccount1\",\r\n \"name\": \"storageaccount1\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/storageAccounts\"\r\n }\r\n ]\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccounts/storageaccount1?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc3RvcmFnZUFjY291bnRzL3N0b3JhZ2VhY2NvdW50MT9hcGktdmVyc2lvbj0yMDE5LTA4LTAx", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "d9f46282-9148-42b1-9f4a-16e208a01047" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccounts/storageaccount1/operationResults/b932ad78-a869-45fe-88af-203c971d40b0?api-version=2019-08-01" + ], + "Retry-After": [ + "30" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "014e66d2-2a72-40e7-a171-22859f7020a7" + ], + "x-ms-client-request-id": [ + "d9f46282-9148-42b1-9f4a-16e208a01047" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-deletes": [ + "14999" + ], + "x-ms-correlation-request-id": [ + "f1dd2fd0-aaac-4acb-8b63-7df9ffd8e9ac" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T141842Z:f1dd2fd0-aaac-4acb-8b63-7df9ffd8e9ac" + ], + "Date": [ + "Thu, 05 Dec 2019 14:18:42 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccounts/storageaccount1/operationResults/b932ad78-a869-45fe-88af-203c971d40b0?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc3RvcmFnZUFjY291bnRzL3N0b3JhZ2VhY2NvdW50MS9vcGVyYXRpb25SZXN1bHRzL2I5MzJhZDc4LWE4NjktNDVmZS04OGFmLTIwM2M5NzFkNDBiMD9hcGktdmVyc2lvbj0yMDE5LTA4LTAx", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "ea90686a-320e-44c3-a454-581da696b3c6" + ], + "x-ms-client-request-id": [ + "47684aed-087d-4328-ad4f-c1f47b6b4e61" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11994" + ], + "x-ms-correlation-request-id": [ + "99578286-0b25-412a-93af-94543f4f20fe" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T141913Z:99578286-0b25-412a-93af-94543f4f20fe" + ], + "Date": [ + "Thu, 05 Dec 2019 14:19:13 GMT" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "", + "StatusCode": 204 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccounts/storageaccount1/operationResults/b932ad78-a869-45fe-88af-203c971d40b0?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc3RvcmFnZUFjY291bnRzL3N0b3JhZ2VhY2NvdW50MS9vcGVyYXRpb25SZXN1bHRzL2I5MzJhZDc4LWE4NjktNDVmZS04OGFmLTIwM2M5NzFkNDBiMD9hcGktdmVyc2lvbj0yMDE5LTA4LTAx", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "37bb1db2-51c4-4d3b-ac43-45059f2f0667" + ], + "x-ms-client-request-id": [ + "225e5a3d-0fbf-41a6-a0fb-6d9a41f0d967" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11993" + ], + "x-ms-correlation-request-id": [ + "5ba55f50-f81a-4573-bd96-a7388bfeb4d5" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T141913Z:5ba55f50-f81a-4573-bd96-a7388bfeb4d5" + ], + "Date": [ + "Thu, 05 Dec 2019 14:19:13 GMT" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "", + "StatusCode": 204 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccounts/storageaccount2?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc3RvcmFnZUFjY291bnRzL3N0b3JhZ2VhY2NvdW50Mj9hcGktdmVyc2lvbj0yMDE5LTA4LTAx", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"description\": \"It is a simple storage account\",\r\n \"storageAccountStatus\": \"OK\",\r\n \"dataPolicy\": \"Cloud\",\r\n \"storageAccountCredentialId\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccountCredentials/databoxedgeutdst\"\r\n }\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "5137ea7e-815a-40e5-9e66-003d2c5cc01a" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "375" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccounts/storageaccount2/operationResults/3cdcbbc2-da13-4aad-a077-927f8c15be0b?api-version=2019-08-01" + ], + "Retry-After": [ + "30" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "6f4d141f-8e81-4996-b541-bbd4089285dd" + ], + "x-ms-client-request-id": [ + "5137ea7e-815a-40e5-9e66-003d2c5cc01a" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1198" + ], + "x-ms-correlation-request-id": [ + "43269c4a-ad41-41fd-80d1-740466b2ee0a" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T141914Z:43269c4a-ad41-41fd-80d1-740466b2ee0a" + ], + "Date": [ + "Thu, 05 Dec 2019 14:19:14 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccounts/storageaccount2/operationResults/3cdcbbc2-da13-4aad-a077-927f8c15be0b?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc3RvcmFnZUFjY291bnRzL3N0b3JhZ2VhY2NvdW50Mi9vcGVyYXRpb25SZXN1bHRzLzNjZGNiYmMyLWRhMTMtNGFhZC1hMDc3LTkyN2Y4YzE1YmUwYj9hcGktdmVyc2lvbj0yMDE5LTA4LTAx", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccounts/storageaccount2?api-version=2019-08-01" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "668b1d56-da54-4481-b954-0ca2fef00e92" + ], + "x-ms-client-request-id": [ + "7b83f420-2fb5-4e80-8624-70c4076c3689" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11992" + ], + "x-ms-correlation-request-id": [ + "a00064a1-571c-4fe0-b395-24d6b92e5d26" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T141945Z:a00064a1-571c-4fe0-b395-24d6b92e5d26" + ], + "Date": [ + "Thu, 05 Dec 2019 14:19:44 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccounts/storageaccount2?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc3RvcmFnZUFjY291bnRzL3N0b3JhZ2VhY2NvdW50Mj9hcGktdmVyc2lvbj0yMDE5LTA4LTAx", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "86a73a1d-780c-4d26-b98f-418f7af818ae" + ], + "x-ms-client-request-id": [ + "2334dc31-6414-4a29-8dae-55fabf7dfe02" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11991" + ], + "x-ms-correlation-request-id": [ + "d237f7f3-63ab-454f-8968-2abd67b78e6d" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T142017Z:d237f7f3-63ab-454f-8968-2abd67b78e6d" + ], + "Date": [ + "Thu, 05 Dec 2019 14:20:16 GMT" + ], + "Content-Length": [ + "765" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"description\": \"It is a simple storage account\",\r\n \"storageAccountStatus\": \"OK\",\r\n \"dataPolicy\": \"Cloud\",\r\n \"storageAccountCredentialId\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccountCredentials/databoxedgeutdst\",\r\n \"blobEndpoint\": \"http://storageaccount2.blob.core.windows.net\",\r\n \"containerCount\": 0\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/storageAccounts/storageaccount2\",\r\n \"name\": \"storageaccount2\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/storageAccounts\"\r\n}", + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "db4e2fdb-6d80-4e6e-b7cd-736098270664", + "SubId": "db4e2fdb-6d80-4e6e-b7cd-736098270664" + } +} \ No newline at end of file diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/TriggerTests/Test_TriggerOperations.json b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/TriggerTests/Test_TriggerOperations.json new file mode 100644 index 0000000000000..ff39f5da181bb --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/TriggerTests/Test_TriggerOperations.json @@ -0,0 +1,840 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/roles/iot-1?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvcm9sZXMvaW90LTE/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "9f2fab87-fae7-4c63-bbfd-22dbf9331b70" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "98dc9ad2-be88-4a7e-9d93-9098bd464b53" + ], + "x-ms-client-request-id": [ + "9f2fab87-fae7-4c63-bbfd-22dbf9331b70" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11986" + ], + "x-ms-correlation-request-id": [ + "e4f41c1e-1fe9-48c7-a61e-2335975425cc" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T105046Z:e4f41c1e-1fe9-48c7-a61e-2335975425cc" + ], + "Date": [ + "Thu, 05 Dec 2019 10:50:45 GMT" + ], + "Content-Length": [ + "750" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"hostPlatform\": \"Linux\",\r\n \"ioTDeviceDetails\": {\r\n \"deviceId\": \"iotdevice\",\r\n \"ioTHostHub\": \"iothub.azure-devices.net\",\r\n \"authentication\": {\r\n \"symmetricKey\": {}\r\n }\r\n },\r\n \"ioTEdgeDeviceDetails\": {\r\n \"deviceId\": \"iotdevice\",\r\n \"ioTHostHub\": \"iothub.azure-devices.net\",\r\n \"authentication\": {\r\n \"symmetricKey\": {}\r\n }\r\n },\r\n \"shareMappings\": [],\r\n \"roleStatus\": \"Enabled\"\r\n },\r\n \"kind\": \"IOT\",\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/roles/iot-1\",\r\n \"name\": \"iot-1\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/roles\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/shares/localshare?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2Uvc2hhcmVzL2xvY2Fsc2hhcmU/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "75dc8970-229a-403d-9e6c-acb10eaadc5f" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "8b5519e6-12c1-4027-83dc-0d4c2ddca2ea" + ], + "x-ms-client-request-id": [ + "75dc8970-229a-403d-9e6c-acb10eaadc5f" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11985" + ], + "x-ms-correlation-request-id": [ + "3953e92d-679a-46b3-9d85-925fc35e6419" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T105046Z:3953e92d-679a-46b3-9d85-925fc35e6419" + ], + "Date": [ + "Thu, 05 Dec 2019 10:50:46 GMT" + ], + "Content-Length": [ + "627" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"shareStatus\": \"OK\",\r\n \"monitoringStatus\": \"Enabled\",\r\n \"accessProtocol\": \"NFS\",\r\n \"userAccessRights\": [],\r\n \"clientAccessRights\": [\r\n {\r\n \"client\": \"10.150.76.81\",\r\n \"accessPermission\": \"ReadWrite\"\r\n }\r\n ],\r\n \"refreshDetails\": {},\r\n \"shareMappings\": [],\r\n \"dataPolicy\": \"Local\"\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/shares/localshare\",\r\n \"name\": \"localshare\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/shares\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/triggers/trigger-fileEventTrigger?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2UvdHJpZ2dlcnMvdHJpZ2dlci1maWxlRXZlbnRUcmlnZ2VyP2FwaS12ZXJzaW9uPTIwMTktMDgtMDE=", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"kind\": \"FileEvent\",\r\n \"properties\": {\r\n \"sourceInfo\": {\r\n \"shareId\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/shares/localshare\"\r\n },\r\n \"sinkInfo\": {\r\n \"roleId\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/roles/iot-1\"\r\n },\r\n \"customContextTag\": \"fileEventTrigger\"\r\n }\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "aaa449ac-30f6-4778-a07d-4ee0206ea836" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "521" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/triggers/trigger-fileEventTrigger/operationResults/27d03fb1-10f3-43e7-8ec1-fec3641d818d?api-version=2019-08-01" + ], + "Retry-After": [ + "30" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "0480af70-9d93-49ca-90f4-08e80dd64a2b" + ], + "x-ms-client-request-id": [ + "aaa449ac-30f6-4778-a07d-4ee0206ea836" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-correlation-request-id": [ + "e42b5892-5792-4621-9074-e2ccd62042d9" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T105048Z:e42b5892-5792-4621-9074-e2ccd62042d9" + ], + "Date": [ + "Thu, 05 Dec 2019 10:50:47 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/triggers/trigger-fileEventTrigger/operationResults/27d03fb1-10f3-43e7-8ec1-fec3641d818d?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2UvdHJpZ2dlcnMvdHJpZ2dlci1maWxlRXZlbnRUcmlnZ2VyL29wZXJhdGlvblJlc3VsdHMvMjdkMDNmYjEtMTBmMy00M2U3LThlYzEtZmVjMzY0MWQ4MThkP2FwaS12ZXJzaW9uPTIwMTktMDgtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/triggers/trigger-fileEventTrigger?api-version=2019-08-01" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "dad9b321-0377-4c06-bc77-13992b5350ec" + ], + "x-ms-client-request-id": [ + "a003d429-dfbc-4bc1-8019-363ebf91b8d9" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11984" + ], + "x-ms-correlation-request-id": [ + "5a33e13e-fc3f-4d91-9314-c36bccb60192" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T105118Z:5a33e13e-fc3f-4d91-9314-c36bccb60192" + ], + "Date": [ + "Thu, 05 Dec 2019 10:51:17 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/triggers/trigger-fileEventTrigger?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2UvdHJpZ2dlcnMvdHJpZ2dlci1maWxlRXZlbnRUcmlnZ2VyP2FwaS12ZXJzaW9uPTIwMTktMDgtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "a8dda5b3-6ef5-4ec8-bb21-ce723d17fe9b" + ], + "x-ms-client-request-id": [ + "b1cd1830-75b3-4ec9-aa38-21a496d6bfd0" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11982" + ], + "x-ms-correlation-request-id": [ + "0823b533-2d7f-48df-b22e-0b10f98e5be6" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T105150Z:0823b533-2d7f-48df-b22e-0b10f98e5be6" + ], + "Date": [ + "Thu, 05 Dec 2019 10:51:50 GMT" + ], + "Content-Length": [ + "820" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"sourceInfo\": {\r\n \"shareId\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/shares/localshare\"\r\n },\r\n \"sinkInfo\": {\r\n \"roleId\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/roles/iot-1\"\r\n },\r\n \"customContextTag\": \"fileEventTrigger\"\r\n },\r\n \"kind\": \"FileEvent\",\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/triggers/trigger-fileEventTrigger\",\r\n \"name\": \"trigger-fileEventTrigger\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/triggers\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/triggers/trigger-periodicTrigger?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2UvdHJpZ2dlcnMvdHJpZ2dlci1wZXJpb2RpY1RyaWdnZXI/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"kind\": \"PeriodicTimerEvent\",\r\n \"properties\": {\r\n \"sourceInfo\": {\r\n \"startTime\": \"2019-12-06T00:00:00Z\",\r\n \"schedule\": \"0.1:0:0\",\r\n \"topic\": \"trigger-periodicTrigger\"\r\n },\r\n \"sinkInfo\": {\r\n \"roleId\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/roles/iot-1\"\r\n },\r\n \"customContextTag\": \"periodicTrigger\"\r\n }\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "5f9948e1-27d8-4554-b443-5dea05b1cd14" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "457" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/triggers/trigger-periodicTrigger/operationResults/a093e8b1-b167-4d6e-bf0a-de729fb68459?api-version=2019-08-01" + ], + "Retry-After": [ + "30" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "30231ec9-9a18-49e7-baaa-cd0d3a05a49c" + ], + "x-ms-client-request-id": [ + "5f9948e1-27d8-4554-b443-5dea05b1cd14" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1198" + ], + "x-ms-correlation-request-id": [ + "1fe337d1-24b9-4fb5-a3c9-1b3b7a68328f" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T105151Z:1fe337d1-24b9-4fb5-a3c9-1b3b7a68328f" + ], + "Date": [ + "Thu, 05 Dec 2019 10:51:51 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/triggers/trigger-periodicTrigger/operationResults/a093e8b1-b167-4d6e-bf0a-de729fb68459?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2UvdHJpZ2dlcnMvdHJpZ2dlci1wZXJpb2RpY1RyaWdnZXIvb3BlcmF0aW9uUmVzdWx0cy9hMDkzZThiMS1iMTY3LTRkNmUtYmYwYS1kZTcyOWZiNjg0NTk/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/triggers/trigger-periodicTrigger?api-version=2019-08-01" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "79b2d328-df0e-45c2-87e6-e2e6a83b1735" + ], + "x-ms-client-request-id": [ + "f723d6f8-0e7c-4591-8d66-a0a40198980e" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11981" + ], + "x-ms-correlation-request-id": [ + "049c6a4b-7120-46b1-ad62-805fb5029c9b" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T105222Z:049c6a4b-7120-46b1-ad62-805fb5029c9b" + ], + "Date": [ + "Thu, 05 Dec 2019 10:52:21 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/triggers/trigger-periodicTrigger?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2UvdHJpZ2dlcnMvdHJpZ2dlci1wZXJpb2RpY1RyaWdnZXI/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "9e62b68f-3240-48e9-8e46-36fafd823b1a" + ], + "x-ms-client-request-id": [ + "ec417b27-84cb-4592-9e3b-0d7180acbf16" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11979" + ], + "x-ms-correlation-request-id": [ + "9a1e23d5-8eb0-4cef-9699-fd7ff7d42812" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T105253Z:9a1e23d5-8eb0-4cef-9699-fd7ff7d42812" + ], + "Date": [ + "Thu, 05 Dec 2019 10:52:53 GMT" + ], + "Content-Length": [ + "755" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"sourceInfo\": {\r\n \"startTime\": \"2019-12-06T00:00:00Z\",\r\n \"schedule\": \"01:00:00\",\r\n \"topic\": \"trigger-periodicTrigger\"\r\n },\r\n \"sinkInfo\": {\r\n \"roleId\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/roles/iot-1\"\r\n },\r\n \"customContextTag\": \"periodicTrigger\"\r\n },\r\n \"kind\": \"PeriodicTimerEvent\",\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/triggers/trigger-periodicTrigger\",\r\n \"name\": \"trigger-periodicTrigger\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/triggers\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/triggers/trigger-periodicTrigger?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2UvdHJpZ2dlcnMvdHJpZ2dlci1wZXJpb2RpY1RyaWdnZXI/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "4db37978-9c89-44fd-bf70-281f52b4d85c" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "e98cf28b-959b-4bf5-bf10-49459f7b27b3" + ], + "x-ms-client-request-id": [ + "4db37978-9c89-44fd-bf70-281f52b4d85c" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11978" + ], + "x-ms-correlation-request-id": [ + "9e14ffb3-fef3-44fc-9db7-655d5af6bf45" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T105254Z:9e14ffb3-fef3-44fc-9db7-655d5af6bf45" + ], + "Date": [ + "Thu, 05 Dec 2019 10:52:54 GMT" + ], + "Content-Length": [ + "755" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"sourceInfo\": {\r\n \"startTime\": \"2019-12-06T00:00:00Z\",\r\n \"schedule\": \"01:00:00\",\r\n \"topic\": \"trigger-periodicTrigger\"\r\n },\r\n \"sinkInfo\": {\r\n \"roleId\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/roles/iot-1\"\r\n },\r\n \"customContextTag\": \"periodicTrigger\"\r\n },\r\n \"kind\": \"PeriodicTimerEvent\",\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/triggers/trigger-periodicTrigger\",\r\n \"name\": \"trigger-periodicTrigger\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/triggers\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/triggers?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2UvdHJpZ2dlcnM/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "6e4ef3cf-f760-4548-a9dd-f1fd6608f94e" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "fe7650d7-fddd-4d32-8466-0bd792f96e40" + ], + "x-ms-client-request-id": [ + "6e4ef3cf-f760-4548-a9dd-f1fd6608f94e" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11977" + ], + "x-ms-correlation-request-id": [ + "064c8860-5f6e-48dd-bdba-bc24c8fe158b" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T105255Z:064c8860-5f6e-48dd-bdba-bc24c8fe158b" + ], + "Date": [ + "Thu, 05 Dec 2019 10:52:55 GMT" + ], + "Content-Length": [ + "1731" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"properties\": {\r\n \"sourceInfo\": {\r\n \"startTime\": \"2019-12-06T00:00:00Z\",\r\n \"schedule\": \"01:00:00\",\r\n \"topic\": \"trigger-periodicTrigger\"\r\n },\r\n \"sinkInfo\": {\r\n \"roleId\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/roles/iot-1\"\r\n },\r\n \"customContextTag\": \"periodicTrigger\"\r\n },\r\n \"kind\": \"PeriodicTimerEvent\",\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/triggers/trigger-periodicTrigger\",\r\n \"name\": \"trigger-periodicTrigger\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/triggers\"\r\n },\r\n {\r\n \"properties\": {\r\n \"sourceInfo\": {\r\n \"shareId\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/shares/localshare\"\r\n },\r\n \"sinkInfo\": {\r\n \"roleId\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/roles/iot-1\"\r\n },\r\n \"customContextTag\": \"fileEventTrigger\"\r\n },\r\n \"kind\": \"FileEvent\",\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/triggers/trigger-fileEventTrigger\",\r\n \"name\": \"trigger-fileEventTrigger\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/triggers\"\r\n }\r\n ]\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/triggers/trigger-periodicTrigger?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2UvdHJpZ2dlcnMvdHJpZ2dlci1wZXJpb2RpY1RyaWdnZXI/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "04d1e951-bdd5-4527-a78b-ef2f8343a430" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/triggers/trigger-periodicTrigger/operationResults/ee4bade7-5521-4d7f-89d9-cd3a26953a94?api-version=2019-08-01" + ], + "Retry-After": [ + "30" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "7a22b18f-a271-4ee1-a217-dbabbc315f58" + ], + "x-ms-client-request-id": [ + "04d1e951-bdd5-4527-a78b-ef2f8343a430" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-deletes": [ + "14999" + ], + "x-ms-correlation-request-id": [ + "71ea00f7-ae58-4b2d-ac0f-6bb39f131e77" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T105256Z:71ea00f7-ae58-4b2d-ac0f-6bb39f131e77" + ], + "Date": [ + "Thu, 05 Dec 2019 10:52:55 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/triggers/trigger-periodicTrigger/operationResults/ee4bade7-5521-4d7f-89d9-cd3a26953a94?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2UvdHJpZ2dlcnMvdHJpZ2dlci1wZXJpb2RpY1RyaWdnZXIvb3BlcmF0aW9uUmVzdWx0cy9lZTRiYWRlNy01NTIxLTRkN2YtODlkOS1jZDNhMjY5NTNhOTQ/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "80b33078-bcf7-4209-8b58-54ccbbdc29b8" + ], + "x-ms-client-request-id": [ + "318d6ff5-d1f1-4c9d-8b80-ef6e4145ec61" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11976" + ], + "x-ms-correlation-request-id": [ + "a7b5c978-72d6-47e6-9fa6-ef3d0c931a9b" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T105326Z:a7b5c978-72d6-47e6-9fa6-ef3d0c931a9b" + ], + "Date": [ + "Thu, 05 Dec 2019 10:53:25 GMT" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "", + "StatusCode": 204 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/triggers/trigger-periodicTrigger/operationResults/ee4bade7-5521-4d7f-89d9-cd3a26953a94?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2UvdHJpZ2dlcnMvdHJpZ2dlci1wZXJpb2RpY1RyaWdnZXIvb3BlcmF0aW9uUmVzdWx0cy9lZTRiYWRlNy01NTIxLTRkN2YtODlkOS1jZDNhMjY5NTNhOTQ/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "359efbb6-63ee-445b-acc0-1f903a694744" + ], + "x-ms-client-request-id": [ + "94cee3a1-1af2-4d4b-96b5-67a5cb9f0678" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11975" + ], + "x-ms-correlation-request-id": [ + "645c7d49-d47c-486e-90c9-5b5d8c58c025" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T105326Z:645c7d49-d47c-486e-90c9-5b5d8c58c025" + ], + "Date": [ + "Thu, 05 Dec 2019 10:53:26 GMT" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "", + "StatusCode": 204 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "db4e2fdb-6d80-4e6e-b7cd-736098270664", + "SubId": "db4e2fdb-6d80-4e6e-b7cd-736098270664" + } +} \ No newline at end of file diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/UserTests/Test_ARMUserPasswordUpdate.json b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/UserTests/Test_ARMUserPasswordUpdate.json new file mode 100644 index 0000000000000..1b814f9c10070 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/UserTests/Test_ARMUserPasswordUpdate.json @@ -0,0 +1,336 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/users/EdgeArmUser?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2UvdXNlcnMvRWRnZUFybVVzZXI/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "ab019430-b675-428d-853a-7e3d19b55bae" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "9a0b4aac-7584-4b79-8b99-63ee92f47861" + ], + "x-ms-client-request-id": [ + "ab019430-b675-428d-853a-7e3d19b55bae" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11988" + ], + "x-ms-correlation-request-id": [ + "e2f6ffed-e39e-4a02-835c-1e010de588c7" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T092919Z:e2f6ffed-e39e-4a02-835c-1e010de588c7" + ], + "Date": [ + "Thu, 05 Dec 2019 09:29:18 GMT" + ], + "Content-Length": [ + "318" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"userType\": \"ARM\"\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/users/EdgeArmUser\",\r\n \"name\": \"EdgeARMUser\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/users\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/users/EdgeArmUser?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2UvdXNlcnMvRWRnZUFybVVzZXI/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "b81913e5-3bdf-4fcb-868c-4214c743013e" + ], + "x-ms-client-request-id": [ + "5be8ade6-ea52-43eb-8155-867f67e5dd33" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11985" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-correlation-request-id": [ + "6f238d59-d4e3-41c0-a6b3-9f6a1ca93d2e" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T093021Z:6f238d59-d4e3-41c0-a6b3-9f6a1ca93d2e" + ], + "Date": [ + "Thu, 05 Dec 2019 09:30:21 GMT" + ], + "Content-Length": [ + "318" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"userType\": \"ARM\"\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/users/EdgeArmUser\",\r\n \"name\": \"EdgeArmUser\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/users\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/getExtendedInformation?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2UvZ2V0RXh0ZW5kZWRJbmZvcm1hdGlvbj9hcGktdmVyc2lvbj0yMDE5LTA4LTAx", + "RequestMethod": "POST", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "92f425ca-392f-461e-9965-64beae0df957" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "57752523-6f34-48e3-85cc-c93bd7e8a32b" + ], + "x-ms-client-request-id": [ + "92f425ca-392f-461e-9965-64beae0df957" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-correlation-request-id": [ + "c7b61953-1118-467d-bcf3-e145f96d59f6" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T092919Z:c7b61953-1118-467d-bcf3-e145f96d59f6" + ], + "Date": [ + "Thu, 05 Dec 2019 09:29:18 GMT" + ], + "Content-Length": [ + "1964" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"encryptionKeyThumbprint\": \"FF27EF016674E5A2801B50362ACE4E82E43CBE0E\",\r\n \"encryptionKey\": \"EAAAAOmCAAaQPDb4mYfmhZccBg06QaeYEPS6knXaQITR/GLP9fhpNGvj8PhFr4k/8sZ16sLrNIlzHqIO5ZLqeiAar3pk/W0yBOeTKPRiLkKJ6p1+NoJ3ynpwTfkH3fLf+5/r8j7utB6KnOtGqMXISyACXf3MiNsjqEUV6OkGiv6SuQifo5UTFnifb9XFKNkGfx30epdwSL4+DO79U+gIjZtWm1c0q0D7l1M7d2CEV1HRMX6L3csU9z2qbY/GS5tDcITb2F+LXvKbMIjKklKjaHPWDB2bGd+RQg3sq+JhL5BK8/YeM0cpqLmkEDwnjSaRIl2StJYvQdl1QwPYx7EzO172h/7U6ZhMtatI1543tOTEc8ytJtVFt5i/mtq3Q2xUX92YoRQShqe1m+LZGsmuBSCOTA4OIXDN2BFNYUcExo8m6ZLUlFlbyK5ILNm6gvzdQ3L59fy4FRSFzuCmCEg2XvjZ2E+tml30zGg4cZO9TIcxUcDRn8Ij3ItUseXCKWxNsjHNqZb6h3qAotYjqAhFRHkeeD1IsleGVd5Ws1P05f/IvKZrPEkvOFuHzkR/BlUYuyvq84GbbCe3GyEMue09HytXgVCLKl7yQjCalHICRnIcBfSs4+niQAF5Y3NaUU1VKtDcumvXZT/pZfVyJl+qvDPipicp9Yd1Hk7zCv+i0SO5G1wsep1Mnsj8reApWzKs604zx6qtpQLXQBva0IsGtad+j9KcNd8kSk/o7jBvCp7ckK+3yxxD6yxsXzToZysO+DnCvfEbWVyboqLFnO6QEhw1aDr0m3LHZIXOJ0/00VrOEosC4FcNYaz126gvWPzyTk/wj5GwWOaU1SFHVESCc54j/jMmmr0+8V0QPMWRJgNEE6TQxLFNTheJbJ1fdBNZSLkyF06Y9nB3dER85w3a0Oq4jZDABS3c6JJkOBBMJ2Z45MZHlaeByBk3qESD4xe7qlmyq3QnptVwnLFxvgGCy+8TWcyLjEoQW+Pbu/TFpLK8MitAwgHd/FUvwbIUipLwyt8NIS1NBiI4Sc3Ow06Jpwq68QvSRvlJsRi80tZxhiZQOz7hIJCt8Tg/NAFfiqrGJJnauju3fEZT9SX58MFN4WKRkmGwq8/3F9paxchytZlSQh3wwAwmcJxrXLusWgFqpaNERk32kkSuHHmOdw//VhKh4ZhM5ni8WQx7AaEQtRSfIFpXT8975KGnuYM7/iheQtpH4hzwYeWeCmKE4M5eeiky9QUEtjDw+br9Y6NisT3LlgjmmDT9cYUbbB5G5KpQRSWZL7CqV0mK4o5/53zxUIk6Q0XJJI4eTa0kn+4mfKwSpRItMtx6AskfUJsbjxN31cIJwEh17KMYTr4b0Rs9F/FMVcuQtH17tTDq19PQ5hZa6ZJ6SNHtzpxyICN7orpIS3zv3anaVHwT/bZB/T7zRn2lOoaW6YL2dcJKbQx5BW6XkZhF1RrQOgJVlS17Lnip/5o5acEq3HiJYSlsNzo9/u7Jq5M+PY3qR9A05YHbh6S9dNEbBbES8RYc8nMwwgQ6aduVFQ==\",\r\n \"resourceKey\": \"7915524720635494902\"\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device\",\r\n \"name\": \"demo-edge-device\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/users/EdgeArmUser?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2UvdXNlcnMvRWRnZUFybVVzZXI/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"encryptedPassword\": {\r\n \"value\": \"LMtAExFGlFeCzfgxEWumvM0yaOfcioQLmTlAq5YEbpxMdz4EO/RRGu6rxTJ2LamT63mi/LiF/TKUOEkviu+9V+RIynEQLT5MMBmpmHb3+NWkB6ZBLsy0q/z+HMtJKXfGFJn008F55AvgIeik9L5azrpxTab4ZP9GdybSakS1phO1B4LETPXfeDrhbT/+xAjk4VqW+zMNdhdEsBlzC7jM7JOtHOJjYrWRXMve9HhhHE4AM68SuAUQ9Osm/Ru2CZ/hkw6UeCAQOgkttub/ivMTgFvcSQ+il9c9d49lD81b0XuoT4o135+rA5uhYe56xNgYrFXgZJv2/cT3KztzCglQpQ==\",\r\n \"encryptionCertThumbprint\": \"FF27EF016674E5A2801B50362ACE4E82E43CBE0E\",\r\n \"encryptionAlgorithm\": \"AES256\"\r\n },\r\n \"userType\": \"ARM\"\r\n }\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "08f54e09-7413-4fc2-8972-1a4cf571de06" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "569" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/users/EdgeArmUser/operationResults/217dfda6-defa-4aef-9cb1-b90d7bc2f98d?api-version=2019-08-01" + ], + "Retry-After": [ + "30" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "804db345-9826-4e14-858a-ac908bbfa00b" + ], + "x-ms-client-request-id": [ + "08f54e09-7413-4fc2-8972-1a4cf571de06" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-correlation-request-id": [ + "b4aa7e7b-865b-45d9-b694-65acea4e1247" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T092920Z:b4aa7e7b-865b-45d9-b694-65acea4e1247" + ], + "Date": [ + "Thu, 05 Dec 2019 09:29:19 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/users/EdgeArmUser/operationResults/217dfda6-defa-4aef-9cb1-b90d7bc2f98d?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2UvdXNlcnMvRWRnZUFybVVzZXIvb3BlcmF0aW9uUmVzdWx0cy8yMTdkZmRhNi1kZWZhLTRhZWYtOWNiMS1iOTBkN2JjMmY5OGQ/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/users/EdgeArmUser?api-version=2019-08-01" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "2b9e9731-a48d-498b-be2c-ca946b6fbca6" + ], + "x-ms-client-request-id": [ + "6a4618ee-ea4b-4177-b4ee-512d71fdf6c5" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11986" + ], + "x-ms-correlation-request-id": [ + "cf1b089a-df19-4b6d-8f23-ddd7e1b17b80" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T092950Z:cf1b089a-df19-4b6d-8f23-ddd7e1b17b80" + ], + "Date": [ + "Thu, 05 Dec 2019 09:29:49 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "db4e2fdb-6d80-4e6e-b7cd-736098270664", + "SubId": "db4e2fdb-6d80-4e6e-b7cd-736098270664" + } +} \ No newline at end of file diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/UserTests/Test_UserManagement.json b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/UserTests/Test_UserManagement.json new file mode 100644 index 0000000000000..cf8bf39153d28 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/SessionRecords/UserTests/Test_UserManagement.json @@ -0,0 +1,774 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/getExtendedInformation?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2UvZ2V0RXh0ZW5kZWRJbmZvcm1hdGlvbj9hcGktdmVyc2lvbj0yMDE5LTA4LTAx", + "RequestMethod": "POST", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "628656f1-4e7a-4cdb-ace8-e7eace8e0fb4" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "cf9629d8-d026-4a8a-8688-ddd5644dd739" + ], + "x-ms-client-request-id": [ + "628656f1-4e7a-4cdb-ace8-e7eace8e0fb4" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-correlation-request-id": [ + "af68a0da-6c93-4597-9c6c-9d8791fddad1" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T092454Z:af68a0da-6c93-4597-9c6c-9d8791fddad1" + ], + "Date": [ + "Thu, 05 Dec 2019 09:24:54 GMT" + ], + "Content-Length": [ + "1964" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"encryptionKeyThumbprint\": \"FF27EF016674E5A2801B50362ACE4E82E43CBE0E\",\r\n \"encryptionKey\": \"EAAAAOmCAAaQPDb4mYfmhZccBg06QaeYEPS6knXaQITR/GLP9fhpNGvj8PhFr4k/8sZ16sLrNIlzHqIO5ZLqeiAar3pk/W0yBOeTKPRiLkKJ6p1+NoJ3ynpwTfkH3fLf+5/r8j7utB6KnOtGqMXISyACXf3MiNsjqEUV6OkGiv6SuQifo5UTFnifb9XFKNkGfx30epdwSL4+DO79U+gIjZtWm1c0q0D7l1M7d2CEV1HRMX6L3csU9z2qbY/GS5tDcITb2F+LXvKbMIjKklKjaHPWDB2bGd+RQg3sq+JhL5BK8/YeM0cpqLmkEDwnjSaRIl2StJYvQdl1QwPYx7EzO172h/7U6ZhMtatI1543tOTEc8ytJtVFt5i/mtq3Q2xUX92YoRQShqe1m+LZGsmuBSCOTA4OIXDN2BFNYUcExo8m6ZLUlFlbyK5ILNm6gvzdQ3L59fy4FRSFzuCmCEg2XvjZ2E+tml30zGg4cZO9TIcxUcDRn8Ij3ItUseXCKWxNsjHNqZb6h3qAotYjqAhFRHkeeD1IsleGVd5Ws1P05f/IvKZrPEkvOFuHzkR/BlUYuyvq84GbbCe3GyEMue09HytXgVCLKl7yQjCalHICRnIcBfSs4+niQAF5Y3NaUU1VKtDcumvXZT/pZfVyJl+qvDPipicp9Yd1Hk7zCv+i0SO5G1wsep1Mnsj8reApWzKs604zx6qtpQLXQBva0IsGtad+j9KcNd8kSk/o7jBvCp7ckK+3yxxD6yxsXzToZysO+DnCvfEbWVyboqLFnO6QEhw1aDr0m3LHZIXOJ0/00VrOEosC4FcNYaz126gvWPzyTk/wj5GwWOaU1SFHVESCc54j/jMmmr0+8V0QPMWRJgNEE6TQxLFNTheJbJ1fdBNZSLkyF06Y9nB3dER85w3a0Oq4jZDABS3c6JJkOBBMJ2Z45MZHlaeByBk3qESD4xe7qlmyq3QnptVwnLFxvgGCy+8TWcyLjEoQW+Pbu/TFpLK8MitAwgHd/FUvwbIUipLwyt8NIS1NBiI4Sc3Ow06Jpwq68QvSRvlJsRi80tZxhiZQOz7hIJCt8Tg/NAFfiqrGJJnauju3fEZT9SX58MFN4WKRkmGwq8/3F9paxchytZlSQh3wwAwmcJxrXLusWgFqpaNERk32kkSuHHmOdw//VhKh4ZhM5ni8WQx7AaEQtRSfIFpXT8975KGnuYM7/iheQtpH4hzwYeWeCmKE4M5eeiky9QUEtjDw+br9Y6NisT3LlgjmmDT9cYUbbB5G5KpQRSWZL7CqV0mK4o5/53zxUIk6Q0XJJI4eTa0kn+4mfKwSpRItMtx6AskfUJsbjxN31cIJwEh17KMYTr4b0Rs9F/FMVcuQtH17tTDq19PQ5hZa6ZJ6SNHtzpxyICN7orpIS3zv3anaVHwT/bZB/T7zRn2lOoaW6YL2dcJKbQx5BW6XkZhF1RrQOgJVlS17Lnip/5o5acEq3HiJYSlsNzo9/u7Jq5M+PY3qR9A05YHbh6S9dNEbBbES8RYc8nMwwgQ6aduVFQ==\",\r\n \"resourceKey\": \"7915524720635494902\"\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device\",\r\n \"name\": \"demo-edge-device\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/users/user1?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2UvdXNlcnMvdXNlcjE/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"encryptedPassword\": {\r\n \"value\": \"LNyvbiulalpJMoSkyCtuzySqqR7wXPFRsYmmXSNpRLj64QJTnNfYGM+2rQqWdDUM8PIhNv7hAKzwlkDH6cjr2em8cPz9DKgPr3SYPmQ5yKrpuMo2nya0E3hXkjcQpW867u/jnTOZ/+nv8OdVlniNQ/yc+k6jd4bRc61sQacNbgKm9li0MrkvMd3PwI9HAiYgxaPtdZBPTZgA8FBedM/3XubhkrBVRhi0QDrWM6Ci7SssTmpHaSZNmQqbhxtGD4TzdL1Y6Lr1H8ZD7E71omfYHiInKSAUZwyieSMyZgpYBf3Wq0YNX5RtcGNJzI7fCqR2YsXRLQpeJ8C4If7+MPAFbA==\",\r\n \"encryptionCertThumbprint\": \"FF27EF016674E5A2801B50362ACE4E82E43CBE0E\",\r\n \"encryptionAlgorithm\": \"AES256\"\r\n },\r\n \"userType\": \"Share\"\r\n }\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "ec43aba6-0b74-42ae-8bcd-9bb56323e444" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "571" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/users/user1/operationResults/c336b9b5-5979-4a59-8339-6daf5b68da3e?api-version=2019-08-01" + ], + "Retry-After": [ + "30" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "e36f2120-2d06-48ed-9ce1-7374a2c20cc0" + ], + "x-ms-client-request-id": [ + "ec43aba6-0b74-42ae-8bcd-9bb56323e444" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-correlation-request-id": [ + "0edde0a3-d08f-4b79-b6c6-7940f26186a1" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T092455Z:0edde0a3-d08f-4b79-b6c6-7940f26186a1" + ], + "Date": [ + "Thu, 05 Dec 2019 09:24:54 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/users/user1/operationResults/c336b9b5-5979-4a59-8339-6daf5b68da3e?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2UvdXNlcnMvdXNlcjEvb3BlcmF0aW9uUmVzdWx0cy9jMzM2YjliNS01OTc5LTRhNTktODMzOS02ZGFmNWI2OGRhM2U/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/users/user1?api-version=2019-08-01" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "560f55b5-3b39-4861-abc0-1432be5b056f" + ], + "x-ms-client-request-id": [ + "c2d0147d-4a51-4b26-afd6-c4d9d83b4d6c" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11999" + ], + "x-ms-correlation-request-id": [ + "5f535bf2-ecb0-41e0-bea8-3d0c0dd7baf5" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T092526Z:5f535bf2-ecb0-41e0-bea8-3d0c0dd7baf5" + ], + "Date": [ + "Thu, 05 Dec 2019 09:25:26 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/users/user1?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2UvdXNlcnMvdXNlcjE/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "61d53d8b-d11f-48a8-af26-9dd666d0ba8b" + ], + "x-ms-client-request-id": [ + "077ea2ff-a2ea-454f-9c39-9026a36004e3" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11998" + ], + "x-ms-correlation-request-id": [ + "36b2bd32-dffb-4bc1-80c8-b43042a1ec1c" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T092558Z:36b2bd32-dffb-4bc1-80c8-b43042a1ec1c" + ], + "Date": [ + "Thu, 05 Dec 2019 09:25:58 GMT" + ], + "Content-Length": [ + "308" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"userType\": \"Share\"\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/users/user1\",\r\n \"name\": \"user1\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/users\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/users/user1?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2UvdXNlcnMvdXNlcjE/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "a9098f3b-eff7-4a6d-b4bc-3912faad7298" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "ee888341-ccd0-47dc-a074-26987d67c38d" + ], + "x-ms-client-request-id": [ + "a9098f3b-eff7-4a6d-b4bc-3912faad7298" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11995" + ], + "x-ms-correlation-request-id": [ + "bf28ac60-8b66-443a-9909-877e28118d08" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T092704Z:bf28ac60-8b66-443a-9909-877e28118d08" + ], + "Date": [ + "Thu, 05 Dec 2019 09:27:03 GMT" + ], + "Content-Length": [ + "308" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"userType\": \"Share\"\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/users/user1\",\r\n \"name\": \"user1\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/users\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/users/user2?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2UvdXNlcnMvdXNlcjI/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"encryptedPassword\": {\r\n \"value\": \"LNyvbiulalpJMoSkyCtuzySqqR7wXPFRsYmmXSNpRLj64QJTnNfYGM+2rQqWdDUM8PIhNv7hAKzwlkDH6cjr2em8cPz9DKgPr3SYPmQ5yKrpuMo2nya0E3hXkjcQpW867u/jnTOZ/+nv8OdVlniNQ/yc+k6jd4bRc61sQacNbgKm9li0MrkvMd3PwI9HAiYgxaPtdZBPTZgA8FBedM/3XubhkrBVRhi0QDrWM6Ci7SssTmpHaSZNmQqbhxtGD4TzdL1Y6Lr1H8ZD7E71omfYHiInKSAUZwyieSMyZgpYBf3Wq0YNX5RtcGNJzI7fCqR2YsXRLQpeJ8C4If7+MPAFbA==\",\r\n \"encryptionCertThumbprint\": \"FF27EF016674E5A2801B50362ACE4E82E43CBE0E\",\r\n \"encryptionAlgorithm\": \"AES256\"\r\n },\r\n \"userType\": \"Share\"\r\n }\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "9b9a3571-5734-4f80-bbbf-0e0df642baef" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "571" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/users/user2/operationResults/0a00a5d3-5629-45df-80ad-b7c37cf75ea7?api-version=2019-08-01" + ], + "Retry-After": [ + "30" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "0f2bbc00-30fc-4cb4-a406-5707972222a4" + ], + "x-ms-client-request-id": [ + "9b9a3571-5734-4f80-bbbf-0e0df642baef" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1198" + ], + "x-ms-correlation-request-id": [ + "c08443f7-0b5b-4e29-9d60-e7ef2dc2b9e1" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T092600Z:c08443f7-0b5b-4e29-9d60-e7ef2dc2b9e1" + ], + "Date": [ + "Thu, 05 Dec 2019 09:26:00 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/users/user2/operationResults/0a00a5d3-5629-45df-80ad-b7c37cf75ea7?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2UvdXNlcnMvdXNlcjIvb3BlcmF0aW9uUmVzdWx0cy8wYTAwYTVkMy01NjI5LTQ1ZGYtODBhZC1iN2MzN2NmNzVlYTc/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/users/user2?api-version=2019-08-01" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "361a82a6-e24e-4472-8e4c-901bd4008377" + ], + "x-ms-client-request-id": [ + "2016062f-6469-4ebe-bbce-19cfc1330504" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11997" + ], + "x-ms-correlation-request-id": [ + "794e908f-0ed5-4310-90b8-555907433068" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T092632Z:794e908f-0ed5-4310-90b8-555907433068" + ], + "Date": [ + "Thu, 05 Dec 2019 09:26:32 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/users/user2?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2UvdXNlcnMvdXNlcjI/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "f6ac165f-e2f0-4607-b092-4f49ba113856" + ], + "x-ms-client-request-id": [ + "02c34c86-8449-4e90-8c30-cd33ed82ac13" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11996" + ], + "x-ms-correlation-request-id": [ + "731e7719-df71-49bb-83ee-200c4215e887" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T092704Z:731e7719-df71-49bb-83ee-200c4215e887" + ], + "Date": [ + "Thu, 05 Dec 2019 09:27:03 GMT" + ], + "Content-Length": [ + "308" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"properties\": {\r\n \"userType\": \"Share\"\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/users/user2\",\r\n \"name\": \"user2\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/users\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/users?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2UvdXNlcnM/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "a8b2b79f-e084-432d-8d42-3c6276f17f28" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "7eee7266-3a1a-46c6-97e0-bd3bad754a21" + ], + "x-ms-client-request-id": [ + "a8b2b79f-e084-432d-8d42-3c6276f17f28" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11994" + ], + "x-ms-correlation-request-id": [ + "7581eb27-25be-49ad-b0ad-4a70aa53905c" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T092705Z:7581eb27-25be-49ad-b0ad-4a70aa53905c" + ], + "Date": [ + "Thu, 05 Dec 2019 09:27:04 GMT" + ], + "Content-Length": [ + "1420" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"properties\": {\r\n \"userType\": \"LocalManagement\"\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/users/EdgeUser\",\r\n \"name\": \"EdgeUser\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/users\"\r\n },\r\n {\r\n \"properties\": {\r\n \"userType\": \"ARM\"\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/users/EdgeARMUser\",\r\n \"name\": \"EdgeARMUser\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/users\"\r\n },\r\n {\r\n \"properties\": {\r\n \"userType\": \"Share\"\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/users/user1\",\r\n \"name\": \"user1\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/users\"\r\n },\r\n {\r\n \"properties\": {\r\n \"userType\": \"Share\"\r\n },\r\n \"id\": \"/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/users/user2\",\r\n \"name\": \"user2\",\r\n \"type\": \"Microsoft.DataBoxEdge/dataBoxEdgeDevices/users\"\r\n }\r\n ]\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/users/user2?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2UvdXNlcnMvdXNlcjI/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "ebcad048-5632-4c0f-ae6e-de795793ff82" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/users/user2/operationResults/9fd9b25e-0bb1-416c-90c7-5c79333e5ae6?api-version=2019-08-01" + ], + "Retry-After": [ + "30" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "a86e2987-f885-4784-be54-299a9fa60962" + ], + "x-ms-client-request-id": [ + "ebcad048-5632-4c0f-ae6e-de795793ff82" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-deletes": [ + "14999" + ], + "x-ms-correlation-request-id": [ + "c8773ac8-9cbf-442c-9ba5-642a8417c309" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T092705Z:c8773ac8-9cbf-442c-9ba5-642a8417c309" + ], + "Date": [ + "Thu, 05 Dec 2019 09:27:05 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/users/user2/operationResults/9fd9b25e-0bb1-416c-90c7-5c79333e5ae6?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2UvdXNlcnMvdXNlcjIvb3BlcmF0aW9uUmVzdWx0cy85ZmQ5YjI1ZS0wYmIxLTQxNmMtOTBjNy01Yzc5MzMzZTVhZTY/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "d3de8ec3-bba0-4f5d-9ac0-8e58d0674144" + ], + "x-ms-client-request-id": [ + "4d9e8a3e-5886-44ce-b43b-ca1c8e126294" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11993" + ], + "x-ms-correlation-request-id": [ + "1d02a9af-f18a-49da-b7dd-583dec713534" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T092737Z:1d02a9af-f18a-49da-b7dd-583dec713534" + ], + "Date": [ + "Thu, 05 Dec 2019 09:27:37 GMT" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "", + "StatusCode": 204 + }, + { + "RequestUri": "/subscriptions/db4e2fdb-6d80-4e6e-b7cd-736098270664/resourceGroups/demo-resources/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/demo-edge-device/users/user2/operationResults/9fd9b25e-0bb1-416c-90c7-5c79333e5ae6?api-version=2019-08-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZGI0ZTJmZGItNmQ4MC00ZTZlLWI3Y2QtNzM2MDk4MjcwNjY0L3Jlc291cmNlR3JvdXBzL2RlbW8tcmVzb3VyY2VzL3Byb3ZpZGVycy9NaWNyb3NvZnQuRGF0YUJveEVkZ2UvZGF0YUJveEVkZ2VEZXZpY2VzL2RlbW8tZWRnZS1kZXZpY2UvdXNlcnMvdXNlcjIvb3BlcmF0aW9uUmVzdWx0cy85ZmQ5YjI1ZS0wYmIxLTQxNmMtOTBjNy01Yzc5MzMzZTVhZTY/YXBpLXZlcnNpb249MjAxOS0wOC0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.27817.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.18363.", + "Microsoft.Azure.Management.DataBoxEdge.DataBoxEdgeManagementClient/1.0.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "x-ms-request-id": [ + "470952ed-a756-462e-bad2-892800e4d448" + ], + "x-ms-client-request-id": [ + "169d8f17-3e03-477c-ad13-4822f939f4c0" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11992" + ], + "x-ms-correlation-request-id": [ + "66a284b1-a108-4c72-98f5-c34bb0fcf1e0" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20191205T092737Z:66a284b1-a108-4c72-98f5-c34bb0fcf1e0" + ], + "Date": [ + "Thu, 05 Dec 2019 09:27:37 GMT" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "", + "StatusCode": 204 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "db4e2fdb-6d80-4e6e-b7cd-736098270664", + "SubId": "db4e2fdb-6d80-4e6e-b7cd-736098270664" + } +} \ No newline at end of file diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/TestConstants.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/TestConstants.cs new file mode 100644 index 0000000000000..e41c849ec7ad4 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/TestConstants.cs @@ -0,0 +1,45 @@ +namespace DataBoxEdge.Tests +{ + /// + /// Contains the constants used in tests + /// + public static class TestConstants + { + /// + /// Location where test resources are created + /// + public const string DefaultResourceLocation = "centraluseuap"; + + /// + /// Resource group in which resources are created + /// + public const string DefaultResourceGroupName = "demo-resources"; + + /// + /// Encryption key of gateway resource + /// + public const string GatewayDeviceCIK = ""; + + /// + /// Encryption key of edge resource + /// + public const string EdgeDeviceCIK = "5d21566d7f55501f02c06ddeaf4984370e499c340458f2f0775223bd316f93c1ff2390de554cf108c07b46f4d42dd302e78a46501d16bf485d515a0e62f7b811"; + + /// + /// Name of the gateway resource being used in the test + /// + public const string GatewayResourceName = "demo-gateway-device"; + + + /// + /// Name of the edge resource being used in the test + /// + public const string EdgeResourceName = "demo-edge-device"; + /// + /// ARM Lite user name + /// + public const string ARMLiteUserName = "EdgeArmUser"; + + + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/AlertTests.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/AlertTests.cs new file mode 100644 index 0000000000000..4db1974417623 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/AlertTests.cs @@ -0,0 +1,48 @@ +using Microsoft.Azure.Management.DataBoxEdge; +using System.Linq; +using Xunit; +using Xunit.Abstractions; + +namespace DataBoxEdge.Tests +{ + /// + /// Contains the tests for alerts APIs + /// + public class AlertTests : DataBoxEdgeTestBase + { + #region Constructor + /// + /// Initializes the instance to test alert APIs + /// + public AlertTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } + + #endregion Constructor + + #region Test Methods + + /// + /// Tests alert list and get APIs + /// + [Fact] + public void Test_Alerts() + { + string contiunationToken = null; + // Get the list of alerts in the device. + var alerts = TestUtilities.ListAlerts(Client, TestConstants.EdgeResourceName, TestConstants.DefaultResourceGroupName, out contiunationToken); + + if (contiunationToken != null) + { + // Get the list of remaining alerts in the device. + alerts = TestUtilities.ListAlertsNext(Client, contiunationToken, out contiunationToken); + } + + if (alerts != null && alerts.Count() > 0) + { + // Get one alert by name + var alert = Client.Alerts.Get(TestConstants.EdgeResourceName, alerts.ToList().First().Name, TestConstants.DefaultResourceGroupName); + } + } + + #endregion Test Methods + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/BandwidthScheduleTests.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/BandwidthScheduleTests.cs new file mode 100644 index 0000000000000..df034567f86b6 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/BandwidthScheduleTests.cs @@ -0,0 +1,49 @@ +using Microsoft.Azure.Management.DataBoxEdge; +using Microsoft.Azure.Management.DataBoxEdge.Models; +using Xunit; +using Xunit.Abstractions; + +namespace DataBoxEdge.Tests +{ + /// + /// Contains the tests for bandwidth schedules APIs + /// + public class BandwidthScheduleTests : DataBoxEdgeTestBase + { + #region Constructor + /// + /// Initializes the instance to test bandwidth schedule APIs + /// + public BandwidthScheduleTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } + + #endregion Constructor + + #region Test Methods + + /// + /// Tests bandwidth schedule create, update, get, list and delete APIs + /// + [Fact] + public void Test_BandwidthSchedule() + { + BandwidthSchedule schedule = TestUtilities.GetBWSObject(); + + // Create a bandwidth schedule + Client.BandwidthSchedules.CreateOrUpdate(TestConstants.EdgeResourceName, "schedule-1", schedule, TestConstants.DefaultResourceGroupName); + + // Get a bandwidth schedule by name + var bandwidthSchedule = Client.BandwidthSchedules.Get(TestConstants.EdgeResourceName, "schedule-1", TestConstants.DefaultResourceGroupName); + + // List all schedules in device + string contiuationToken = null; + var bandwidthSchedules = TestUtilities.ListBandwidthSchedules(Client, TestConstants.EdgeResourceName, TestConstants.DefaultResourceGroupName, out contiuationToken); + + // Delete a schedules by name + Client.BandwidthSchedules.Delete(TestConstants.EdgeResourceName, "schedule-1", TestConstants.DefaultResourceGroupName); + + } + #endregion Test Methods + + } +} + diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/ContainerTests.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/ContainerTests.cs new file mode 100644 index 0000000000000..4659bae41462d --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/ContainerTests.cs @@ -0,0 +1,60 @@ +using Microsoft.Azure.Management.DataBoxEdge; +using Microsoft.Azure.Management.DataBoxEdge.Models; +using System.Collections.Generic; +using System.Linq; +using Xunit; +using Xunit.Abstractions; + +namespace DataBoxEdge.Tests +{ + /// + /// Contains the tests for storage account APIs + /// + public class ContainerTests : DataBoxEdgeTestBase + { + #region Constructor + /// + /// Creates an instance to test storage account APIs + /// + public ContainerTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } + + #endregion Constructor + + #region Test Methods + + /// + /// Tests storage APIs + /// + [Fact] + public void Test_ContainerOperations() + { + string storageAccountName = "storageaccount2"; + string containerName = "container1"; + + // Get storage account details + string storageAccountId = null; + var storageAccount = Client.StorageAccounts.Get(TestConstants.EdgeResourceName, storageAccountName, TestConstants.DefaultResourceGroupName); + if (storageAccount != null) + { + storageAccountId = storageAccount.Id; + } + + var container = new Container(AzureContainerDataFormat.BlockBlob); + // Create container + Client.Containers.CreateOrUpdate(TestConstants.EdgeResourceName, storageAccountName, containerName, container, TestConstants.DefaultResourceGroupName); + + // Get container + container = Client.Containers.Get(TestConstants.EdgeResourceName, storageAccountName, containerName, TestConstants.DefaultResourceGroupName); + + // // List containers in the storage account + string continuationToken = null; + IEnumerable containers = TestUtilities.ListContainers(Client, TestConstants.EdgeResourceName, storageAccountName, TestConstants.DefaultResourceGroupName, out continuationToken); + + // // Delete container + Client.Containers.Delete(TestConstants.EdgeResourceName, storageAccountName, containerName, TestConstants.DefaultResourceGroupName); + + } + + #endregion Test Methods + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/DeviceExtendedInfoTests.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/DeviceExtendedInfoTests.cs new file mode 100644 index 0000000000000..1c4d1c01da962 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/DeviceExtendedInfoTests.cs @@ -0,0 +1,37 @@ +namespace DataBoxEdge.Tests +{ + using Microsoft.Azure.Management.DataBoxEdge.Models; + using Xunit; + using Xunit.Abstractions; + using Microsoft.Azure.Management.DataBoxEdge; + + /// + /// Contains the tests for device extended information APIs + /// + public class DeviceExtendedInfoTests : DataBoxEdgeTestBase + { + #region Constructor + /// + /// Initializes the instance to test device extended information APIs + /// + public DeviceExtendedInfoTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } + + #endregion Constructor + + #region Test Methods + + /// + /// Tests device extended information APIs + /// + [Fact] + public void Test_GetExtendedInformation() + { + // Get the extended information. + var extendedInfo = Client.Devices.GetExtendedInformation(TestConstants.EdgeResourceName, TestConstants.DefaultResourceGroupName); + } + + #endregion Test Methods + + } +} + diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/DeviceTests.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/DeviceTests.cs new file mode 100644 index 0000000000000..b6faff7a07af8 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/DeviceTests.cs @@ -0,0 +1,98 @@ +namespace DataBoxEdge.Tests +{ + using Microsoft.Azure.Management.DataBoxEdge.Models; + using Xunit; + using Xunit.Abstractions; + using Microsoft.Azure.Management.DataBoxEdge; + using System.Linq; + + /// + /// Contains the tests for device operations + /// + public class DeviceTests : DataBoxEdgeTestBase + { + #region Constructor + /// + /// Initializes an instance to test device operations + /// + public DeviceTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } + + #endregion Constructor + + #region Test Methods + + /// + /// Tests create, update, get, list and delete device APIs + /// + [Fact] + public void Test_ManageDeviceOperations() + { + + DataBoxEdgeDevice device = new DataBoxEdgeDevice(); + + // Populate device properties as a Gateway resource + device.PopulateGatewayDeviceProperties(); + + // Create a gateway resource + device.CreateOrUpdate(TestConstants.GatewayResourceName, Client, TestConstants.DefaultResourceGroupName); + + // Get a device by name + var gatewayDevice = Client.Devices.Get(TestConstants.GatewayResourceName, TestConstants.DefaultResourceGroupName); + + string contiuationToken = null; + // Get devices in the resource group + var devicesInResourceGroup = TestUtilities.GetResourcesByResourceGroup(Client, TestConstants.DefaultResourceGroupName, out contiuationToken); + + if (contiuationToken != null) + { + // Get the remaining devices in the resource group + devicesInResourceGroup.ToList().AddRange(TestUtilities.GetResourcesByResourceGroupNext(Client, contiuationToken, out contiuationToken)); + } + + contiuationToken = null; + + // Get all devices in subscription + var devicesInSubscription = TestUtilities.GetResourcesBySubscription(Client, out contiuationToken); + + if (contiuationToken != null) + { + // Get the remaining devices in the subscription + devicesInSubscription.ToList().AddRange(TestUtilities.GetResourcesBySubscriptionNext(Client, contiuationToken, out contiuationToken)); + } + + // Get the tags to be updated to resource + var tags = device.GetTags(); + + // Update tags in the resource + Client.Devices.Update(TestConstants.GatewayResourceName, new DataBoxEdgeDevicePatch() { Tags = tags }, TestConstants.DefaultResourceGroupName); + + // Delete a gateway resource + Client.Devices.Delete(TestConstants.GatewayResourceName, TestConstants.DefaultResourceGroupName); + + // Create an edge device + DataBoxEdgeDevice edgeDevice = new DataBoxEdgeDevice(); + + // Populate device properties as a Gateway resource + edgeDevice.PopulateEdgeDeviceProperties(); + + // Create an edge resource + edgeDevice.CreateOrUpdate(TestConstants.EdgeResourceName, Client, TestConstants.DefaultResourceGroupName); + + } + + /// + /// Tests device admin password change + /// + [Fact] + public void Test_DevicePasswordUpdate() + { + var asymmetricEncryptedSecret = Client.Devices.GetAsymmetricEncryptedSecret(TestConstants.EdgeResourceName, TestConstants.DefaultResourceGroupName, "Password3", TestConstants.EdgeDeviceCIK); + // Update the device admin password + Client.Devices.CreateOrUpdateSecuritySettings(TestConstants.EdgeResourceName, new SecuritySettings(asymmetricEncryptedSecret), TestConstants.DefaultResourceGroupName); + } + + #endregion Test Methods + + } +} + diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/DeviceUpdatesTests.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/DeviceUpdatesTests.cs new file mode 100644 index 0000000000000..345e4486de190 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/DeviceUpdatesTests.cs @@ -0,0 +1,63 @@ +using Microsoft.Azure.Management.DataBoxEdge; +using Xunit; +using Xunit.Abstractions; + + +namespace DataBoxEdge.Tests +{ + /// + /// Contains the tests for device update APIs + /// + public class DeviceUpdatesTests : DataBoxEdgeTestBase + { + #region Constructor + /// + /// Creates an instance to test device update APIs + /// + public DeviceUpdatesTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } + + #endregion Constructor + + #region Test Methods + + /// + /// Tests download device updates APIs. + /// + [Fact] + public void Test_GetAndDownloadUpdates() + { + // Get the update summary. + var updateSummary = Client.Devices.GetUpdateSummary(TestConstants.EdgeResourceName, TestConstants.DefaultResourceGroupName); + + // Scan the device for updates. + Client.Devices.ScanForUpdates(TestConstants.EdgeResourceName, TestConstants.DefaultResourceGroupName); + + // Download the updates in the device. + // This is a long running operation and may take upto hours. + Client.Devices.DownloadUpdates(TestConstants.EdgeResourceName, TestConstants.DefaultResourceGroupName); + + // Get the update summary. + updateSummary = Client.Devices.GetUpdateSummary(TestConstants.EdgeResourceName, TestConstants.DefaultResourceGroupName); + + + } + + + /// + /// Tests install device updates APIs. + /// + //[Fact] + //public void Test_InstallUpdates() + //{ + // // Install updates in the device. + // // This is a long running operation and may take upto hours. + // Client.Devices.InstallUpdates(TestConstants.EdgeResourceName, TestConstants.DefaultResourceGroupName); + + // // Get the update summary. + // var updateSummary = Client.Devices.GetUpdateSummary(TestConstants.EdgeResourceName, TestConstants.DefaultResourceGroupName); + //} + + #endregion Test Methods + } +} + diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/EdgeGatewayTestBase.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/EdgeGatewayTestBase.cs new file mode 100644 index 0000000000000..7f23528f5a09a --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/EdgeGatewayTestBase.cs @@ -0,0 +1,112 @@ +namespace DataBoxEdge.Tests +{ + using Microsoft.Azure.Management.DataBoxEdge; + using Microsoft.Azure.Management.DataBoxEdge.Models; + using Microsoft.Azure.Test.HttpRecorder; + using Microsoft.Rest.ClientRuntime.Azure.TestFramework; + using System; + using System.Reflection; + using System.Threading; + using Xunit.Abstractions; + using Xunit.Sdk; + + /// + /// Base class for all tests + /// + public class DataBoxEdgeTestBase : TestBase, IDisposable + { + /// + /// The subscription id key + /// + protected const string SubIdKey = "SubId"; + + /// + /// The subscription id used for tests + /// + public string SubscriptionId { get; protected set; } + + /// + /// The context in which the tests run + /// + protected MockContext Context { get; set; } + + /// + /// The edge gateway client + /// + public DataBoxEdgeManagementClient Client { get; protected set; } + + + /// + /// Initializes common properties used across tests + /// + public DataBoxEdgeTestBase(ITestOutputHelper testOutputHelper) + { + // Getting test method name here as we are not initializing context from each method + var helper = (TestOutputHelper)testOutputHelper; + ITest test = (ITest)helper.GetType().GetField("test", BindingFlags.NonPublic | BindingFlags.Instance) + .GetValue(helper); + this.Context = MockContext.Start(this.GetType(), test.TestCase.TestMethod.Method.Name); + + this.Client = this.Context.GetServiceClient(); + var testEnv = TestEnvironmentFactory.GetTestEnvironment(); + this.SubscriptionId = testEnv.SubscriptionId; + + if (HttpMockServer.Mode == HttpRecorderMode.Record) + { + HttpMockServer.Variables[SubIdKey] = testEnv.SubscriptionId; + } + } + + /// + /// Wait for the specified span unless we are in mock playback mode + /// + /// The span of time to wait for + public static void Wait(TimeSpan timeout) + { + if (HttpMockServer.Mode != HttpRecorderMode.Playback) + { + Thread.Sleep(timeout); + } + } + + /// + /// Disposes the client and context + /// + public void Dispose() + { + this.Client.Dispose(); + this.Context.Dispose(); + } + + /// + /// Disposes the object + /// + ~DataBoxEdgeTestBase() + { + Dispose(); + } + + ///// + ///// Disposes the object + ///// + //protected static object GetResourceManagementClient(object context, object handler) + //{ + // throw new NotImplementedException(); + //} + + ///// + ///// Disposes the object + ///// + //protected static Sku GetDefaultSku() + //{ + // return new Sku + // { + // Name = SkuName.Edge + // }; + //} + + + + } +} + diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/JobsTests.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/JobsTests.cs new file mode 100644 index 0000000000000..f1710e43d15e0 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/JobsTests.cs @@ -0,0 +1,34 @@ +using Microsoft.Azure.Management.DataBoxEdge; +using Xunit; +using Xunit.Abstractions; + +namespace DataBoxEdge.Tests +{ + /// + /// Contains the tests for jobs APIs + /// + public class JobsTests : DataBoxEdgeTestBase + { + #region Constructor + /// + /// Creates an instance to test jobs API + /// + public JobsTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } + + #endregion Constructor + + #region Test Methods + + /// + /// Test job get API + /// + //[Fact] + //public void Test_Jobs() + //{ + // // Get a job by name + // Client.Jobs.Get(TestConstants.EdgeResourceName, "d27da901-5e8c-4e53-880a-e6f6fd4af560", TestConstants.DefaultResourceGroupName); + //} + #endregion Test Methods + } +} + diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/NetworkSettingsTest.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/NetworkSettingsTest.cs new file mode 100644 index 0000000000000..48328b2ac11b1 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/NetworkSettingsTest.cs @@ -0,0 +1,35 @@ +using Microsoft.Azure.Management.DataBoxEdge; +using Xunit; +using Xunit.Abstractions; + +namespace DataBoxEdge.Tests +{ + /// + /// Contains the tests for network settings APIs + /// + public class NetworkSettingsTest : DataBoxEdgeTestBase + { + #region Constructor + /// + /// Creates an instance to test network settings APIs + /// + public NetworkSettingsTest(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } + + #endregion Constructor + + #region Test Methods + + /// + /// Tests network settings create, update, get, list and delete APIs + /// + [Fact] + public void Test_GetNetworkSettings() + { + // Get the device network settings. + var NetworkSettings = Client.Devices.GetNetworkSettings(TestConstants.EdgeResourceName, TestConstants.DefaultResourceGroupName); + } + + #endregion Test Methods + } +} + diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/OrderTests.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/OrderTests.cs new file mode 100644 index 0000000000000..ec70422c23759 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/OrderTests.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Xunit; +using Xunit.Abstractions; +using Microsoft.Azure.Management.DataBoxEdge; +using Microsoft.Azure.Management.DataBoxEdge.Models; + +namespace DataBoxEdge.Tests +{ + /// + /// Contains the tests for order APIs + /// + public class OrderTests : DataBoxEdgeTestBase + { + #region Constructor + /// + ///Creates an instance to test order API + /// + public OrderTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } + + #endregion Constructor + + #region Test Methods + + /// + /// Tests order create, update, get, list and delete APIs + /// + [Fact] + public void Test_DeviceOrders() + { + Order order = TestUtilities.GetOrderObject(); + // Create an order + Client.Orders.CreateOrUpdate(TestConstants.EdgeResourceName, order, TestConstants.DefaultResourceGroupName); + + // Get an order + Client.Orders.Get(TestConstants.EdgeResourceName, TestConstants.DefaultResourceGroupName); + + // List all orders in the device (We support only one order for now) + string continuationToken = null; + TestUtilities.ListOrders(Client, TestConstants.EdgeResourceName, TestConstants.DefaultResourceGroupName, out continuationToken); + + // Delete an order + Client.Orders.Delete(TestConstants.EdgeResourceName, TestConstants.DefaultResourceGroupName); + } + #endregion Test Methods + + } +} + diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/RoleTests.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/RoleTests.cs new file mode 100644 index 0000000000000..83c180a7e464a --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/RoleTests.cs @@ -0,0 +1,57 @@ +using Microsoft.Azure.Management.DataBoxEdge.Models; +using Xunit; +using Xunit.Abstractions; +using Microsoft.Azure.Management.DataBoxEdge; +using System.Linq; + +namespace DataBoxEdge.Tests +{ + /// + /// Contains the tests for role APIs + /// + public class RoleTests : DataBoxEdgeTestBase + { + #region Constructor + /// + /// Creates an instance to thes role APIs + /// + public RoleTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } + + #endregion Constructor + + #region Test Methods + + /// + /// Tests IoT role management APIs + /// + [Fact] + public void Test_IoTRoles() + { + AsymmetricEncryptedSecret iotDevicesecret = Client.Devices.GetAsymmetricEncryptedSecret(TestConstants.EdgeResourceName, TestConstants.DefaultResourceGroupName, "IotDeviceConnectionString", TestConstants.EdgeDeviceCIK); + AsymmetricEncryptedSecret iotEdgeDevicesecret = Client.Devices.GetAsymmetricEncryptedSecret(TestConstants.EdgeResourceName, TestConstants.DefaultResourceGroupName, "IotEdgeDeviceConnectionString", TestConstants.EdgeDeviceCIK); + + var iotRole = TestUtilities.GetIoTRoleObject(iotDevicesecret, iotEdgeDevicesecret); + + // Create an iot role + Client.Roles.CreateOrUpdate(TestConstants.EdgeResourceName, "iot-1", iotRole, TestConstants.DefaultResourceGroupName); + + // Get an iot role by name + Client.Roles.Get(TestConstants.EdgeResourceName, "iot-1", TestConstants.DefaultResourceGroupName); + + // List iot Roles in the device + string continuationToken = null; + TestUtilities.ListRoles(Client, TestConstants.EdgeResourceName, TestConstants.DefaultResourceGroupName, out continuationToken); + + // Delete iot role + Client.Roles.Delete(TestConstants.EdgeResourceName, "iot-1", TestConstants.DefaultResourceGroupName); + + // Create iot role again as we want to persist it for further testing + Client.Roles.CreateOrUpdate(TestConstants.EdgeResourceName, "iot-1", iotRole, TestConstants.DefaultResourceGroupName); + + } + + #endregion Test Methods + + } +} + diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/ShareTests.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/ShareTests.cs new file mode 100644 index 0000000000000..6c222f2de310a --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/ShareTests.cs @@ -0,0 +1,101 @@ +using Microsoft.Azure.Management.DataBoxEdge; +using Microsoft.Azure.Management.DataBoxEdge.Models; +using System.Collections.Generic; +using System.Linq; +using Xunit; +using Xunit.Abstractions; + +namespace DataBoxEdge.Tests +{ + /// + /// Contains the tests for share APIs + /// + public class ShareTests : DataBoxEdgeTestBase + { + #region Constructor + /// + /// Creates an instance to test share APIs + /// + public ShareTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } + + #endregion Constructor + + #region Test Methods + + /// + /// Tests share management APIs + /// + [Fact] + public void Test_ShareOperations() + { + string sacName = "databoxedgeutdst"; + string userName = "user1"; + + string userId = null; + string sacId = null; + // Get the user details + var user = Client.Users.Get(TestConstants.EdgeResourceName, userName, TestConstants.DefaultResourceGroupName); + if (user != null) + { + userId = user.Id; + } + + // Get SAC details + var sac = Client.StorageAccountCredentials.Get(TestConstants.EdgeResourceName, sacName, TestConstants.DefaultResourceGroupName); + if (sac != null) + { + sacId = sac.Id; + } + + // Get SMB share object + Share smbShare = TestUtilities.GetSMBShareObject(sacId, userId); + + // Create SMB share + Client.Shares.CreateOrUpdate(TestConstants.EdgeResourceName, "smb1", smbShare, TestConstants.DefaultResourceGroupName); + + // Get NFS share object + Share nfsShare = TestUtilities.GetNFSShareObject(sacId, "10.150.76.81"); + + // Create NFS share + Client.Shares.CreateOrUpdate(TestConstants.EdgeResourceName, "nfs1", nfsShare, TestConstants.DefaultResourceGroupName); + + + // Get local share object + Share localShare = TestUtilities.GetNFSShareObject(sacId, "10.150.76.81",DataPolicy.Local); + //Create Local share + Client.Shares.CreateOrUpdate(TestConstants.EdgeResourceName, "localshare", localShare, TestConstants.DefaultResourceGroupName); + + // Get share by name + var share = Client.Shares.Get(TestConstants.EdgeResourceName, "smb1", TestConstants.DefaultResourceGroupName); + + // List shares in the device + string continuationToken = null; + var shares = TestUtilities.ListShares(Client, TestConstants.EdgeResourceName, TestConstants.DefaultResourceGroupName, out continuationToken); + + if (continuationToken != null) + { + shares.ToList().AddRange(TestUtilities.ListSharesNext(Client, continuationToken, out continuationToken)); + } + + // Delete a share + Client.Shares.Delete(TestConstants.EdgeResourceName, "smb1", TestConstants.DefaultResourceGroupName); + + } + + /// + /// Tests share refresh API + /// + [Fact] + public void Test_RefreshShare() + { + + + // Refresh a share + Client.Shares.Refresh(TestConstants.EdgeResourceName, "nfs1", TestConstants.DefaultResourceGroupName); + + } + #endregion Test Methods + + } +} + diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/SkuTests.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/SkuTests.cs new file mode 100644 index 0000000000000..2af5b03c04d0a --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/SkuTests.cs @@ -0,0 +1,34 @@ +using Microsoft.Azure.Management.DataBoxEdge; +using Microsoft.Azure.Management.DataBoxEdge.Models; +using System.Collections.Generic; +using System.Linq; +using Xunit; +using Xunit.Abstractions; + +namespace DataBoxEdge.Tests +{ + /// + /// Contains the tests for Sku API + /// + public class SkuTests : DataBoxEdgeTestBase + { + #region Constructor + /// + /// Creates an instance to test share APIs + /// + public SkuTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } + + #endregion Constructor + + #region Test Methods + /// + /// Tests sku API + /// + [Fact] + public void Test_ListSku() + { + var skus = Client.Skus.List("location eq '" + TestConstants.DefaultResourceLocation +"'"); + } + #endregion Test Methods + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/StorageAccountCredentialsTests.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/StorageAccountCredentialsTests.cs new file mode 100644 index 0000000000000..8c39f59f7ac43 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/StorageAccountCredentialsTests.cs @@ -0,0 +1,59 @@ +using Microsoft.Azure.Management.DataBoxEdge; +using Microsoft.Azure.Management.DataBoxEdge.Models; +using Xunit; +using Xunit.Abstractions; + +namespace DataBoxEdge.Tests +{ + /// + /// Contains the tests for storage account credential APIs + /// + public class StorageAccountCredentialsTests : DataBoxEdgeTestBase + { + #region Constructor + + /// + /// Creates an instance to test storage account credential APIs + /// + public StorageAccountCredentialsTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } + + #endregion Constructor + + #region Test Methods + + /// + /// Tests storage account credential APIs + /// + [Fact] + public void Test_SACManagement() + { + // There is a restriction that storage account name and SAC name has to be same. So the names are used interchanteable + string storageAccountName = "databoxedgeutdst"; + //Create storage account credential + AsymmetricEncryptedSecret encryptedSecret = Client.Devices.GetAsymmetricEncryptedSecret(TestConstants.EdgeResourceName, TestConstants.DefaultResourceGroupName, "EyIbt0QelBmm4ggkWsvQGaGaijYv/JBXIRl5ZR7pwgCJCkLYQmKY+H5RV4COGhbi01dBRIC1dNSF1sbJoeAL1Q==", TestConstants.EdgeDeviceCIK); + StorageAccountCredential sac1 = TestUtilities.GetSACObject(encryptedSecret, storageAccountName); + Client.StorageAccountCredentials.CreateOrUpdate(TestConstants.EdgeResourceName, storageAccountName, sac1, TestConstants.DefaultResourceGroupName); + + //Get storage account credential by name. + Client.StorageAccountCredentials.Get(TestConstants.EdgeResourceName, storageAccountName, TestConstants.DefaultResourceGroupName); + + //List storage account credentials in the device + string continuationToken = null; + var storageCredentials = TestUtilities.ListStorageAccountCredentials(Client, TestConstants.EdgeResourceName, TestConstants.DefaultResourceGroupName,out continuationToken); + + //List storage account credentials in the device + Client.StorageAccountCredentials.Delete(TestConstants.EdgeResourceName, storageAccountName, TestConstants.DefaultResourceGroupName); + + //Create again as we want to keep the SAC object inresource + sac1 = TestUtilities.GetSACObject(encryptedSecret, storageAccountName); + Client.StorageAccountCredentials.CreateOrUpdate(TestConstants.EdgeResourceName, storageAccountName, sac1, TestConstants.DefaultResourceGroupName); + + } + + #endregion Test Methods + + + + } +} + diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/StorageAccountTests.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/StorageAccountTests.cs new file mode 100644 index 0000000000000..b777606799aa0 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/StorageAccountTests.cs @@ -0,0 +1,63 @@ +using Microsoft.Azure.Management.DataBoxEdge; +using Microsoft.Azure.Management.DataBoxEdge.Models; +using System.Collections.Generic; +using System.Linq; +using Xunit; +using Xunit.Abstractions; + +namespace DataBoxEdge.Tests +{ + /// + /// Contains the tests for storage account APIs + /// + public class StorageAccountTests : DataBoxEdgeTestBase + { + #region Constructor + /// + /// Creates an instance to test storage account APIs + /// + public StorageAccountTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } + + #endregion Constructor + + #region Test Methods + + /// + /// Tests storage APIs + /// + [Fact] + public void Test_StorageOperations() + { + string sacName = "databoxedgeutdst"; + // Get SAC details + string sacId = null; + var sac = Client.StorageAccountCredentials.Get(TestConstants.EdgeResourceName, sacName, TestConstants.DefaultResourceGroupName); + if (sac != null) + { + sacId = sac.Id; + } + var storageAccount = new StorageAccount(storageAccountStatus: StorageAccountStatus.OK, dataPolicy: DataPolicy.Cloud, storageAccountCredentialId: sacId, description: "It is a simple storage account"); + + // Create storage account + Client.StorageAccounts.CreateOrUpdate(TestConstants.EdgeResourceName, "storageaccount1", storageAccount, TestConstants.DefaultResourceGroupName); + + // Get storage account + storageAccount = Client.StorageAccounts.Get(TestConstants.EdgeResourceName, "storageaccount1", TestConstants.DefaultResourceGroupName); + + // // List storage account in the device + string continuationToken = null; + IEnumerable storageAccounts = TestUtilities.ListStorageAccounts(Client, TestConstants.EdgeResourceName, TestConstants.DefaultResourceGroupName, out continuationToken); + + // // Delete storage account + Client.StorageAccounts.Delete(TestConstants.EdgeResourceName, "storageaccount1", TestConstants.DefaultResourceGroupName); + + var storageAccount2 = new StorageAccount(storageAccountStatus: StorageAccountStatus.OK, dataPolicy: DataPolicy.Cloud, storageAccountCredentialId: sacId, description: "It is a simple storage account"); + + // Create storage account + Client.StorageAccounts.CreateOrUpdate(TestConstants.EdgeResourceName, "storageaccount2", storageAccount2, TestConstants.DefaultResourceGroupName); + + } + + #endregion Test Methods + } +} diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/TriggerTests.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/TriggerTests.cs new file mode 100644 index 0000000000000..aefd038847466 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/TriggerTests.cs @@ -0,0 +1,69 @@ +using Microsoft.Azure.Management.DataBoxEdge; +using Microsoft.Azure.Management.DataBoxEdge.Models; +using System.Collections.Generic; +using System.Linq; +using Xunit; +using Xunit.Abstractions; + +namespace DataBoxEdge.Tests +{ + /// + /// Contains the tests for trigger APIs + /// + public class TriggerTests : DataBoxEdgeTestBase + { + #region Constructor + /// + /// Creates an instance to test share APIs + /// + public TriggerTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } + + #endregion Constructor + + #region Test Methods + + /// + /// Tests share management APIs + /// + [Fact] + public void Test_TriggerOperations() + { + string localShareId = null, iotRoleId = null; + + // Get an iot role by name + var iotRole = Client.Roles.Get(TestConstants.EdgeResourceName, "iot-1", TestConstants.DefaultResourceGroupName); + if (iotRole != null) + { + iotRoleId = iotRole.Id; + } + var localShare = Client.Shares.Get(TestConstants.EdgeResourceName, "localshare", TestConstants.DefaultResourceGroupName); + if (localShare != null) + { + localShareId = localShare.Id; + } + + Trigger fileTrigger = TestUtilities.GetFileTriggerObject(localShareId, iotRoleId); + + // Create a file event trigger + Client.Triggers.CreateOrUpdate(TestConstants.EdgeResourceName, "trigger-fileEventTrigger", fileTrigger, TestConstants.DefaultResourceGroupName); + + // Create a periodic timer event trigger + + Trigger periodicTrigger = TestUtilities.GetPeriodicTriggerObject(iotRoleId); + Client.Triggers.CreateOrUpdate(TestConstants.EdgeResourceName, "trigger-periodicTrigger", periodicTrigger, TestConstants.DefaultResourceGroupName); + + // Get a trigger by name + var trigger = Client.Triggers.Get(TestConstants.EdgeResourceName, "trigger-periodicTrigger", TestConstants.DefaultResourceGroupName); + + string continuationToken = null; + // List all triggers in the device + var triggers = TestUtilities.ListTriggers(Client, TestConstants.EdgeResourceName, TestConstants.DefaultResourceGroupName, out continuationToken); + + // Delete a share + Client.Triggers.Delete(TestConstants.EdgeResourceName, "trigger-periodicTrigger", TestConstants.DefaultResourceGroupName); + } + #endregion Test Methods + + } +} + diff --git a/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/UserTests.cs b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/UserTests.cs new file mode 100644 index 0000000000000..b60ebe0e91ac3 --- /dev/null +++ b/sdk/databoxedge/Microsoft.Azure.Management.DataBoxEdge/tests/Tests/UserTests.cs @@ -0,0 +1,73 @@ +using Microsoft.Azure.Management.DataBoxEdge; +using Microsoft.Azure.Management.DataBoxEdge.Models; +using System.Linq; +using Xunit; +using Xunit.Abstractions; + +namespace DataBoxEdge.Tests +{ + /// + /// Contains the tests for user operations + /// + public class UserTests : DataBoxEdgeTestBase + { + #region Constructor + /// + /// Initializes an instance to test user operations + /// + public UserTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } + + #endregion Constructor + + #region Test Methods + + /// + /// Tests user management APIs + /// + [Fact] + public void Test_UserManagement() + { + // Create the encrypted password for the user + AsymmetricEncryptedSecret encryptedSecret = Client.Devices.GetAsymmetricEncryptedSecret(TestConstants.EdgeResourceName, TestConstants.DefaultResourceGroupName, "Password1", TestConstants.EdgeDeviceCIK); + User user = new User() { EncryptedPassword = encryptedSecret, UserType = UserType.Share }; + + // Create user. + Client.Users.CreateOrUpdate(TestConstants.EdgeResourceName, "user1", user, TestConstants.DefaultResourceGroupName); + Client.Users.CreateOrUpdate(TestConstants.EdgeResourceName, "user2", user, TestConstants.DefaultResourceGroupName); + + // Get user by name + var retrievedUser = Client.Users.Get(TestConstants.EdgeResourceName, "user1", TestConstants.DefaultResourceGroupName); + + // List users in the device + string continuationToken = null; + var usersInDevice = TestUtilities.ListUsers(Client, TestConstants.EdgeResourceName, TestConstants.DefaultResourceGroupName, out continuationToken); + if (continuationToken != null) + { + usersInDevice.ToList().AddRange(TestUtilities.ListUsers(Client, TestConstants.EdgeResourceName, TestConstants.DefaultResourceGroupName, out continuationToken)); + } + + // Delete user + Client.Users.Delete(TestConstants.EdgeResourceName, "user2", TestConstants.DefaultResourceGroupName); + + } + + /// + /// Tests user management APIs + /// + [Fact] + public void Test_ARMUserPasswordUpdate() + { + // Get user by name + var retrievedUser = Client.Users.Get(TestConstants.EdgeResourceName, TestConstants.ARMLiteUserName, TestConstants.DefaultResourceGroupName); + + // Create the encrypted password for the user + AsymmetricEncryptedSecret encryptedSecret = Client.Devices.GetAsymmetricEncryptedSecret(TestConstants.EdgeResourceName, TestConstants.DefaultResourceGroupName, "Password1", TestConstants.EdgeDeviceCIK); + retrievedUser.EncryptedPassword = encryptedSecret; + + // Create user. + Client.Users.CreateOrUpdate(TestConstants.EdgeResourceName, TestConstants.ARMLiteUserName, retrievedUser, TestConstants.DefaultResourceGroupName); + } + #endregion Test Methods + } +} + diff --git a/src/SDKs/_metadata/databoxedge_resource-manager.txt b/src/SDKs/_metadata/databoxedge_resource-manager.txt new file mode 100644 index 0000000000000..fb3b4debf1d98 --- /dev/null +++ b/src/SDKs/_metadata/databoxedge_resource-manager.txt @@ -0,0 +1,11 @@ +2019-12-09 06:34:37 UTC + +1) azure-rest-api-specs repository information +GitHub user: azure +Branch: master +Commit: ef354ec8d6580227707ed935684e533b898beabe + +2) AutoRest information +Requested version: latest +Bootstrapper version: C:\Users\anponnet\AppData\Roaming\npm `-- autorest@2.0.4407 +Latest installed version: