diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Customizations/RecoveryServicesClient.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Customizations/RecoveryServicesClient.cs new file mode 100644 index 000000000000..db2a6433f0ab --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Customizations/RecoveryServicesClient.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. + +using System.Linq; +using System.Net.Http; +using Microsoft.Rest; +using Microsoft.Rest.Serialization; + +namespace Microsoft.Azure.Management.RecoveryServices +{ + public partial class RecoveryServicesClient + { + bool DisableDispose { get; set; } + + protected RecoveryServicesClient(HttpClient httpClient, params DelegatingHandler[] handlers) + { + InitializeHttpClient(httpClient, null, handlers); + Initialize(); + } + + public RecoveryServicesClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClient httpClient, bool disableDispose, params DelegatingHandler[] handlers) + : this(httpClient, 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); + } + DisableDispose = disableDispose; + } + + protected override void Dispose(bool disposing) + { + if (DisableDispose) + { + base.Dispose(disposing); + } + } + + partial void CustomInitialize() + { + var iso8601TimeSpanConverter = DeserializationSettings.Converters.First(conv => conv is Iso8601TimeSpanConverter); + if (iso8601TimeSpanConverter != null) + { + DeserializationSettings.Converters.Remove(iso8601TimeSpanConverter); + } + } + } +} \ No newline at end of file diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/BackupStorageConfigsOperations.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/BackupStorageConfigsOperations.cs new file mode 100644 index 000000000000..e75fdc8e9760 --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/BackupStorageConfigsOperations.cs @@ -0,0 +1,433 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + 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; + + /// + /// BackupStorageConfigsOperations operations. + /// + internal partial class BackupStorageConfigsOperations : IServiceOperations, IBackupStorageConfigsOperations + { + /// + /// Initializes a new instance of the BackupStorageConfigsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal BackupStorageConfigsOperations(RecoveryServicesClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesClient + /// + public RecoveryServicesClient Client { get; private set; } + + /// + /// Fetches resource storage config. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// 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 resourceGroupName, string vaultName, 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 (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + string apiVersion = "2016-12-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); + 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.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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; + } + + /// + /// Updates vault storage model type. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// Backup storage config. + /// + /// + /// 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 UpdateWithHttpMessagesAsync(string resourceGroupName, string vaultName, BackupStorageConfig backupStorageConfig, 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 (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (backupStorageConfig == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "backupStorageConfig"); + } + string apiVersion = "2016-12-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("backupStorageConfig", backupStorageConfig); + 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.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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(backupStorageConfig != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(backupStorageConfig, 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 != 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; + } + + } +} diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/BackupStorageConfigsOperationsExtensions.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/BackupStorageConfigsOperationsExtensions.cs new file mode 100644 index 000000000000..a3eea8c07697 --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/BackupStorageConfigsOperationsExtensions.cs @@ -0,0 +1,108 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for BackupStorageConfigsOperations. + /// + public static partial class BackupStorageConfigsOperationsExtensions + { + /// + /// Fetches resource storage config. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the recovery services vault. + /// + public static BackupStorageConfig Get(this IBackupStorageConfigsOperations operations, string resourceGroupName, string vaultName) + { + return operations.GetAsync(resourceGroupName, vaultName).GetAwaiter().GetResult(); + } + + /// + /// Fetches resource storage config. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IBackupStorageConfigsOperations operations, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vaultName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates vault storage model type. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// Backup storage config. + /// + public static void Update(this IBackupStorageConfigsOperations operations, string resourceGroupName, string vaultName, BackupStorageConfig backupStorageConfig) + { + operations.UpdateAsync(resourceGroupName, vaultName, backupStorageConfig).GetAwaiter().GetResult(); + } + + /// + /// Updates vault storage model type. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// Backup storage config. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IBackupStorageConfigsOperations operations, string resourceGroupName, string vaultName, BackupStorageConfig backupStorageConfig, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.UpdateWithHttpMessagesAsync(resourceGroupName, vaultName, backupStorageConfig, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + } +} diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/BackupVaultConfigsOperations.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/BackupVaultConfigsOperations.cs new file mode 100644 index 000000000000..e6a7ad44a289 --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/BackupVaultConfigsOperations.cs @@ -0,0 +1,454 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + 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; + + /// + /// BackupVaultConfigsOperations operations. + /// + internal partial class BackupVaultConfigsOperations : IServiceOperations, IBackupVaultConfigsOperations + { + /// + /// Initializes a new instance of the BackupVaultConfigsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal BackupVaultConfigsOperations(RecoveryServicesClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesClient + /// + public RecoveryServicesClient Client { get; private set; } + + /// + /// Fetches vault config. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// 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 resourceGroupName, string vaultName, 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 (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + string apiVersion = "2016-12-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); + 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.RecoveryServices/vaults/{vaultName}/backupconfig/vaultconfig").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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; + } + + /// + /// Updates vault config model type. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// Backup vault config. + /// + /// + /// 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 resourceGroupName, string vaultName, BackupVaultConfig backupVaultConfig, 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 (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (backupVaultConfig == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "backupVaultConfig"); + } + string apiVersion = "2016-12-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("backupVaultConfig", backupVaultConfig); + 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.RecoveryServices/vaults/{vaultName}/backupconfig/vaultconfig").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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(backupVaultConfig != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(backupVaultConfig, 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; + } + + } +} diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/BackupVaultConfigsOperationsExtensions.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/BackupVaultConfigsOperationsExtensions.cs new file mode 100644 index 000000000000..d0a968329ca1 --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/BackupVaultConfigsOperationsExtensions.cs @@ -0,0 +1,111 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for BackupVaultConfigsOperations. + /// + public static partial class BackupVaultConfigsOperationsExtensions + { + /// + /// Fetches vault config. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the recovery services vault. + /// + public static BackupVaultConfig Get(this IBackupVaultConfigsOperations operations, string resourceGroupName, string vaultName) + { + return operations.GetAsync(resourceGroupName, vaultName).GetAwaiter().GetResult(); + } + + /// + /// Fetches vault config. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IBackupVaultConfigsOperations operations, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vaultName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates vault config model type. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// Backup vault config. + /// + public static BackupVaultConfig Update(this IBackupVaultConfigsOperations operations, string resourceGroupName, string vaultName, BackupVaultConfig backupVaultConfig) + { + return operations.UpdateAsync(resourceGroupName, vaultName, backupVaultConfig).GetAwaiter().GetResult(); + } + + /// + /// Updates vault config model type. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// Backup vault config. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IBackupVaultConfigsOperations operations, string resourceGroupName, string vaultName, BackupVaultConfig backupVaultConfig, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, vaultName, backupVaultConfig, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/IBackupStorageConfigsOperations.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/IBackupStorageConfigsOperations.cs new file mode 100644 index 000000000000..628d398c9ae2 --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/IBackupStorageConfigsOperations.cs @@ -0,0 +1,75 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// BackupStorageConfigsOperations operations. + /// + public partial interface IBackupStorageConfigsOperations + { + /// + /// Fetches resource storage config. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// 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 resourceGroupName, string vaultName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates vault storage model type. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// Backup storage config. + /// + /// + /// 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 UpdateWithHttpMessagesAsync(string resourceGroupName, string vaultName, BackupStorageConfig backupStorageConfig, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/IBackupVaultConfigsOperations.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/IBackupVaultConfigsOperations.cs new file mode 100644 index 000000000000..d303bb217eff --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/IBackupVaultConfigsOperations.cs @@ -0,0 +1,78 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// BackupVaultConfigsOperations operations. + /// + public partial interface IBackupVaultConfigsOperations + { + /// + /// Fetches vault config. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// 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 resourceGroupName, string vaultName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates vault config model type. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// Backup vault config. + /// + /// + /// 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 resourceGroupName, string vaultName, BackupVaultConfig backupVaultConfig, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/IOperations.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/IOperations.cs new file mode 100644 index 000000000000..675d715b50bb --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/IOperations.cs @@ -0,0 +1,68 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + 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 + { + /// + /// Returns the list of available operations. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// 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 resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Returns the list of available 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/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/IRecoveryServicesClient.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/IRecoveryServicesClient.cs index 5c0691d781c5..983ef915a66d 100644 --- a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/IRecoveryServicesClient.cs +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/IRecoveryServicesClient.cs @@ -1,17 +1,18 @@ -// 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 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.RecoveryServices { + using Microsoft.Azure; + using Microsoft.Azure.Management; using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; + using Newtonsoft.Json; /// + /// Composite Swagger for Recovery Services Client /// public partial interface IRecoveryServicesClient : System.IDisposable { @@ -23,28 +24,23 @@ public partial interface IRecoveryServicesClient : System.IDisposable /// /// Gets or sets json serialization settings. /// - Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; } + JsonSerializerSettings SerializationSettings { get; } /// /// Gets or sets json deserialization settings. /// - Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; } + JsonSerializerSettings DeserializationSettings { get; } /// /// Credentials needed for the client to connect to Azure. /// - Microsoft.Rest.ServiceClientCredentials Credentials { get; } + ServiceClientCredentials Credentials { get; } /// /// The subscription Id. /// string SubscriptionId { get; set; } - /// - /// Client Api Version. - /// - string ApiVersion { get; } - /// /// Gets or sets the preferred language for the response. /// @@ -57,16 +53,56 @@ public partial interface IRecoveryServicesClient : System.IDisposable int? LongRunningOperationRetryTimeout { get; set; } /// - /// When set to true a unique x-ms-client-request-id value is - /// generated and included in each request. Default is true. + /// 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 IBackupVaultConfigsOperations. + /// + IBackupVaultConfigsOperations BackupVaultConfigs { get; } + + /// + /// Gets the IBackupStorageConfigsOperations. + /// + IBackupStorageConfigsOperations BackupStorageConfigs { get; } + + /// + /// Gets the IVaultCertificatesOperations. + /// + IVaultCertificatesOperations VaultCertificates { get; } + + /// + /// Gets the IRegisteredIdentitiesOperations. + /// + IRegisteredIdentitiesOperations RegisteredIdentities { get; } + + /// + /// Gets the IReplicationUsagesOperations. + /// + IReplicationUsagesOperations ReplicationUsages { get; } + /// /// Gets the IVaultsOperations. /// IVaultsOperations Vaults { get; } + /// + /// Gets the IVaultExtendedInfoOperations. + /// + IVaultExtendedInfoOperations VaultExtendedInfo { get; } + + /// + /// Gets the IUsagesOperations. + /// + IUsagesOperations Usages { get; } + } } diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/IRegisteredIdentitiesOperations.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/IRegisteredIdentitiesOperations.cs new file mode 100644 index 000000000000..a4d0b0bbcd44 --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/IRegisteredIdentitiesOperations.cs @@ -0,0 +1,49 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// RegisteredIdentitiesOperations operations. + /// + public partial interface IRegisteredIdentitiesOperations + { + /// + /// Unregisters the given container from your Recovery Services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// Name of the protection container to unregister. + /// + /// + /// 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 resourceGroupName, string vaultName, string identityName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/IReplicationUsagesOperations.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/IReplicationUsagesOperations.cs new file mode 100644 index 000000000000..e525882063c1 --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/IReplicationUsagesOperations.cs @@ -0,0 +1,49 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ReplicationUsagesOperations operations. + /// + public partial interface IReplicationUsagesOperations + { + /// + /// Fetches the replication usages of the vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// 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 resourceGroupName, string vaultName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/IUsagesOperations.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/IUsagesOperations.cs new file mode 100644 index 000000000000..e417b229bf3d --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/IUsagesOperations.cs @@ -0,0 +1,49 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// UsagesOperations operations. + /// + public partial interface IUsagesOperations + { + /// + /// Fetches the usages of the vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// 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>> ListByVaultsWithHttpMessagesAsync(string resourceGroupName, string vaultName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/IVaultCertificatesOperations.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/IVaultCertificatesOperations.cs new file mode 100644 index 000000000000..331c82d60486 --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/IVaultCertificatesOperations.cs @@ -0,0 +1,55 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// VaultCertificatesOperations operations. + /// + public partial interface IVaultCertificatesOperations + { + /// + /// Upload a certificate for a resource. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// Certificate friendly name. + /// + /// + /// Input parameters for uploading the vault certificate. + /// + /// + /// 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> CreateWithHttpMessagesAsync(string resourceGroupName, string vaultName, string certificateName, CertificateRequest certificateRequest, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/IVaultExtendedInfoOperations.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/IVaultExtendedInfoOperations.cs new file mode 100644 index 000000000000..acda50836779 --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/IVaultExtendedInfoOperations.cs @@ -0,0 +1,107 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// VaultExtendedInfoOperations operations. + /// + public partial interface IVaultExtendedInfoOperations + { + /// + /// Get the vault extended info. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// 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 resourceGroupName, string vaultName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create vault extended info. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// resourceResourceExtendedInfoDetails + /// + /// + /// 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 resourceGroupName, string vaultName, VaultExtendedInfoResource resourceResourceExtendedInfoDetails, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update vault extended info. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// resourceResourceExtendedInfoDetails + /// + /// + /// 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 resourceGroupName, string vaultName, VaultExtendedInfoResource resourceResourceExtendedInfoDetails, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/IVaultsOperations.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/IVaultsOperations.cs index 7cd2f45f108e..9092457fc8cc 100644 --- a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/IVaultsOperations.cs +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/IVaultsOperations.cs @@ -1,14 +1,18 @@ -// 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 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.RecoveryServices { + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; /// /// VaultsOperations operations. @@ -16,14 +20,31 @@ namespace Microsoft.Azure.Management.RecoveryServices public partial interface IVaultsOperations { /// - /// Get the Vault details. + /// Fetches all the resources of the specified type in the + /// subscription. /// - /// - /// The name of the resource group where the recovery services vault - /// is present. + /// + /// The headers that will be added to request. /// - /// - /// The name of the recovery services vault. + /// + /// 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>> ListBySubscriptionIdWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Retrieve a list of Vaults. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. /// /// /// The headers that will be added to request. @@ -40,20 +61,17 @@ public partial interface IVaultsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Creates or updates a Recovery Services vault. + /// Get the Vault details. /// /// - /// The name of the resource group where the recovery services vault - /// is present. + /// The name of the resource group where the recovery services vault is + /// present. /// /// /// The name of the recovery services vault. /// - /// - /// Recovery Services Vault to be created. - /// /// /// The headers that will be added to request. /// @@ -69,17 +87,20 @@ public partial interface IVaultsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vaultName, Vault vault, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Deletes a vault. + /// Creates or updates a Recovery Services vault. /// /// - /// The name of the resource group where the recovery services vault - /// is present. + /// The name of the resource group where the recovery services vault is + /// present. /// /// /// The name of the recovery services vault. /// + /// + /// Recovery Services Vault to be created. + /// /// /// The headers that will be added to request. /// @@ -89,16 +110,22 @@ public partial interface IVaultsOperations /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vaultName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vaultName, Vault vault, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Retrieve a list of Vaults. + /// Deletes a vault. /// /// - /// The name of the resource group where the recovery services vault - /// is present. + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the recovery services vault. /// /// /// The headers that will be added to request. @@ -109,18 +136,22 @@ public partial interface IVaultsOperations /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vaultName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Retrieve a list of Vaults. + /// Updates the vault. /// - /// - /// The NextLink from the previous successful call to List operation. + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// Recovery Services Vault to be created. /// /// /// The headers that will be added to request. @@ -137,6 +168,6 @@ public partial interface IVaultsOperations /// /// Thrown when a required parameter is null /// - System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string vaultName, Vault vault, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/AuthType.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/AuthType.cs new file mode 100644 index 000000000000..803d1f8d8764 --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/AuthType.cs @@ -0,0 +1,22 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.RecoveryServices; + + /// + /// Defines values for AuthType. + /// + public static class AuthType + { + public const string Invalid = "Invalid"; + public const string ACS = "ACS"; + public const string AAD = "AAD"; + public const string AccessControlService = "AccessControlService"; + public const string AzureActiveDirectory = "AzureActiveDirectory"; + } +} diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/BackupStorageConfig.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/BackupStorageConfig.cs new file mode 100644 index 000000000000..3b79445fbac4 --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/BackupStorageConfig.cs @@ -0,0 +1,75 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.RecoveryServices; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The backup storage config. + /// + [Rest.Serialization.JsonTransformation] + public partial class BackupStorageConfig : Resource + { + /// + /// Initializes a new instance of the BackupStorageConfig class. + /// + public BackupStorageConfig() { } + + /// + /// Initializes a new instance of the BackupStorageConfig class. + /// + /// Resource Id represents the complete path to the + /// resource. + /// Resource name associated with the + /// resource. + /// Resource type represents the complete path of + /// the form Namespace/ResourceType/ResourceType/... + /// Optional ETag. + /// Storage model type. Possible values + /// include: 'Invalid', 'GeoRedundant', 'LocallyRedundant' + /// Storage type. Possible values include: + /// 'Invalid', 'GeoRedundant', 'LocallyRedundant' + /// Locked or Unlocked. Once a machine + /// is registered against a resource, the storageTypeState is always + /// Locked. Possible values include: 'Invalid', 'Locked', + /// 'Unlocked' + public BackupStorageConfig(string id = default(string), string name = default(string), string type = default(string), string eTag = default(string), string storageModelType = default(string), string storageType = default(string), string storageTypeState = default(string)) + : base(id, name, type, eTag) + { + StorageModelType = storageModelType; + StorageType = storageType; + StorageTypeState = storageTypeState; + } + + /// + /// Gets or sets storage model type. Possible values include: + /// 'Invalid', 'GeoRedundant', 'LocallyRedundant' + /// + [JsonProperty(PropertyName = "properties.storageModelType")] + public string StorageModelType { get; set; } + + /// + /// Gets or sets storage type. Possible values include: 'Invalid', + /// 'GeoRedundant', 'LocallyRedundant' + /// + [JsonProperty(PropertyName = "properties.storageType")] + public string StorageType { get; set; } + + /// + /// Gets or sets locked or Unlocked. Once a machine is registered + /// against a resource, the storageTypeState is always Locked. Possible + /// values include: 'Invalid', 'Locked', 'Unlocked' + /// + [JsonProperty(PropertyName = "properties.storageTypeState")] + public string StorageTypeState { get; set; } + + } +} diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/BackupVaultConfig.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/BackupVaultConfig.cs new file mode 100644 index 000000000000..76d310a59261 --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/BackupVaultConfig.cs @@ -0,0 +1,75 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.RecoveryServices; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Backup vault config details. + /// + [Rest.Serialization.JsonTransformation] + public partial class BackupVaultConfig : Resource + { + /// + /// Initializes a new instance of the BackupVaultConfig class. + /// + public BackupVaultConfig() { } + + /// + /// Initializes a new instance of the BackupVaultConfig class. + /// + /// Resource Id represents the complete path to the + /// resource. + /// Resource name associated with the + /// resource. + /// Resource type represents the complete path of + /// the form Namespace/ResourceType/ResourceType/... + /// Optional ETag. + /// Storage type. Possible values include: + /// 'Invalid', 'GeoRedundant', 'LocallyRedundant' + /// Locked or Unlocked. Once a machine + /// is registered against a resource, the storageTypeState is always + /// Locked. Possible values include: 'Invalid', 'Locked', + /// 'Unlocked' + /// Enabled or Disabled. Possible + /// values include: 'Invalid', 'Enabled', 'Disabled' + public BackupVaultConfig(string id = default(string), string name = default(string), string type = default(string), string eTag = default(string), string storageType = default(string), string storageTypeState = default(string), string enhancedSecurityState = default(string)) + : base(id, name, type, eTag) + { + StorageType = storageType; + StorageTypeState = storageTypeState; + EnhancedSecurityState = enhancedSecurityState; + } + + /// + /// Gets or sets storage type. Possible values include: 'Invalid', + /// 'GeoRedundant', 'LocallyRedundant' + /// + [JsonProperty(PropertyName = "properties.storageType")] + public string StorageType { get; set; } + + /// + /// Gets or sets locked or Unlocked. Once a machine is registered + /// against a resource, the storageTypeState is always Locked. Possible + /// values include: 'Invalid', 'Locked', 'Unlocked' + /// + [JsonProperty(PropertyName = "properties.storageTypeState")] + public string StorageTypeState { get; set; } + + /// + /// Gets or sets enabled or Disabled. Possible values include: + /// 'Invalid', 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "properties.enhancedSecurityState")] + public string EnhancedSecurityState { get; set; } + + } +} diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/CertificateRequest.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/CertificateRequest.cs new file mode 100644 index 000000000000..dae9358c9196 --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/CertificateRequest.cs @@ -0,0 +1,37 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.RecoveryServices; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Details of the certificate to be uploaded to the vault. + /// + public partial class CertificateRequest + { + /// + /// Initializes a new instance of the CertificateRequest class. + /// + public CertificateRequest() { } + + /// + /// Initializes a new instance of the CertificateRequest class. + /// + public CertificateRequest(RawCertificateData properties = default(RawCertificateData)) + { + Properties = properties; + } + + /// + /// + [JsonProperty(PropertyName = "properties")] + public RawCertificateData Properties { get; set; } + + } +} diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/ClientDiscoveryDisplay.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/ClientDiscoveryDisplay.cs new file mode 100644 index 000000000000..822c8c8e8d2f --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/ClientDiscoveryDisplay.cs @@ -0,0 +1,63 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.RecoveryServices; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Localized display information of an operation. + /// + public partial class ClientDiscoveryDisplay + { + /// + /// Initializes a new instance of the ClientDiscoveryDisplay class. + /// + public ClientDiscoveryDisplay() { } + + /// + /// Initializes a new instance of the ClientDiscoveryDisplay class. + /// + /// Name of the resource provider. + /// Type of the resource. + /// Name of the operation. + /// Operation description. + public ClientDiscoveryDisplay(string provider = default(string), string resource = default(string), string operation = default(string), string description = default(string)) + { + Provider = provider; + Resource = resource; + Operation = operation; + Description = description; + } + + /// + /// Gets name of the resource provider. + /// + [JsonProperty(PropertyName = "Provider")] + public string Provider { get; private set; } + + /// + /// Gets type of the resource. + /// + [JsonProperty(PropertyName = "Resource")] + public string Resource { get; private set; } + + /// + /// Gets name of the operation. + /// + [JsonProperty(PropertyName = "Operation")] + public string Operation { get; private set; } + + /// + /// Gets operation description. + /// + [JsonProperty(PropertyName = "Description")] + public string Description { get; private set; } + + } +} diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/ClientDiscoveryForLogSpecification.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/ClientDiscoveryForLogSpecification.cs new file mode 100644 index 000000000000..fb323f122e9d --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/ClientDiscoveryForLogSpecification.cs @@ -0,0 +1,57 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.RecoveryServices; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Log specification for the operation. + /// + public partial class ClientDiscoveryForLogSpecification + { + /// + /// Initializes a new instance of the + /// ClientDiscoveryForLogSpecification class. + /// + public ClientDiscoveryForLogSpecification() { } + + /// + /// Initializes a new instance of the + /// ClientDiscoveryForLogSpecification class. + /// + /// Name of the log. + /// Localized display name. + /// Blob duration. + public ClientDiscoveryForLogSpecification(string name = default(string), string displayName = default(string), System.DateTime? blobDuration = default(System.DateTime?)) + { + Name = name; + DisplayName = displayName; + BlobDuration = blobDuration; + } + + /// + /// Gets name of the log. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets localized display name. + /// + [JsonProperty(PropertyName = "displayName")] + public string DisplayName { get; private set; } + + /// + /// Gets blob duration. + /// + [JsonProperty(PropertyName = "blobDuration")] + public System.DateTime? BlobDuration { get; private set; } + + } +} diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/ClientDiscoveryForServiceSpecification.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/ClientDiscoveryForServiceSpecification.cs new file mode 100644 index 000000000000..89f8adeddf57 --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/ClientDiscoveryForServiceSpecification.cs @@ -0,0 +1,44 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.RecoveryServices; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Operation properties. + /// + public partial class ClientDiscoveryForServiceSpecification + { + /// + /// Initializes a new instance of the + /// ClientDiscoveryForServiceSpecification class. + /// + public ClientDiscoveryForServiceSpecification() { } + + /// + /// Initializes a new instance of the + /// ClientDiscoveryForServiceSpecification class. + /// + /// List of log specifications of this + /// operation. + public ClientDiscoveryForServiceSpecification(IList logSpecifications = default(IList)) + { + LogSpecifications = logSpecifications; + } + + /// + /// Gets list of log specifications of this operation. + /// + [JsonProperty(PropertyName = "logSpecifications")] + public IList LogSpecifications { get; private set; } + + } +} diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/ClientDiscoveryValueForSingleApi.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/ClientDiscoveryValueForSingleApi.cs new file mode 100644 index 000000000000..3b93e25482a0 --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/ClientDiscoveryValueForSingleApi.cs @@ -0,0 +1,71 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.RecoveryServices; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Available operation details. + /// + [Rest.Serialization.JsonTransformation] + public partial class ClientDiscoveryValueForSingleApi + { + /// + /// Initializes a new instance of the ClientDiscoveryValueForSingleApi + /// class. + /// + public ClientDiscoveryValueForSingleApi() { } + + /// + /// Initializes a new instance of the ClientDiscoveryValueForSingleApi + /// class. + /// + /// Name of the operation. + /// Contains the localized display information + /// for this particular operation. + /// The intended executor of the + /// operation. + /// Operation properties. + public ClientDiscoveryValueForSingleApi(string name = default(string), ClientDiscoveryDisplay display = default(ClientDiscoveryDisplay), string origin = default(string), ClientDiscoveryForServiceSpecification serviceSpecification = default(ClientDiscoveryForServiceSpecification)) + { + Name = name; + Display = display; + Origin = origin; + ServiceSpecification = serviceSpecification; + } + + /// + /// Gets name of the operation. + /// + [JsonProperty(PropertyName = "Name")] + public string Name { get; private set; } + + /// + /// Gets contains the localized display information for this particular + /// operation. + /// + [JsonProperty(PropertyName = "Display")] + public ClientDiscoveryDisplay Display { get; private set; } + + /// + /// Gets the intended executor of the operation. + /// + [JsonProperty(PropertyName = "Origin")] + public string Origin { get; private set; } + + /// + /// Gets operation properties. + /// + [JsonProperty(PropertyName = "Properties.serviceSpecification")] + public ClientDiscoveryForServiceSpecification ServiceSpecification { get; private set; } + + } +} diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/EnhancedSecurityState.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/EnhancedSecurityState.cs new file mode 100644 index 000000000000..0d6874a92bec --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/EnhancedSecurityState.cs @@ -0,0 +1,20 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.RecoveryServices; + + /// + /// Defines values for EnhancedSecurityState. + /// + public static class EnhancedSecurityState + { + public const string Invalid = "Invalid"; + public const string Enabled = "Enabled"; + public const string Disabled = "Disabled"; + } +} diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/JobsSummary.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/JobsSummary.cs new file mode 100644 index 000000000000..cffe781bf1d3 --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/JobsSummary.cs @@ -0,0 +1,55 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.RecoveryServices; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Summary of the replication job data for this vault. + /// + public partial class JobsSummary + { + /// + /// Initializes a new instance of the JobsSummary class. + /// + public JobsSummary() { } + + /// + /// Initializes a new instance of the JobsSummary class. + /// + /// Count of failed jobs. + /// Count of suspended jobs. + /// Count of in-progress jobs. + public JobsSummary(int? failedJobs = default(int?), int? suspendedJobs = default(int?), int? inProgressJobs = default(int?)) + { + FailedJobs = failedJobs; + SuspendedJobs = suspendedJobs; + InProgressJobs = inProgressJobs; + } + + /// + /// Gets or sets count of failed jobs. + /// + [JsonProperty(PropertyName = "failedJobs")] + public int? FailedJobs { get; set; } + + /// + /// Gets or sets count of suspended jobs. + /// + [JsonProperty(PropertyName = "suspendedJobs")] + public int? SuspendedJobs { get; set; } + + /// + /// Gets or sets count of in-progress jobs. + /// + [JsonProperty(PropertyName = "inProgressJobs")] + public int? InProgressJobs { get; set; } + + } +} diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/MonitoringSummary.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/MonitoringSummary.cs new file mode 100644 index 000000000000..9a32ec20e015 --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/MonitoringSummary.cs @@ -0,0 +1,84 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.RecoveryServices; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Summary of the replication monitoring data for this vault. + /// + public partial class MonitoringSummary + { + /// + /// Initializes a new instance of the MonitoringSummary class. + /// + public MonitoringSummary() { } + + /// + /// Initializes a new instance of the MonitoringSummary class. + /// + /// Count of unhealthy VMs. + /// Count of unhealthy replication + /// providers. + /// Count of all critical warnings. + /// Count of all deprecated + /// recovery service providers. + /// Count of all the supported + /// recovery service providers. + /// Count of all the unsupported + /// recovery service providers. + public MonitoringSummary(int? unHealthyVmCount = default(int?), int? unHealthyProviderCount = default(int?), int? eventsCount = default(int?), int? deprecatedProviderCount = default(int?), int? supportedProviderCount = default(int?), int? unsupportedProviderCount = default(int?)) + { + UnHealthyVmCount = unHealthyVmCount; + UnHealthyProviderCount = unHealthyProviderCount; + EventsCount = eventsCount; + DeprecatedProviderCount = deprecatedProviderCount; + SupportedProviderCount = supportedProviderCount; + UnsupportedProviderCount = unsupportedProviderCount; + } + + /// + /// Gets or sets count of unhealthy VMs. + /// + [JsonProperty(PropertyName = "unHealthyVmCount")] + public int? UnHealthyVmCount { get; set; } + + /// + /// Gets or sets count of unhealthy replication providers. + /// + [JsonProperty(PropertyName = "unHealthyProviderCount")] + public int? UnHealthyProviderCount { get; set; } + + /// + /// Gets or sets count of all critical warnings. + /// + [JsonProperty(PropertyName = "eventsCount")] + public int? EventsCount { get; set; } + + /// + /// Gets or sets count of all deprecated recovery service providers. + /// + [JsonProperty(PropertyName = "deprecatedProviderCount")] + public int? DeprecatedProviderCount { get; set; } + + /// + /// Gets or sets count of all the supported recovery service providers. + /// + [JsonProperty(PropertyName = "supportedProviderCount")] + public int? SupportedProviderCount { get; set; } + + /// + /// Gets or sets count of all the unsupported recovery service + /// providers. + /// + [JsonProperty(PropertyName = "unsupportedProviderCount")] + public int? UnsupportedProviderCount { get; set; } + + } +} diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/NameInfo.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/NameInfo.cs new file mode 100644 index 000000000000..464874ec652a --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/NameInfo.cs @@ -0,0 +1,47 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.RecoveryServices; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The name of usage. + /// + public partial class NameInfo + { + /// + /// Initializes a new instance of the NameInfo class. + /// + public NameInfo() { } + + /// + /// Initializes a new instance of the NameInfo class. + /// + /// Value of usage. + /// Localized value of usage. + public NameInfo(string value = default(string), string localizedValue = default(string)) + { + Value = value; + LocalizedValue = localizedValue; + } + + /// + /// Gets or sets value of usage. + /// + [JsonProperty(PropertyName = "value")] + public string Value { get; set; } + + /// + /// Gets or sets localized value of usage. + /// + [JsonProperty(PropertyName = "localizedValue")] + public string LocalizedValue { get; set; } + + } +} diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/Page.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/Page.cs index cd73ca468752..a85ed111d170 100644 --- a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/Page.cs +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/Page.cs @@ -1,43 +1,48 @@ -// 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 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.RecoveryServices.Models { + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.RecoveryServices; + 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 - [Newtonsoft.Json.JsonObject] - public class Page : Microsoft.Rest.Azure.IPage + [JsonObject] + public class Page : IPage { /// /// Gets the link to the next page. /// - [Newtonsoft.Json.JsonProperty("null")] - public System.String NextPageLink { get; private set; } + [JsonProperty("NextLink")] + public string NextPageLink { get; private set; } - [Newtonsoft.Json.JsonProperty("value")] - private System.Collections.Generic.IList Items{ get; 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 System.Collections.Generic.IEnumerator GetEnumerator() + public IEnumerator GetEnumerator() { - return (Items == null) ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.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. - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() + IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/Page1.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/Page1.cs new file mode 100644 index 000000000000..71c27deefe11 --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/Page1.cs @@ -0,0 +1,50 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.RecoveryServices; + 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/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/RawCertificateData.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/RawCertificateData.cs new file mode 100644 index 000000000000..7fe9dd967d61 --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/RawCertificateData.cs @@ -0,0 +1,52 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.RecoveryServices; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Raw certificate data. + /// + public partial class RawCertificateData + { + /// + /// Initializes a new instance of the RawCertificateData class. + /// + public RawCertificateData() { } + + /// + /// Initializes a new instance of the RawCertificateData class. + /// + /// Specifies the authentication type. Possible + /// values include: 'Invalid', 'ACS', 'AAD', 'AccessControlService', + /// 'AzureActiveDirectory' + /// The base64 encoded certificate raw data + /// string + public RawCertificateData(string authType = default(string), byte[] certificate = default(byte[])) + { + AuthType = authType; + Certificate = certificate; + } + + /// + /// Gets or sets specifies the authentication type. Possible values + /// include: 'Invalid', 'ACS', 'AAD', 'AccessControlService', + /// 'AzureActiveDirectory' + /// + [JsonProperty(PropertyName = "authType")] + public string AuthType { get; set; } + + /// + /// Gets or sets the base64 encoded certificate raw data string + /// + [JsonProperty(PropertyName = "certificate")] + public byte[] Certificate { get; set; } + + } +} diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/ReplicationUsage.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/ReplicationUsage.cs new file mode 100644 index 000000000000..bc5575c11404 --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/ReplicationUsage.cs @@ -0,0 +1,87 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.RecoveryServices; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Replication usages of a vault. + /// + public partial class ReplicationUsage + { + /// + /// Initializes a new instance of the ReplicationUsage class. + /// + public ReplicationUsage() { } + + /// + /// Initializes a new instance of the ReplicationUsage class. + /// + /// Summary of the replication + /// monitoring data for this vault. + /// Summary of the replication jobs data for + /// this vault. + /// Number of replication protected + /// items for this vault. + /// Number of replication recovery + /// plans for this vault. + /// Number of servers registered + /// to this vault. + /// The authentication + /// type of recovery service providers in the vault. + public ReplicationUsage(MonitoringSummary monitoringSummary = default(MonitoringSummary), JobsSummary jobsSummary = default(JobsSummary), int? protectedItemCount = default(int?), int? recoveryPlanCount = default(int?), int? registeredServersCount = default(int?), int? recoveryServicesProviderAuthType = default(int?)) + { + MonitoringSummary = monitoringSummary; + JobsSummary = jobsSummary; + ProtectedItemCount = protectedItemCount; + RecoveryPlanCount = recoveryPlanCount; + RegisteredServersCount = registeredServersCount; + RecoveryServicesProviderAuthType = recoveryServicesProviderAuthType; + } + + /// + /// Gets or sets summary of the replication monitoring data for this + /// vault. + /// + [JsonProperty(PropertyName = "monitoringSummary")] + public MonitoringSummary MonitoringSummary { get; set; } + + /// + /// Gets or sets summary of the replication jobs data for this vault. + /// + [JsonProperty(PropertyName = "jobsSummary")] + public JobsSummary JobsSummary { get; set; } + + /// + /// Gets or sets number of replication protected items for this vault. + /// + [JsonProperty(PropertyName = "protectedItemCount")] + public int? ProtectedItemCount { get; set; } + + /// + /// Gets or sets number of replication recovery plans for this vault. + /// + [JsonProperty(PropertyName = "recoveryPlanCount")] + public int? RecoveryPlanCount { get; set; } + + /// + /// Gets or sets number of servers registered to this vault. + /// + [JsonProperty(PropertyName = "registeredServersCount")] + public int? RegisteredServersCount { get; set; } + + /// + /// Gets or sets the authentication type of recovery service providers + /// in the vault. + /// + [JsonProperty(PropertyName = "recoveryServicesProviderAuthType")] + public int? RecoveryServicesProviderAuthType { get; set; } + + } +} diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/Resource.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/Resource.cs index f642675b7631..186dd6541f7b 100644 --- a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/Resource.cs +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/Resource.cs @@ -1,15 +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 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.RecoveryServices.Models { + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.RecoveryServices; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; using System.Linq; - public partial class Resource : Microsoft.Rest.Azure.IResource + /// + /// ARM Resource. + /// + public partial class Resource : IResource { /// /// Initializes a new instance of the Resource class. @@ -19,68 +25,45 @@ public Resource() { } /// /// Initializes a new instance of the Resource class. /// - /// Resource Id - /// Resource Name - /// Resource Type - /// Resource Location - /// Resource Tags - public Resource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), Sku sku = default(Sku), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary)) + /// Resource Id represents the complete path to the + /// resource. + /// Resource name associated with the + /// resource. + /// Resource type represents the complete path of + /// the form Namespace/ResourceType/ResourceType/... + /// Optional ETag. + public Resource(string id = default(string), string name = default(string), string type = default(string), string eTag = default(string)) { Id = id; Name = name; Type = type; - Location = location; - Sku = sku; - Tags = tags; + ETag = eTag; } /// - /// Gets resource Id + /// Gets resource Id represents the complete path to the resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "id")] + [JsonProperty(PropertyName = "id")] public string Id { get; private set; } /// - /// Gets resource Name + /// Gets resource name associated with the resource. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; private set; } /// - /// Gets resource Type + /// Gets resource type represents the complete path of the form + /// Namespace/ResourceType/ResourceType/... /// - [Newtonsoft.Json.JsonProperty(PropertyName = "type")] + [JsonProperty(PropertyName = "type")] public string Type { get; private set; } /// - /// Gets or sets resource Location + /// Gets or sets optional ETag. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] - public string Location { get; set; } + [JsonProperty(PropertyName = "eTag")] + public string ETag { get; set; } - /// - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "sku")] - public Sku Sku { get; set; } - - /// - /// Gets or sets resource Tags - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] - public System.Collections.Generic.IDictionary Tags { get; set; } - - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (this.Sku != null) - { - this.Sku.Validate(); - } - } } } diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/ResourceCertificateAndAADDetails.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/ResourceCertificateAndAADDetails.cs new file mode 100644 index 000000000000..36b09d37fe06 --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/ResourceCertificateAndAADDetails.cs @@ -0,0 +1,118 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.RecoveryServices; + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Certificate details representing the Vault credentials for AAD. + /// + [Newtonsoft.Json.JsonObject("AzureActiveDirectory")] + public partial class ResourceCertificateAndAadDetails : ResourceCertificateDetails + { + /// + /// Initializes a new instance of the ResourceCertificateAndAadDetails + /// class. + /// + public ResourceCertificateAndAadDetails() { } + + /// + /// Initializes a new instance of the ResourceCertificateAndAadDetails + /// class. + /// + /// AAD tenant authority. + /// AAD tenant Id. + /// AAD service principal + /// clientId. + /// AAD service principal + /// ObjectId. + /// Azure Management + /// Endpoint Audience. + /// The base64 encoded certificate raw data + /// string. + /// Certificate friendlyname. + /// Certificate issuer. + /// Resource ID of the vault. + /// Certificate Subject Name. + /// Certificate thumbprint. + /// Certificate Validity start Date + /// time. + /// Certificate Validity End Date time. + public ResourceCertificateAndAadDetails(string aadAuthority, string aadTenantId, string servicePrincipalClientId, string servicePrincipalObjectId, string azureManagementEndpointAudience, byte[] certificate = default(byte[]), string friendlyName = default(string), string issuer = default(string), long? resourceId = default(long?), string subject = default(string), string thumbprint = default(string), System.DateTime? validFrom = default(System.DateTime?), System.DateTime? validTo = default(System.DateTime?)) + : base(certificate, friendlyName, issuer, resourceId, subject, thumbprint, validFrom, validTo) + { + AadAuthority = aadAuthority; + AadTenantId = aadTenantId; + ServicePrincipalClientId = servicePrincipalClientId; + ServicePrincipalObjectId = servicePrincipalObjectId; + AzureManagementEndpointAudience = azureManagementEndpointAudience; + } + + /// + /// Gets or sets AAD tenant authority. + /// + [JsonProperty(PropertyName = "aadAuthority")] + public string AadAuthority { get; set; } + + /// + /// Gets or sets AAD tenant Id. + /// + [JsonProperty(PropertyName = "aadTenantId")] + public string AadTenantId { get; set; } + + /// + /// Gets or sets AAD service principal clientId. + /// + [JsonProperty(PropertyName = "servicePrincipalClientId")] + public string ServicePrincipalClientId { get; set; } + + /// + /// Gets or sets AAD service principal ObjectId. + /// + [JsonProperty(PropertyName = "servicePrincipalObjectId")] + public string ServicePrincipalObjectId { get; set; } + + /// + /// Gets or sets azure Management Endpoint Audience. + /// + [JsonProperty(PropertyName = "azureManagementEndpointAudience")] + public string AzureManagementEndpointAudience { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (AadAuthority == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "AadAuthority"); + } + if (AadTenantId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "AadTenantId"); + } + if (ServicePrincipalClientId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ServicePrincipalClientId"); + } + if (ServicePrincipalObjectId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ServicePrincipalObjectId"); + } + if (AzureManagementEndpointAudience == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "AzureManagementEndpointAudience"); + } + } + } +} diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/ResourceCertificateAndACSDetails.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/ResourceCertificateAndACSDetails.cs new file mode 100644 index 000000000000..ebf771ff54a3 --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/ResourceCertificateAndACSDetails.cs @@ -0,0 +1,94 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.RecoveryServices; + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Certificate details representing the Vault credentials for ACS. + /// + [Newtonsoft.Json.JsonObject("AccessControlService")] + public partial class ResourceCertificateAndAcsDetails : ResourceCertificateDetails + { + /// + /// Initializes a new instance of the ResourceCertificateAndAcsDetails + /// class. + /// + public ResourceCertificateAndAcsDetails() { } + + /// + /// Initializes a new instance of the ResourceCertificateAndAcsDetails + /// class. + /// + /// ACS namespace name - tenant for + /// our service. + /// Acs mgmt host name to connect + /// to. + /// Global ACS namespace RP + /// realm. + /// The base64 encoded certificate raw data + /// string. + /// Certificate friendlyname. + /// Certificate issuer. + /// Resource ID of the vault. + /// Certificate Subject Name. + /// Certificate thumbprint. + /// Certificate Validity start Date + /// time. + /// Certificate Validity End Date time. + public ResourceCertificateAndAcsDetails(string globalAcsNamespace, string globalAcsHostName, string globalAcsRPRealm, byte[] certificate = default(byte[]), string friendlyName = default(string), string issuer = default(string), long? resourceId = default(long?), string subject = default(string), string thumbprint = default(string), System.DateTime? validFrom = default(System.DateTime?), System.DateTime? validTo = default(System.DateTime?)) + : base(certificate, friendlyName, issuer, resourceId, subject, thumbprint, validFrom, validTo) + { + GlobalAcsNamespace = globalAcsNamespace; + GlobalAcsHostName = globalAcsHostName; + GlobalAcsRPRealm = globalAcsRPRealm; + } + + /// + /// Gets or sets ACS namespace name - tenant for our service. + /// + [JsonProperty(PropertyName = "globalAcsNamespace")] + public string GlobalAcsNamespace { get; set; } + + /// + /// Gets or sets acs mgmt host name to connect to. + /// + [JsonProperty(PropertyName = "globalAcsHostName")] + public string GlobalAcsHostName { get; set; } + + /// + /// Gets or sets global ACS namespace RP realm. + /// + [JsonProperty(PropertyName = "globalAcsRPRealm")] + public string GlobalAcsRPRealm { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (GlobalAcsNamespace == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "GlobalAcsNamespace"); + } + if (GlobalAcsHostName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "GlobalAcsHostName"); + } + if (GlobalAcsRPRealm == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "GlobalAcsRPRealm"); + } + } + } +} diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/ResourceCertificateDetails.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/ResourceCertificateDetails.cs new file mode 100644 index 000000000000..6bbf83d61f3b --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/ResourceCertificateDetails.cs @@ -0,0 +1,97 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.RecoveryServices; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Certificate details representing the Vault credentials. + /// + public partial class ResourceCertificateDetails + { + /// + /// Initializes a new instance of the ResourceCertificateDetails class. + /// + public ResourceCertificateDetails() { } + + /// + /// Initializes a new instance of the ResourceCertificateDetails class. + /// + /// The base64 encoded certificate raw data + /// string. + /// Certificate friendlyname. + /// Certificate issuer. + /// Resource ID of the vault. + /// Certificate Subject Name. + /// Certificate thumbprint. + /// Certificate Validity start Date + /// time. + /// Certificate Validity End Date time. + public ResourceCertificateDetails(byte[] certificate = default(byte[]), string friendlyName = default(string), string issuer = default(string), long? resourceId = default(long?), string subject = default(string), string thumbprint = default(string), System.DateTime? validFrom = default(System.DateTime?), System.DateTime? validTo = default(System.DateTime?)) + { + Certificate = certificate; + FriendlyName = friendlyName; + Issuer = issuer; + ResourceId = resourceId; + Subject = subject; + Thumbprint = thumbprint; + ValidFrom = validFrom; + ValidTo = validTo; + } + + /// + /// Gets or sets the base64 encoded certificate raw data string. + /// + [JsonProperty(PropertyName = "certificate")] + public byte[] Certificate { get; set; } + + /// + /// Gets or sets certificate friendlyname. + /// + [JsonProperty(PropertyName = "friendlyName")] + public string FriendlyName { get; set; } + + /// + /// Gets or sets certificate issuer. + /// + [JsonProperty(PropertyName = "issuer")] + public string Issuer { get; set; } + + /// + /// Gets or sets resource ID of the vault. + /// + [JsonProperty(PropertyName = "resourceId")] + public long? ResourceId { get; set; } + + /// + /// Gets or sets certificate Subject Name. + /// + [JsonProperty(PropertyName = "subject")] + public string Subject { get; set; } + + /// + /// Gets or sets certificate thumbprint. + /// + [JsonProperty(PropertyName = "thumbprint")] + public string Thumbprint { get; set; } + + /// + /// Gets or sets certificate Validity start Date time. + /// + [JsonProperty(PropertyName = "validFrom")] + public System.DateTime? ValidFrom { get; set; } + + /// + /// Gets or sets certificate Validity End Date time. + /// + [JsonProperty(PropertyName = "validTo")] + public System.DateTime? ValidTo { get; set; } + + } +} diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/Sku.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/Sku.cs index 0a5b20ae2b5c..12ff6dd20eb5 100644 --- a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/Sku.cs +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/Sku.cs @@ -1,12 +1,14 @@ -// 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 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.RecoveryServices.Models { + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.RecoveryServices; + using Microsoft.Rest; + using Newtonsoft.Json; using System.Linq; /// @@ -33,20 +35,20 @@ public Sku(string name) /// Gets or sets the Sku name. Possible values include: 'Standard', /// 'RS0' /// - [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public virtual void Validate() { if (Name == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "Name"); + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); } } } diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/SkuName.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/SkuName.cs index c1cef2877a22..929f5cac4947 100644 --- a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/SkuName.cs +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/SkuName.cs @@ -1,12 +1,12 @@ -// 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 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.RecoveryServices.Models { + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.RecoveryServices; /// /// Defines values for SkuName. diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/StorageModelType.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/StorageModelType.cs new file mode 100644 index 000000000000..01b7af11c343 --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/StorageModelType.cs @@ -0,0 +1,20 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.RecoveryServices; + + /// + /// Defines values for StorageModelType. + /// + public static class StorageModelType + { + public const string Invalid = "Invalid"; + public const string GeoRedundant = "GeoRedundant"; + public const string LocallyRedundant = "LocallyRedundant"; + } +} diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/StorageType.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/StorageType.cs new file mode 100644 index 000000000000..068b7393b302 --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/StorageType.cs @@ -0,0 +1,20 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.RecoveryServices; + + /// + /// Defines values for StorageType. + /// + public static class StorageType + { + public const string Invalid = "Invalid"; + public const string GeoRedundant = "GeoRedundant"; + public const string LocallyRedundant = "LocallyRedundant"; + } +} diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/StorageTypeState.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/StorageTypeState.cs new file mode 100644 index 000000000000..defd73fd2ebc --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/StorageTypeState.cs @@ -0,0 +1,20 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.RecoveryServices; + + /// + /// Defines values for StorageTypeState. + /// + public static class StorageTypeState + { + public const string Invalid = "Invalid"; + public const string Locked = "Locked"; + public const string Unlocked = "Unlocked"; + } +} diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/TrackedResource.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/TrackedResource.cs new file mode 100644 index 000000000000..08e97c6a1b4a --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/TrackedResource.cs @@ -0,0 +1,71 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.RecoveryServices; + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Tracked resource with location. + /// + public partial class TrackedResource : Resource + { + /// + /// Initializes a new instance of the TrackedResource class. + /// + public TrackedResource() { } + + /// + /// Initializes a new instance of the TrackedResource class. + /// + /// Resource location. + /// Resource Id represents the complete path to the + /// resource. + /// Resource name associated with the + /// resource. + /// Resource type represents the complete path of + /// the form Namespace/ResourceType/ResourceType/... + /// Optional ETag. + /// Resource tags. + public TrackedResource(string location, string id = default(string), string name = default(string), string type = default(string), string eTag = default(string), IDictionary tags = default(IDictionary)) + : base(id, name, type, eTag) + { + Location = location; + Tags = tags; + } + + /// + /// Gets or sets resource location. + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; set; } + + /// + /// Gets or sets resource tags. + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Location"); + } + } + } +} diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/TriggerType.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/TriggerType.cs new file mode 100644 index 000000000000..92cbcc1209c8 --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/TriggerType.cs @@ -0,0 +1,19 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.RecoveryServices; + + /// + /// Defines values for TriggerType. + /// + public static class TriggerType + { + public const string UserTriggered = "UserTriggered"; + public const string ForcedUpgrade = "ForcedUpgrade"; + } +} diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/UpgradeDetails.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/UpgradeDetails.cs new file mode 100644 index 000000000000..6911ae62b268 --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/UpgradeDetails.cs @@ -0,0 +1,118 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.RecoveryServices; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Details for upgrading vault. + /// + public partial class UpgradeDetails + { + /// + /// Initializes a new instance of the UpgradeDetails class. + /// + public UpgradeDetails() { } + + /// + /// Initializes a new instance of the UpgradeDetails class. + /// + /// ID of the vault upgrade + /// operation. + /// UTC time at which the upgrade operation + /// has started. + /// UTC time at which the upgrade + /// operation status was last updated. + /// UTC time at which the upgrade operation + /// has ended. + /// Status of the vault upgrade operation. + /// Possible values include: 'Unknown', 'InProgress', 'Upgraded', + /// 'Failed' + /// Message to the user containing information + /// about the upgrade operation. + /// The way the vault upgradation was + /// triggered. Possible values include: 'UserTriggered', + /// 'ForcedUpgrade' + /// Resource ID of the upgraded + /// vault. + /// Resource ID of the vault before + /// the upgrade. + public UpgradeDetails(string operationId = default(string), System.DateTime? startTimeUtc = default(System.DateTime?), System.DateTime? lastUpdatedTimeUtc = default(System.DateTime?), System.DateTime? endTimeUtc = default(System.DateTime?), string status = default(string), string message = default(string), string triggerType = default(string), string upgradedResourceId = default(string), string previousResourceId = default(string)) + { + OperationId = operationId; + StartTimeUtc = startTimeUtc; + LastUpdatedTimeUtc = lastUpdatedTimeUtc; + EndTimeUtc = endTimeUtc; + Status = status; + Message = message; + TriggerType = triggerType; + UpgradedResourceId = upgradedResourceId; + PreviousResourceId = previousResourceId; + } + + /// + /// Gets ID of the vault upgrade operation. + /// + [JsonProperty(PropertyName = "operationId")] + public string OperationId { get; private set; } + + /// + /// Gets UTC time at which the upgrade operation has started. + /// + [JsonProperty(PropertyName = "startTimeUtc")] + public System.DateTime? StartTimeUtc { get; private set; } + + /// + /// Gets UTC time at which the upgrade operation status was last + /// updated. + /// + [JsonProperty(PropertyName = "lastUpdatedTimeUtc")] + public System.DateTime? LastUpdatedTimeUtc { get; private set; } + + /// + /// Gets UTC time at which the upgrade operation has ended. + /// + [JsonProperty(PropertyName = "endTimeUtc")] + public System.DateTime? EndTimeUtc { get; private set; } + + /// + /// Gets status of the vault upgrade operation. Possible values + /// include: 'Unknown', 'InProgress', 'Upgraded', 'Failed' + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; private set; } + + /// + /// Gets message to the user containing information about the upgrade + /// operation. + /// + [JsonProperty(PropertyName = "message")] + public string Message { get; private set; } + + /// + /// Gets the way the vault upgradation was triggered. Possible values + /// include: 'UserTriggered', 'ForcedUpgrade' + /// + [JsonProperty(PropertyName = "triggerType")] + public string TriggerType { get; private set; } + + /// + /// Gets resource ID of the upgraded vault. + /// + [JsonProperty(PropertyName = "upgradedResourceId")] + public string UpgradedResourceId { get; private set; } + + /// + /// Gets resource ID of the vault before the upgrade. + /// + [JsonProperty(PropertyName = "previousResourceId")] + public string PreviousResourceId { get; private set; } + + } +} diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/UsagesUnit.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/UsagesUnit.cs new file mode 100644 index 000000000000..b80a396c165a --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/UsagesUnit.cs @@ -0,0 +1,23 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.RecoveryServices; + + /// + /// Defines values for UsagesUnit. + /// + public static class UsagesUnit + { + public const string Count = "Count"; + public const string Bytes = "Bytes"; + public const string Seconds = "Seconds"; + public const string Percent = "Percent"; + public const string CountPerSecond = "CountPerSecond"; + public const string BytesPerSecond = "BytesPerSecond"; + } +} diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/Vault.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/Vault.cs index 05be128bc91a..c26953b3cad3 100644 --- a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/Vault.cs +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/Vault.cs @@ -1,18 +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 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.RecoveryServices.Models { + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.RecoveryServices; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// /// Resource information, as returned by the resource provider. /// - public partial class Vault : Resource + public partial class Vault : TrackedResource { /// /// Initializes a new instance of the Vault class. @@ -22,39 +25,45 @@ public Vault() { } /// /// Initializes a new instance of the Vault class. /// - /// Resource Id - /// Resource Name - /// Resource Type - /// Resource Location - /// Resource Tags - /// ETag of the Vault. - public Vault(string id = default(string), string name = default(string), string type = default(string), string location = default(string), Sku sku = default(Sku), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string etag = default(string), VaultProperties properties = default(VaultProperties)) - : base(id, name, type, location, sku, tags) + /// Resource location. + /// Resource Id represents the complete path to the + /// resource. + /// Resource name associated with the + /// resource. + /// Resource type represents the complete path of + /// the form Namespace/ResourceType/ResourceType/... + /// Optional ETag. + /// Resource tags. + public Vault(string location, string id = default(string), string name = default(string), string type = default(string), string eTag = default(string), IDictionary tags = default(IDictionary), VaultProperties properties = default(VaultProperties), Sku sku = default(Sku)) + : base(location, id, name, type, eTag, tags) { - Etag = etag; Properties = properties; + Sku = sku; } /// - /// Gets eTag of the Vault. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "etag")] - public string Etag { get; private set; } + [JsonProperty(PropertyName = "properties")] + public VaultProperties Properties { get; set; } /// /// - [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] - public VaultProperties Properties { get; set; } + [JsonProperty(PropertyName = "sku")] + public Sku Sku { get; set; } /// /// Validate the object. /// - /// + /// /// Thrown if validation fails /// public override void Validate() { base.Validate(); + if (Sku != null) + { + Sku.Validate(); + } } } } diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/VaultCertificateResponse.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/VaultCertificateResponse.cs new file mode 100644 index 000000000000..56994a122f74 --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/VaultCertificateResponse.cs @@ -0,0 +1,56 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.RecoveryServices; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Certificate corresponding to a vault that can be used by clients to + /// register themselves with the vault. + /// + public partial class VaultCertificateResponse + { + /// + /// Initializes a new instance of the VaultCertificateResponse class. + /// + public VaultCertificateResponse() { } + + /// + /// Initializes a new instance of the VaultCertificateResponse class. + /// + public VaultCertificateResponse(string name = default(string), string type = default(string), string id = default(string), ResourceCertificateDetails properties = default(ResourceCertificateDetails)) + { + Name = name; + Type = type; + Id = id; + Properties = properties; + } + + /// + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + /// + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + /// + /// + [JsonProperty(PropertyName = "properties")] + public ResourceCertificateDetails Properties { get; set; } + + } +} diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/VaultExtendedInfoResource.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/VaultExtendedInfoResource.cs new file mode 100644 index 000000000000..03c651de7369 --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/VaultExtendedInfoResource.cs @@ -0,0 +1,75 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.RecoveryServices; + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Vault extended information. + /// + [Rest.Serialization.JsonTransformation] + public partial class VaultExtendedInfoResource : Resource + { + /// + /// Initializes a new instance of the VaultExtendedInfoResource class. + /// + public VaultExtendedInfoResource() { } + + /// + /// Initializes a new instance of the VaultExtendedInfoResource class. + /// + /// Resource Id represents the complete path to the + /// resource. + /// Resource name associated with the + /// resource. + /// Resource type represents the complete path of + /// the form Namespace/ResourceType/ResourceType/... + /// Optional ETag. + /// Integrity key. + /// Encryption key. + /// Encryption key + /// thumbprint. + /// Algorithm. + public VaultExtendedInfoResource(string id = default(string), string name = default(string), string type = default(string), string eTag = default(string), string integrityKey = default(string), string encryptionKey = default(string), string encryptionKeyThumbprint = default(string), string algorithm = default(string)) + : base(id, name, type, eTag) + { + IntegrityKey = integrityKey; + EncryptionKey = encryptionKey; + EncryptionKeyThumbprint = encryptionKeyThumbprint; + Algorithm = algorithm; + } + + /// + /// Gets or sets integrity key. + /// + [JsonProperty(PropertyName = "properties.integrityKey")] + public string IntegrityKey { get; set; } + + /// + /// Gets or sets encryption key. + /// + [JsonProperty(PropertyName = "properties.encryptionKey")] + public string EncryptionKey { get; set; } + + /// + /// Gets or sets encryption key thumbprint. + /// + [JsonProperty(PropertyName = "properties.encryptionKeyThumbprint")] + public string EncryptionKeyThumbprint { get; set; } + + /// + /// Gets or sets algorithm. + /// + [JsonProperty(PropertyName = "properties.algorithm")] + public string Algorithm { get; set; } + + } +} diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/VaultProperties.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/VaultProperties.cs index cb5bea1dc32e..72bece3084e0 100644 --- a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/VaultProperties.cs +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/VaultProperties.cs @@ -1,12 +1,13 @@ -// 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 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.RecoveryServices.Models { + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.RecoveryServices; + using Newtonsoft.Json; using System.Linq; /// @@ -23,16 +24,22 @@ public VaultProperties() { } /// Initializes a new instance of the VaultProperties class. /// /// Provisioning State. - public VaultProperties(string provisioningState = default(string)) + public VaultProperties(string provisioningState = default(string), UpgradeDetails upgradeDetails = default(UpgradeDetails)) { ProvisioningState = provisioningState; + UpgradeDetails = upgradeDetails; } /// /// Gets provisioning State. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "provisioningState")] + [JsonProperty(PropertyName = "provisioningState")] public string ProvisioningState { get; private set; } + /// + /// + [JsonProperty(PropertyName = "upgradeDetails")] + public UpgradeDetails UpgradeDetails { get; set; } + } } diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/VaultUpgradeState.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/VaultUpgradeState.cs new file mode 100644 index 000000000000..e8f8f03a7ea1 --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/VaultUpgradeState.cs @@ -0,0 +1,21 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.RecoveryServices; + + /// + /// Defines values for VaultUpgradeState. + /// + public static class VaultUpgradeState + { + public const string Unknown = "Unknown"; + public const string InProgress = "InProgress"; + public const string Upgraded = "Upgraded"; + public const string Failed = "Failed"; + } +} diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/VaultUsage.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/VaultUsage.cs new file mode 100644 index 000000000000..e30e13ce96d7 --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Models/VaultUsage.cs @@ -0,0 +1,82 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Models +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Azure.Management.RecoveryServices; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Usages of a vault. + /// + public partial class VaultUsage + { + /// + /// Initializes a new instance of the VaultUsage class. + /// + public VaultUsage() { } + + /// + /// Initializes a new instance of the VaultUsage class. + /// + /// Unit of the usage. Possible values include: + /// 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', + /// 'BytesPerSecond' + /// Quota period of usage. + /// Next reset time of usage. + /// Current value of usage. + /// Limit of usage. + /// Name of usage. + public VaultUsage(string unit = default(string), string quotaPeriod = default(string), System.DateTime? nextResetTime = default(System.DateTime?), long? currentValue = default(long?), long? limit = default(long?), NameInfo name = default(NameInfo)) + { + Unit = unit; + QuotaPeriod = quotaPeriod; + NextResetTime = nextResetTime; + CurrentValue = currentValue; + Limit = limit; + Name = name; + } + + /// + /// Gets or sets unit of the usage. Possible values include: 'Count', + /// 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond' + /// + [JsonProperty(PropertyName = "unit")] + public string Unit { get; set; } + + /// + /// Gets or sets quota period of usage. + /// + [JsonProperty(PropertyName = "quotaPeriod")] + public string QuotaPeriod { get; set; } + + /// + /// Gets or sets next reset time of usage. + /// + [JsonProperty(PropertyName = "nextResetTime")] + public System.DateTime? NextResetTime { get; set; } + + /// + /// Gets or sets current value of usage. + /// + [JsonProperty(PropertyName = "currentValue")] + public long? CurrentValue { get; set; } + + /// + /// Gets or sets limit of usage. + /// + [JsonProperty(PropertyName = "limit")] + public long? Limit { get; set; } + + /// + /// Gets or sets name of usage. + /// + [JsonProperty(PropertyName = "name")] + public NameInfo Name { get; set; } + + } +} diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Operations.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Operations.cs new file mode 100644 index 000000000000..c5315bcf551f --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/Operations.cs @@ -0,0 +1,415 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + 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(RecoveryServicesClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesClient + /// + public RecoveryServicesClient Client { get; private set; } + + /// + /// Returns the list of available operations. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// 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 resourceGroupName, 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"); + } + string apiVersion = "2016-12-01"; + string apiVersion1 = "2016-06-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion1", apiVersion1); + 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/operations").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (apiVersion1 != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion1))); + } + 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; + } + + /// + /// Returns the list of available 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/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/OperationsExtensions.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/OperationsExtensions.cs new file mode 100644 index 000000000000..2b8a6c75648f --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/OperationsExtensions.cs @@ -0,0 +1,91 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + 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 + { + /// + /// Returns the list of available operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + public static IPage List(this IOperations operations, string resourceGroupName) + { + return operations.ListAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Returns the list of available operations. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Returns the list of available 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(); + } + + /// + /// Returns the list of available 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/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/RecoveryServicesClient.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/RecoveryServicesClient.cs index 4efcfdd2af03..bac42da6aea4 100644 --- a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/RecoveryServicesClient.cs +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/RecoveryServicesClient.cs @@ -1,18 +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 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.RecoveryServices { - using System.Linq; + using Microsoft.Azure; + using Microsoft.Azure.Management; 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 RecoveryServicesClient : Microsoft.Rest.ServiceClient, IRecoveryServicesClient, IAzureClient + /// + /// Composite Swagger for Recovery Services Client + /// + public partial class RecoveryServicesClient : ServiceClient, IRecoveryServicesClient, IAzureClient { /// /// The base URI of the service. @@ -22,28 +30,23 @@ public partial class RecoveryServicesClient : Microsoft.Rest.ServiceClient /// Gets or sets json serialization settings. /// - public Newtonsoft.Json.JsonSerializerSettings SerializationSettings { get; private set; } + public JsonSerializerSettings SerializationSettings { get; private set; } /// /// Gets or sets json deserialization settings. /// - public Newtonsoft.Json.JsonSerializerSettings DeserializationSettings { get; private set; } + public JsonSerializerSettings DeserializationSettings { get; private set; } /// /// Credentials needed for the client to connect to Azure. /// - public Microsoft.Rest.ServiceClientCredentials Credentials { get; private set; } + public ServiceClientCredentials Credentials { get; private set; } /// /// The subscription Id. /// public string SubscriptionId { get; set; } - /// - /// Client Api Version. - /// - public string ApiVersion { get; private set; } - /// /// Gets or sets the preferred language for the response. /// @@ -61,20 +64,60 @@ public partial class RecoveryServicesClient : Microsoft.Rest.ServiceClient public bool? GenerateClientRequestId { get; set; } + /// + /// Gets the IOperations. + /// + public virtual IOperations Operations { get; private set; } + + /// + /// Gets the IBackupVaultConfigsOperations. + /// + public virtual IBackupVaultConfigsOperations BackupVaultConfigs { get; private set; } + + /// + /// Gets the IBackupStorageConfigsOperations. + /// + public virtual IBackupStorageConfigsOperations BackupStorageConfigs { get; private set; } + + /// + /// Gets the IVaultCertificatesOperations. + /// + public virtual IVaultCertificatesOperations VaultCertificates { get; private set; } + + /// + /// Gets the IRegisteredIdentitiesOperations. + /// + public virtual IRegisteredIdentitiesOperations RegisteredIdentities { get; private set; } + + /// + /// Gets the IReplicationUsagesOperations. + /// + public virtual IReplicationUsagesOperations ReplicationUsages { get; private set; } + /// /// Gets the IVaultsOperations. /// public virtual IVaultsOperations Vaults { get; private set; } + /// + /// Gets the IVaultExtendedInfoOperations. + /// + public virtual IVaultExtendedInfoOperations VaultExtendedInfo { get; private set; } + + /// + /// Gets the IUsagesOperations. + /// + public virtual IUsagesOperations Usages { get; private set; } + /// /// Initializes a new instance of the RecoveryServicesClient class. /// /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected RecoveryServicesClient(params System.Net.Http.DelegatingHandler[] handlers) : base(handlers) + protected RecoveryServicesClient(params DelegatingHandler[] handlers) : base(handlers) { - this.Initialize(); + Initialize(); } /// @@ -86,9 +129,9 @@ protected RecoveryServicesClient(params System.Net.Http.DelegatingHandler[] hand /// /// Optional. The delegating handlers to add to the http client pipeline. /// - protected RecoveryServicesClient(System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : base(rootHandler, handlers) + protected RecoveryServicesClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandler, handlers) { - this.Initialize(); + Initialize(); } /// @@ -103,13 +146,13 @@ protected RecoveryServicesClient(System.Net.Http.HttpClientHandler rootHandler, /// /// Thrown when a required parameter is null /// - protected RecoveryServicesClient(System.Uri baseUri, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) + protected RecoveryServicesClient(System.Uri baseUri, params DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { throw new System.ArgumentNullException("baseUri"); } - this.BaseUri = baseUri; + BaseUri = baseUri; } /// @@ -127,13 +170,13 @@ protected RecoveryServicesClient(System.Uri baseUri, params System.Net.Http.Dele /// /// Thrown when a required parameter is null /// - protected RecoveryServicesClient(System.Uri baseUri, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) + protected RecoveryServicesClient(System.Uri baseUri, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { throw new System.ArgumentNullException("baseUri"); } - this.BaseUri = baseUri; + BaseUri = baseUri; } /// @@ -148,16 +191,16 @@ protected RecoveryServicesClient(System.Uri baseUri, System.Net.Http.HttpClientH /// /// Thrown when a required parameter is null /// - internal RecoveryServicesClient(Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) + public RecoveryServicesClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - this.Credentials = credentials; - if (this.Credentials != null) + Credentials = credentials; + if (Credentials != null) { - this.Credentials.InitializeServiceClient(this); + Credentials.InitializeServiceClient(this); } } @@ -176,16 +219,16 @@ internal RecoveryServicesClient(Microsoft.Rest.ServiceClientCredentials credenti /// /// Thrown when a required parameter is null /// - internal RecoveryServicesClient(Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) + public RecoveryServicesClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (credentials == null) { throw new System.ArgumentNullException("credentials"); } - this.Credentials = credentials; - if (this.Credentials != null) + Credentials = credentials; + if (Credentials != null) { - this.Credentials.InitializeServiceClient(this); + Credentials.InitializeServiceClient(this); } } @@ -204,7 +247,7 @@ internal RecoveryServicesClient(Microsoft.Rest.ServiceClientCredentials credenti /// /// Thrown when a required parameter is null /// - internal RecoveryServicesClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, params System.Net.Http.DelegatingHandler[] handlers) : this(handlers) + public RecoveryServicesClient(System.Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handlers) { if (baseUri == null) { @@ -214,11 +257,11 @@ internal RecoveryServicesClient(System.Uri baseUri, Microsoft.Rest.ServiceClient { throw new System.ArgumentNullException("credentials"); } - this.BaseUri = baseUri; - this.Credentials = credentials; - if (this.Credentials != null) + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) { - this.Credentials.InitializeServiceClient(this); + Credentials.InitializeServiceClient(this); } } @@ -240,7 +283,7 @@ internal RecoveryServicesClient(System.Uri baseUri, Microsoft.Rest.ServiceClient /// /// Thrown when a required parameter is null /// - internal RecoveryServicesClient(System.Uri baseUri, Microsoft.Rest.ServiceClientCredentials credentials, System.Net.Http.HttpClientHandler rootHandler, params System.Net.Http.DelegatingHandler[] handlers) : this(rootHandler, handlers) + public RecoveryServicesClient(System.Uri baseUri, ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : this(rootHandler, handlers) { if (baseUri == null) { @@ -250,11 +293,11 @@ internal RecoveryServicesClient(System.Uri baseUri, Microsoft.Rest.ServiceClient { throw new System.ArgumentNullException("credentials"); } - this.BaseUri = baseUri; - this.Credentials = credentials; - if (this.Credentials != null) + BaseUri = baseUri; + Credentials = credentials; + if (Credentials != null) { - this.Credentials.InitializeServiceClient(this); + Credentials.InitializeServiceClient(this); } } @@ -267,39 +310,50 @@ internal RecoveryServicesClient(System.Uri baseUri, Microsoft.Rest.ServiceClient /// private void Initialize() { - this.Vaults = new VaultsOperations(this); - this.BaseUri = new System.Uri("https://management.azure.com"); - this.ApiVersion = "2016-06-01"; - this.AcceptLanguage = "en-US"; - this.LongRunningOperationRetryTimeout = 30; - this.GenerateClientRequestId = true; - SerializationSettings = new Newtonsoft.Json.JsonSerializerSettings + Operations = new Operations(this); + BackupVaultConfigs = new BackupVaultConfigsOperations(this); + BackupStorageConfigs = new BackupStorageConfigsOperations(this); + VaultCertificates = new VaultCertificatesOperations(this); + RegisteredIdentities = new RegisteredIdentitiesOperations(this); + ReplicationUsages = new ReplicationUsagesOperations(this); + Vaults = new VaultsOperations(this); + VaultExtendedInfo = new VaultExtendedInfoOperations(this); + Usages = new UsagesOperations(this); + BaseUri = new System.Uri("https://management.azure.com"); + 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 Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), - Converters = new System.Collections.Generic.List + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List { - new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() + new Iso8601TimeSpanConverter() } }; - DeserializationSettings = new Newtonsoft.Json.JsonSerializerSettings + 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 Microsoft.Rest.Serialization.ReadOnlyJsonContractResolver(), - Converters = new System.Collections.Generic.List + ContractResolver = new ReadOnlyJsonContractResolver(), + Converters = new List { - new Microsoft.Rest.Serialization.Iso8601TimeSpanConverter() + new Iso8601TimeSpanConverter() } }; + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("authType")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("authType")); CustomInitialize(); - DeserializationSettings.Converters.Add(new Microsoft.Rest.Azure.CloudErrorJsonConverter()); - } + DeserializationSettings.Converters.Add(new TransformationJsonConverter()); + DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); + } } } diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/RegisteredIdentitiesOperations.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/RegisteredIdentitiesOperations.cs new file mode 100644 index 000000000000..1dc1246ca04f --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/RegisteredIdentitiesOperations.cs @@ -0,0 +1,233 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + 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; + + /// + /// RegisteredIdentitiesOperations operations. + /// + internal partial class RegisteredIdentitiesOperations : IServiceOperations, IRegisteredIdentitiesOperations + { + /// + /// Initializes a new instance of the RegisteredIdentitiesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal RegisteredIdentitiesOperations(RecoveryServicesClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesClient + /// + public RecoveryServicesClient Client { get; private set; } + + /// + /// Unregisters the given container from your Recovery Services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// Name of the protection container to unregister. + /// + /// + /// 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 DeleteWithHttpMessagesAsync(string resourceGroupName, string vaultName, string identityName, 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 (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (identityName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "identityName"); + } + string apiVersion = "2016-06-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("identityName", identityName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Delete", 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.RecoveryServices/vaults/{vaultName}/registeredIdentities/{identityName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{identityName}", System.Uri.EscapeDataString(identityName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 != 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; + } + + } +} diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/RegisteredIdentitiesOperationsExtensions.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/RegisteredIdentitiesOperationsExtensions.cs new file mode 100644 index 000000000000..a7a9c66d17ab --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/RegisteredIdentitiesOperationsExtensions.cs @@ -0,0 +1,66 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for RegisteredIdentitiesOperations. + /// + public static partial class RegisteredIdentitiesOperationsExtensions + { + /// + /// Unregisters the given container from your Recovery Services vault. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// Name of the protection container to unregister. + /// + public static void Delete(this IRegisteredIdentitiesOperations operations, string resourceGroupName, string vaultName, string identityName) + { + operations.DeleteAsync(resourceGroupName, vaultName, identityName).GetAwaiter().GetResult(); + } + + /// + /// Unregisters the given container from your Recovery Services vault. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// Name of the protection container to unregister. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IRegisteredIdentitiesOperations operations, string resourceGroupName, string vaultName, string identityName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, vaultName, identityName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + } +} diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/ReplicationUsagesOperations.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/ReplicationUsagesOperations.cs new file mode 100644 index 000000000000..88368c496983 --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/ReplicationUsagesOperations.cs @@ -0,0 +1,245 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + 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; + + /// + /// ReplicationUsagesOperations operations. + /// + internal partial class ReplicationUsagesOperations : IServiceOperations, IReplicationUsagesOperations + { + /// + /// Initializes a new instance of the ReplicationUsagesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ReplicationUsagesOperations(RecoveryServicesClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesClient + /// + public RecoveryServicesClient Client { get; private set; } + + /// + /// Fetches the replication usages of the vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// 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 resourceGroupName, string vaultName, 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 (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + string apiVersion = "2016-06-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); + 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/replicationUsages").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/ReplicationUsagesOperationsExtensions.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/ReplicationUsagesOperationsExtensions.cs new file mode 100644 index 000000000000..8ac0f197fd16 --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/ReplicationUsagesOperationsExtensions.cs @@ -0,0 +1,65 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + 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 ReplicationUsagesOperations. + /// + public static partial class ReplicationUsagesOperationsExtensions + { + /// + /// Fetches the replication usages of the vault. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the recovery services vault. + /// + public static IEnumerable List(this IReplicationUsagesOperations operations, string resourceGroupName, string vaultName) + { + return operations.ListAsync(resourceGroupName, vaultName).GetAwaiter().GetResult(); + } + + /// + /// Fetches the replication usages of the vault. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IReplicationUsagesOperations operations, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, vaultName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/UsagesOperations.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/UsagesOperations.cs new file mode 100644 index 000000000000..bcd8fe0392e7 --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/UsagesOperations.cs @@ -0,0 +1,245 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + 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; + + /// + /// UsagesOperations operations. + /// + internal partial class UsagesOperations : IServiceOperations, IUsagesOperations + { + /// + /// Initializes a new instance of the UsagesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal UsagesOperations(RecoveryServicesClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesClient + /// + public RecoveryServicesClient Client { get; private set; } + + /// + /// Fetches the usages of the vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// 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>> ListByVaultsWithHttpMessagesAsync(string resourceGroupName, string vaultName, 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 (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + string apiVersion = "2016-06-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByVaults", 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.RecoveryServices/vaults/{vaultName}/usages").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/UsagesOperationsExtensions.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/UsagesOperationsExtensions.cs new file mode 100644 index 000000000000..6ab377e8dc21 --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/UsagesOperationsExtensions.cs @@ -0,0 +1,65 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + 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 UsagesOperations. + /// + public static partial class UsagesOperationsExtensions + { + /// + /// Fetches the usages of the vault. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the recovery services vault. + /// + public static IEnumerable ListByVaults(this IUsagesOperations operations, string resourceGroupName, string vaultName) + { + return operations.ListByVaultsAsync(resourceGroupName, vaultName).GetAwaiter().GetResult(); + } + + /// + /// Fetches the usages of the vault. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByVaultsAsync(this IUsagesOperations operations, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByVaultsWithHttpMessagesAsync(resourceGroupName, vaultName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/VaultCertificatesOperations.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/VaultCertificatesOperations.cs new file mode 100644 index 000000000000..3d989c08a509 --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/VaultCertificatesOperations.cs @@ -0,0 +1,268 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + 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; + + /// + /// VaultCertificatesOperations operations. + /// + internal partial class VaultCertificatesOperations : IServiceOperations, IVaultCertificatesOperations + { + /// + /// Initializes a new instance of the VaultCertificatesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal VaultCertificatesOperations(RecoveryServicesClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesClient + /// + public RecoveryServicesClient Client { get; private set; } + + /// + /// Upload a certificate for a resource. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// Certificate friendly name. + /// + /// + /// Input parameters for uploading the vault certificate. + /// + /// + /// 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> CreateWithHttpMessagesAsync(string resourceGroupName, string vaultName, string certificateName, CertificateRequest certificateRequest, 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 (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (certificateName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "certificateName"); + } + if (certificateRequest == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "certificateRequest"); + } + string apiVersion = "2016-06-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("certificateName", certificateName); + tracingParameters.Add("certificateRequest", certificateRequest); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Create", 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.RecoveryServices/vaults/{vaultName}/certificates/{certificateName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{certificateName}", System.Uri.EscapeDataString(certificateName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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(certificateRequest != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(certificateRequest, 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; + } + + } +} diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/VaultCertificatesOperationsExtensions.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/VaultCertificatesOperationsExtensions.cs new file mode 100644 index 000000000000..0ad1dd14680d --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/VaultCertificatesOperationsExtensions.cs @@ -0,0 +1,75 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for VaultCertificatesOperations. + /// + public static partial class VaultCertificatesOperationsExtensions + { + /// + /// Upload a certificate for a resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// Certificate friendly name. + /// + /// + /// Input parameters for uploading the vault certificate. + /// + public static VaultCertificateResponse Create(this IVaultCertificatesOperations operations, string resourceGroupName, string vaultName, string certificateName, CertificateRequest certificateRequest) + { + return operations.CreateAsync(resourceGroupName, vaultName, certificateName, certificateRequest).GetAwaiter().GetResult(); + } + + /// + /// Upload a certificate for a resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// Certificate friendly name. + /// + /// + /// Input parameters for uploading the vault certificate. + /// + /// + /// The cancellation token. + /// + public static async Task CreateAsync(this IVaultCertificatesOperations operations, string resourceGroupName, string vaultName, string certificateName, CertificateRequest certificateRequest, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateWithHttpMessagesAsync(resourceGroupName, vaultName, certificateName, certificateRequest, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/VaultExtendedInfoOperations.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/VaultExtendedInfoOperations.cs new file mode 100644 index 000000000000..fff5a01b494e --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/VaultExtendedInfoOperations.cs @@ -0,0 +1,663 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + 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; + + /// + /// VaultExtendedInfoOperations operations. + /// + internal partial class VaultExtendedInfoOperations : IServiceOperations, IVaultExtendedInfoOperations + { + /// + /// Initializes a new instance of the VaultExtendedInfoOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal VaultExtendedInfoOperations(RecoveryServicesClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesClient + /// + public RecoveryServicesClient Client { get; private set; } + + /// + /// Get the vault extended info. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// 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 resourceGroupName, string vaultName, 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 (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + string apiVersion = "2016-06-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); + 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.RecoveryServices/vaults/{vaultName}/extendedInformation/vaultExtendedInfo").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 vault extended info. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// resourceResourceExtendedInfoDetails + /// + /// + /// 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> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vaultName, VaultExtendedInfoResource resourceResourceExtendedInfoDetails, 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 (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceResourceExtendedInfoDetails == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceResourceExtendedInfoDetails"); + } + string apiVersion = "2016-06-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceResourceExtendedInfoDetails", resourceResourceExtendedInfoDetails); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", 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.RecoveryServices/vaults/{vaultName}/extendedInformation/vaultExtendedInfo").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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(resourceResourceExtendedInfoDetails != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(resourceResourceExtendedInfoDetails, 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; + } + + /// + /// Update vault extended info. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// resourceResourceExtendedInfoDetails + /// + /// + /// 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 resourceGroupName, string vaultName, VaultExtendedInfoResource resourceResourceExtendedInfoDetails, 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 (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceResourceExtendedInfoDetails == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceResourceExtendedInfoDetails"); + } + string apiVersion = "2016-06-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceResourceExtendedInfoDetails", resourceResourceExtendedInfoDetails); + 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.RecoveryServices/vaults/{vaultName}/extendedInformation/vaultExtendedInfo").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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(resourceResourceExtendedInfoDetails != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(resourceResourceExtendedInfoDetails, 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; + } + + } +} diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/VaultExtendedInfoOperationsExtensions.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/VaultExtendedInfoOperationsExtensions.cs new file mode 100644 index 000000000000..a238c906bc36 --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/VaultExtendedInfoOperationsExtensions.cs @@ -0,0 +1,159 @@ +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices +{ + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for VaultExtendedInfoOperations. + /// + public static partial class VaultExtendedInfoOperationsExtensions + { + /// + /// Get the vault extended info. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the recovery services vault. + /// + public static VaultExtendedInfoResource Get(this IVaultExtendedInfoOperations operations, string resourceGroupName, string vaultName) + { + return operations.GetAsync(resourceGroupName, vaultName).GetAwaiter().GetResult(); + } + + /// + /// Get the vault extended info. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IVaultExtendedInfoOperations operations, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vaultName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Create vault extended info. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// resourceResourceExtendedInfoDetails + /// + public static VaultExtendedInfoResource CreateOrUpdate(this IVaultExtendedInfoOperations operations, string resourceGroupName, string vaultName, VaultExtendedInfoResource resourceResourceExtendedInfoDetails) + { + return operations.CreateOrUpdateAsync(resourceGroupName, vaultName, resourceResourceExtendedInfoDetails).GetAwaiter().GetResult(); + } + + /// + /// Create vault extended info. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// resourceResourceExtendedInfoDetails + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IVaultExtendedInfoOperations operations, string resourceGroupName, string vaultName, VaultExtendedInfoResource resourceResourceExtendedInfoDetails, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vaultName, resourceResourceExtendedInfoDetails, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Update vault extended info. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// resourceResourceExtendedInfoDetails + /// + public static VaultExtendedInfoResource Update(this IVaultExtendedInfoOperations operations, string resourceGroupName, string vaultName, VaultExtendedInfoResource resourceResourceExtendedInfoDetails) + { + return operations.UpdateAsync(resourceGroupName, vaultName, resourceResourceExtendedInfoDetails).GetAwaiter().GetResult(); + } + + /// + /// Update vault extended info. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// resourceResourceExtendedInfoDetails + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IVaultExtendedInfoOperations operations, string resourceGroupName, string vaultName, VaultExtendedInfoResource resourceResourceExtendedInfoDetails, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, vaultName, resourceResourceExtendedInfoDetails, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/VaultsOperations.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/VaultsOperations.cs index fd1a031542ad..af9955f19eeb 100644 --- a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/VaultsOperations.cs +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/VaultsOperations.cs @@ -1,21 +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 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.RecoveryServices { - using System.Linq; + using Microsoft.Azure; + using Microsoft.Azure.Management; 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; /// /// VaultsOperations operations. /// - internal partial class VaultsOperations : Microsoft.Rest.IServiceOperations, IVaultsOperations + internal partial class VaultsOperations : IServiceOperations, IVaultsOperations { /// /// Initializes a new instance of the VaultsOperations class. @@ -28,11 +34,11 @@ internal partial class VaultsOperations : Microsoft.Rest.IServiceOperations internal VaultsOperations(RecoveryServicesClient client) { - if (client == null) + if (client == null) { throw new System.ArgumentNullException("client"); } - this.Client = client; + Client = client; } /// @@ -41,96 +47,266 @@ internal VaultsOperations(RecoveryServicesClient client) public RecoveryServicesClient Client { get; private set; } /// - /// Get the Vault details. + /// Fetches all the resources of the specified type in the subscription. + /// + /// + /// 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>> ListBySubscriptionIdWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2016-06-01"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListBySubscriptionId", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/vaults").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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; + } + + /// + /// Retrieve a list of Vaults. /// /// /// The name of the resource group where the recovery services vault is /// present. /// - /// - /// The name of the recovery services vault. - /// /// /// 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 System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (vaultName == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); - } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } + string apiVersion = "2016-06-01"; // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + List _queryParameters = new List(); + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -146,51 +322,51 @@ internal VaultsOperations(RecoveryServicesClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -200,7 +376,7 @@ internal VaultsOperations(RecoveryServicesClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -213,27 +389,27 @@ internal VaultsOperations(RecoveryServicesClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Creates or updates a Recovery Services vault. + /// Get the Vault details. /// /// /// The name of the resource group where the recovery services vault is @@ -242,99 +418,90 @@ internal VaultsOperations(RecoveryServicesClient client) /// /// The name of the recovery services vault. /// - /// - /// Recovery Services Vault to be created. - /// /// /// 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 System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vaultName, Vault vault, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (vaultName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); - } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - if (vault == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vault"); - } - if (vault != null) - { - vault.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); } + string apiVersion = "2016-06-01"; // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vaultName", vaultName); - tracingParameters.Add("vault", vault); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + List _queryParameters = new List(); + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -349,58 +516,52 @@ internal VaultsOperations(RecoveryServicesClient client) // Serialize Request string _requestContent = null; - if(vault != null) - { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(vault, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201) + if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -410,7 +571,7 @@ internal VaultsOperations(RecoveryServicesClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -423,45 +584,27 @@ internal VaultsOperations(RecoveryServicesClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - // Deserialize Response - if ((int)_statusCode == 201) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Deletes a vault. + /// Creates or updates a Recovery Services vault. /// /// /// The name of the resource group where the recovery services vault is @@ -470,84 +613,102 @@ internal VaultsOperations(RecoveryServicesClient client) /// /// The name of the recovery services vault. /// + /// + /// Recovery Services Vault to be created. + /// /// /// 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 System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vaultName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vaultName, Vault vault, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (vaultName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (vault == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vault"); } - if (this.Client.ApiVersion == null) + if (vault != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + vault.Validate(); } + string apiVersion = "2016-06-01"; // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("vault", vault); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; + var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + List _queryParameters = new List(); + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -562,44 +723,58 @@ internal VaultsOperations(RecoveryServicesClient client) // Serialize Request string _requestContent = null; + if(vault != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(vault, 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 (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - if (_httpResponse.Content != null) { + 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; + } } - else { - _responseContent = string.Empty; + catch (JsonException) + { + // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -609,102 +784,147 @@ internal VaultsOperations(RecoveryServicesClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + 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); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _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) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Retrieve a list of Vaults. + /// Deletes a vault. /// /// /// The name of the resource group where the recovery services vault is /// present. /// + /// + /// The name of the recovery services vault. + /// /// /// 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 System.Threading.Tasks.Task>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vaultName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (this.Client.SubscriptionId == null) + if (Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (this.Client.ApiVersion == null) + if (vaultName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); } + string apiVersion = "2016-06-01"; // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } // Construct URL - var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (this.Client.ApiVersion != null) + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + List _queryParameters = new List(); + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -720,51 +940,51 @@ internal VaultsOperations(RecoveryServicesClient client) // Serialize Request string _requestContent = null; // Set Credentials - if (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -774,43 +994,32 @@ internal VaultsOperations(RecoveryServicesClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + 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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } /// - /// Retrieve a list of Vaults. + /// Updates the vault. /// - /// - /// The NextLink from the previous successful call to List operation. + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// Recovery Services Vault to be created. /// /// /// Headers that will be added to request. @@ -818,61 +1027,89 @@ internal VaultsOperations(RecoveryServicesClient client) /// /// 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 System.Threading.Tasks.Task>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string vaultName, Vault vault, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (nextPageLink == null) + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (vault == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + throw new ValidationException(ValidationRules.CannotBeNull, "vault"); } + string apiVersion = "2016-06-01"; // Tracing - bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; if (_shouldTrace) { - _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); - System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("vault", vault); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroupNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); } // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); } // Create HTTP transport objects - System.Net.Http.HttpRequestMessage _httpRequest = new System.Net.Http.HttpRequestMessage(); - System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers - if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) { _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); } - if (this.Client.AcceptLanguage != null) + if (Client.AcceptLanguage != null) { if (_httpRequest.Headers.Contains("accept-language")) { _httpRequest.Headers.Remove("accept-language"); } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); } + + if (customHeaders != null) { foreach(var _header in customHeaders) @@ -887,52 +1124,58 @@ internal VaultsOperations(RecoveryServicesClient client) // Serialize Request string _requestContent = null; + if(vault != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(vault, 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 (this.Client.Credentials != null) + if (Client.Credentials != null) { cancellationToken.ThrowIfCancellationRequested(); - await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); } // Send Request if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); } cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } - catch (Newtonsoft.Json.JsonException) + catch (JsonException) { // Ignore the exception } - ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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) { - Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + ServiceClientTracing.Error(_invocationId, ex); } _httpRequest.Dispose(); if (_httpResponse != null) @@ -942,7 +1185,7 @@ internal VaultsOperations(RecoveryServicesClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -955,21 +1198,39 @@ internal VaultsOperations(RecoveryServicesClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _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); + } + } + // Deserialize Response + if ((int)_statusCode == 201) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } - catch (Newtonsoft.Json.JsonException ex) + catch (JsonException ex) { _httpRequest.Dispose(); if (_httpResponse != null) { _httpResponse.Dispose(); } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); } } if (_shouldTrace) { - Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + ServiceClientTracing.Exit(_invocationId, _result); } return _result; } diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/VaultsOperationsExtensions.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/VaultsOperationsExtensions.cs index 1a642ee6b079..2b8115d599ea 100644 --- a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/VaultsOperationsExtensions.cs +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Generated/VaultsOperationsExtensions.cs @@ -1,21 +1,88 @@ -// 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 0.17.0.0 +// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 // Changes may cause incorrect behavior and will be lost if the code is // regenerated. namespace Microsoft.Azure.Management.RecoveryServices { + using Microsoft.Azure; + using Microsoft.Azure.Management; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; using System.Threading.Tasks; - using Microsoft.Rest.Azure; - using Models; /// /// Extension methods for VaultsOperations. /// public static partial class VaultsOperationsExtensions { + /// + /// Fetches all the resources of the specified type in the subscription. + /// + /// + /// The operations group for this extension method. + /// + public static IEnumerable ListBySubscriptionId(this IVaultsOperations operations) + { + return operations.ListBySubscriptionIdAsync().GetAwaiter().GetResult(); + } + + /// + /// Fetches all the resources of the specified type in the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListBySubscriptionIdAsync(this IVaultsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionIdWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Retrieve a list of Vaults. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + public static IEnumerable ListByResourceGroup(this IVaultsOperations operations, string resourceGroupName) + { + return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Retrieve a list of Vaults. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupAsync(this IVaultsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Get the Vault details. /// @@ -31,7 +98,7 @@ public static partial class VaultsOperationsExtensions /// public static Vault Get(this IVaultsOperations operations, string resourceGroupName, string vaultName) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVaultsOperations)s).GetAsync(resourceGroupName, vaultName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.GetAsync(resourceGroupName, vaultName).GetAwaiter().GetResult(); } /// @@ -50,7 +117,7 @@ public static Vault Get(this IVaultsOperations operations, string resourceGroupN /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this IVaultsOperations operations, string resourceGroupName, string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task GetAsync(this IVaultsOperations operations, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vaultName, null, cancellationToken).ConfigureAwait(false)) { @@ -76,7 +143,7 @@ public static Vault Get(this IVaultsOperations operations, string resourceGroupN /// public static Vault CreateOrUpdate(this IVaultsOperations operations, string resourceGroupName, string vaultName, Vault vault) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVaultsOperations)s).CreateOrUpdateAsync(resourceGroupName, vaultName, vault), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.CreateOrUpdateAsync(resourceGroupName, vaultName, vault).GetAwaiter().GetResult(); } /// @@ -98,7 +165,7 @@ public static Vault CreateOrUpdate(this IVaultsOperations operations, string res /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IVaultsOperations operations, string resourceGroupName, string vaultName, Vault vault, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task CreateOrUpdateAsync(this IVaultsOperations operations, string resourceGroupName, string vaultName, Vault vault, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vaultName, vault, null, cancellationToken).ConfigureAwait(false)) { @@ -121,7 +188,7 @@ public static Vault CreateOrUpdate(this IVaultsOperations operations, string res /// public static void Delete(this IVaultsOperations operations, string resourceGroupName, string vaultName) { - System.Threading.Tasks.Task.Factory.StartNew(s => ((IVaultsOperations)s).DeleteAsync(resourceGroupName, vaultName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + operations.DeleteAsync(resourceGroupName, vaultName).GetAwaiter().GetResult(); } /// @@ -140,13 +207,13 @@ public static void Delete(this IVaultsOperations operations, string resourceGrou /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteAsync(this IVaultsOperations operations, string resourceGroupName, string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task DeleteAsync(this IVaultsOperations operations, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default(CancellationToken)) { - await operations.DeleteWithHttpMessagesAsync(resourceGroupName, vaultName, null, cancellationToken).ConfigureAwait(false); + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, vaultName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// Retrieve a list of Vaults. + /// Updates the vault. /// /// /// The operations group for this extension method. @@ -155,13 +222,19 @@ public static void Delete(this IVaultsOperations operations, string resourceGrou /// The name of the resource group where the recovery services vault is /// present. /// - public static Microsoft.Rest.Azure.IPage ListByResourceGroup(this IVaultsOperations operations, string resourceGroupName) + /// + /// The name of the recovery services vault. + /// + /// + /// Recovery Services Vault to be created. + /// + public static Vault Update(this IVaultsOperations operations, string resourceGroupName, string vaultName, Vault vault) { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVaultsOperations)s).ListByResourceGroupAsync(resourceGroupName), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); + return operations.UpdateAsync(resourceGroupName, vaultName, vault).GetAwaiter().GetResult(); } /// - /// Retrieve a list of Vaults. + /// Updates the vault. /// /// /// The operations group for this extension method. @@ -170,46 +243,18 @@ public static Microsoft.Rest.Azure.IPage ListByResourceGroup(this IVaults /// The name of the resource group where the recovery services vault is /// present. /// - /// - /// The cancellation token. - /// - public static async Task> ListByResourceGroupAsync(this IVaultsOperations operations, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Retrieve a list of Vaults. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static Microsoft.Rest.Azure.IPage ListByResourceGroupNext(this IVaultsOperations operations, string nextPageLink) - { - return System.Threading.Tasks.Task.Factory.StartNew(s => ((IVaultsOperations)s).ListByResourceGroupNextAsync(nextPageLink), operations, System.Threading.CancellationToken.None, System.Threading.Tasks.TaskCreationOptions.None, System.Threading.Tasks.TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); - } - - /// - /// Retrieve a list of Vaults. - /// - /// - /// The operations group for this extension method. + /// + /// The name of the recovery services vault. /// - /// - /// The NextLink from the previous successful call to List operation. + /// + /// Recovery Services Vault to be created. /// /// /// The cancellation token. /// - public static async Task> ListByResourceGroupNextAsync(this IVaultsOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async Task UpdateAsync(this IVaultsOperations operations, string resourceGroupName, string vaultName, Vault vault, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, vaultName, vault, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Microsoft.Azure.Management.RecoveryServices.xproj b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Microsoft.Azure.Management.RecoveryServices.xproj index 3f2839e4740d..2101ecd05405 100644 --- a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Microsoft.Azure.Management.RecoveryServices.xproj +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Microsoft.Azure.Management.RecoveryServices.xproj @@ -6,7 +6,7 @@ - 5b42c053-eca0-4ecf-afa7-fe6746430340 + 44bb4174-5ddd-4008-b391-df20db60b490 Microsoft.Azure.Management.RecoveryServices .\obj .\bin\ diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Properties/AssemblyInfo.cs b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..39acfa2d0309 --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/Properties/AssemblyInfo.cs @@ -0,0 +1,20 @@ +// 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.Resources; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("Microsoft Azure Management Recovery Services")] +[assembly: AssemblyDescription("Provides Management for Recovery Services.")] + +[assembly: AssemblyVersion("4.2.0.0")] +[assembly: AssemblyFileVersion("4.2.0.0")] + +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("Microsoft Azure .NET SDK")] +[assembly: AssemblyCopyright("Copyright (c) Microsoft Corporation")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] +[assembly: NeutralResourcesLanguage("en")] diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/generate.cmd b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/generate.cmd index 54bdc86439cc..9aab96732b02 100644 --- a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/generate.cmd +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/generate.cmd @@ -4,9 +4,9 @@ :: @echo off -set autoRestVersion=0.17.0-Nightly20161003 +set autoRestVersion=1.0.1.0 if "%1" == "" ( - set specFile="https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-recoveryservices/2016-06-01/swagger/recoveryservices.json" + set specFile="https://github.com/Azure/azure-rest-api-specs/blob/1c421b473ac5d927a380ed28c06a0eec31b796f2/arm-recoveryservices/compositeRecoveryServicesClient.json" ) else ( set specFile="%1" ) diff --git a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/project.json b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/project.json index 18a1294b59e3..75392f3ef647 100644 --- a/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/project.json +++ b/src/ResourceManagement/RecoveryServices/Microsoft.Azure.Management.RecoveryServices/project.json @@ -1,5 +1,5 @@ { - "version": "4.1.0-preview", + "version": "4.2.0-preview", "description": "Provides developers with libraries for the updated recovery services backup feature under Azure Resource manager.", "authors": [ "Microsoft" ], "packOptions": { @@ -18,7 +18,7 @@ }, "dependencies": { "Microsoft.Rest.ClientRuntime.Azure": "[3.3.5,4.0.0)", - "Microsoft.Rest.ClientRuntime": "[2.3.5,3.0.0)" + "Microsoft.Rest.ClientRuntime": "[2.3.6,3.0.0)" }, "frameworks": { "net45": { diff --git a/src/ResourceManagement/RecoveryServices/RecoveryServices.Tests/RecoveryServicesTestBase.cs b/src/ResourceManagement/RecoveryServices/RecoveryServices.Tests/RecoveryServicesTestBase.cs index 46f9fb4939d3..15b5ee000e7f 100644 --- a/src/ResourceManagement/RecoveryServices/RecoveryServices.Tests/RecoveryServicesTestBase.cs +++ b/src/ResourceManagement/RecoveryServices/RecoveryServices.Tests/RecoveryServicesTestBase.cs @@ -1,5 +1,17 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Copyright (c) Microsoft. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// using Microsoft.Azure.Management.RecoveryServices.Models; using Microsoft.Azure.Management.Resources; @@ -8,13 +20,14 @@ using Microsoft.Rest.ClientRuntime.Azure.TestFramework; using System; using System.Collections.Generic; +using System.Linq; using System.Net; namespace Microsoft.Azure.Management.RecoveryServices.Tests { public class RecoveryServicesTestBase : TestBase, IDisposable { - private const string resourceGroup = "RecoveryServicesTestRg"; + private string resourceGroup = "SDKTestRg"; private const string location = "westus"; public RecoveryServicesClient VaultClient { get; private set; } @@ -24,44 +37,43 @@ public RecoveryServicesTestBase(MockContext context) VaultClient = this.GetManagementClient(context); ResourceManagementClient resourcesClient = this.GetResourcesClient(context); + CreateResourceGroup(resourcesClient); + } + + private void CreateResourceGroup(ResourceManagementClient resourcesClient) + { + bool resourceGroupExists = true; try { - resourcesClient.ResourceGroups.CreateOrUpdate(resourceGroup, - new ResourceGroup - { - Location = location - }); - + resourcesClient.ResourceGroups.Get(resourceGroup); } catch (CloudException ex) { - if (ex.Response.StatusCode != HttpStatusCode.Conflict) throw; - } - } - - public List ListVaults() - { - var vaults = new List(); - string nextLink = null; - - var pagedVaults = VaultClient.Vaults.ListByResourceGroup(resourceGroup); - - foreach (var pagedVault in pagedVaults) - { - vaults.Add(pagedVault); + // Doesn't exist + resourceGroupExists = false; } - while (!string.IsNullOrEmpty(nextLink)) + if (!resourceGroupExists) { - nextLink = pagedVaults.NextPageLink; - - foreach (var pagedVault in VaultClient.Vaults.ListByResourceGroupNext(nextLink)) + try { - vaults.Add(pagedVault); + resourcesClient.ResourceGroups.CreateOrUpdate(resourceGroup, + new ResourceGroup + { + Location = location + }); + } + catch (CloudException ex) + { + if (ex.Response.StatusCode != HttpStatusCode.Conflict) throw; } } + } - return vaults; + #region Vault + public List ListVaults() + { + return VaultClient.Vaults.ListByResourceGroup(resourceGroup).ToList(); } public void DeleteVault(string vaultName) @@ -83,10 +95,82 @@ public void CreateVault(string vaultName) { Name = SkuName.Standard, }, - Properties = new VaultProperties(), + Properties = new VaultProperties() }; VaultClient.Vaults.CreateOrUpdate(resourceGroup, vaultName, vault); } + #endregion + + #region Vault Extended Info + public VaultExtendedInfoResource CreateVaultExtendedInfo(Vault vault) + { + VaultExtendedInfoResource extInfo = new VaultExtendedInfoResource() + { + Algorithm = "None", + IntegrityKey = TestUtilities.GenerateRandomKey(128) + }; + + return VaultClient.VaultExtendedInfo.CreateOrUpdate(resourceGroup, vault.Name, extInfo); + } + + public VaultExtendedInfoResource UpdateVaultExtendedInfo(Vault vault) + { + VaultExtendedInfoResource extInfo = new VaultExtendedInfoResource() + { + Algorithm = "None", + IntegrityKey = TestUtilities.GenerateRandomKey(128) + }; + + return VaultClient.VaultExtendedInfo.CreateOrUpdate(resourceGroup, vault.Name, extInfo); + } + + public VaultExtendedInfoResource GetVaultExtendedInfo(Vault vault) + { + return VaultClient.VaultExtendedInfo.Get(resourceGroup, vault.Name); + } + #endregion + + #region VaultUsages + + /// + /// List vault usages. + /// + /// List of vault usages. + public List ListVaultUsages(string vaultName) + { + return VaultClient.Usages.ListByVaults(resourceGroup, vaultName).ToList(); + } + + public List ListReplicationUsages(string vaultName) + { + return VaultClient.ReplicationUsages.List(resourceGroup, vaultName).ToList(); + } + + #endregion VaultUsages + + #region Vault Config + + public BackupVaultConfig GetVaultConfig(string vaultName) + { + return VaultClient.BackupVaultConfigs.Get(resourceGroup, vaultName); + } + + public BackupVaultConfig UpdateVaultConfig(string vaultName, BackupVaultConfig backupVaultConfig) + { + return VaultClient.BackupVaultConfigs.Update(resourceGroup, vaultName, backupVaultConfig); + } + + #endregion + + public BackupStorageConfig GetStorageConfig(string vaultName) + { + return VaultClient.BackupStorageConfigs.Get(resourceGroup, vaultName); + } + + public void UpdateStorageConfig(string vaultName, BackupStorageConfig backupStorageConfig) + { + VaultClient.BackupStorageConfigs.Update(resourceGroup, vaultName, backupStorageConfig); + } public void DisposeVaults() { diff --git a/src/ResourceManagement/RecoveryServices/RecoveryServices.Tests/ScenarioTests/VaultScenarioTests.cs b/src/ResourceManagement/RecoveryServices/RecoveryServices.Tests/ScenarioTests/VaultScenarioTests.cs index fac75140a0e2..680a85d0e6b5 100644 --- a/src/ResourceManagement/RecoveryServices/RecoveryServices.Tests/ScenarioTests/VaultScenarioTests.cs +++ b/src/ResourceManagement/RecoveryServices/RecoveryServices.Tests/ScenarioTests/VaultScenarioTests.cs @@ -1,10 +1,25 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Copyright (c) Microsoft. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// using Microsoft.Rest.Azure; using Microsoft.Rest.ClientRuntime.Azure.TestFramework; using System.Linq; using Xunit; +using System; +using System.Net; +using Microsoft.Azure.Management.RecoveryServices.Models; namespace Microsoft.Azure.Management.RecoveryServices.Tests { @@ -39,5 +54,72 @@ public void CanCreateGetListDeleteVaultTest() } } } + + [Fact] + public void CanCreateGetListDeleteVaultExtendedInfoTest() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + using (RecoveryServicesTestBase _testFixture = new RecoveryServicesTestBase(context)) + { + string vaultName = VaultDefinition.TestCrud.VaultName; + + _testFixture.CreateVault(vaultName); + var vault = _testFixture.GetVault(vaultName); + Assert.NotNull(vault); + + Models.VaultExtendedInfoResource extendedInfo = null; + try + { + extendedInfo = _testFixture.GetVaultExtendedInfo(vault); + } + catch (CloudException ex) + { + if (ex.Response.StatusCode != HttpStatusCode.NotFound) + { + throw; + } + } + + if (extendedInfo == null) + { + extendedInfo = _testFixture.CreateVaultExtendedInfo(vault); + } + + Assert.NotNull(extendedInfo.IntegrityKey); + } + } + } + + [Fact] + public void GetAndUpdateBackupVaultAndStorageConfigTest() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + using (RecoveryServicesTestBase _testFixture = new RecoveryServicesTestBase(context)) + { + string vaultName = VaultDefinition.TestCrud.VaultName; + + _testFixture.CreateVault(vaultName); + var vault = _testFixture.GetVault(vaultName); + Assert.NotNull(vault); + + var vaultConfig = _testFixture.GetVaultConfig(vaultName); + + vaultConfig.EnhancedSecurityState = EnhancedSecurityState.Disabled; + Assert.Throws(() => + { + var vaultConfig2 = _testFixture.UpdateVaultConfig(vaultName, vaultConfig); + }); + + var storageConfig = _testFixture.GetStorageConfig(vaultName); + storageConfig.StorageModelType = StorageModelType.LocallyRedundant; + _testFixture.UpdateStorageConfig(vaultName, storageConfig); + + var storageConfig2 = _testFixture.GetStorageConfig(vaultName); + Assert.Equal(storageConfig2.StorageModelType, StorageModelType.LocallyRedundant); + } + } + } } } diff --git a/src/ResourceManagement/RecoveryServices/RecoveryServices.Tests/ScenarioTests/VaultUsageScenarioTests.cs b/src/ResourceManagement/RecoveryServices/RecoveryServices.Tests/ScenarioTests/VaultUsageScenarioTests.cs new file mode 100644 index 000000000000..b2a81c955c82 --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/RecoveryServices.Tests/ScenarioTests/VaultUsageScenarioTests.cs @@ -0,0 +1,63 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +using Microsoft.Rest.Azure; +using Microsoft.Rest.ClientRuntime.Azure.TestFramework; +using System.Linq; +using Xunit; + +namespace Microsoft.Azure.Management.RecoveryServices.Tests +{ + public class VaultUsageScenarioTests : TestBase + { + [Fact] + public void RetrieveVaultUsages() + { + using (var context = MockContext.Start(this.GetType().FullName)) + { + using (RecoveryServicesTestBase _testFixture = new RecoveryServicesTestBase(context)) + { + string vaultName = VaultDefinition.TestCrud.VaultName; + + _testFixture.CreateVault(vaultName); + var vault = _testFixture.GetVault(vaultName); + Assert.NotNull(vault); + + var vaults = _testFixture.ListVaults(); + Assert.NotNull(vaults); + Assert.NotEmpty(vaults); + Assert.True(vaults.Any(v => v.Name == vaultName)); + + var response = _testFixture.ListVaultUsages(vaultName); + + Assert.NotNull(response); + Assert.NotEqual(response.Count(), 0); + foreach (var usage in response) + { + Assert.NotNull(usage.Name.Value); + Assert.NotNull(usage.Unit); + Assert.NotNull(usage.CurrentValue); + Assert.NotNull(usage.Limit); + } + + var replicationResponse = _testFixture.ListReplicationUsages(vaultName); + + Assert.NotNull(replicationResponse); + Assert.Equal(replicationResponse.Count(), 0); + } + } + } + } +} diff --git a/src/ResourceManagement/RecoveryServices/RecoveryServices.Tests/SessionRecords/Microsoft.Azure.Management.RecoveryServices.Tests.VaultScenarioTests/CanCreateGetListDeleteVaultExtendedInfoTest.json b/src/ResourceManagement/RecoveryServices/RecoveryServices.Tests/SessionRecords/Microsoft.Azure.Management.RecoveryServices.Tests.VaultScenarioTests/CanCreateGetListDeleteVaultExtendedInfoTest.json new file mode 100644 index 000000000000..336c3c4666f2 --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/RecoveryServices.Tests/SessionRecords/Microsoft.Azure.Management.RecoveryServices.Tests.VaultScenarioTests/CanCreateGetListDeleteVaultExtendedInfoTest.json @@ -0,0 +1,508 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourcegroups/SDKTestRg?api-version=2015-11-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlZ3JvdXBzL1NES1Rlc3RSZz9hcGktdmVyc2lvbj0yMDE1LTExLTAx", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "0ae0fcc2-e9c2-4aa9-89cf-3f5ee15fd80f" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24410.01", + "Microsoft.Azure.Management.Resources.ResourceManagementClient/1.0.0-preview" + ] + }, + "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceGroupNotFound\",\r\n \"message\": \"Resource group 'SDKTestRg' could not be found.\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "101" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 04 Apr 2017 19:48:38 GMT" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-failure-cause": [ + "gateway" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14922" + ], + "x-ms-request-id": [ + "c624317a-f740-4e3c-889c-4423e23fdd7d" + ], + "x-ms-correlation-request-id": [ + "c624317a-f740-4e3c-889c-4423e23fdd7d" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20170404T194839Z:c624317a-f740-4e3c-889c-4423e23fdd7d" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 404 + }, + { + "RequestUri": "/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourcegroups/SDKTestRg?api-version=2015-11-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlZ3JvdXBzL1NES1Rlc3RSZz9hcGktdmVyc2lvbj0yMDE1LTExLTAx", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"westus\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "28" + ], + "x-ms-client-request-id": [ + "c9e4d5a9-2401-4d20-868f-f757b2173af9" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24410.01", + "Microsoft.Azure.Management.Resources.ResourceManagementClient/1.0.0-preview" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg\",\r\n \"name\": \"SDKTestRg\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "171" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 04 Apr 2017 19:48:41 GMT" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1198" + ], + "x-ms-request-id": [ + "fba5f7a5-5760-4ca2-90d7-54753e7eb537" + ], + "x-ms-correlation-request-id": [ + "fba5f7a5-5760-4ca2-90d7-54753e7eb537" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20170404T194842Z:fba5f7a5-5760-4ca2-90d7-54753e7eb537" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault?api-version=2016-06-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlR3JvdXBzL1NES1Rlc3RSZy9wcm92aWRlcnMvTWljcm9zb2Z0LlJlY292ZXJ5U2VydmljZXMvdmF1bHRzL1NES1Rlc3RSc1ZhdWx0P2FwaS12ZXJzaW9uPTIwMTYtMDYtMDE=", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {},\r\n \"sku\": {\r\n \"name\": \"Standard\"\r\n },\r\n \"location\": \"westus\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "91" + ], + "x-ms-client-request-id": [ + "5b3473de-2750-4b42-8eda-ad3fff18fa49" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24410.01", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/4.0.1-preview" + ] + }, + "ResponseBody": "{\r\n \"location\": \"westus\",\r\n \"name\": \"SDKTestRsVault\",\r\n \"etag\": \"W/\\\"datetime'2017-04-04T19%3A48%3A51.1226224Z'\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault\",\r\n \"type\": \"Microsoft.RecoveryServices/vaults\",\r\n \"sku\": {\r\n \"name\": \"Standard\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "362" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 04 Apr 2017 19:48:51 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-IIS/8.0" + ], + "x-ms-request-id": [ + "99f09e24-17cd-4751-94e6-8fcc6fcac5c5" + ], + "x-ms-client-request-id": [ + "5b3473de-2750-4b42-8eda-ad3fff18fa49" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1198" + ], + "x-ms-correlation-request-id": [ + "99f09e24-17cd-4751-94e6-8fcc6fcac5c5" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20170404T194852Z:99f09e24-17cd-4751-94e6-8fcc6fcac5c5" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault?api-version=2016-06-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlR3JvdXBzL1NES1Rlc3RSZy9wcm92aWRlcnMvTWljcm9zb2Z0LlJlY292ZXJ5U2VydmljZXMvdmF1bHRzL1NES1Rlc3RSc1ZhdWx0P2FwaS12ZXJzaW9uPTIwMTYtMDYtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "6f8f20e0-ebec-4d04-8438-1d58312eb654" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24410.01", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/4.0.1-preview" + ] + }, + "ResponseBody": "{\r\n \"location\": \"westus\",\r\n \"name\": \"SDKTestRsVault\",\r\n \"etag\": \"W/\\\"datetime'2017-04-04T19%3A48%3A51.1226224Z'\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault\",\r\n \"type\": \"Microsoft.RecoveryServices/vaults\",\r\n \"sku\": {\r\n \"name\": \"Standard\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 04 Apr 2017 19:48:51 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-IIS/8.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "74d80c1e-2aae-4447-a482-a7b31a460858" + ], + "x-ms-client-request-id": [ + "6f8f20e0-ebec-4d04-8438-1d58312eb654" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14997" + ], + "x-ms-correlation-request-id": [ + "74d80c1e-2aae-4447-a482-a7b31a460858" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20170404T194852Z:74d80c1e-2aae-4447-a482-a7b31a460858" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault/extendedInformation/vaultExtendedInfo?api-version=2016-06-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlR3JvdXBzL1NES1Rlc3RSZy9wcm92aWRlcnMvTWljcm9zb2Z0LlJlY292ZXJ5U2VydmljZXMvdmF1bHRzL1NES1Rlc3RSc1ZhdWx0L2V4dGVuZGVkSW5mb3JtYXRpb24vdmF1bHRFeHRlbmRlZEluZm8/YXBpLXZlcnNpb249MjAxNi0wNi0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "34c1e43d-bdb4-4d7d-8f72-c24f325906c9" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24410.01", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/4.0.1-preview" + ] + }, + "ResponseBody": "{\r\n \"ErrorCode\": \"ResourceExtendedInfoNotFound\",\r\n \"Message\": {\r\n \"Language\": \"en-US\",\r\n \"Value\": \"\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "86" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 04 Apr 2017 19:48:52 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-IIS/8.0" + ], + "x-ms-request-id": [ + "3f958960-a46a-498d-bdf0-74911c4ef196" + ], + "x-ms-client-request-id": [ + "34c1e43d-bdb4-4d7d-8f72-c24f325906c9" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14996" + ], + "x-ms-correlation-request-id": [ + "3f958960-a46a-498d-bdf0-74911c4ef196" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20170404T194853Z:3f958960-a46a-498d-bdf0-74911c4ef196" + ] + }, + "StatusCode": 404 + }, + { + "RequestUri": "/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault/extendedInformation/vaultExtendedInfo?api-version=2016-06-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlR3JvdXBzL1NES1Rlc3RSZy9wcm92aWRlcnMvTWljcm9zb2Z0LlJlY292ZXJ5U2VydmljZXMvdmF1bHRzL1NES1Rlc3RSc1ZhdWx0L2V4dGVuZGVkSW5mb3JtYXRpb24vdmF1bHRFeHRlbmRlZEluZm8/YXBpLXZlcnNpb249MjAxNi0wNi0wMQ==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {\r\n \"integrityKey\": \"a1gzNBRxFj19JGhqN1codA==\",\r\n \"algorithm\": \"None\"\r\n }\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "102" + ], + "x-ms-client-request-id": [ + "e92a37d9-460d-4ad4-8837-8268b1a95f1a" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24410.01", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/4.0.1-preview" + ] + }, + "ResponseBody": "{\r\n \"name\": \"vaultExtendedInfo\",\r\n \"etag\": \"c52c1185-88db-4200-8269-dae7d1eb40d4\",\r\n \"properties\": {\r\n \"integrityKey\": \"a1gzNBRxFj19JGhqN1codA==\",\r\n \"algorithm\": \"None\"\r\n },\r\n \"id\": \"/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVaultextendedInformation/vaultExtendedInfo\",\r\n \"type\": \"Microsoft.RecoveryServices/vaults/extendedInformation\"\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 04 Apr 2017 19:48:52 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-IIS/8.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "9d076fa3-6cbb-42f2-a8c9-091a78fc4f24" + ], + "x-ms-client-request-id": [ + "e92a37d9-460d-4ad4-8837-8268b1a95f1a" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1197" + ], + "x-ms-correlation-request-id": [ + "9d076fa3-6cbb-42f2-a8c9-091a78fc4f24" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20170404T194853Z:9d076fa3-6cbb-42f2-a8c9-091a78fc4f24" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults?api-version=2016-06-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlR3JvdXBzL1NES1Rlc3RSZy9wcm92aWRlcnMvTWljcm9zb2Z0LlJlY292ZXJ5U2VydmljZXMvdmF1bHRzP2FwaS12ZXJzaW9uPTIwMTYtMDYtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "1198b07e-7e2f-4a4f-800c-2473d3d5eeda" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24410.01", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/4.0.1-preview" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"SDKTestRsVault\",\r\n \"etag\": \"W/\\\"datetime'2017-04-04T19%3A48%3A53.6121238Z'\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault\",\r\n \"type\": \"Microsoft.RecoveryServices/vaults\",\r\n \"sku\": {\r\n \"name\": \"Standard\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 04 Apr 2017 19:48:53 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-IIS/8.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "d7a9d297-3aea-47b2-b5d3-6e81bc1e50e6" + ], + "x-ms-client-request-id": [ + "1198b07e-7e2f-4a4f-800c-2473d3d5eeda" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14995" + ], + "x-ms-correlation-request-id": [ + "d7a9d297-3aea-47b2-b5d3-6e81bc1e50e6" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20170404T194854Z:d7a9d297-3aea-47b2-b5d3-6e81bc1e50e6" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault?api-version=2016-06-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlR3JvdXBzL1NES1Rlc3RSZy9wcm92aWRlcnMvTWljcm9zb2Z0LlJlY292ZXJ5U2VydmljZXMvdmF1bHRzL1NES1Rlc3RSc1ZhdWx0P2FwaS12ZXJzaW9uPTIwMTYtMDYtMDE=", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "aae21fb2-5087-440a-8a70-92e58552087c" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24410.01", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/4.0.1-preview" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 04 Apr 2017 19:48:56 GMT" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "ef0b1f38-1d4c-48f2-9e54-06a46c34e226" + ], + "x-ms-client-request-id": [ + "aae21fb2-5087-440a-8a70-92e58552087c" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1196" + ], + "x-ms-correlation-request-id": [ + "ef0b1f38-1d4c-48f2-9e54-06a46c34e226" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20170404T194857Z:ef0b1f38-1d4c-48f2-9e54-06a46c34e226" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "f7424430-103b-4ba3-bd9e-b6f0986f848a" + } +} \ No newline at end of file diff --git a/src/ResourceManagement/RecoveryServices/RecoveryServices.Tests/SessionRecords/Microsoft.Azure.Management.RecoveryServices.Tests.VaultScenarioTests/CanCreateGetListDeleteVaultTest.json b/src/ResourceManagement/RecoveryServices/RecoveryServices.Tests/SessionRecords/Microsoft.Azure.Management.RecoveryServices.Tests.VaultScenarioTests/CanCreateGetListDeleteVaultTest.json index 6154eede7944..ade33a1632ac 100644 --- a/src/ResourceManagement/RecoveryServices/RecoveryServices.Tests/SessionRecords/Microsoft.Azure.Management.RecoveryServices.Tests.VaultScenarioTests/CanCreateGetListDeleteVaultTest.json +++ b/src/ResourceManagement/RecoveryServices/RecoveryServices.Tests/SessionRecords/Microsoft.Azure.Management.RecoveryServices.Tests.VaultScenarioTests/CanCreateGetListDeleteVaultTest.json @@ -1,8 +1,66 @@ { "Entries": [ { - "RequestUri": "/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourcegroups/RecoveryServicesTestRg?api-version=2015-11-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlZ3JvdXBzL1JlY292ZXJ5U2VydmljZXNUZXN0Umc/YXBpLXZlcnNpb249MjAxNS0xMS0wMQ==", + "RequestUri": "/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourcegroups/SDKTestRg?api-version=2015-11-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlZ3JvdXBzL1NES1Rlc3RSZz9hcGktdmVyc2lvbj0yMDE1LTExLTAx", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "932df15c-689d-456a-b98a-ab8ac106c81d" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24410.01", + "Microsoft.Azure.Management.Resources.ResourceManagementClient/1.0.0-preview" + ] + }, + "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceGroupNotFound\",\r\n \"message\": \"Resource group 'SDKTestRg' could not be found.\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "101" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 04 Apr 2017 19:54:31 GMT" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-failure-cause": [ + "gateway" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14889" + ], + "x-ms-request-id": [ + "3dfb7474-49b7-465b-9734-9e2293a24aa6" + ], + "x-ms-correlation-request-id": [ + "3dfb7474-49b7-465b-9734-9e2293a24aa6" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20170404T195432Z:3dfb7474-49b7-465b-9734-9e2293a24aa6" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 404 + }, + { + "RequestUri": "/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourcegroups/SDKTestRg?api-version=2015-11-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlZ3JvdXBzL1NES1Rlc3RSZz9hcGktdmVyc2lvbj0yMDE1LTExLTAx", "RequestMethod": "PUT", "RequestBody": "{\r\n \"location\": \"westus\"\r\n}", "RequestHeaders": { @@ -13,19 +71,20 @@ "28" ], "x-ms-client-request-id": [ - "06981e16-2366-40cc-942d-aabe3ecb8112" + "d00f113e-adae-4264-86c2-ae24cf484a61" ], "accept-language": [ "en-US" ], "User-Agent": [ + "FxVersion/4.6.24410.01", "Microsoft.Azure.Management.Resources.ResourceManagementClient/1.0.0-preview" ] }, - "ResponseBody": "{\r\n \"id\": \"/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/RecoveryServicesTestRg\",\r\n \"name\": \"RecoveryServicesTestRg\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseBody": "{\r\n \"id\": \"/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg\",\r\n \"name\": \"SDKTestRg\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", "ResponseHeaders": { "Content-Length": [ - "197" + "171" ], "Content-Type": [ "application/json; charset=utf-8" @@ -37,22 +96,22 @@ "no-cache" ], "Date": [ - "Mon, 26 Sep 2016 21:10:27 GMT" + "Tue, 04 Apr 2017 19:54:34 GMT" ], "Pragma": [ "no-cache" ], "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" + "1198" ], "x-ms-request-id": [ - "b112051d-d7fd-47b0-8c50-c23ebaa0cdfd" + "b14ea7c5-deb9-4716-860d-630f9282f5ab" ], "x-ms-correlation-request-id": [ - "b112051d-d7fd-47b0-8c50-c23ebaa0cdfd" + "b14ea7c5-deb9-4716-860d-630f9282f5ab" ], "x-ms-routing-request-id": [ - "SOUTHINDIA:20160926T211027Z:b112051d-d7fd-47b0-8c50-c23ebaa0cdfd" + "SOUTHINDIA:20170404T195435Z:b14ea7c5-deb9-4716-860d-630f9282f5ab" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -61,10 +120,10 @@ "StatusCode": 201 }, { - "RequestUri": "/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/RecoveryServicesTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault?api-version=2016-06-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlR3JvdXBzL1JlY292ZXJ5U2VydmljZXNUZXN0UmcvcHJvdmlkZXJzL01pY3Jvc29mdC5SZWNvdmVyeVNlcnZpY2VzL3ZhdWx0cy9TREtUZXN0UnNWYXVsdD9hcGktdmVyc2lvbj0yMDE2LTA2LTAx", + "RequestUri": "/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault?api-version=2016-06-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlR3JvdXBzL1NES1Rlc3RSZy9wcm92aWRlcnMvTWljcm9zb2Z0LlJlY292ZXJ5U2VydmljZXMvdmF1bHRzL1NES1Rlc3RSc1ZhdWx0P2FwaS12ZXJzaW9uPTIwMTYtMDYtMDE=", "RequestMethod": "PUT", - "RequestBody": "{\r\n \"properties\": {},\r\n \"location\": \"westus\",\r\n \"sku\": {\r\n \"name\": \"Standard\"\r\n }\r\n}", + "RequestBody": "{\r\n \"properties\": {},\r\n \"sku\": {\r\n \"name\": \"Standard\"\r\n },\r\n \"location\": \"westus\"\r\n}", "RequestHeaders": { "Content-Type": [ "application/json; charset=utf-8" @@ -73,19 +132,20 @@ "91" ], "x-ms-client-request-id": [ - "f74bed95-aa3b-40de-95f3-552474eb0e5d" + "584b79dd-6b2a-4cff-a8b2-0486c7bc04ff" ], "accept-language": [ "en-US" ], "User-Agent": [ - "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/0.1.2" + "FxVersion/4.6.24410.01", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/4.0.1-preview" ] }, - "ResponseBody": "{\r\n \"location\": \"westus\",\r\n \"name\": \"SDKTestRsVault\",\r\n \"etag\": \"W/\\\"datetime'2016-09-26T21%3A10%3A41.2067061Z'\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/RecoveryServicesTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault\",\r\n \"type\": \"Microsoft.RecoveryServices/vaults\",\r\n \"sku\": {\r\n \"name\": \"Standard\"\r\n }\r\n}", + "ResponseBody": "{\r\n \"location\": \"westus\",\r\n \"name\": \"SDKTestRsVault\",\r\n \"etag\": \"W/\\\"datetime'2017-04-04T19%3A54%3A42.9751927Z'\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault\",\r\n \"type\": \"Microsoft.RecoveryServices/vaults\",\r\n \"sku\": {\r\n \"name\": \"Standard\"\r\n }\r\n}", "ResponseHeaders": { "Content-Length": [ - "375" + "362" ], "Content-Type": [ "application/json" @@ -97,7 +157,7 @@ "no-cache" ], "Date": [ - "Mon, 26 Sep 2016 21:10:42 GMT" + "Tue, 04 Apr 2017 19:54:43 GMT" ], "Pragma": [ "no-cache" @@ -106,43 +166,44 @@ "Microsoft-IIS/8.0" ], "x-ms-request-id": [ - "ae842e4f-c827-43ed-baca-6012d5e82034" + "220c474f-c407-4631-bb73-3dbf3e28eacc" ], "x-ms-client-request-id": [ - "f74bed95-aa3b-40de-95f3-552474eb0e5d" + "584b79dd-6b2a-4cff-a8b2-0486c7bc04ff" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], "x-ms-ratelimit-remaining-subscription-writes": [ - "1199" + "1197" ], "x-ms-correlation-request-id": [ - "ae842e4f-c827-43ed-baca-6012d5e82034" + "220c474f-c407-4631-bb73-3dbf3e28eacc" ], "x-ms-routing-request-id": [ - "SOUTHINDIA:20160926T211042Z:ae842e4f-c827-43ed-baca-6012d5e82034" + "SOUTHINDIA:20170404T195444Z:220c474f-c407-4631-bb73-3dbf3e28eacc" ] }, "StatusCode": 201 }, { - "RequestUri": "/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/RecoveryServicesTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault?api-version=2016-06-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlR3JvdXBzL1JlY292ZXJ5U2VydmljZXNUZXN0UmcvcHJvdmlkZXJzL01pY3Jvc29mdC5SZWNvdmVyeVNlcnZpY2VzL3ZhdWx0cy9TREtUZXN0UnNWYXVsdD9hcGktdmVyc2lvbj0yMDE2LTA2LTAx", + "RequestUri": "/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault?api-version=2016-06-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlR3JvdXBzL1NES1Rlc3RSZy9wcm92aWRlcnMvTWljcm9zb2Z0LlJlY292ZXJ5U2VydmljZXMvdmF1bHRzL1NES1Rlc3RSc1ZhdWx0P2FwaS12ZXJzaW9uPTIwMTYtMDYtMDE=", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "6547f7ab-eb9a-414c-8721-41d60d25738e" + "3a97a3d5-4c06-45a3-87a5-d7b753789fca" ], "accept-language": [ "en-US" ], "User-Agent": [ - "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/0.1.2" + "FxVersion/4.6.24410.01", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/4.0.1-preview" ] }, - "ResponseBody": "{\r\n \"location\": \"westus\",\r\n \"name\": \"SDKTestRsVault\",\r\n \"etag\": \"W/\\\"datetime'2016-09-26T21%3A10%3A41.2067061Z'\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/RecoveryServicesTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault\",\r\n \"type\": \"Microsoft.RecoveryServices/vaults\",\r\n \"sku\": {\r\n \"name\": \"Standard\"\r\n }\r\n}", + "ResponseBody": "{\r\n \"location\": \"westus\",\r\n \"name\": \"SDKTestRsVault\",\r\n \"etag\": \"W/\\\"datetime'2017-04-04T19%3A54%3A42.9751927Z'\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault\",\r\n \"type\": \"Microsoft.RecoveryServices/vaults\",\r\n \"sku\": {\r\n \"name\": \"Standard\"\r\n }\r\n}", "ResponseHeaders": { "Content-Type": [ "application/json" @@ -154,7 +215,7 @@ "no-cache" ], "Date": [ - "Mon, 26 Sep 2016 21:10:43 GMT" + "Tue, 04 Apr 2017 19:54:43 GMT" ], "Pragma": [ "no-cache" @@ -169,31 +230,31 @@ "Accept-Encoding" ], "x-ms-request-id": [ - "36dff474-d2c0-4f60-b74a-5d303aef602c" + "b02288b6-9c2c-403f-91b0-1cbc4f544c27" ], "x-ms-client-request-id": [ - "6547f7ab-eb9a-414c-8721-41d60d25738e" + "3a97a3d5-4c06-45a3-87a5-d7b753789fca" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], "x-ms-ratelimit-remaining-subscription-reads": [ - "14956" + "14922" ], "x-ms-correlation-request-id": [ - "36dff474-d2c0-4f60-b74a-5d303aef602c" + "b02288b6-9c2c-403f-91b0-1cbc4f544c27" ], "x-ms-routing-request-id": [ - "SOUTHINDIA:20160926T211044Z:36dff474-d2c0-4f60-b74a-5d303aef602c" + "SOUTHINDIA:20170404T195444Z:b02288b6-9c2c-403f-91b0-1cbc4f544c27" ] }, "StatusCode": 200 }, { - "RequestUri": "/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/RecoveryServicesTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault2?api-version=2016-06-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlR3JvdXBzL1JlY292ZXJ5U2VydmljZXNUZXN0UmcvcHJvdmlkZXJzL01pY3Jvc29mdC5SZWNvdmVyeVNlcnZpY2VzL3ZhdWx0cy9TREtUZXN0UnNWYXVsdDI/YXBpLXZlcnNpb249MjAxNi0wNi0wMQ==", + "RequestUri": "/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault2?api-version=2016-06-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlR3JvdXBzL1NES1Rlc3RSZy9wcm92aWRlcnMvTWljcm9zb2Z0LlJlY292ZXJ5U2VydmljZXMvdmF1bHRzL1NES1Rlc3RSc1ZhdWx0Mj9hcGktdmVyc2lvbj0yMDE2LTA2LTAx", "RequestMethod": "PUT", - "RequestBody": "{\r\n \"properties\": {},\r\n \"location\": \"westus\",\r\n \"sku\": {\r\n \"name\": \"Standard\"\r\n }\r\n}", + "RequestBody": "{\r\n \"properties\": {},\r\n \"sku\": {\r\n \"name\": \"Standard\"\r\n },\r\n \"location\": \"westus\"\r\n}", "RequestHeaders": { "Content-Type": [ "application/json; charset=utf-8" @@ -202,19 +263,20 @@ "91" ], "x-ms-client-request-id": [ - "c46bb730-b627-475a-9f4d-fd497e87778d" + "e6cead16-3918-4c6c-a24c-5c8dda098d06" ], "accept-language": [ "en-US" ], "User-Agent": [ - "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/0.1.2" + "FxVersion/4.6.24410.01", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/4.0.1-preview" ] }, - "ResponseBody": "{\r\n \"location\": \"westus\",\r\n \"name\": \"SDKTestRsVault2\",\r\n \"etag\": \"W/\\\"datetime'2016-09-26T21%3A10%3A50.9428734Z'\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/RecoveryServicesTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault2\",\r\n \"type\": \"Microsoft.RecoveryServices/vaults\",\r\n \"sku\": {\r\n \"name\": \"Standard\"\r\n }\r\n}", + "ResponseBody": "{\r\n \"location\": \"westus\",\r\n \"name\": \"SDKTestRsVault2\",\r\n \"etag\": \"W/\\\"datetime'2017-04-04T19%3A54%3A48.7580035Z'\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault2\",\r\n \"type\": \"Microsoft.RecoveryServices/vaults\",\r\n \"sku\": {\r\n \"name\": \"Standard\"\r\n }\r\n}", "ResponseHeaders": { "Content-Length": [ - "377" + "364" ], "Content-Type": [ "application/json" @@ -226,7 +288,7 @@ "no-cache" ], "Date": [ - "Mon, 26 Sep 2016 21:10:52 GMT" + "Tue, 04 Apr 2017 19:54:49 GMT" ], "Pragma": [ "no-cache" @@ -235,43 +297,44 @@ "Microsoft-IIS/8.0" ], "x-ms-request-id": [ - "7d6016e7-2923-4217-b182-0a710f73dfb6" + "ee67b88f-ab04-4726-99da-7f6ec9374c0b" ], "x-ms-client-request-id": [ - "c46bb730-b627-475a-9f4d-fd497e87778d" + "e6cead16-3918-4c6c-a24c-5c8dda098d06" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], "x-ms-ratelimit-remaining-subscription-writes": [ - "1198" + "1196" ], "x-ms-correlation-request-id": [ - "7d6016e7-2923-4217-b182-0a710f73dfb6" + "ee67b88f-ab04-4726-99da-7f6ec9374c0b" ], "x-ms-routing-request-id": [ - "SOUTHINDIA:20160926T211052Z:7d6016e7-2923-4217-b182-0a710f73dfb6" + "SOUTHINDIA:20170404T195449Z:ee67b88f-ab04-4726-99da-7f6ec9374c0b" ] }, "StatusCode": 201 }, { - "RequestUri": "/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/RecoveryServicesTestRg/providers/Microsoft.RecoveryServices/vaults?api-version=2016-06-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlR3JvdXBzL1JlY292ZXJ5U2VydmljZXNUZXN0UmcvcHJvdmlkZXJzL01pY3Jvc29mdC5SZWNvdmVyeVNlcnZpY2VzL3ZhdWx0cz9hcGktdmVyc2lvbj0yMDE2LTA2LTAx", + "RequestUri": "/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults?api-version=2016-06-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlR3JvdXBzL1NES1Rlc3RSZy9wcm92aWRlcnMvTWljcm9zb2Z0LlJlY292ZXJ5U2VydmljZXMvdmF1bHRzP2FwaS12ZXJzaW9uPTIwMTYtMDYtMDE=", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "dd3a0e1e-4c13-4de5-82da-c8ec34695170" + "3d94bff5-6db8-43d5-abe5-a3ab6493eed8" ], "accept-language": [ "en-US" ], "User-Agent": [ - "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/0.1.2" + "FxVersion/4.6.24410.01", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/4.0.1-preview" ] }, - "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"SDKTestRsVault\",\r\n \"etag\": \"W/\\\"datetime'2016-09-26T21%3A10%3A41.2067061Z'\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/RecoveryServicesTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault\",\r\n \"type\": \"Microsoft.RecoveryServices/vaults\",\r\n \"sku\": {\r\n \"name\": \"Standard\"\r\n }\r\n },\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"SDKTestRsVault2\",\r\n \"etag\": \"W/\\\"datetime'2016-09-26T21%3A10%3A50.9428734Z'\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/RecoveryServicesTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault2\",\r\n \"type\": \"Microsoft.RecoveryServices/vaults\",\r\n \"sku\": {\r\n \"name\": \"Standard\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"SDKTestRsVault\",\r\n \"etag\": \"W/\\\"datetime'2017-04-04T19%3A54%3A42.9751927Z'\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault\",\r\n \"type\": \"Microsoft.RecoveryServices/vaults\",\r\n \"sku\": {\r\n \"name\": \"Standard\"\r\n }\r\n },\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"SDKTestRsVault2\",\r\n \"etag\": \"W/\\\"datetime'2017-04-04T19%3A54%3A48.7580035Z'\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault2\",\r\n \"type\": \"Microsoft.RecoveryServices/vaults\",\r\n \"sku\": {\r\n \"name\": \"Standard\"\r\n }\r\n }\r\n ]\r\n}", "ResponseHeaders": { "Content-Type": [ "application/json" @@ -283,7 +346,7 @@ "no-cache" ], "Date": [ - "Mon, 26 Sep 2016 21:10:53 GMT" + "Tue, 04 Apr 2017 19:54:49 GMT" ], "Pragma": [ "no-cache" @@ -298,43 +361,44 @@ "Accept-Encoding" ], "x-ms-request-id": [ - "c6556906-e1c7-4b62-977e-584698fede65" + "d6e0ea55-a121-4bdd-8f75-0f07732d3770" ], "x-ms-client-request-id": [ - "dd3a0e1e-4c13-4de5-82da-c8ec34695170" + "3d94bff5-6db8-43d5-abe5-a3ab6493eed8" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], "x-ms-ratelimit-remaining-subscription-reads": [ - "14955" + "14921" ], "x-ms-correlation-request-id": [ - "c6556906-e1c7-4b62-977e-584698fede65" + "d6e0ea55-a121-4bdd-8f75-0f07732d3770" ], "x-ms-routing-request-id": [ - "SOUTHINDIA:20160926T211053Z:c6556906-e1c7-4b62-977e-584698fede65" + "SOUTHINDIA:20170404T195450Z:d6e0ea55-a121-4bdd-8f75-0f07732d3770" ] }, "StatusCode": 200 }, { - "RequestUri": "/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/RecoveryServicesTestRg/providers/Microsoft.RecoveryServices/vaults?api-version=2016-06-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlR3JvdXBzL1JlY292ZXJ5U2VydmljZXNUZXN0UmcvcHJvdmlkZXJzL01pY3Jvc29mdC5SZWNvdmVyeVNlcnZpY2VzL3ZhdWx0cz9hcGktdmVyc2lvbj0yMDE2LTA2LTAx", + "RequestUri": "/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults?api-version=2016-06-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlR3JvdXBzL1NES1Rlc3RSZy9wcm92aWRlcnMvTWljcm9zb2Z0LlJlY292ZXJ5U2VydmljZXMvdmF1bHRzP2FwaS12ZXJzaW9uPTIwMTYtMDYtMDE=", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "e6ec94c4-ae6c-4c08-8ee9-168e46cba70c" + "80d54a0a-9717-412e-a12d-f1d1be1c606c" ], "accept-language": [ "en-US" ], "User-Agent": [ - "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/0.1.2" + "FxVersion/4.6.24410.01", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/4.0.1-preview" ] }, - "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"SDKTestRsVault\",\r\n \"etag\": \"W/\\\"datetime'2016-09-26T21%3A10%3A41.2067061Z'\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/RecoveryServicesTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault\",\r\n \"type\": \"Microsoft.RecoveryServices/vaults\",\r\n \"sku\": {\r\n \"name\": \"Standard\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"SDKTestRsVault\",\r\n \"etag\": \"W/\\\"datetime'2017-04-04T19%3A54%3A42.9751927Z'\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault\",\r\n \"type\": \"Microsoft.RecoveryServices/vaults\",\r\n \"sku\": {\r\n \"name\": \"Standard\"\r\n }\r\n }\r\n ]\r\n}", "ResponseHeaders": { "Content-Type": [ "application/json" @@ -346,7 +410,7 @@ "no-cache" ], "Date": [ - "Mon, 26 Sep 2016 21:11:09 GMT" + "Tue, 04 Apr 2017 19:54:53 GMT" ], "Pragma": [ "no-cache" @@ -361,40 +425,41 @@ "Accept-Encoding" ], "x-ms-request-id": [ - "ac987907-6d88-4370-a19c-cb6093e29b05" + "912cfbd1-9132-4816-b184-464e51848c61" ], "x-ms-client-request-id": [ - "e6ec94c4-ae6c-4c08-8ee9-168e46cba70c" + "80d54a0a-9717-412e-a12d-f1d1be1c606c" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], "x-ms-ratelimit-remaining-subscription-reads": [ - "14953" + "14919" ], "x-ms-correlation-request-id": [ - "ac987907-6d88-4370-a19c-cb6093e29b05" + "912cfbd1-9132-4816-b184-464e51848c61" ], "x-ms-routing-request-id": [ - "SOUTHINDIA:20160926T211110Z:ac987907-6d88-4370-a19c-cb6093e29b05" + "SOUTHINDIA:20170404T195454Z:912cfbd1-9132-4816-b184-464e51848c61" ] }, "StatusCode": 200 }, { - "RequestUri": "/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/RecoveryServicesTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault2?api-version=2016-06-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlR3JvdXBzL1JlY292ZXJ5U2VydmljZXNUZXN0UmcvcHJvdmlkZXJzL01pY3Jvc29mdC5SZWNvdmVyeVNlcnZpY2VzL3ZhdWx0cy9TREtUZXN0UnNWYXVsdDI/YXBpLXZlcnNpb249MjAxNi0wNi0wMQ==", + "RequestUri": "/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault2?api-version=2016-06-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlR3JvdXBzL1NES1Rlc3RSZy9wcm92aWRlcnMvTWljcm9zb2Z0LlJlY292ZXJ5U2VydmljZXMvdmF1bHRzL1NES1Rlc3RSc1ZhdWx0Mj9hcGktdmVyc2lvbj0yMDE2LTA2LTAx", "RequestMethod": "DELETE", "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "cbff4ff4-864c-4a2b-8689-f016e0eb71cc" + "c6cf66e4-2270-4ff2-aca8-5411a8bf9e27" ], "accept-language": [ "en-US" ], "User-Agent": [ - "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/0.1.2" + "FxVersion/4.6.24410.01", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/4.0.1-preview" ] }, "ResponseBody": "", @@ -409,52 +474,53 @@ "no-cache" ], "Date": [ - "Mon, 26 Sep 2016 21:11:01 GMT" + "Tue, 04 Apr 2017 19:54:53 GMT" ], "Pragma": [ "no-cache" ], "x-ms-request-id": [ - "5243cf21-152b-4e87-91b4-f4eaa0f5027e" + "200e2a29-824b-47b6-8658-c81e0ab1d5a9" ], "x-ms-client-request-id": [ - "cbff4ff4-864c-4a2b-8689-f016e0eb71cc" + "c6cf66e4-2270-4ff2-aca8-5411a8bf9e27" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], "x-ms-ratelimit-remaining-subscription-writes": [ - "1197" + "1195" ], "x-ms-correlation-request-id": [ - "5243cf21-152b-4e87-91b4-f4eaa0f5027e" + "200e2a29-824b-47b6-8658-c81e0ab1d5a9" ], "x-ms-routing-request-id": [ - "SOUTHINDIA:20160926T211102Z:5243cf21-152b-4e87-91b4-f4eaa0f5027e" + "SOUTHINDIA:20170404T195454Z:200e2a29-824b-47b6-8658-c81e0ab1d5a9" ] }, "StatusCode": 200 }, { - "RequestUri": "/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/RecoveryServicesTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault2?api-version=2016-06-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlR3JvdXBzL1JlY292ZXJ5U2VydmljZXNUZXN0UmcvcHJvdmlkZXJzL01pY3Jvc29mdC5SZWNvdmVyeVNlcnZpY2VzL3ZhdWx0cy9TREtUZXN0UnNWYXVsdDI/YXBpLXZlcnNpb249MjAxNi0wNi0wMQ==", + "RequestUri": "/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault2?api-version=2016-06-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlR3JvdXBzL1NES1Rlc3RSZy9wcm92aWRlcnMvTWljcm9zb2Z0LlJlY292ZXJ5U2VydmljZXMvdmF1bHRzL1NES1Rlc3RSc1ZhdWx0Mj9hcGktdmVyc2lvbj0yMDE2LTA2LTAx", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "c38d7188-04c8-4a44-a4e7-12f02e959a71" + "340afc11-3fab-409c-a6bc-05dee07c2d9e" ], "accept-language": [ "en-US" ], "User-Agent": [ - "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/0.1.2" + "FxVersion/4.6.24410.01", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/4.0.1-preview" ] }, - "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"The Resource 'Microsoft.RecoveryServices/vaults/SDKTestRsVault2' under resource group 'RecoveryServicesTestRg' was not found.\"\r\n }\r\n}", + "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceNotFound\",\r\n \"message\": \"The Resource 'Microsoft.RecoveryServices/vaults/SDKTestRsVault2' under resource group 'SDKTestRg' was not found.\"\r\n }\r\n}", "ResponseHeaders": { "Content-Length": [ - "175" + "162" ], "Content-Type": [ "application/json; charset=utf-8" @@ -466,7 +532,7 @@ "no-cache" ], "Date": [ - "Mon, 26 Sep 2016 21:11:06 GMT" + "Tue, 04 Apr 2017 19:54:53 GMT" ], "Pragma": [ "no-cache" @@ -475,13 +541,13 @@ "gateway" ], "x-ms-request-id": [ - "93cd75ab-a4ad-4c91-a47a-f6cb9ecffc93" + "0a3e948b-c6da-4346-bd96-88c485aa2968" ], "x-ms-correlation-request-id": [ - "93cd75ab-a4ad-4c91-a47a-f6cb9ecffc93" + "0a3e948b-c6da-4346-bd96-88c485aa2968" ], "x-ms-routing-request-id": [ - "SOUTHINDIA:20160926T211107Z:93cd75ab-a4ad-4c91-a47a-f6cb9ecffc93" + "SOUTHINDIA:20170404T195454Z:0a3e948b-c6da-4346-bd96-88c485aa2968" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" @@ -490,19 +556,20 @@ "StatusCode": 404 }, { - "RequestUri": "/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/RecoveryServicesTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault?api-version=2016-06-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlR3JvdXBzL1JlY292ZXJ5U2VydmljZXNUZXN0UmcvcHJvdmlkZXJzL01pY3Jvc29mdC5SZWNvdmVyeVNlcnZpY2VzL3ZhdWx0cy9TREtUZXN0UnNWYXVsdD9hcGktdmVyc2lvbj0yMDE2LTA2LTAx", + "RequestUri": "/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault?api-version=2016-06-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlR3JvdXBzL1NES1Rlc3RSZy9wcm92aWRlcnMvTWljcm9zb2Z0LlJlY292ZXJ5U2VydmljZXMvdmF1bHRzL1NES1Rlc3RSc1ZhdWx0P2FwaS12ZXJzaW9uPTIwMTYtMDYtMDE=", "RequestMethod": "DELETE", "RequestBody": "", "RequestHeaders": { "x-ms-client-request-id": [ - "591603ba-a74a-46cf-9194-6074aa194a11" + "f154a351-10a5-4d22-8032-11624590ccec" ], "accept-language": [ "en-US" ], "User-Agent": [ - "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/0.1.2" + "FxVersion/4.6.24410.01", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/4.0.1-preview" ] }, "ResponseBody": "", @@ -517,28 +584,28 @@ "no-cache" ], "Date": [ - "Mon, 26 Sep 2016 21:11:13 GMT" + "Tue, 04 Apr 2017 19:54:57 GMT" ], "Pragma": [ "no-cache" ], "x-ms-request-id": [ - "c5d04ec4-f5a3-443a-a322-0848396f1281" + "d4164015-008f-4cee-b437-29ea2cc2636c" ], "x-ms-client-request-id": [ - "591603ba-a74a-46cf-9194-6074aa194a11" + "f154a351-10a5-4d22-8032-11624590ccec" ], "Strict-Transport-Security": [ "max-age=31536000; includeSubDomains" ], "x-ms-ratelimit-remaining-subscription-writes": [ - "1196" + "1194" ], "x-ms-correlation-request-id": [ - "c5d04ec4-f5a3-443a-a322-0848396f1281" + "d4164015-008f-4cee-b437-29ea2cc2636c" ], "x-ms-routing-request-id": [ - "SOUTHINDIA:20160926T211114Z:c5d04ec4-f5a3-443a-a322-0848396f1281" + "SOUTHINDIA:20170404T195458Z:d4164015-008f-4cee-b437-29ea2cc2636c" ] }, "StatusCode": 200 diff --git a/src/ResourceManagement/RecoveryServices/RecoveryServices.Tests/SessionRecords/Microsoft.Azure.Management.RecoveryServices.Tests.VaultScenarioTests/GetAndUpdateBackupVaultAndStorageConfigTest.json b/src/ResourceManagement/RecoveryServices/RecoveryServices.Tests/SessionRecords/Microsoft.Azure.Management.RecoveryServices.Tests.VaultScenarioTests/GetAndUpdateBackupVaultAndStorageConfigTest.json new file mode 100644 index 000000000000..56e670998b30 --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/RecoveryServices.Tests/SessionRecords/Microsoft.Azure.Management.RecoveryServices.Tests.VaultScenarioTests/GetAndUpdateBackupVaultAndStorageConfigTest.json @@ -0,0 +1,650 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourcegroups/SDKTestRg?api-version=2015-11-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlZ3JvdXBzL1NES1Rlc3RSZz9hcGktdmVyc2lvbj0yMDE1LTExLTAx", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "55ea6aa6-906c-4fb8-b844-75c70327eeca" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24410.01", + "Microsoft.Azure.Management.Resources.ResourceManagementClient/1.0.0-preview" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg\",\r\n \"name\": \"SDKTestRg\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 04 Apr 2017 20:54:12 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14940" + ], + "x-ms-request-id": [ + "c1cb7b42-d5be-4493-a238-adc0a144c1fe" + ], + "x-ms-correlation-request-id": [ + "c1cb7b42-d5be-4493-a238-adc0a144c1fe" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20170404T205413Z:c1cb7b42-d5be-4493-a238-adc0a144c1fe" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault?api-version=2016-06-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlR3JvdXBzL1NES1Rlc3RSZy9wcm92aWRlcnMvTWljcm9zb2Z0LlJlY292ZXJ5U2VydmljZXMvdmF1bHRzL1NES1Rlc3RSc1ZhdWx0P2FwaS12ZXJzaW9uPTIwMTYtMDYtMDE=", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {},\r\n \"sku\": {\r\n \"name\": \"Standard\"\r\n },\r\n \"location\": \"westus\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "91" + ], + "x-ms-client-request-id": [ + "9d21a88b-3fa7-463a-8f04-ec8ac44756f6" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24410.01", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/4.0.1-preview" + ] + }, + "ResponseBody": "{\r\n \"location\": \"westus\",\r\n \"name\": \"SDKTestRsVault\",\r\n \"etag\": \"W/\\\"datetime'2017-04-04T20%3A54%3A21.6941981Z'\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault\",\r\n \"type\": \"Microsoft.RecoveryServices/vaults\",\r\n \"sku\": {\r\n \"name\": \"Standard\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "362" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 04 Apr 2017 20:54:22 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-IIS/8.0" + ], + "x-ms-request-id": [ + "d25943b6-241b-4330-9e55-d623788d1bb4" + ], + "x-ms-client-request-id": [ + "9d21a88b-3fa7-463a-8f04-ec8ac44756f6" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1196" + ], + "x-ms-correlation-request-id": [ + "d25943b6-241b-4330-9e55-d623788d1bb4" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20170404T205422Z:d25943b6-241b-4330-9e55-d623788d1bb4" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault?api-version=2016-06-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlR3JvdXBzL1NES1Rlc3RSZy9wcm92aWRlcnMvTWljcm9zb2Z0LlJlY292ZXJ5U2VydmljZXMvdmF1bHRzL1NES1Rlc3RSc1ZhdWx0P2FwaS12ZXJzaW9uPTIwMTYtMDYtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "70d1722f-ccac-462d-961c-22562fe22d06" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24410.01", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/4.0.1-preview" + ] + }, + "ResponseBody": "{\r\n \"location\": \"westus\",\r\n \"name\": \"SDKTestRsVault\",\r\n \"etag\": \"W/\\\"datetime'2017-04-04T20%3A54%3A21.6941981Z'\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault\",\r\n \"type\": \"Microsoft.RecoveryServices/vaults\",\r\n \"sku\": {\r\n \"name\": \"Standard\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 04 Apr 2017 20:54:22 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-IIS/8.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "65a2d62c-0302-45e7-b30a-f2f7c593debd" + ], + "x-ms-client-request-id": [ + "70d1722f-ccac-462d-961c-22562fe22d06" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14754" + ], + "x-ms-correlation-request-id": [ + "65a2d62c-0302-45e7-b30a-f2f7c593debd" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20170404T205423Z:65a2d62c-0302-45e7-b30a-f2f7c593debd" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault/backupconfig/vaultconfig?api-version=2016-12-01", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlR3JvdXBzL1NES1Rlc3RSZy9wcm92aWRlcnMvTWljcm9zb2Z0LlJlY292ZXJ5U2VydmljZXMvdmF1bHRzL1NES1Rlc3RSc1ZhdWx0L2JhY2t1cGNvbmZpZy92YXVsdGNvbmZpZz9hcGktdmVyc2lvbj0yMDE2LTEyLTAx", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "18f67c5e-27b2-4bde-8df8-f1286f75b622" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24410.01", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/4.0.1-preview" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault/backupconfig/vaultconfig\",\r\n \"name\": \"vaultconfig\",\r\n \"type\": \"Microsoft.RecoveryServices/vaults/backupconfig\",\r\n \"properties\": {\r\n \"enhancedSecurityState\": \"Enabled\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 04 Apr 2017 20:54:23 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-IIS/8.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "15127f3a-d40d-47c2-801d-a5ba74efae94" + ], + "x-ms-client-request-id": [ + "18f67c5e-27b2-4bde-8df8-f1286f75b622", + "18f67c5e-27b2-4bde-8df8-f1286f75b622" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14753" + ], + "x-ms-correlation-request-id": [ + "15127f3a-d40d-47c2-801d-a5ba74efae94" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20170404T205424Z:15127f3a-d40d-47c2-801d-a5ba74efae94" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault/backupconfig/vaultconfig?api-version=2016-12-01", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlR3JvdXBzL1NES1Rlc3RSZy9wcm92aWRlcnMvTWljcm9zb2Z0LlJlY292ZXJ5U2VydmljZXMvdmF1bHRzL1NES1Rlc3RSc1ZhdWx0L2JhY2t1cGNvbmZpZy92YXVsdGNvbmZpZz9hcGktdmVyc2lvbj0yMDE2LTEyLTAx", + "RequestMethod": "PATCH", + "RequestBody": "{\r\n \"properties\": {\r\n \"enhancedSecurityState\": \"Disabled\"\r\n }\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "69" + ], + "x-ms-client-request-id": [ + "66557b5d-13fc-4431-94d6-aaa225fcc201" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24410.01", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/4.0.1-preview" + ] + }, + "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"UserErrorChangeEnhancedSecurityStateNotAllowed\",\r\n \"message\": \"Enhanced Security is enabled for this vault. You cannot disable Enhanced Security after enabling it.\\r\\nEnhanced Security is enabled for this vault. You cannot disable Enhanced Security after enabling it.\",\r\n \"target\": null,\r\n \"details\": null,\r\n \"innerError\": null\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "331" + ], + "Content-Type": [ + "application/json" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 04 Apr 2017 20:54:24 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-IIS/8.0" + ], + "x-ms-request-id": [ + "3ff94c40-8934-4bed-ac55-a145d72d4a60" + ], + "x-ms-client-request-id": [ + "66557b5d-13fc-4431-94d6-aaa225fcc201", + "66557b5d-13fc-4431-94d6-aaa225fcc201" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1195" + ], + "x-ms-correlation-request-id": [ + "3ff94c40-8934-4bed-ac55-a145d72d4a60" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20170404T205425Z:3ff94c40-8934-4bed-ac55-a145d72d4a60" + ] + }, + "StatusCode": 400 + }, + { + "RequestUri": "/Subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault/backupstorageconfig/vaultstorageconfig?api-version=2016-12-01", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlR3JvdXBzL1NES1Rlc3RSZy9wcm92aWRlcnMvTWljcm9zb2Z0LlJlY292ZXJ5U2VydmljZXMvdmF1bHRzL1NES1Rlc3RSc1ZhdWx0L2JhY2t1cHN0b3JhZ2Vjb25maWcvdmF1bHRzdG9yYWdlY29uZmlnP2FwaS12ZXJzaW9uPTIwMTYtMTItMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "781be3e8-5e73-4b84-a1a8-0ef4c0561705" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24410.01", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/4.0.1-preview" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault/backupstorageconfig/vaultstorageconfig\",\r\n \"name\": \"vaultstorageconfig\",\r\n \"type\": \"Microsoft.RecoveryServices/vaults/backupstorageconfig\",\r\n \"properties\": {\r\n \"storageModelType\": \"GeoRedundant\",\r\n \"storageType\": \"GeoRedundant\",\r\n \"dedupState\": \"Disabled\",\r\n \"xcoolState\": \"Disabled\",\r\n \"storageTypeState\": \"Unlocked\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 04 Apr 2017 20:54:25 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-IIS/8.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "a94b50b0-659c-48fc-841e-875c4630d34b" + ], + "x-ms-client-request-id": [ + "781be3e8-5e73-4b84-a1a8-0ef4c0561705", + "781be3e8-5e73-4b84-a1a8-0ef4c0561705" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14752" + ], + "x-ms-correlation-request-id": [ + "a94b50b0-659c-48fc-841e-875c4630d34b" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20170404T205426Z:a94b50b0-659c-48fc-841e-875c4630d34b" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault/backupstorageconfig/vaultstorageconfig?api-version=2016-12-01", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlR3JvdXBzL1NES1Rlc3RSZy9wcm92aWRlcnMvTWljcm9zb2Z0LlJlY292ZXJ5U2VydmljZXMvdmF1bHRzL1NES1Rlc3RSc1ZhdWx0L2JhY2t1cHN0b3JhZ2Vjb25maWcvdmF1bHRzdG9yYWdlY29uZmlnP2FwaS12ZXJzaW9uPTIwMTYtMTItMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "f667b204-99e8-49db-a790-34cb1247d96e" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24410.01", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/4.0.1-preview" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault/backupstorageconfig/vaultstorageconfig\",\r\n \"name\": \"vaultstorageconfig\",\r\n \"type\": \"Microsoft.RecoveryServices/vaults/backupstorageconfig\",\r\n \"properties\": {\r\n \"storageModelType\": \"LocallyRedundant\",\r\n \"storageType\": \"LocallyRedundant\",\r\n \"dedupState\": \"Disabled\",\r\n \"xcoolState\": \"Disabled\",\r\n \"storageTypeState\": \"Unlocked\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 04 Apr 2017 20:54:26 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-IIS/8.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "5638cb13-12a3-44a0-a563-9fae98dec974" + ], + "x-ms-client-request-id": [ + "f667b204-99e8-49db-a790-34cb1247d96e", + "f667b204-99e8-49db-a790-34cb1247d96e" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14751" + ], + "x-ms-correlation-request-id": [ + "5638cb13-12a3-44a0-a563-9fae98dec974" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20170404T205427Z:5638cb13-12a3-44a0-a563-9fae98dec974" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault/backupstorageconfig/vaultstorageconfig?api-version=2016-12-01", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlR3JvdXBzL1NES1Rlc3RSZy9wcm92aWRlcnMvTWljcm9zb2Z0LlJlY292ZXJ5U2VydmljZXMvdmF1bHRzL1NES1Rlc3RSc1ZhdWx0L2JhY2t1cHN0b3JhZ2Vjb25maWcvdmF1bHRzdG9yYWdlY29uZmlnP2FwaS12ZXJzaW9uPTIwMTYtMTItMDE=", + "RequestMethod": "PATCH", + "RequestBody": "{\r\n \"properties\": {\r\n \"storageModelType\": \"LocallyRedundant\",\r\n \"storageType\": \"GeoRedundant\",\r\n \"storageTypeState\": \"Unlocked\"\r\n }\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "145" + ], + "x-ms-client-request-id": [ + "87ed6cb3-bbd3-4ed3-99c5-2da028e12356" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24410.01", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/4.0.1-preview" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 04 Apr 2017 20:54:25 GMT" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "e1d130e2-74b6-478f-9e43-13442a82fd7b" + ], + "x-ms-client-request-id": [ + "87ed6cb3-bbd3-4ed3-99c5-2da028e12356", + "87ed6cb3-bbd3-4ed3-99c5-2da028e12356" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1194" + ], + "x-ms-correlation-request-id": [ + "e1d130e2-74b6-478f-9e43-13442a82fd7b" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20170404T205426Z:e1d130e2-74b6-478f-9e43-13442a82fd7b" + ] + }, + "StatusCode": 204 + }, + { + "RequestUri": "/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults?api-version=2016-06-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlR3JvdXBzL1NES1Rlc3RSZy9wcm92aWRlcnMvTWljcm9zb2Z0LlJlY292ZXJ5U2VydmljZXMvdmF1bHRzP2FwaS12ZXJzaW9uPTIwMTYtMDYtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "fb8e7eef-52da-4e24-961d-45ac4e3a7ad4" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24410.01", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/4.0.1-preview" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"SDKTestRsVault\",\r\n \"etag\": \"W/\\\"datetime'2017-04-04T20%3A54%3A21.6941981Z'\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault\",\r\n \"type\": \"Microsoft.RecoveryServices/vaults\",\r\n \"sku\": {\r\n \"name\": \"Standard\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 04 Apr 2017 20:54:26 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-IIS/8.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "85f654cc-bfc1-499e-9672-c4a1dd963fa5" + ], + "x-ms-client-request-id": [ + "fb8e7eef-52da-4e24-961d-45ac4e3a7ad4" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14750" + ], + "x-ms-correlation-request-id": [ + "85f654cc-bfc1-499e-9672-c4a1dd963fa5" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20170404T205427Z:85f654cc-bfc1-499e-9672-c4a1dd963fa5" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault?api-version=2016-06-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlR3JvdXBzL1NES1Rlc3RSZy9wcm92aWRlcnMvTWljcm9zb2Z0LlJlY292ZXJ5U2VydmljZXMvdmF1bHRzL1NES1Rlc3RSc1ZhdWx0P2FwaS12ZXJzaW9uPTIwMTYtMDYtMDE=", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "6bcf626c-c138-4bc3-942f-a706e3470259" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24410.01", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/4.0.1-preview" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 04 Apr 2017 20:54:30 GMT" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "278c80ef-964d-43c0-b65e-7c7fe77c2d99" + ], + "x-ms-client-request-id": [ + "6bcf626c-c138-4bc3-942f-a706e3470259" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1193" + ], + "x-ms-correlation-request-id": [ + "278c80ef-964d-43c0-b65e-7c7fe77c2d99" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20170404T205430Z:278c80ef-964d-43c0-b65e-7c7fe77c2d99" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "f7424430-103b-4ba3-bd9e-b6f0986f848a" + } +} \ No newline at end of file diff --git a/src/ResourceManagement/RecoveryServices/RecoveryServices.Tests/SessionRecords/Microsoft.Azure.Management.RecoveryServices.Tests.VaultScenarioTests/ListOperationsTest.json b/src/ResourceManagement/RecoveryServices/RecoveryServices.Tests/SessionRecords/Microsoft.Azure.Management.RecoveryServices.Tests.VaultScenarioTests/ListOperationsTest.json new file mode 100644 index 000000000000..0268acad2196 --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/RecoveryServices.Tests/SessionRecords/Microsoft.Azure.Management.RecoveryServices.Tests.VaultScenarioTests/ListOperationsTest.json @@ -0,0 +1,452 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourcegroups/SDKTestRg?api-version=2015-11-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlZ3JvdXBzL1NES1Rlc3RSZz9hcGktdmVyc2lvbj0yMDE1LTExLTAx", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "67a8019e-e22c-4a22-8c79-4c7b41a2bc54" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24410.01", + "Microsoft.Azure.Management.Resources.ResourceManagementClient/1.0.0-preview" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg\",\r\n \"name\": \"SDKTestRg\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 04 Apr 2017 20:39:16 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14986" + ], + "x-ms-request-id": [ + "24b06ace-2fe4-4051-9652-7a15c682a392" + ], + "x-ms-correlation-request-id": [ + "24b06ace-2fe4-4051-9652-7a15c682a392" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20170404T203916Z:24b06ace-2fe4-4051-9652-7a15c682a392" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault?api-version=2016-06-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlR3JvdXBzL1NES1Rlc3RSZy9wcm92aWRlcnMvTWljcm9zb2Z0LlJlY292ZXJ5U2VydmljZXMvdmF1bHRzL1NES1Rlc3RSc1ZhdWx0P2FwaS12ZXJzaW9uPTIwMTYtMDYtMDE=", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {},\r\n \"sku\": {\r\n \"name\": \"Standard\"\r\n },\r\n \"location\": \"westus\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "91" + ], + "x-ms-client-request-id": [ + "f9a6cc59-0d20-48ba-9a1a-802a3ebd56b5" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24410.01", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/4.0.1-preview" + ] + }, + "ResponseBody": "{\r\n \"location\": \"westus\",\r\n \"name\": \"SDKTestRsVault\",\r\n \"etag\": \"W/\\\"datetime'2017-04-04T20%3A39%3A18.6993572Z'\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault\",\r\n \"type\": \"Microsoft.RecoveryServices/vaults\",\r\n \"sku\": {\r\n \"name\": \"Standard\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 04 Apr 2017 20:39:18 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-IIS/8.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "7a4d283e-dd09-4086-8146-79d8e349d7fa" + ], + "x-ms-client-request-id": [ + "f9a6cc59-0d20-48ba-9a1a-802a3ebd56b5" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-correlation-request-id": [ + "7a4d283e-dd09-4086-8146-79d8e349d7fa" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20170404T203918Z:7a4d283e-dd09-4086-8146-79d8e349d7fa" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault?api-version=2016-06-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlR3JvdXBzL1NES1Rlc3RSZy9wcm92aWRlcnMvTWljcm9zb2Z0LlJlY292ZXJ5U2VydmljZXMvdmF1bHRzL1NES1Rlc3RSc1ZhdWx0P2FwaS12ZXJzaW9uPTIwMTYtMDYtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "01625d4c-761c-4587-a3d3-320b21fc874e" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24410.01", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/4.0.1-preview" + ] + }, + "ResponseBody": "{\r\n \"location\": \"westus\",\r\n \"name\": \"SDKTestRsVault\",\r\n \"etag\": \"W/\\\"datetime'2017-04-04T20%3A39%3A18.6993572Z'\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault\",\r\n \"type\": \"Microsoft.RecoveryServices/vaults\",\r\n \"sku\": {\r\n \"name\": \"Standard\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 04 Apr 2017 20:39:19 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-IIS/8.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "0d3e0bf6-f19b-4f2e-ad01-b28894c2e13a" + ], + "x-ms-client-request-id": [ + "01625d4c-761c-4587-a3d3-320b21fc874e" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14770" + ], + "x-ms-correlation-request-id": [ + "0d3e0bf6-f19b-4f2e-ad01-b28894c2e13a" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20170404T203919Z:0d3e0bf6-f19b-4f2e-ad01-b28894c2e13a" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault/backupconfig/vaultconfig?api-version=2016-12-01", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlR3JvdXBzL1NES1Rlc3RSZy9wcm92aWRlcnMvTWljcm9zb2Z0LlJlY292ZXJ5U2VydmljZXMvdmF1bHRzL1NES1Rlc3RSc1ZhdWx0L2JhY2t1cGNvbmZpZy92YXVsdGNvbmZpZz9hcGktdmVyc2lvbj0yMDE2LTEyLTAx", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "c6584456-dc5c-4a26-aec9-13aa88489b48" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24410.01", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/4.0.1-preview" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault/backupconfig/vaultconfig\",\r\n \"name\": \"vaultconfig\",\r\n \"type\": \"Microsoft.RecoveryServices/vaults/backupconfig\",\r\n \"properties\": {\r\n \"enhancedSecurityState\": \"Enabled\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 04 Apr 2017 20:39:20 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-IIS/8.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "9336c678-9e23-466a-a594-fcaffe5061d2" + ], + "x-ms-client-request-id": [ + "c6584456-dc5c-4a26-aec9-13aa88489b48", + "c6584456-dc5c-4a26-aec9-13aa88489b48" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14769" + ], + "x-ms-correlation-request-id": [ + "9336c678-9e23-466a-a594-fcaffe5061d2" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20170404T203920Z:9336c678-9e23-466a-a594-fcaffe5061d2" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault/backupconfig/vaultconfig?api-version=2016-12-01", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlR3JvdXBzL1NES1Rlc3RSZy9wcm92aWRlcnMvTWljcm9zb2Z0LlJlY292ZXJ5U2VydmljZXMvdmF1bHRzL1NES1Rlc3RSc1ZhdWx0L2JhY2t1cGNvbmZpZy92YXVsdGNvbmZpZz9hcGktdmVyc2lvbj0yMDE2LTEyLTAx", + "RequestMethod": "PATCH", + "RequestBody": "{\r\n \"properties\": {\r\n \"enhancedSecurityState\": \"Disabled\"\r\n }\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "69" + ], + "x-ms-client-request-id": [ + "159dcd86-ae79-4990-b4fc-0bdffda7e1f2" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24410.01", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/4.0.1-preview" + ] + }, + "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"UserErrorChangeEnhancedSecurityStateNotAllowed\",\r\n \"message\": \"Enhanced Security is enabled for this vault. You cannot disable Enhanced Security after enabling it.\\r\\nEnhanced Security is enabled for this vault. You cannot disable Enhanced Security after enabling it.\",\r\n \"target\": null,\r\n \"details\": null,\r\n \"innerError\": null\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "331" + ], + "Content-Type": [ + "application/json" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 04 Apr 2017 20:39:21 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-IIS/8.0" + ], + "x-ms-request-id": [ + "cf418a8f-e855-4642-8146-5136524ff7cc" + ], + "x-ms-client-request-id": [ + "159dcd86-ae79-4990-b4fc-0bdffda7e1f2", + "159dcd86-ae79-4990-b4fc-0bdffda7e1f2" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1198" + ], + "x-ms-correlation-request-id": [ + "cf418a8f-e855-4642-8146-5136524ff7cc" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20170404T203921Z:cf418a8f-e855-4642-8146-5136524ff7cc" + ] + }, + "StatusCode": 400 + }, + { + "RequestUri": "/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults?api-version=2016-06-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlR3JvdXBzL1NES1Rlc3RSZy9wcm92aWRlcnMvTWljcm9zb2Z0LlJlY292ZXJ5U2VydmljZXMvdmF1bHRzP2FwaS12ZXJzaW9uPTIwMTYtMDYtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "778bd126-0451-49f4-bd0f-ebcd5298bf0b" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24410.01", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/4.0.1-preview" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"SDKTestRsVault\",\r\n \"etag\": \"W/\\\"datetime'2017-04-04T20%3A39%3A18.6993572Z'\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault\",\r\n \"type\": \"Microsoft.RecoveryServices/vaults\",\r\n \"sku\": {\r\n \"name\": \"Standard\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 04 Apr 2017 20:39:22 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-IIS/8.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "cdc2eb4f-0729-4a8f-a915-c042db4f5f4a" + ], + "x-ms-client-request-id": [ + "778bd126-0451-49f4-bd0f-ebcd5298bf0b" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14768" + ], + "x-ms-correlation-request-id": [ + "cdc2eb4f-0729-4a8f-a915-c042db4f5f4a" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20170404T203922Z:cdc2eb4f-0729-4a8f-a915-c042db4f5f4a" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault?api-version=2016-06-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlR3JvdXBzL1NES1Rlc3RSZy9wcm92aWRlcnMvTWljcm9zb2Z0LlJlY292ZXJ5U2VydmljZXMvdmF1bHRzL1NES1Rlc3RSc1ZhdWx0P2FwaS12ZXJzaW9uPTIwMTYtMDYtMDE=", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "7a8aec07-243e-4446-8f86-f4385ad34590" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24410.01", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/4.0.1-preview" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 04 Apr 2017 20:39:27 GMT" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "5d586d4a-236b-434e-8afa-7a756af56aab" + ], + "x-ms-client-request-id": [ + "7a8aec07-243e-4446-8f86-f4385ad34590" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1197" + ], + "x-ms-correlation-request-id": [ + "5d586d4a-236b-434e-8afa-7a756af56aab" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20170404T203927Z:5d586d4a-236b-434e-8afa-7a756af56aab" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "f7424430-103b-4ba3-bd9e-b6f0986f848a" + } +} \ No newline at end of file diff --git a/src/ResourceManagement/RecoveryServices/RecoveryServices.Tests/SessionRecords/Microsoft.Azure.Management.RecoveryServices.Tests.VaultUsageScenarioTests/RetrieveVaultReplicationUsages.json b/src/ResourceManagement/RecoveryServices/RecoveryServices.Tests/SessionRecords/Microsoft.Azure.Management.RecoveryServices.Tests.VaultUsageScenarioTests/RetrieveVaultReplicationUsages.json new file mode 100644 index 000000000000..0d10622ef734 --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/RecoveryServices.Tests/SessionRecords/Microsoft.Azure.Management.RecoveryServices.Tests.VaultUsageScenarioTests/RetrieveVaultReplicationUsages.json @@ -0,0 +1,396 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourcegroups/RecoveryServicesTestRg?api-version=2015-11-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlZ3JvdXBzL1JlY292ZXJ5U2VydmljZXNUZXN0Umc/YXBpLXZlcnNpb249MjAxNS0xMS0wMQ==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"westus\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "28" + ], + "x-ms-client-request-id": [ + "0f97c85d-7b73-4983-874d-86e4c2249249" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24410.01", + "Microsoft.Azure.Management.Resources.ResourceManagementClient/1.0.0-preview" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/RecoveryServicesTestRg\",\r\n \"name\": \"RecoveryServicesTestRg\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 27 Mar 2017 20:19:29 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1197" + ], + "x-ms-request-id": [ + "0cbf64a3-aded-4e80-a1b7-c9244c269fe2" + ], + "x-ms-correlation-request-id": [ + "0cbf64a3-aded-4e80-a1b7-c9244c269fe2" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20170327T201930Z:0cbf64a3-aded-4e80-a1b7-c9244c269fe2" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/RecoveryServicesTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault?api-version=2016-06-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlR3JvdXBzL1JlY292ZXJ5U2VydmljZXNUZXN0UmcvcHJvdmlkZXJzL01pY3Jvc29mdC5SZWNvdmVyeVNlcnZpY2VzL3ZhdWx0cy9TREtUZXN0UnNWYXVsdD9hcGktdmVyc2lvbj0yMDE2LTA2LTAx", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {},\r\n \"sku\": {\r\n \"name\": \"Standard\"\r\n },\r\n \"location\": \"westus\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "91" + ], + "x-ms-client-request-id": [ + "17bfe492-f3c2-4c1a-99f0-1130c6f9caf8" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24410.01", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/4.0.1-preview" + ] + }, + "ResponseBody": "{\r\n \"location\": \"westus\",\r\n \"name\": \"SDKTestRsVault\",\r\n \"etag\": \"W/\\\"datetime'2017-03-27T20%3A19%3A32.7061797Z'\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/RecoveryServicesTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault\",\r\n \"type\": \"Microsoft.RecoveryServices/vaults\",\r\n \"sku\": {\r\n \"name\": \"Standard\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 27 Mar 2017 20:19:32 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-IIS/8.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "dfa7eb94-f7b0-4a61-81ef-4920b00228a1" + ], + "x-ms-client-request-id": [ + "17bfe492-f3c2-4c1a-99f0-1130c6f9caf8" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1198" + ], + "x-ms-correlation-request-id": [ + "dfa7eb94-f7b0-4a61-81ef-4920b00228a1" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20170327T201932Z:dfa7eb94-f7b0-4a61-81ef-4920b00228a1" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/RecoveryServicesTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault?api-version=2016-06-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlR3JvdXBzL1JlY292ZXJ5U2VydmljZXNUZXN0UmcvcHJvdmlkZXJzL01pY3Jvc29mdC5SZWNvdmVyeVNlcnZpY2VzL3ZhdWx0cy9TREtUZXN0UnNWYXVsdD9hcGktdmVyc2lvbj0yMDE2LTA2LTAx", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "ebbc12dc-c06d-4316-8d07-2c49b7c319d4" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24410.01", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/4.0.1-preview" + ] + }, + "ResponseBody": "{\r\n \"location\": \"westus\",\r\n \"name\": \"SDKTestRsVault\",\r\n \"etag\": \"W/\\\"datetime'2017-03-27T20%3A19%3A32.7061797Z'\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/RecoveryServicesTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault\",\r\n \"type\": \"Microsoft.RecoveryServices/vaults\",\r\n \"sku\": {\r\n \"name\": \"Standard\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 27 Mar 2017 20:19:32 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-IIS/8.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "b2696853-a99d-4cb9-9016-7e69832495f1" + ], + "x-ms-client-request-id": [ + "ebbc12dc-c06d-4316-8d07-2c49b7c319d4" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14958" + ], + "x-ms-correlation-request-id": [ + "b2696853-a99d-4cb9-9016-7e69832495f1" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20170327T201933Z:b2696853-a99d-4cb9-9016-7e69832495f1" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/RecoveryServicesTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault/replicationUsages?api-version=2016-06-01", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlR3JvdXBzL1JlY292ZXJ5U2VydmljZXNUZXN0UmcvcHJvdmlkZXJzL01pY3Jvc29mdC5SZWNvdmVyeVNlcnZpY2VzL3ZhdWx0cy9TREtUZXN0UnNWYXVsdC9yZXBsaWNhdGlvblVzYWdlcz9hcGktdmVyc2lvbj0yMDE2LTA2LTAx", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "b3f97c85-0723-438c-89be-498c8afcee96" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24410.01", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/4.0.1-preview" + ] + }, + "ResponseBody": "{\r\n \"monitoringSummary\": {\r\n \"unHealthyVmCount\": 0,\r\n \"unHealthyProviderCount\": 0,\r\n \"eventsCount\": 0,\r\n \"deprecatedProviderCount\": 0,\r\n \"supportedProviderCount\": 0,\r\n \"unsupportedProviderCount\": 0\r\n },\r\n \"jobsSummary\": {\r\n \"failedJobs\": 0,\r\n \"suspendedJobs\": 0,\r\n \"inProgressJobs\": 0\r\n },\r\n \"protectedItemCount\": 0,\r\n \"registeredServersCount\": 0,\r\n \"recoveryPlanCount\": 0\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 27 Mar 2017 20:19:33 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-IIS/8.0", + "Microsoft-IIS/8.5" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "b3f97c85-0723-438c-89be-498c8afcee96 3/27/2017 8:19:33 PM" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-client-request-id": [ + "b3f97c85-0723-438c-89be-498c8afcee96" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14957" + ], + "x-ms-correlation-request-id": [ + "5b959070-9bb8-474e-b59d-85c47b92c986" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20170327T201933Z:5b959070-9bb8-474e-b59d-85c47b92c986" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/RecoveryServicesTestRg/providers/Microsoft.RecoveryServices/vaults?api-version=2016-06-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlR3JvdXBzL1JlY292ZXJ5U2VydmljZXNUZXN0UmcvcHJvdmlkZXJzL01pY3Jvc29mdC5SZWNvdmVyeVNlcnZpY2VzL3ZhdWx0cz9hcGktdmVyc2lvbj0yMDE2LTA2LTAx", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "e3414856-161a-4305-86b7-0a34474b6fb5" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24410.01", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/4.0.1-preview" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"SDKTestRsVault\",\r\n \"etag\": \"W/\\\"datetime'2017-03-27T20%3A19%3A32.7061797Z'\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/RecoveryServicesTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault\",\r\n \"type\": \"Microsoft.RecoveryServices/vaults\",\r\n \"sku\": {\r\n \"name\": \"Standard\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 27 Mar 2017 20:19:33 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-IIS/8.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "9c60342c-9415-4da5-9302-feeae22d68d6" + ], + "x-ms-client-request-id": [ + "e3414856-161a-4305-86b7-0a34474b6fb5" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14956" + ], + "x-ms-correlation-request-id": [ + "9c60342c-9415-4da5-9302-feeae22d68d6" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20170327T201933Z:9c60342c-9415-4da5-9302-feeae22d68d6" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/RecoveryServicesTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault?api-version=2016-06-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlR3JvdXBzL1JlY292ZXJ5U2VydmljZXNUZXN0UmcvcHJvdmlkZXJzL01pY3Jvc29mdC5SZWNvdmVyeVNlcnZpY2VzL3ZhdWx0cy9TREtUZXN0UnNWYXVsdD9hcGktdmVyc2lvbj0yMDE2LTA2LTAx", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "c7de2358-8503-4bb6-8673-902a1d6ea28a" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24410.01", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/4.0.1-preview" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Mon, 27 Mar 2017 20:19:37 GMT" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "dd1a2280-dffb-4484-8e88-4d531109b565" + ], + "x-ms-client-request-id": [ + "c7de2358-8503-4bb6-8673-902a1d6ea28a" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1197" + ], + "x-ms-correlation-request-id": [ + "dd1a2280-dffb-4484-8e88-4d531109b565" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20170327T201938Z:dd1a2280-dffb-4484-8e88-4d531109b565" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "f7424430-103b-4ba3-bd9e-b6f0986f848a" + } +} \ No newline at end of file diff --git a/src/ResourceManagement/RecoveryServices/RecoveryServices.Tests/SessionRecords/Microsoft.Azure.Management.RecoveryServices.Tests.VaultUsageScenarioTests/RetrieveVaultUsages.json b/src/ResourceManagement/RecoveryServices/RecoveryServices.Tests/SessionRecords/Microsoft.Azure.Management.RecoveryServices.Tests.VaultUsageScenarioTests/RetrieveVaultUsages.json new file mode 100644 index 000000000000..cc4df46300fc --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/RecoveryServices.Tests/SessionRecords/Microsoft.Azure.Management.RecoveryServices.Tests.VaultUsageScenarioTests/RetrieveVaultUsages.json @@ -0,0 +1,576 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourcegroups/SDKTestRg?api-version=2015-11-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlZ3JvdXBzL1NES1Rlc3RSZz9hcGktdmVyc2lvbj0yMDE1LTExLTAx", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "8008ef7c-9e1e-45bb-8f4c-782f81a75173" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24410.01", + "Microsoft.Azure.Management.Resources.ResourceManagementClient/1.0.0-preview" + ] + }, + "ResponseBody": "{\r\n \"error\": {\r\n \"code\": \"ResourceGroupNotFound\",\r\n \"message\": \"Resource group 'SDKTestRg' could not be found.\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "101" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 04 Apr 2017 20:05:35 GMT" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-failure-cause": [ + "gateway" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14980" + ], + "x-ms-request-id": [ + "5813229f-9d42-4333-83d9-a6eefbc0a849" + ], + "x-ms-correlation-request-id": [ + "5813229f-9d42-4333-83d9-a6eefbc0a849" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20170404T200536Z:5813229f-9d42-4333-83d9-a6eefbc0a849" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 404 + }, + { + "RequestUri": "/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourcegroups/SDKTestRg?api-version=2015-11-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlZ3JvdXBzL1NES1Rlc3RSZz9hcGktdmVyc2lvbj0yMDE1LTExLTAx", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"westus\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "28" + ], + "x-ms-client-request-id": [ + "ddf7bffc-5b16-4d3b-b986-32b8e9b84f26" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24410.01", + "Microsoft.Azure.Management.Resources.ResourceManagementClient/1.0.0-preview" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg\",\r\n \"name\": \"SDKTestRg\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "171" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 04 Apr 2017 20:05:47 GMT" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1198" + ], + "x-ms-request-id": [ + "78f156e2-692a-4137-b7cd-563c47925ca7" + ], + "x-ms-correlation-request-id": [ + "78f156e2-692a-4137-b7cd-563c47925ca7" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20170404T200547Z:78f156e2-692a-4137-b7cd-563c47925ca7" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault?api-version=2016-06-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlR3JvdXBzL1NES1Rlc3RSZy9wcm92aWRlcnMvTWljcm9zb2Z0LlJlY292ZXJ5U2VydmljZXMvdmF1bHRzL1NES1Rlc3RSc1ZhdWx0P2FwaS12ZXJzaW9uPTIwMTYtMDYtMDE=", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"properties\": {},\r\n \"sku\": {\r\n \"name\": \"Standard\"\r\n },\r\n \"location\": \"westus\"\r\n}", + "RequestHeaders": { + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "91" + ], + "x-ms-client-request-id": [ + "c8a78213-2a9a-443c-b675-9dcb95e1b9fa" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24410.01", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/4.0.1-preview" + ] + }, + "ResponseBody": "{\r\n \"location\": \"westus\",\r\n \"name\": \"SDKTestRsVault\",\r\n \"etag\": \"W/\\\"datetime'2017-04-04T20%3A06%3A03.9585011Z'\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault\",\r\n \"type\": \"Microsoft.RecoveryServices/vaults\",\r\n \"sku\": {\r\n \"name\": \"Standard\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Length": [ + "362" + ], + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 04 Apr 2017 20:06:04 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Server": [ + "Microsoft-IIS/8.0" + ], + "x-ms-request-id": [ + "a86f033a-aef5-434b-9756-47035bb38407" + ], + "x-ms-client-request-id": [ + "c8a78213-2a9a-443c-b675-9dcb95e1b9fa" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1195" + ], + "x-ms-correlation-request-id": [ + "a86f033a-aef5-434b-9756-47035bb38407" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20170404T200605Z:a86f033a-aef5-434b-9756-47035bb38407" + ] + }, + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault?api-version=2016-06-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlR3JvdXBzL1NES1Rlc3RSZy9wcm92aWRlcnMvTWljcm9zb2Z0LlJlY292ZXJ5U2VydmljZXMvdmF1bHRzL1NES1Rlc3RSc1ZhdWx0P2FwaS12ZXJzaW9uPTIwMTYtMDYtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "b68c4f26-0127-4d91-bd0e-25c2d882b85a" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24410.01", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/4.0.1-preview" + ] + }, + "ResponseBody": "{\r\n \"location\": \"westus\",\r\n \"name\": \"SDKTestRsVault\",\r\n \"etag\": \"W/\\\"datetime'2017-04-04T20%3A06%3A03.9585011Z'\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault\",\r\n \"type\": \"Microsoft.RecoveryServices/vaults\",\r\n \"sku\": {\r\n \"name\": \"Standard\"\r\n }\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 04 Apr 2017 20:06:14 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-IIS/8.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "2b5852ad-d1ff-43cb-94d8-3081ce3c31a0" + ], + "x-ms-client-request-id": [ + "b68c4f26-0127-4d91-bd0e-25c2d882b85a" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14905" + ], + "x-ms-correlation-request-id": [ + "2b5852ad-d1ff-43cb-94d8-3081ce3c31a0" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20170404T200614Z:2b5852ad-d1ff-43cb-94d8-3081ce3c31a0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults?api-version=2016-06-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlR3JvdXBzL1NES1Rlc3RSZy9wcm92aWRlcnMvTWljcm9zb2Z0LlJlY292ZXJ5U2VydmljZXMvdmF1bHRzP2FwaS12ZXJzaW9uPTIwMTYtMDYtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "648a3d66-bab1-4e7b-906c-b778a6c1124d" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24410.01", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/4.0.1-preview" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"SDKTestRsVault\",\r\n \"etag\": \"W/\\\"datetime'2017-04-04T20%3A06%3A03.9585011Z'\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault\",\r\n \"type\": \"Microsoft.RecoveryServices/vaults\",\r\n \"sku\": {\r\n \"name\": \"Standard\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 04 Apr 2017 20:06:15 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-IIS/8.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "32c52e96-6b54-4cfe-a3c2-77b45f286706" + ], + "x-ms-client-request-id": [ + "648a3d66-bab1-4e7b-906c-b778a6c1124d" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14904" + ], + "x-ms-correlation-request-id": [ + "32c52e96-6b54-4cfe-a3c2-77b45f286706" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20170404T200616Z:32c52e96-6b54-4cfe-a3c2-77b45f286706" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults?api-version=2016-06-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlR3JvdXBzL1NES1Rlc3RSZy9wcm92aWRlcnMvTWljcm9zb2Z0LlJlY292ZXJ5U2VydmljZXMvdmF1bHRzP2FwaS12ZXJzaW9uPTIwMTYtMDYtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "3ad4f30f-fe47-4482-897f-6e24cec8665a" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24410.01", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/4.0.1-preview" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"location\": \"westus\",\r\n \"name\": \"SDKTestRsVault\",\r\n \"etag\": \"W/\\\"datetime'2017-04-04T20%3A06%3A03.9585011Z'\\\"\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n },\r\n \"id\": \"/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault\",\r\n \"type\": \"Microsoft.RecoveryServices/vaults\",\r\n \"sku\": {\r\n \"name\": \"Standard\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 04 Apr 2017 20:07:12 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-IIS/8.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "28fc36ce-d029-475c-8334-e5ddb98888a0" + ], + "x-ms-client-request-id": [ + "3ad4f30f-fe47-4482-897f-6e24cec8665a" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14900" + ], + "x-ms-correlation-request-id": [ + "28fc36ce-d029-475c-8334-e5ddb98888a0" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20170404T200713Z:28fc36ce-d029-475c-8334-e5ddb98888a0" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault/usages?api-version=2016-06-01", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlR3JvdXBzL1NES1Rlc3RSZy9wcm92aWRlcnMvTWljcm9zb2Z0LlJlY292ZXJ5U2VydmljZXMvdmF1bHRzL1NES1Rlc3RSc1ZhdWx0L3VzYWdlcz9hcGktdmVyc2lvbj0yMDE2LTA2LTAx", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "2b911f67-7ce1-463d-8ba3-df614e4f97ea" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24410.01", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/4.0.1-preview" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"unit\": \"Count\",\r\n \"currentValue\": 0,\r\n \"limit\": -1,\r\n \"name\": {\r\n \"value\": \"MABContainersCount\",\r\n \"localizedValue\": \"Backup management servers\"\r\n }\r\n },\r\n {\r\n \"unit\": \"Count\",\r\n \"currentValue\": 0,\r\n \"limit\": -1,\r\n \"name\": {\r\n \"value\": \"ProtectedItemCount\",\r\n \"localizedValue\": \"Backup items/Azure virtual machine backup\"\r\n }\r\n },\r\n {\r\n \"unit\": \"Count\",\r\n \"currentValue\": 0,\r\n \"limit\": -1,\r\n \"name\": {\r\n \"value\": \"ProtectedItemCriticalCount\",\r\n \"localizedValue\": \"Critical\"\r\n }\r\n },\r\n {\r\n \"unit\": \"Count\",\r\n \"currentValue\": 0,\r\n \"limit\": -1,\r\n \"name\": {\r\n \"value\": \"ProtectedItemWarningCount\",\r\n \"localizedValue\": \"Warning\"\r\n }\r\n },\r\n {\r\n \"unit\": \"Count\",\r\n \"currentValue\": 0,\r\n \"limit\": -1,\r\n \"name\": {\r\n \"value\": \"IaaSVMProtectedItemCount\",\r\n \"localizedValue\": \"Azure Virtual Machines\"\r\n }\r\n },\r\n {\r\n \"unit\": \"Count\",\r\n \"currentValue\": 0,\r\n \"limit\": -1,\r\n \"name\": {\r\n \"value\": \"IaaSVMProtectedItemCriticalCount\",\r\n \"localizedValue\": \"Critical\"\r\n }\r\n },\r\n {\r\n \"unit\": \"Count\",\r\n \"currentValue\": 0,\r\n \"limit\": -1,\r\n \"name\": {\r\n \"value\": \"IaaSVMProtectedItemWarningCount\",\r\n \"localizedValue\": \"Warning\"\r\n }\r\n },\r\n {\r\n \"unit\": \"Count\",\r\n \"currentValue\": 0,\r\n \"limit\": -1,\r\n \"name\": {\r\n \"value\": \"MABProtectedItemCount\",\r\n \"localizedValue\": \"File-Folders\"\r\n }\r\n },\r\n {\r\n \"unit\": \"Count\",\r\n \"currentValue\": 0,\r\n \"limit\": -1,\r\n \"name\": {\r\n \"value\": \"DPMProtectedItemCount\",\r\n \"localizedValue\": \"DPM Protected Items Count\"\r\n }\r\n },\r\n {\r\n \"unit\": \"Count\",\r\n \"currentValue\": 0,\r\n \"limit\": -1,\r\n \"name\": {\r\n \"value\": \"AzureBackupServerProtectedItemCount\",\r\n \"localizedValue\": \"Azure Backup Server Protected Items Count\"\r\n }\r\n },\r\n {\r\n \"unit\": \"Count\",\r\n \"quotaPeriod\": \"P1D\",\r\n \"currentValue\": 0,\r\n \"limit\": -1,\r\n \"name\": {\r\n \"value\": \"InProgressJobsCount\",\r\n \"localizedValue\": \"In progress\"\r\n }\r\n },\r\n {\r\n \"unit\": \"Count\",\r\n \"quotaPeriod\": \"P1D\",\r\n \"currentValue\": 0,\r\n \"limit\": -1,\r\n \"name\": {\r\n \"value\": \"FailedJobsCount\",\r\n \"localizedValue\": \"Failed\"\r\n }\r\n },\r\n {\r\n \"unit\": \"Bytes\",\r\n \"currentValue\": 0,\r\n \"limit\": -1,\r\n \"name\": {\r\n \"value\": \"GRSStorageUsage\",\r\n \"localizedValue\": \"Cloud - GRS\"\r\n }\r\n },\r\n {\r\n \"unit\": \"Bytes\",\r\n \"currentValue\": 0,\r\n \"limit\": -1,\r\n \"name\": {\r\n \"value\": \"LRSStorageUsage\",\r\n \"localizedValue\": \"Cloud - LRS\"\r\n }\r\n },\r\n {\r\n \"unit\": \"Count\",\r\n \"currentValue\": 0,\r\n \"limit\": -1,\r\n \"name\": {\r\n \"value\": \"ManagedInstances\",\r\n \"localizedValue\": \"Protected Instances\"\r\n }\r\n },\r\n {\r\n \"unit\": \"Bytes\",\r\n \"currentValue\": 0,\r\n \"limit\": -1,\r\n \"name\": {\r\n \"value\": \"GRSDedupStorageUsage\",\r\n \"localizedValue\": \"Dedup - GRS\"\r\n }\r\n },\r\n {\r\n \"unit\": \"Bytes\",\r\n \"currentValue\": 0,\r\n \"limit\": -1,\r\n \"name\": {\r\n \"value\": \"LRSDedupStorageUsage\",\r\n \"localizedValue\": \"Dedup - LRS\"\r\n }\r\n },\r\n {\r\n \"unit\": \"Bytes\",\r\n \"currentValue\": 0,\r\n \"limit\": -1,\r\n \"name\": {\r\n \"value\": \"UsedDiskSize\",\r\n \"localizedValue\": \"Backup Engines' Disk Used\"\r\n }\r\n },\r\n {\r\n \"name\": {\r\n \"value\": \"ProtectedItem\",\r\n \"localizedValue\": \"Replicated Items\"\r\n },\r\n \"unit\": \"Count\",\r\n \"currentValue\": 0,\r\n \"limit\": -1\r\n },\r\n {\r\n \"name\": {\r\n \"value\": \"RecoveryPlan\",\r\n \"localizedValue\": \"Recovery Plans\"\r\n },\r\n \"unit\": \"Count\",\r\n \"currentValue\": 0,\r\n \"limit\": -1\r\n },\r\n {\r\n \"name\": {\r\n \"value\": \"UnHealthyProvider\",\r\n \"localizedValue\": \"Server health critical\"\r\n },\r\n \"unit\": \"Count\",\r\n \"currentValue\": 0,\r\n \"limit\": -1\r\n },\r\n {\r\n \"name\": {\r\n \"value\": \"DeprecatedProvider\",\r\n \"localizedValue\": null\r\n },\r\n \"unit\": \"Count\",\r\n \"currentValue\": 0,\r\n \"limit\": -1\r\n },\r\n {\r\n \"name\": {\r\n \"value\": \"UnSupportedProvider\",\r\n \"localizedValue\": null\r\n },\r\n \"unit\": \"Count\",\r\n \"currentValue\": 0,\r\n \"limit\": -1\r\n },\r\n {\r\n \"name\": {\r\n \"value\": \"SupportedProvider\",\r\n \"localizedValue\": null\r\n },\r\n \"unit\": \"Count\",\r\n \"currentValue\": 0,\r\n \"limit\": -1\r\n },\r\n {\r\n \"name\": {\r\n \"value\": \"Event\",\r\n \"localizedValue\": \"Events\"\r\n },\r\n \"unit\": \"Count\",\r\n \"currentValue\": 0,\r\n \"limit\": -1\r\n },\r\n {\r\n \"name\": {\r\n \"value\": \"FailedJob\",\r\n \"localizedValue\": \"Failed\"\r\n },\r\n \"unit\": \"Count\",\r\n \"currentValue\": 0,\r\n \"limit\": -1\r\n },\r\n {\r\n \"name\": {\r\n \"value\": \"InProgressJob\",\r\n \"localizedValue\": \"In progress\"\r\n },\r\n \"unit\": \"Count\",\r\n \"currentValue\": 0,\r\n \"limit\": -1\r\n },\r\n {\r\n \"name\": {\r\n \"value\": \"SuspendedJob\",\r\n \"localizedValue\": \"User input required\"\r\n },\r\n \"unit\": \"Count\",\r\n \"currentValue\": 0,\r\n \"limit\": -1\r\n },\r\n {\r\n \"name\": {\r\n \"value\": \"RegisteredServersCount\",\r\n \"localizedValue\": \"Registered servers count\"\r\n },\r\n \"unit\": \"Count\",\r\n \"currentValue\": 0,\r\n \"limit\": -1\r\n },\r\n {\r\n \"unit\": 0,\r\n \"currentValue\": 0,\r\n \"limit\": -1,\r\n \"name\": {\r\n \"value\": \"Critical\",\r\n \"localizedValue\": \"Critical\"\r\n }\r\n },\r\n {\r\n \"unit\": 0,\r\n \"currentValue\": 0,\r\n \"limit\": -1,\r\n \"name\": {\r\n \"value\": \"Warning\",\r\n \"localizedValue\": \"Warning\"\r\n }\r\n }\r\n ]\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 04 Apr 2017 20:06:18 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-IIS/8.0" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "75760b9f-a965-4c69-ace6-4d744cf87415" + ], + "x-ms-client-request-id": [ + "2b911f67-7ce1-463d-8ba3-df614e4f97ea" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14903" + ], + "x-ms-correlation-request-id": [ + "75760b9f-a965-4c69-ace6-4d744cf87415" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20170404T200619Z:75760b9f-a965-4c69-ace6-4d744cf87415" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/Subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault/replicationUsages?api-version=2016-06-01", + "EncodedRequestUri": "L1N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlR3JvdXBzL1NES1Rlc3RSZy9wcm92aWRlcnMvTWljcm9zb2Z0LlJlY292ZXJ5U2VydmljZXMvdmF1bHRzL1NES1Rlc3RSc1ZhdWx0L3JlcGxpY2F0aW9uVXNhZ2VzP2FwaS12ZXJzaW9uPTIwMTYtMDYtMDE=", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "a4f687f8-1013-4af1-a524-d954c27015f5" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24410.01", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/4.0.1-preview" + ] + }, + "ResponseBody": "{\r\n \"monitoringSummary\": {\r\n \"unHealthyVmCount\": 0,\r\n \"unHealthyProviderCount\": 0,\r\n \"eventsCount\": 0,\r\n \"deprecatedProviderCount\": 0,\r\n \"supportedProviderCount\": 0,\r\n \"unsupportedProviderCount\": 0\r\n },\r\n \"jobsSummary\": {\r\n \"failedJobs\": 0,\r\n \"suspendedJobs\": 0,\r\n \"inProgressJobs\": 0\r\n },\r\n \"protectedItemCount\": 0,\r\n \"registeredServersCount\": 0,\r\n \"recoveryPlanCount\": 0\r\n}", + "ResponseHeaders": { + "Content-Type": [ + "application/json" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 04 Apr 2017 20:06:54 GMT" + ], + "Pragma": [ + "no-cache" + ], + "Transfer-Encoding": [ + "chunked" + ], + "Server": [ + "Microsoft-IIS/8.0", + "Microsoft-IIS/8.5" + ], + "Vary": [ + "Accept-Encoding" + ], + "x-ms-request-id": [ + "a4f687f8-1013-4af1-a524-d954c27015f5 4/4/2017 8:06:55 PM" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-AspNet-Version": [ + "4.0.30319" + ], + "X-Powered-By": [ + "ASP.NET" + ], + "x-ms-client-request-id": [ + "a4f687f8-1013-4af1-a524-d954c27015f5" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "14901" + ], + "x-ms-correlation-request-id": [ + "c825d37f-a7a9-4ff7-98f5-0ab87c9e2ba5" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20170404T200655Z:c825d37f-a7a9-4ff7-98f5-0ab87c9e2ba5" + ] + }, + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/f7424430-103b-4ba3-bd9e-b6f0986f848a/resourceGroups/SDKTestRg/providers/Microsoft.RecoveryServices/vaults/SDKTestRsVault?api-version=2016-06-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZjc0MjQ0MzAtMTAzYi00YmEzLWJkOWUtYjZmMDk4NmY4NDhhL3Jlc291cmNlR3JvdXBzL1NES1Rlc3RSZy9wcm92aWRlcnMvTWljcm9zb2Z0LlJlY292ZXJ5U2VydmljZXMvdmF1bHRzL1NES1Rlc3RSc1ZhdWx0P2FwaS12ZXJzaW9uPTIwMTYtMDYtMDE=", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "44a2ac56-4b12-4f38-8fd9-76d3eaca4709" + ], + "accept-language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.24410.01", + "Microsoft.Azure.Management.RecoveryServices.RecoveryServicesClient/4.0.1-preview" + ] + }, + "ResponseBody": "", + "ResponseHeaders": { + "Content-Length": [ + "0" + ], + "Expires": [ + "-1" + ], + "Cache-Control": [ + "no-cache" + ], + "Date": [ + "Tue, 04 Apr 2017 20:07:27 GMT" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-request-id": [ + "0a2324a5-87c4-4672-bd52-814539cbb013" + ], + "x-ms-client-request-id": [ + "44a2ac56-4b12-4f38-8fd9-76d3eaca4709" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1194" + ], + "x-ms-correlation-request-id": [ + "0a2324a5-87c4-4672-bd52-814539cbb013" + ], + "x-ms-routing-request-id": [ + "SOUTHINDIA:20170404T200727Z:0a2324a5-87c4-4672-bd52-814539cbb013" + ] + }, + "StatusCode": 200 + } + ], + "Names": {}, + "Variables": { + "SubscriptionId": "f7424430-103b-4ba3-bd9e-b6f0986f848a" + } +} \ No newline at end of file diff --git a/src/ResourceManagement/RecoveryServices/RecoveryServices.Tests/TestHelpers/ClientManagementUtilities.cs b/src/ResourceManagement/RecoveryServices/RecoveryServices.Tests/TestHelpers/ClientManagementUtilities.cs index cff349ee57a4..ad1521d1499d 100644 --- a/src/ResourceManagement/RecoveryServices/RecoveryServices.Tests/TestHelpers/ClientManagementUtilities.cs +++ b/src/ResourceManagement/RecoveryServices/RecoveryServices.Tests/TestHelpers/ClientManagementUtilities.cs @@ -1,5 +1,17 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Copyright (c) Microsoft. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// using Microsoft.Azure.Management.Resources; using Microsoft.Rest.ClientRuntime.Azure.TestFramework; diff --git a/src/ResourceManagement/RecoveryServices/RecoveryServices.Tests/TestHelpers/TestUtilities.cs b/src/ResourceManagement/RecoveryServices/RecoveryServices.Tests/TestHelpers/TestUtilities.cs new file mode 100644 index 000000000000..3d1038aad731 --- /dev/null +++ b/src/ResourceManagement/RecoveryServices/RecoveryServices.Tests/TestHelpers/TestUtilities.cs @@ -0,0 +1,36 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +using System; +using Microsoft.Azure.Management.Resources; +using Microsoft.Rest.ClientRuntime.Azure.TestFramework; + +namespace Microsoft.Azure.Management.RecoveryServices.Tests +{ + public static class TestUtilities + { + public static string GenerateRandomKey(int size) + { + Random rand = new Random(); + var len = (int)size / 8; + byte[] key = new byte[len]; + for (int i = 0; i < len; i++) + { + key[i] = (byte)(rand.Next() % 128); + } + return Convert.ToBase64String(key); + } + } +} diff --git a/src/ResourceManagement/RecoveryServices/RecoveryServices.Tests/TestHelpers/VaultDefinition.cs b/src/ResourceManagement/RecoveryServices/RecoveryServices.Tests/TestHelpers/VaultDefinition.cs index 569a9d5ac912..a6f02c43685b 100644 --- a/src/ResourceManagement/RecoveryServices/RecoveryServices.Tests/TestHelpers/VaultDefinition.cs +++ b/src/ResourceManagement/RecoveryServices/RecoveryServices.Tests/TestHelpers/VaultDefinition.cs @@ -1,5 +1,17 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +// +// Copyright (c) Microsoft. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// namespace Microsoft.Azure.Management.RecoveryServices.Tests {