diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/AccountBackupsOperations.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/AccountBackupsOperations.cs index 4de7ca92a6ad..a9c1402857e9 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/AccountBackupsOperations.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/AccountBackupsOperations.cs @@ -83,7 +83,7 @@ internal AccountBackupsOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -232,7 +232,7 @@ internal AccountBackupsOperations(AzureNetAppFilesManagementClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -245,7 +245,7 @@ internal AccountBackupsOperations(AzureNetAppFilesManagementClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { @@ -268,7 +268,7 @@ internal AccountBackupsOperations(AzureNetAppFilesManagementClient client) /// Get Backup for a Netapp Account /// /// - /// Get Backup for a Netapp Account + /// Gets the specified backup for a Netapp Account /// /// /// The name of the resource group. @@ -491,7 +491,7 @@ internal AccountBackupsOperations(AzureNetAppFilesManagementClient client) /// Delete Backup for a Netapp Account /// /// - /// Delete Backup for a Netapp Account + /// Delete the specified Backup for a Netapp Account /// /// /// The name of the resource group. @@ -519,7 +519,7 @@ internal AccountBackupsOperations(AzureNetAppFilesManagementClient client) /// Delete Backup for a Netapp Account /// /// - /// Delete Backup for a Netapp Account + /// Delete the specified Backup for a Netapp Account /// /// /// The name of the resource group. diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/AccountBackupsOperationsExtensions.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/AccountBackupsOperationsExtensions.cs index 21f4f96ea810..65c8e2b93aaf 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/AccountBackupsOperationsExtensions.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/AccountBackupsOperationsExtensions.cs @@ -13,6 +13,8 @@ namespace Microsoft.Azure.Management.NetApp using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; + using System.Collections; + using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; @@ -36,7 +38,7 @@ public static partial class AccountBackupsOperationsExtensions /// /// The name of the NetApp account /// - public static BackupsList List(this IAccountBackupsOperations operations, string resourceGroupName, string accountName) + public static IEnumerable List(this IAccountBackupsOperations operations, string resourceGroupName, string accountName) { return operations.ListAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); } @@ -59,7 +61,7 @@ public static BackupsList List(this IAccountBackupsOperations operations, string /// /// The cancellation token. /// - public static async Task ListAsync(this IAccountBackupsOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this IAccountBackupsOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) { @@ -71,7 +73,7 @@ public static BackupsList List(this IAccountBackupsOperations operations, string /// Get Backup for a Netapp Account /// /// - /// Get Backup for a Netapp Account + /// Gets the specified backup for a Netapp Account /// /// /// The operations group for this extension method. @@ -94,7 +96,7 @@ public static Backup Get(this IAccountBackupsOperations operations, string resou /// Get Backup for a Netapp Account /// /// - /// Get Backup for a Netapp Account + /// Gets the specified backup for a Netapp Account /// /// /// The operations group for this extension method. @@ -123,7 +125,7 @@ public static Backup Get(this IAccountBackupsOperations operations, string resou /// Delete Backup for a Netapp Account /// /// - /// Delete Backup for a Netapp Account + /// Delete the specified Backup for a Netapp Account /// /// /// The operations group for this extension method. @@ -146,7 +148,7 @@ public static void Delete(this IAccountBackupsOperations operations, string reso /// Delete Backup for a Netapp Account /// /// - /// Delete Backup for a Netapp Account + /// Delete the specified Backup for a Netapp Account /// /// /// The operations group for this extension method. @@ -172,7 +174,7 @@ public static void Delete(this IAccountBackupsOperations operations, string reso /// Delete Backup for a Netapp Account /// /// - /// Delete Backup for a Netapp Account + /// Delete the specified Backup for a Netapp Account /// /// /// The operations group for this extension method. @@ -195,7 +197,7 @@ public static void BeginDelete(this IAccountBackupsOperations operations, string /// Delete Backup for a Netapp Account /// /// - /// Delete Backup for a Netapp Account + /// Delete the specified Backup for a Netapp Account /// /// /// The operations group for this extension method. diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/AzureNetAppFilesManagementClient.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/AzureNetAppFilesManagementClient.cs index cb6d5c64e104..2b930cbab271 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/AzureNetAppFilesManagementClient.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/AzureNetAppFilesManagementClient.cs @@ -112,20 +112,15 @@ public partial class AzureNetAppFilesManagementClient : ServiceClient - /// Gets the IVolumeBackupStatusOperations. + /// Gets the IBackupsOperations. /// - public virtual IVolumeBackupStatusOperations VolumeBackupStatus { get; private set; } + public virtual IBackupsOperations Backups { get; private set; } /// /// Gets the IAccountBackupsOperations. /// public virtual IAccountBackupsOperations AccountBackups { get; private set; } - /// - /// Gets the IBackupsOperations. - /// - public virtual IBackupsOperations Backups { get; private set; } - /// /// Gets the IBackupPoliciesOperations. /// @@ -384,13 +379,12 @@ private void Initialize() Volumes = new VolumesOperations(this); Snapshots = new SnapshotsOperations(this); SnapshotPolicies = new SnapshotPoliciesOperations(this); - VolumeBackupStatus = new VolumeBackupStatusOperations(this); - AccountBackups = new AccountBackupsOperations(this); Backups = new BackupsOperations(this); + AccountBackups = new AccountBackupsOperations(this); BackupPolicies = new BackupPoliciesOperations(this); Vaults = new VaultsOperations(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2020-12-01"; + ApiVersion = "2021-02-01"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/BackupPoliciesOperations.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/BackupPoliciesOperations.cs index b24200e5350e..eb3731fa00c2 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/BackupPoliciesOperations.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/BackupPoliciesOperations.cs @@ -537,6 +537,65 @@ internal BackupPoliciesOperations(AzureNetAppFilesManagementClient client) /// Backup policy object supplied in the body of the operation. /// /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupPolicyName, BackupPolicyPatch body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, accountName, backupPolicyName, body, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Delete a backup policy + /// + /// + /// Delete backup policy + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// Backup policy Name which uniquely identify backup policy. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, backupPolicyName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Create a backup policy + /// + /// + /// Create a backup policy for Netapp Account + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// Backup policy Name which uniquely identify backup policy. + /// + /// + /// Backup policy object supplied in the body of the operation. + /// + /// /// Headers that will be added to request. /// /// @@ -557,7 +616,7 @@ internal BackupPoliciesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupPolicyName, BackupPolicyPatch body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupPolicyName, BackupPolicy body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -598,6 +657,10 @@ internal BackupPoliciesOperations(AzureNetAppFilesManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "body"); } + if (body != null) + { + body.Validate(); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -610,7 +673,7 @@ internal BackupPoliciesOperations(AzureNetAppFilesManagementClient client) tracingParameters.Add("backupPolicyName", backupPolicyName); tracingParameters.Add("body", body); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -631,7 +694,7 @@ internal BackupPoliciesOperations(AzureNetAppFilesManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -688,7 +751,7 @@ internal BackupPoliciesOperations(AzureNetAppFilesManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -749,7 +812,7 @@ internal BackupPoliciesOperations(AzureNetAppFilesManagementClient client) } } // Deserialize Response - if ((int)_statusCode == 202) + if ((int)_statusCode == 201) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try @@ -774,38 +837,10 @@ internal BackupPoliciesOperations(AzureNetAppFilesManagementClient client) } /// - /// Delete a backup policy - /// - /// - /// Delete backup policy - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the NetApp account - /// - /// - /// Backup policy Name which uniquely identify backup policy. - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupPolicyName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, backupPolicyName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - - /// - /// Create a backup policy + /// Patch a backup policy /// /// - /// Create a backup policy for Netapp Account + /// Patch a backup policy for Netapp Account /// /// /// The name of the resource group. @@ -840,7 +875,7 @@ internal BackupPoliciesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupPolicyName, BackupPolicy body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupPolicyName, BackupPolicyPatch body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -881,10 +916,6 @@ internal BackupPoliciesOperations(AzureNetAppFilesManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "body"); } - if (body != null) - { - body.Validate(); - } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -897,7 +928,7 @@ internal BackupPoliciesOperations(AzureNetAppFilesManagementClient client) tracingParameters.Add("backupPolicyName", backupPolicyName); tracingParameters.Add("body", body); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -918,7 +949,7 @@ internal BackupPoliciesOperations(AzureNetAppFilesManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -975,7 +1006,7 @@ internal BackupPoliciesOperations(AzureNetAppFilesManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1036,7 +1067,7 @@ internal BackupPoliciesOperations(AzureNetAppFilesManagementClient client) } } // Deserialize Response - if ((int)_statusCode == 201) + if ((int)_statusCode == 202) { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/BackupPoliciesOperationsExtensions.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/BackupPoliciesOperationsExtensions.cs index 1b44800f0631..ef0616e485b3 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/BackupPoliciesOperationsExtensions.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/BackupPoliciesOperationsExtensions.cs @@ -344,6 +344,64 @@ public static BackupPolicy BeginCreate(this IBackupPoliciesOperations operations } } + /// + /// Patch a backup policy + /// + /// + /// Patch a backup policy for Netapp Account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// Backup policy Name which uniquely identify backup policy. + /// + /// + /// Backup policy object supplied in the body of the operation. + /// + public static BackupPolicy BeginUpdate(this IBackupPoliciesOperations operations, string resourceGroupName, string accountName, string backupPolicyName, BackupPolicyPatch body) + { + return operations.BeginUpdateAsync(resourceGroupName, accountName, backupPolicyName, body).GetAwaiter().GetResult(); + } + + /// + /// Patch a backup policy + /// + /// + /// Patch a backup policy for Netapp Account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// Backup policy Name which uniquely identify backup policy. + /// + /// + /// Backup policy object supplied in the body of the operation. + /// + /// + /// The cancellation token. + /// + public static async Task BeginUpdateAsync(this IBackupPoliciesOperations operations, string resourceGroupName, string accountName, string backupPolicyName, BackupPolicyPatch body, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, accountName, backupPolicyName, body, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Delete a backup policy /// diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/BackupsOperations.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/BackupsOperations.cs index 54d2c3b10922..e64c96c42d7e 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/BackupsOperations.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/BackupsOperations.cs @@ -50,6 +50,268 @@ internal BackupsOperations(AzureNetAppFilesManagementClient client) /// public AzureNetAppFilesManagementClient Client { get; private set; } + /// + /// Get volume's backup status + /// + /// + /// Get the status of the backup for a volume + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// 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> GetStatusWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, 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 (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (poolName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); + } + if (poolName != null) + { + if (poolName.Length > 64) + { + throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); + } + if (poolName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "poolName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) + { + throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); + } + } + if (volumeName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "volumeName"); + } + if (volumeName != null) + { + if (volumeName.Length > 64) + { + throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64); + } + if (volumeName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "volumeName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(volumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) + { + throw new ValidationException(ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); + } + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("poolName", poolName); + tracingParameters.Add("volumeName", volumeName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "GetStatus", 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.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backupStatus").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); + _url = _url.Replace("{volumeName}", System.Uri.EscapeDataString(volumeName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + /// /// List Backups /// @@ -316,7 +578,7 @@ internal BackupsOperations(AzureNetAppFilesManagementClient client) /// Get a backup /// /// - /// Get a particular backup of the volume + /// Gets the specified backup of the volume /// /// /// The name of the resource group. diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/BackupsOperationsExtensions.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/BackupsOperationsExtensions.cs index f49b818e98e6..418f778c9b03 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/BackupsOperationsExtensions.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/BackupsOperationsExtensions.cs @@ -23,6 +23,64 @@ namespace Microsoft.Azure.Management.NetApp /// public static partial class BackupsOperationsExtensions { + /// + /// Get volume's backup status + /// + /// + /// Get the status of the backup for a volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + public static BackupStatus GetStatus(this IBackupsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) + { + return operations.GetStatusAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); + } + + /// + /// Get volume's backup status + /// + /// + /// Get the status of the backup for a volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The cancellation token. + /// + public static async Task GetStatusAsync(this IBackupsOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetStatusWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// List Backups /// @@ -85,7 +143,7 @@ public static IEnumerable List(this IBackupsOperations operations, strin /// Get a backup /// /// - /// Get a particular backup of the volume + /// Gets the specified backup of the volume /// /// /// The operations group for this extension method. @@ -114,7 +172,7 @@ public static Backup Get(this IBackupsOperations operations, string resourceGrou /// Get a backup /// /// - /// Get a particular backup of the volume + /// Gets the specified backup of the volume /// /// /// The operations group for this extension method. diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IAccountBackupsOperations.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IAccountBackupsOperations.cs index e0cd67339e77..01a215429295 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IAccountBackupsOperations.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IAccountBackupsOperations.cs @@ -50,12 +50,12 @@ public partial interface IAccountBackupsOperations /// /// Thrown when a required parameter is null /// - Task> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Get Backup for a Netapp Account /// /// - /// Get Backup for a Netapp Account + /// Gets the specified backup for a Netapp Account /// /// /// The name of the resource group. @@ -86,7 +86,7 @@ public partial interface IAccountBackupsOperations /// Delete Backup for a Netapp Account /// /// - /// Delete Backup for a Netapp Account + /// Delete the specified Backup for a Netapp Account /// /// /// The name of the resource group. @@ -114,7 +114,7 @@ public partial interface IAccountBackupsOperations /// Delete Backup for a Netapp Account /// /// - /// Delete Backup for a Netapp Account + /// Delete the specified Backup for a Netapp Account /// /// /// The name of the resource group. diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IAzureNetAppFilesManagementClient.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IAzureNetAppFilesManagementClient.cs index 0b969e155b2c..52afe2b6017c 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IAzureNetAppFilesManagementClient.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IAzureNetAppFilesManagementClient.cs @@ -107,20 +107,15 @@ public partial interface IAzureNetAppFilesManagementClient : System.IDisposable ISnapshotPoliciesOperations SnapshotPolicies { get; } /// - /// Gets the IVolumeBackupStatusOperations. + /// Gets the IBackupsOperations. /// - IVolumeBackupStatusOperations VolumeBackupStatus { get; } + IBackupsOperations Backups { get; } /// /// Gets the IAccountBackupsOperations. /// IAccountBackupsOperations AccountBackups { get; } - /// - /// Gets the IBackupsOperations. - /// - IBackupsOperations Backups { get; } - /// /// Gets the IBackupPoliciesOperations. /// diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IBackupPoliciesOperations.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IBackupPoliciesOperations.cs index d299f191a28b..81e124e02b99 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IBackupPoliciesOperations.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IBackupPoliciesOperations.cs @@ -213,6 +213,40 @@ public partial interface IBackupPoliciesOperations /// Task> BeginCreateWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupPolicyName, BackupPolicy body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Patch a backup policy + /// + /// + /// Patch a backup policy for Netapp Account + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// Backup policy Name which uniquely identify backup policy. + /// + /// + /// Backup policy object supplied in the body of the 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> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string accountName, string backupPolicyName, BackupPolicyPatch body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Delete a backup policy /// /// diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IBackupsOperations.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IBackupsOperations.cs index 5a5d0a8aa932..826a6e6d7d76 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IBackupsOperations.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IBackupsOperations.cs @@ -23,6 +23,40 @@ namespace Microsoft.Azure.Management.NetApp /// public partial interface IBackupsOperations { + /// + /// Get volume's backup status + /// + /// + /// Get the status of the backup for a volume + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// 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> GetStatusWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// List Backups /// @@ -61,7 +95,7 @@ public partial interface IBackupsOperations /// Get a backup /// /// - /// Get a particular backup of the volume + /// Gets the specified backup of the volume /// /// /// The name of the resource group. diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IVolumeBackupStatusOperations.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IVolumeBackupStatusOperations.cs deleted file mode 100644 index 895dc9c13630..000000000000 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IVolumeBackupStatusOperations.cs +++ /dev/null @@ -1,61 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.NetApp -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// VolumeBackupStatusOperations operations. - /// - public partial interface IVolumeBackupStatusOperations - { - /// - /// Get volume's backup status - /// - /// - /// Get the status of the backup for a volume - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// 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 accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Backup.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Backup.cs index 70f038c56cf1..d49239bb6db3 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Backup.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Backup.cs @@ -42,10 +42,13 @@ public Backup() /// Azure lifecycle management /// Size of backup /// Label for backup - /// Type of backup adhoc or scheduled + /// backupType /// Failure reason /// Volume name - public Backup(string location, string id = default(string), string name = default(string), string type = default(string), string backupId = default(string), System.DateTime? creationDate = default(System.DateTime?), string provisioningState = default(string), long? size = default(long?), string label = default(string), string backupType = default(string), string failureReason = default(string), string volumeName = default(string)) + /// Manual backup an already existing + /// snapshot. This will always be false for scheduled backups and + /// true/false for manual backups + public Backup(string location, string id = default(string), string name = default(string), string type = default(string), string backupId = default(string), System.DateTime? creationDate = default(System.DateTime?), string provisioningState = default(string), long? size = default(long?), string label = default(string), string backupType = default(string), string failureReason = default(string), string volumeName = default(string), bool? useExistingSnapshot = default(bool?)) { Location = location; Id = id; @@ -59,6 +62,7 @@ public Backup() BackupType = backupType; FailureReason = failureReason; VolumeName = volumeName; + UseExistingSnapshot = useExistingSnapshot; CustomInit(); } @@ -128,8 +132,12 @@ public Backup() public string Label { get; set; } /// - /// Gets type of backup adhoc or scheduled + /// Gets backupType /// + /// + /// Type of backup Manual or Scheduled. Possible values include: + /// 'Manual', 'Scheduled' + /// [JsonProperty(PropertyName = "properties.backupType")] public string BackupType { get; private set; } @@ -145,6 +153,14 @@ public Backup() [JsonProperty(PropertyName = "properties.volumeName")] public string VolumeName { get; private set; } + /// + /// Gets or sets manual backup an already existing snapshot. This will + /// always be false for scheduled backups and true/false for manual + /// backups + /// + [JsonProperty(PropertyName = "properties.useExistingSnapshot")] + public bool? UseExistingSnapshot { get; set; } + /// /// Validate the object. /// diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/BackupPatch.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/BackupPatch.cs index 7c18d7b5e5dc..79354559e943 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/BackupPatch.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/BackupPatch.cs @@ -41,10 +41,13 @@ public BackupPatch() /// Azure lifecycle management /// Size of backup /// Label for backup - /// Type of backup adhoc or scheduled + /// backupType /// Failure reason /// Volume name - public BackupPatch(IDictionary tags = default(IDictionary), string backupId = default(string), System.DateTime? creationDate = default(System.DateTime?), string provisioningState = default(string), long? size = default(long?), string label = default(string), string backupType = default(string), string failureReason = default(string), string volumeName = default(string)) + /// Manual backup an already existing + /// snapshot. This will always be false for scheduled backups and + /// true/false for manual backups + public BackupPatch(IDictionary tags = default(IDictionary), string backupId = default(string), System.DateTime? creationDate = default(System.DateTime?), string provisioningState = default(string), long? size = default(long?), string label = default(string), string backupType = default(string), string failureReason = default(string), string volumeName = default(string), bool? useExistingSnapshot = default(bool?)) { Tags = tags; BackupId = backupId; @@ -55,6 +58,7 @@ public BackupPatch() BackupType = backupType; FailureReason = failureReason; VolumeName = volumeName; + UseExistingSnapshot = useExistingSnapshot; CustomInit(); } @@ -106,8 +110,12 @@ public BackupPatch() public string Label { get; set; } /// - /// Gets type of backup adhoc or scheduled + /// Gets backupType /// + /// + /// Type of backup Manual or Scheduled. Possible values include: + /// 'Manual', 'Scheduled' + /// [JsonProperty(PropertyName = "properties.backupType")] public string BackupType { get; private set; } @@ -123,6 +131,14 @@ public BackupPatch() [JsonProperty(PropertyName = "properties.volumeName")] public string VolumeName { get; private set; } + /// + /// Gets or sets manual backup an already existing snapshot. This will + /// always be false for scheduled backups and true/false for manual + /// backups + /// + [JsonProperty(PropertyName = "properties.useExistingSnapshot")] + public bool? UseExistingSnapshot { get; set; } + /// /// Validate the object. /// diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/BackupType.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/BackupType.cs new file mode 100644 index 000000000000..80f6c2483262 --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/BackupType.cs @@ -0,0 +1,28 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.NetApp.Models +{ + + /// + /// Defines values for BackupType. + /// + public static class BackupType + { + /// + /// Manual backup + /// + public const string Manual = "Manual"; + /// + /// Scheduled backup + /// + public const string Scheduled = "Scheduled"; + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/BackupsList.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/BackupsList.cs deleted file mode 100644 index fa61eb952215..000000000000 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/BackupsList.cs +++ /dev/null @@ -1,53 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.NetApp.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// List of Backups - /// - public partial class BackupsList - { - /// - /// Initializes a new instance of the BackupsList class. - /// - public BackupsList() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the BackupsList class. - /// - /// A list of Backups - public BackupsList(IList value = default(IList)) - { - Value = value; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets a list of Backups - /// - [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } - - } -} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/CapacityPoolPatch.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/CapacityPoolPatch.cs index b4113f746648..a1824484d4bf 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/CapacityPoolPatch.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/CapacityPoolPatch.cs @@ -116,16 +116,13 @@ public CapacityPoolPatch() /// public virtual void Validate() { - if (Size != null) + if (Size > 549755813888000) { - if (Size > 549755813888000) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Size", 549755813888000); - } - if (Size < 4398046511104) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Size", 4398046511104); - } + throw new ValidationException(ValidationRules.InclusiveMaximum, "Size", 549755813888000); + } + if (Size < 4398046511104) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "Size", 4398046511104); } } } diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ResourceIdentity.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ResourceIdentity.cs index b16af017af25..cc4df6e13c3f 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ResourceIdentity.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ResourceIdentity.cs @@ -13,6 +13,9 @@ namespace Microsoft.Azure.Management.NetApp.Models using Newtonsoft.Json; using System.Linq; + /// + /// Identity for the resource. + /// public partial class ResourceIdentity { /// diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Volume.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Volume.cs index c6da8ffc3b43..8920e257c3d5 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Volume.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Volume.cs @@ -197,7 +197,7 @@ public Volume() /// Gets or sets protocolTypes /// /// - /// Set of protocol types, default NFSv3, CIFS fro SMB protocol + /// Set of protocol types, default NFSv3, CIFS for SMB protocol /// [JsonProperty(PropertyName = "properties.protocolTypes")] public IList ProtocolTypes { get; set; } @@ -434,16 +434,13 @@ public virtual void Validate() { DataProtection.Validate(); } - if (ThroughputMibps != null) + if (ThroughputMibps > 4500) { - if (ThroughputMibps > 4500) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "ThroughputMibps", 4500); - } - if (ThroughputMibps < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "ThroughputMibps", 0); - } + throw new ValidationException(ValidationRules.InclusiveMaximum, "ThroughputMibps", 4500); + } + if (ThroughputMibps < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "ThroughputMibps", 0); } } } diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumePatch.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumePatch.cs index 70212c81a0b9..a0d20540c890 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumePatch.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumePatch.cs @@ -151,27 +151,21 @@ public VolumePatch() /// public virtual void Validate() { - if (UsageThreshold != null) + if (UsageThreshold > 109951162777600) { - if (UsageThreshold > 109951162777600) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "UsageThreshold", 109951162777600); - } - if (UsageThreshold < 107374182400) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "UsageThreshold", 107374182400); - } + throw new ValidationException(ValidationRules.InclusiveMaximum, "UsageThreshold", 109951162777600); } - if (ThroughputMibps != null) + if (UsageThreshold < 107374182400) { - if (ThroughputMibps > 4500) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "ThroughputMibps", 4500); - } - if (ThroughputMibps < 1) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "ThroughputMibps", 1); - } + throw new ValidationException(ValidationRules.InclusiveMinimum, "UsageThreshold", 107374182400); + } + if (ThroughputMibps > 4500) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "ThroughputMibps", 4500); + } + if (ThroughputMibps < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "ThroughputMibps", 1); } } } diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumePatchPropertiesDataProtection.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumePatchPropertiesDataProtection.cs index 83cca230f4f2..29b3dd50f1da 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumePatchPropertiesDataProtection.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumePatchPropertiesDataProtection.cs @@ -36,9 +36,11 @@ public VolumePatchPropertiesDataProtection() /// VolumePatchPropertiesDataProtection class. /// /// Backup - public VolumePatchPropertiesDataProtection(VolumeBackupProperties backup = default(VolumeBackupProperties)) + /// Snapshot + public VolumePatchPropertiesDataProtection(VolumeBackupProperties backup = default(VolumeBackupProperties), VolumeSnapshotProperties snapshot = default(VolumeSnapshotProperties)) { Backup = backup; + Snapshot = snapshot; CustomInit(); } @@ -56,5 +58,14 @@ public VolumePatchPropertiesDataProtection() [JsonProperty(PropertyName = "backup")] public VolumeBackupProperties Backup { get; set; } + /// + /// Gets or sets snapshot + /// + /// + /// Snapshot properties. + /// + [JsonProperty(PropertyName = "snapshot")] + public VolumeSnapshotProperties Snapshot { get; set; } + } } diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/SdkInfo_NetAppManagementClient.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/SdkInfo_NetAppManagementClient.cs index 9c5fd4682bd1..2b893aaeed22 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/SdkInfo_NetAppManagementClient.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/SdkInfo_NetAppManagementClient.cs @@ -19,31 +19,19 @@ public static IEnumerable> ApiInfo_NetAppManagemen { return new Tuple[] { - new Tuple("NetApp", "AccountBackups", "2020-12-01"), - new Tuple("NetApp", "Accounts", "2020-12-01"), - new Tuple("NetApp", "BackupPolicies", "2020-12-01"), - new Tuple("NetApp", "Backups", "2020-12-01"), - new Tuple("NetApp", "NetAppResource", "2020-12-01"), - new Tuple("NetApp", "Operations", "2020-12-01"), - new Tuple("NetApp", "Pools", "2020-12-01"), - new Tuple("NetApp", "SnapshotPolicies", "2020-12-01"), - new Tuple("NetApp", "Snapshots", "2020-12-01"), - new Tuple("NetApp", "Vaults", "2020-12-01"), - new Tuple("NetApp", "VolumeBackupStatus", "2020-12-01"), - new Tuple("NetApp", "Volumes", "2020-12-01"), + new Tuple("NetApp", "AccountBackups", "2021-02-01"), + new Tuple("NetApp", "Accounts", "2021-02-01"), + new Tuple("NetApp", "BackupPolicies", "2021-02-01"), + new Tuple("NetApp", "Backups", "2021-02-01"), + new Tuple("NetApp", "NetAppResource", "2021-02-01"), + new Tuple("NetApp", "Operations", "2021-02-01"), + new Tuple("NetApp", "Pools", "2021-02-01"), + new Tuple("NetApp", "SnapshotPolicies", "2021-02-01"), + new Tuple("NetApp", "Snapshots", "2021-02-01"), + new Tuple("NetApp", "Vaults", "2021-02-01"), + new Tuple("NetApp", "Volumes", "2021-02-01"), }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "v2"; - public static readonly String AutoRestBootStrapperVersion = "autorest@1.9.1"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/netapp/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --use:@microsoft.azure/autorest.csharp@2.3.90 --csharp-sdks-folder=C:\\Users\\audunn\\Source\\repos\\azure\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "a2b6c113528f50d9be6b3e7c4d695a8a971b05b8"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/VolumeBackupStatusOperations.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/VolumeBackupStatusOperations.cs deleted file mode 100644 index d1c9fb1f459a..000000000000 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/VolumeBackupStatusOperations.cs +++ /dev/null @@ -1,316 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.NetApp -{ - 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; - - /// - /// VolumeBackupStatusOperations operations. - /// - internal partial class VolumeBackupStatusOperations : IServiceOperations, IVolumeBackupStatusOperations - { - /// - /// Initializes a new instance of the VolumeBackupStatusOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal VolumeBackupStatusOperations(AzureNetAppFilesManagementClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the AzureNetAppFilesManagementClient - /// - public AzureNetAppFilesManagementClient Client { get; private set; } - - /// - /// Get volume's backup status - /// - /// - /// Get the status of the backup for a volume - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// 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 accountName, string poolName, string volumeName, 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 (resourceGroupName != null) - { - if (resourceGroupName.Length > 90) - { - throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); - } - if (resourceGroupName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) - { - throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); - } - } - if (accountName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); - } - if (poolName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "poolName"); - } - if (poolName != null) - { - if (poolName.Length > 64) - { - throw new ValidationException(ValidationRules.MaxLength, "poolName", 64); - } - if (poolName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "poolName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(poolName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) - { - throw new ValidationException(ValidationRules.Pattern, "poolName", "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$"); - } - } - if (volumeName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "volumeName"); - } - if (volumeName != null) - { - if (volumeName.Length > 64) - { - throw new ValidationException(ValidationRules.MaxLength, "volumeName", 64); - } - if (volumeName.Length < 1) - { - throw new ValidationException(ValidationRules.MinLength, "volumeName", 1); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(volumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) - { - throw new ValidationException(ValidationRules.Pattern, "volumeName", "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$"); - } - } - if (Client.ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("accountName", accountName); - tracingParameters.Add("poolName", poolName); - tracingParameters.Add("volumeName", volumeName); - 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.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/backupStatus").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); - _url = _url.Replace("{poolName}", System.Uri.EscapeDataString(poolName)); - _url = _url.Replace("{volumeName}", System.Uri.EscapeDataString(volumeName)); - List _queryParameters = new List(); - if (Client.ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (Client.AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Client.Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - } -} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/VolumeBackupStatusOperationsExtensions.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/VolumeBackupStatusOperationsExtensions.cs deleted file mode 100644 index e4407b886382..000000000000 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/VolumeBackupStatusOperationsExtensions.cs +++ /dev/null @@ -1,83 +0,0 @@ -// -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for -// license information. -// -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. -// - -namespace Microsoft.Azure.Management.NetApp -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for VolumeBackupStatusOperations. - /// - public static partial class VolumeBackupStatusOperationsExtensions - { - /// - /// Get volume's backup status - /// - /// - /// Get the status of the backup for a volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - public static BackupStatus Get(this IVolumeBackupStatusOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) - { - return operations.GetAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); - } - - /// - /// Get volume's backup status - /// - /// - /// Get the status of the backup for a volume - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IVolumeBackupStatusOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -}