diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/AccountsOperations.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/AccountsOperations.cs index 7e8ed09b5215..0dcfe8e0dba5 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/AccountsOperations.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/AccountsOperations.cs @@ -752,6 +752,33 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client) return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } + /// + /// Renew identity credentials + /// + /// + /// Renew identity credentials that are used to authenticate to key vault, for + /// customer-managed key encryption. If encryption.identity.principalId does + /// not match identity.principalId, running this operation will fix it. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task RenewCredentialsWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginRenewCredentialsWithHttpMessagesAsync(resourceGroupName, accountName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + /// /// Create or update a NetApp account /// @@ -1462,6 +1489,208 @@ internal AccountsOperations(AzureNetAppFilesManagementClient client) return _result; } + /// + /// Renew identity credentials + /// + /// + /// Renew identity credentials that are used to authenticate to key vault, for + /// customer-managed key encryption. If encryption.identity.principalId does + /// not match identity.principalId, running this operation will fix it. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// 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 BeginRenewCredentialsWithHttpMessagesAsync(string resourceGroupName, string accountName, 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 (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // 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("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginRenewCredentials", 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}/renewCredentials").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)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + /// /// Describe all NetApp Accounts in a subscription /// diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/AccountsOperationsExtensions.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/AccountsOperationsExtensions.cs index 94317ddb2efb..c24b82af7f3f 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/AccountsOperationsExtensions.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/AccountsOperationsExtensions.cs @@ -288,6 +288,53 @@ public static NetAppAccount Update(this IAccountsOperations operations, NetAppAc } } + /// + /// Renew identity credentials + /// + /// + /// Renew identity credentials that are used to authenticate to key vault, for + /// customer-managed key encryption. If encryption.identity.principalId does + /// not match identity.principalId, running this operation will fix it. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + public static void RenewCredentials(this IAccountsOperations operations, string resourceGroupName, string accountName) + { + operations.RenewCredentialsAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } + + /// + /// Renew identity credentials + /// + /// + /// Renew identity credentials that are used to authenticate to key vault, for + /// customer-managed key encryption. If encryption.identity.principalId does + /// not match identity.principalId, running this operation will fix it. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The cancellation token. + /// + public static async Task RenewCredentialsAsync(this IAccountsOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.RenewCredentialsWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// /// Create or update a NetApp account /// @@ -435,6 +482,53 @@ public static NetAppAccount BeginUpdate(this IAccountsOperations operations, Net } } + /// + /// Renew identity credentials + /// + /// + /// Renew identity credentials that are used to authenticate to key vault, for + /// customer-managed key encryption. If encryption.identity.principalId does + /// not match identity.principalId, running this operation will fix it. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + public static void BeginRenewCredentials(this IAccountsOperations operations, string resourceGroupName, string accountName) + { + operations.BeginRenewCredentialsAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } + + /// + /// Renew identity credentials + /// + /// + /// Renew identity credentials that are used to authenticate to key vault, for + /// customer-managed key encryption. If encryption.identity.principalId does + /// not match identity.principalId, running this operation will fix it. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The cancellation token. + /// + public static async Task BeginRenewCredentialsAsync(this IAccountsOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginRenewCredentialsWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// /// Describe all NetApp Accounts in a subscription /// 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 255ee670336e..8e4de039be3a 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/AzureNetAppFilesManagementClient.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/AzureNetAppFilesManagementClient.cs @@ -131,6 +131,11 @@ public partial class AzureNetAppFilesManagementClient : ServiceClient public virtual IBackupPoliciesOperations BackupPolicies { get; private set; } + /// + /// Gets the IVolumeQuotaRulesOperations. + /// + public virtual IVolumeQuotaRulesOperations VolumeQuotaRules { get; private set; } + /// /// Gets the IVaultsOperations. /// @@ -398,11 +403,12 @@ private void Initialize() Backups = new BackupsOperations(this); AccountBackups = new AccountBackupsOperations(this); BackupPolicies = new BackupPoliciesOperations(this); + VolumeQuotaRules = new VolumeQuotaRulesOperations(this); Vaults = new VaultsOperations(this); VolumeGroups = new VolumeGroupsOperations(this); Subvolumes = new SubvolumesOperations(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2021-10-01"; + ApiVersion = "2022-05-01"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IAccountsOperations.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IAccountsOperations.cs index e7c467ee81dc..db158ee440a4 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IAccountsOperations.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IAccountsOperations.cs @@ -187,6 +187,34 @@ public partial interface IAccountsOperations /// Task> UpdateWithHttpMessagesAsync(NetAppAccountPatch body, string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Renew identity credentials + /// + /// + /// Renew identity credentials that are used to authenticate to key + /// vault, for customer-managed key encryption. If + /// encryption.identity.principalId does not match + /// identity.principalId, running this operation will fix it. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// 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 RenewCredentialsWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Create or update a NetApp account /// /// @@ -275,6 +303,34 @@ public partial interface IAccountsOperations /// Task> BeginUpdateWithHttpMessagesAsync(NetAppAccountPatch body, string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Renew identity credentials + /// + /// + /// Renew identity credentials that are used to authenticate to key + /// vault, for customer-managed key encryption. If + /// encryption.identity.principalId does not match + /// identity.principalId, running this operation will fix it. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// 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 BeginRenewCredentialsWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Describe all NetApp Accounts in a subscription /// /// 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 b785b45f3494..282de7671eb4 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IAzureNetAppFilesManagementClient.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IAzureNetAppFilesManagementClient.cs @@ -126,6 +126,11 @@ public partial interface IAzureNetAppFilesManagementClient : System.IDisposable /// IBackupPoliciesOperations BackupPolicies { get; } + /// + /// Gets the IVolumeQuotaRulesOperations. + /// + IVolumeQuotaRulesOperations VolumeQuotaRules { get; } + /// /// Gets the IVaultsOperations. /// diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/INetAppResourceOperations.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/INetAppResourceOperations.cs index 3b526ee9a1c9..635c4b33b730 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/INetAppResourceOperations.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/INetAppResourceOperations.cs @@ -131,5 +131,31 @@ public partial interface INetAppResourceOperations /// Thrown when a required parameter is null /// Task> CheckQuotaAvailabilityWithHttpMessagesAsync(string location, string name, string type, string resourceGroup, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Describes region specific information. + /// + /// + /// Provides storage to network proximity and logical zone mapping + /// information. + /// + /// + /// The location + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> QueryRegionInfoWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IVolumeQuotaRulesOperations.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IVolumeQuotaRulesOperations.cs new file mode 100644 index 000000000000..cce25a51b6b3 --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IVolumeQuotaRulesOperations.cs @@ -0,0 +1,326 @@ +// +// 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; + + /// + /// VolumeQuotaRulesOperations operations. + /// + public partial interface IVolumeQuotaRulesOperations + { + /// + /// Get all quota rules for a volume + /// + /// + /// List all quota rules associated with the 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>> ListByVolumeWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Describe a quota rule + /// + /// + /// Get details of the specified quota rule + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of volume quota rule + /// + /// + /// 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, string volumeQuotaRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create a quota rule + /// + /// + /// Create the specified quota rule within the given volume + /// + /// + /// Quota rule object supplied in the body of the operation. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of volume quota rule + /// + /// + /// 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(VolumeQuotaRule body, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update a quota rule + /// + /// + /// Patch a quota rule + /// + /// + /// Quota rule object supplied in the body of the operation. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of volume quota rule + /// + /// + /// 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(VolumeQuotaRulePatch body, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete a quota rule + /// + /// + /// Delete quota rule + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of volume quota rule + /// + /// + /// 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 accountName, string poolName, string volumeName, string volumeQuotaRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create a quota rule + /// + /// + /// Create the specified quota rule within the given volume + /// + /// + /// Quota rule object supplied in the body of the operation. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of volume quota rule + /// + /// + /// 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> BeginCreateWithHttpMessagesAsync(VolumeQuotaRule body, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update a quota rule + /// + /// + /// Patch a quota rule + /// + /// + /// Quota rule object supplied in the body of the operation. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of volume quota rule + /// + /// + /// 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(VolumeQuotaRulePatch body, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete a quota rule + /// + /// + /// Delete quota rule + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of volume quota rule + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IVolumesOperations.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IVolumesOperations.cs index b824ac54833e..c5d30e4b6a74 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IVolumesOperations.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IVolumesOperations.cs @@ -233,6 +233,37 @@ public partial interface IVolumesOperations /// Task RevertWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, VolumeRevert body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Reset cifs password + /// + /// + /// Reset cifs password from 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 a required parameter is null + /// + Task ResetCifsPasswordWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Break volume replication /// /// @@ -267,6 +298,41 @@ public partial interface IVolumesOperations /// Task BreakReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, BreakReplicationRequest body = default(BreakReplicationRequest), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Re-establish volume replication + /// + /// + /// Re-establish a previously deleted replication between 2 volumes + /// that have a common ad-hoc or policy-based snapshots + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// body for the id of the source volume. + /// + /// + /// 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 ReestablishReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, ReestablishReplicationRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Get volume replication status /// /// @@ -301,6 +367,40 @@ public partial interface IVolumesOperations /// Task> ReplicationStatusMethodWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// List replications for volume + /// + /// + /// List all replications for a specified 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>> ListReplicationsMethodWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Resync volume replication /// /// @@ -465,6 +565,104 @@ public partial interface IVolumesOperations /// Task PoolChangeWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, PoolChangeRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Relocate volume + /// + /// + /// Relocates volume to a new stamp + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// Relocate volume request + /// + /// + /// 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 RelocateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, RelocateVolumeRequest body = default(RelocateVolumeRequest), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Finalize volume relocation + /// + /// + /// Finalizes the relocation of the volume and cleans up the old + /// 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 a required parameter is null + /// + Task FinalizeRelocationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Revert volume relocation + /// + /// + /// Reverts the volume relocation process, cleans up the new volume and + /// starts using the former-existing 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 a required parameter is null + /// + Task RevertRelocationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Create or Update a volume /// /// @@ -609,6 +807,37 @@ public partial interface IVolumesOperations /// Task BeginRevertWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, VolumeRevert body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Reset cifs password + /// + /// + /// Reset cifs password from 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 a required parameter is null + /// + Task BeginResetCifsPasswordWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Break volume replication /// /// @@ -643,6 +872,41 @@ public partial interface IVolumesOperations /// Task BeginBreakReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, BreakReplicationRequest body = default(BreakReplicationRequest), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Re-establish volume replication + /// + /// + /// Re-establish a previously deleted replication between 2 volumes + /// that have a common ad-hoc or policy-based snapshots + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// body for the id of the source volume. + /// + /// + /// 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 BeginReestablishReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, ReestablishReplicationRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Resync volume replication /// /// @@ -807,6 +1071,104 @@ public partial interface IVolumesOperations /// Task BeginPoolChangeWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, PoolChangeRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Relocate volume + /// + /// + /// Relocates volume to a new stamp + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// Relocate volume request + /// + /// + /// 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 BeginRelocateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, RelocateVolumeRequest body = default(RelocateVolumeRequest), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Finalize volume relocation + /// + /// + /// Finalizes the relocation of the volume and cleans up the old + /// 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 a required parameter is null + /// + Task BeginFinalizeRelocationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Revert volume relocation + /// + /// + /// Reverts the volume relocation process, cleans up the new volume and + /// starts using the former-existing 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 a required parameter is null + /// + Task BeginRevertRelocationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Describe all volumes /// /// diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/AccountEncryption.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/AccountEncryption.cs index b3fb76c804ba..279a50ec462c 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/AccountEncryption.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/AccountEncryption.cs @@ -29,11 +29,19 @@ public AccountEncryption() /// /// Initializes a new instance of the AccountEncryption class. /// - /// Encryption Key Source. Possible values are: - /// 'Microsoft.NetApp'. - public AccountEncryption(string keySource = default(string)) + /// The encryption keySource (provider). + /// Possible values (case-insensitive): Microsoft.NetApp, + /// Microsoft.KeyVault. Possible values include: 'Microsoft.NetApp', + /// 'Microsoft.KeyVault' + /// Properties provided by KeVault. + /// Applicable if keySource is 'Microsoft.KeyVault'. + /// Identity used to authenticate to KeyVault. + /// Applicable if keySource is 'Microsoft.KeyVault'. + public AccountEncryption(string keySource = default(string), KeyVaultProperties keyVaultProperties = default(KeyVaultProperties), EncryptionIdentity identity = default(EncryptionIdentity)) { KeySource = keySource; + KeyVaultProperties = keyVaultProperties; + Identity = identity; CustomInit(); } @@ -43,11 +51,39 @@ public AccountEncryption() partial void CustomInit(); /// - /// Gets or sets encryption Key Source. Possible values are: - /// 'Microsoft.NetApp'. + /// Gets or sets the encryption keySource (provider). Possible values + /// (case-insensitive): Microsoft.NetApp, Microsoft.KeyVault. Possible + /// values include: 'Microsoft.NetApp', 'Microsoft.KeyVault' /// [JsonProperty(PropertyName = "keySource")] public string KeySource { get; set; } + /// + /// Gets or sets properties provided by KeVault. Applicable if + /// keySource is 'Microsoft.KeyVault'. + /// + [JsonProperty(PropertyName = "keyVaultProperties")] + public KeyVaultProperties KeyVaultProperties { get; set; } + + /// + /// Gets or sets identity used to authenticate to KeyVault. Applicable + /// if keySource is 'Microsoft.KeyVault'. + /// + [JsonProperty(PropertyName = "identity")] + public EncryptionIdentity Identity { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (KeyVaultProperties != null) + { + KeyVaultProperties.Validate(); + } + } } } diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/AzureEntityResource.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/AzureEntityResource.cs index b58bedc7951b..a5d7fc63658b 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/AzureEntityResource.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/AzureEntityResource.cs @@ -39,9 +39,11 @@ public AzureEntityResource() /// The type of the resource. E.g. /// "Microsoft.Compute/virtualMachines" or /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. /// Resource Etag. - public AzureEntityResource(string id = default(string), string name = default(string), string type = default(string), string etag = default(string)) - : base(id, name, type) + public AzureEntityResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string etag = default(string)) + : base(id, name, type, systemData) { Etag = etag; CustomInit(); diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/BackupPolicy.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/BackupPolicy.cs index 2b442feb96ce..04ba468662f9 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/BackupPolicy.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/BackupPolicy.cs @@ -11,7 +11,6 @@ namespace Microsoft.Azure.Management.NetApp.Models { using Microsoft.Rest; - using Microsoft.Rest.Azure; using Microsoft.Rest.Serialization; using Newtonsoft.Json; using System.Collections; @@ -22,7 +21,7 @@ namespace Microsoft.Azure.Management.NetApp.Models /// Backup policy information /// [Rest.Serialization.JsonTransformation] - public partial class BackupPolicy : IResource + public partial class BackupPolicy : TrackedResource { /// /// Initializes a new instance of the BackupPolicy class. @@ -35,13 +34,19 @@ public BackupPolicy() /// /// Initializes a new instance of the BackupPolicy class. /// - /// Resource location - /// Resource Id - /// Resource name + /// The geo-location where the resource + /// lives + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. + /// Resource tags. /// A unique read-only string that changes whenever /// the resource is updated. - /// Resource type - /// Resource tags /// Backup Policy Resource ID /// Azure lifecycle management /// Daily backups count to @@ -56,16 +61,10 @@ public BackupPolicy() /// not /// A list of volumes assigned to this /// policy - /// The system meta data relating to this - /// resource. - public BackupPolicy(string location, string id = default(string), string name = default(string), string etag = default(string), string type = default(string), IDictionary tags = default(IDictionary), string backupPolicyId = default(string), string provisioningState = default(string), int? dailyBackupsToKeep = default(int?), int? weeklyBackupsToKeep = default(int?), int? monthlyBackupsToKeep = default(int?), int? volumesAssigned = default(int?), bool? enabled = default(bool?), IList volumeBackups = default(IList), SystemData systemData = default(SystemData)) + public BackupPolicy(string location, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), IDictionary tags = default(IDictionary), string etag = default(string), string backupPolicyId = default(string), string provisioningState = default(string), int? dailyBackupsToKeep = default(int?), int? weeklyBackupsToKeep = default(int?), int? monthlyBackupsToKeep = default(int?), int? volumesAssigned = default(int?), bool? enabled = default(bool?), IList volumeBackups = default(IList)) + : base(location, id, name, type, systemData, tags) { - Location = location; - Id = id; - Name = name; Etag = etag; - Type = type; - Tags = tags; BackupPolicyId = backupPolicyId; ProvisioningState = provisioningState; DailyBackupsToKeep = dailyBackupsToKeep; @@ -74,7 +73,6 @@ public BackupPolicy() VolumesAssigned = volumesAssigned; Enabled = enabled; VolumeBackups = volumeBackups; - SystemData = systemData; CustomInit(); } @@ -83,24 +81,6 @@ public BackupPolicy() /// partial void CustomInit(); - /// - /// Gets or sets resource location - /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } - - /// - /// Gets resource Id - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } - - /// - /// Gets resource name - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } - /// /// Gets a unique read-only string that changes whenever the resource /// is updated. @@ -108,18 +88,6 @@ public BackupPolicy() [JsonProperty(PropertyName = "etag")] public string Etag { get; private set; } - /// - /// Gets resource type - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - - /// - /// Gets or sets resource tags - /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - /// /// Gets backup Policy Resource ID /// @@ -168,24 +136,15 @@ public BackupPolicy() [JsonProperty(PropertyName = "properties.volumeBackups")] public IList VolumeBackups { get; private set; } - /// - /// Gets the system meta data relating to this resource. - /// - [JsonProperty(PropertyName = "systemData")] - public SystemData SystemData { get; private set; } - /// /// Validate the object. /// /// /// Thrown if validation fails /// - public virtual void Validate() + public override void Validate() { - if (Location == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Location"); - } + base.Validate(); } } } diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/CapacityPool.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/CapacityPool.cs index ba6f52e0f7d4..14a974a7b766 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/CapacityPool.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/CapacityPool.cs @@ -11,7 +11,6 @@ namespace Microsoft.Azure.Management.NetApp.Models { using Microsoft.Rest; - using Microsoft.Rest.Azure; using Microsoft.Rest.Serialization; using Newtonsoft.Json; using System.Collections; @@ -22,7 +21,7 @@ namespace Microsoft.Azure.Management.NetApp.Models /// Capacity pool resource /// [Rest.Serialization.JsonTransformation] - public partial class CapacityPool : IResource + public partial class CapacityPool : TrackedResource { /// /// Initializes a new instance of the CapacityPool class. @@ -35,35 +34,35 @@ public CapacityPool() /// /// Initializes a new instance of the CapacityPool class. /// - /// Resource location + /// The geo-location where the resource + /// lives /// size /// serviceLevel - /// Resource Id - /// Resource name + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. + /// Resource tags. /// A unique read-only string that changes whenever /// the resource is updated. - /// Resource type - /// Resource tags /// poolId /// Azure lifecycle management /// Total throughput of pool in - /// Mibps + /// MiB/s /// Utilized throughput of pool - /// in Mibps + /// in MiB/s /// qosType /// If enabled (true) the pool can contain /// cool Access enabled volumes. /// encryptionType - /// The system meta data relating to this - /// resource. - public CapacityPool(string location, long size, string serviceLevel, string id = default(string), string name = default(string), string etag = default(string), string type = default(string), IDictionary tags = default(IDictionary), string poolId = default(string), string provisioningState = default(string), double? totalThroughputMibps = default(double?), double? utilizedThroughputMibps = default(double?), string qosType = default(string), bool? coolAccess = default(bool?), string encryptionType = default(string), SystemData systemData = default(SystemData)) + public CapacityPool(string location, long size, string serviceLevel, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), IDictionary tags = default(IDictionary), string etag = default(string), string poolId = default(string), string provisioningState = default(string), double? totalThroughputMibps = default(double?), double? utilizedThroughputMibps = default(double?), string qosType = default(string), bool? coolAccess = default(bool?), string encryptionType = default(string)) + : base(location, id, name, type, systemData, tags) { - Location = location; - Id = id; - Name = name; Etag = etag; - Type = type; - Tags = tags; PoolId = poolId; Size = size; ServiceLevel = serviceLevel; @@ -73,7 +72,6 @@ public CapacityPool() QosType = qosType; CoolAccess = coolAccess; EncryptionType = encryptionType; - SystemData = systemData; CustomInit(); } @@ -82,24 +80,6 @@ public CapacityPool() /// partial void CustomInit(); - /// - /// Gets or sets resource location - /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } - - /// - /// Gets resource Id - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } - - /// - /// Gets resource name - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } - /// /// Gets a unique read-only string that changes whenever the resource /// is updated. @@ -107,18 +87,6 @@ public CapacityPool() [JsonProperty(PropertyName = "etag")] public string Etag { get; private set; } - /// - /// Gets resource type - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - - /// - /// Gets or sets resource tags - /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - /// /// Gets poolId /// @@ -155,13 +123,13 @@ public CapacityPool() public string ProvisioningState { get; private set; } /// - /// Gets total throughput of pool in Mibps + /// Gets total throughput of pool in MiB/s /// [JsonProperty(PropertyName = "properties.totalThroughputMibps")] public double? TotalThroughputMibps { get; private set; } /// - /// Gets utilized throughput of pool in Mibps + /// Gets utilized throughput of pool in MiB/s /// [JsonProperty(PropertyName = "properties.utilizedThroughputMibps")] public double? UtilizedThroughputMibps { get; private set; } @@ -194,24 +162,15 @@ public CapacityPool() [JsonProperty(PropertyName = "properties.encryptionType")] public string EncryptionType { get; set; } - /// - /// Gets the system meta data relating to this resource. - /// - [JsonProperty(PropertyName = "systemData")] - public SystemData SystemData { get; private set; } - /// /// Validate the object. /// /// /// Thrown if validation fails /// - public virtual void Validate() + public override void Validate() { - if (Location == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Location"); - } + base.Validate(); if (ServiceLevel == null) { throw new ValidationException(ValidationRules.CannotBeNull, "ServiceLevel"); 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 9ddec18ebdb1..af24267a2893 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 @@ -42,7 +42,9 @@ public CapacityPoolPatch() /// Resource tags /// size /// qosType - public CapacityPoolPatch(string location = default(string), string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), long? size = default(long?), string qosType = default(string)) + /// If enabled (true) the pool can contain + /// cool Access enabled volumes. + public CapacityPoolPatch(string location = default(string), string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), long? size = default(long?), string qosType = default(string), bool? coolAccess = default(bool?)) { Location = location; Id = id; @@ -51,6 +53,7 @@ public CapacityPoolPatch() Tags = tags; Size = size; QosType = qosType; + CoolAccess = coolAccess; CustomInit(); } @@ -108,5 +111,12 @@ public CapacityPoolPatch() [JsonProperty(PropertyName = "properties.qosType")] public string QosType { get; set; } + /// + /// Gets or sets if enabled (true) the pool can contain cool Access + /// enabled volumes. + /// + [JsonProperty(PropertyName = "properties.coolAccess")] + public bool? CoolAccess { get; set; } + } } diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/EncryptionIdentity.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/EncryptionIdentity.cs new file mode 100644 index 000000000000..14cec3f3db4e --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/EncryptionIdentity.cs @@ -0,0 +1,67 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.NetApp.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Identity used to authenticate with key vault. + /// + public partial class EncryptionIdentity + { + /// + /// Initializes a new instance of the EncryptionIdentity class. + /// + public EncryptionIdentity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the EncryptionIdentity class. + /// + /// The principal ID (object ID) of the + /// identity used to authenticate with key vault. Read-only. + /// The ARM resource identifier of + /// the user assigned identity used to authenticate with key vault. + /// Applicable if identity.type has 'UserAssigned'. It should match key + /// of identity.userAssignedIdentities. + public EncryptionIdentity(string principalId = default(string), string userAssignedIdentity = default(string)) + { + PrincipalId = principalId; + UserAssignedIdentity = userAssignedIdentity; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the principal ID (object ID) of the identity used to + /// authenticate with key vault. Read-only. + /// + [JsonProperty(PropertyName = "principalId")] + public string PrincipalId { get; private set; } + + /// + /// Gets or sets the ARM resource identifier of the user assigned + /// identity used to authenticate with key vault. Applicable if + /// identity.type has 'UserAssigned'. It should match key of + /// identity.userAssignedIdentities. + /// + [JsonProperty(PropertyName = "userAssignedIdentity")] + public string UserAssignedIdentity { get; set; } + + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/EncryptionKeySource.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/EncryptionKeySource.cs new file mode 100644 index 000000000000..c34f7a337d6c --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/EncryptionKeySource.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 EncryptionKeySource. + /// + public static class EncryptionKeySource + { + /// + /// Microsoft-managed key encryption + /// + public const string MicrosoftNetApp = "Microsoft.NetApp"; + /// + /// Customer-managed key encryption + /// + public const string MicrosoftKeyVault = "Microsoft.KeyVault"; + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Identity.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Identity.cs new file mode 100644 index 000000000000..c8de15789d60 --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Identity.cs @@ -0,0 +1,102 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.NetApp.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Identity for the resource. + /// + public partial class Identity + { + /// + /// Initializes a new instance of the Identity class. + /// + public Identity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Identity class. + /// + /// The identity type. Possible values include: + /// 'None', 'SystemAssigned', 'UserAssigned', + /// 'SystemAssigned,UserAssigned' + /// The principal ID of resource + /// identity. + /// The tenant ID of resource. + /// Gets or sets a list of key + /// value pairs that describe the set of User Assigned identities that + /// will be used with this storage account. The key is the ARM resource + /// identifier of the identity. Only 1 User Assigned identity is + /// permitted here. + public Identity(string type, string principalId = default(string), string tenantId = default(string), IDictionary userAssignedIdentities = default(IDictionary)) + { + PrincipalId = principalId; + TenantId = tenantId; + Type = type; + UserAssignedIdentities = userAssignedIdentities; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the principal ID of resource identity. + /// + [JsonProperty(PropertyName = "principalId")] + public string PrincipalId { get; private set; } + + /// + /// Gets the tenant ID of resource. + /// + [JsonProperty(PropertyName = "tenantId")] + public string TenantId { get; private set; } + + /// + /// Gets or sets the identity type. Possible values include: 'None', + /// 'SystemAssigned', 'UserAssigned', 'SystemAssigned,UserAssigned' + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; set; } + + /// + /// Gets or sets a list of key value pairs that describe the set of + /// User Assigned identities that will be used with this storage + /// account. The key is the ARM resource identifier of the identity. + /// Only 1 User Assigned identity is permitted here. + /// + [JsonProperty(PropertyName = "userAssignedIdentities")] + public IDictionary UserAssignedIdentities { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Type == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Type"); + } + } + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/IdentityType.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/IdentityType.cs new file mode 100644 index 000000000000..d5682116f10c --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/IdentityType.cs @@ -0,0 +1,24 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.NetApp.Models +{ + + /// + /// Defines values for IdentityType. + /// + public static class IdentityType + { + public const string None = "None"; + public const string SystemAssigned = "SystemAssigned"; + public const string UserAssigned = "UserAssigned"; + public const string SystemAssignedUserAssigned = "SystemAssigned,UserAssigned"; + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/KeySource.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/KeySource.cs new file mode 100644 index 000000000000..33c16e7d9762 --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/KeySource.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 KeySource. + /// + public static class KeySource + { + /// + /// Microsoft-managed key encryption + /// + public const string MicrosoftNetApp = "Microsoft.NetApp"; + /// + /// Customer-managed key encryption + /// + public const string MicrosoftKeyVault = "Microsoft.KeyVault"; + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/KeyVaultProperties.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/KeyVaultProperties.cs new file mode 100644 index 000000000000..85ed9a341b7c --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/KeyVaultProperties.cs @@ -0,0 +1,125 @@ +// +// 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 Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Properties of key vault. + /// + public partial class KeyVaultProperties + { + /// + /// Initializes a new instance of the KeyVaultProperties class. + /// + public KeyVaultProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the KeyVaultProperties class. + /// + /// The Uri of KeyVault. + /// The name of KeyVault key. + /// The resource ID of + /// KeyVault. + /// UUID v4 used to identify the Azure Key + /// Vault configuration + /// Status of the KeyVault connection. Possible + /// values include: 'Created', 'InUse', 'Deleted', 'Error', + /// 'Updating' + public KeyVaultProperties(string keyVaultUri, string keyName, string keyVaultResourceId, string keyVaultId = default(string), string status = default(string)) + { + KeyVaultId = keyVaultId; + KeyVaultUri = keyVaultUri; + KeyName = keyName; + KeyVaultResourceId = keyVaultResourceId; + Status = status; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets UUID v4 used to identify the Azure Key Vault configuration + /// + [JsonProperty(PropertyName = "keyVaultId")] + public string KeyVaultId { get; private set; } + + /// + /// Gets or sets the Uri of KeyVault. + /// + [JsonProperty(PropertyName = "keyVaultUri")] + public string KeyVaultUri { get; set; } + + /// + /// Gets or sets the name of KeyVault key. + /// + [JsonProperty(PropertyName = "keyName")] + public string KeyName { get; set; } + + /// + /// Gets or sets the resource ID of KeyVault. + /// + [JsonProperty(PropertyName = "keyVaultResourceId")] + public string KeyVaultResourceId { get; set; } + + /// + /// Gets status of the KeyVault connection. Possible values include: + /// 'Created', 'InUse', 'Deleted', 'Error', 'Updating' + /// + [JsonProperty(PropertyName = "status")] + public string Status { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (KeyVaultUri == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "KeyVaultUri"); + } + if (KeyName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "KeyName"); + } + if (KeyVaultResourceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "KeyVaultResourceId"); + } + if (KeyVaultId != null) + { + if (KeyVaultId.Length > 36) + { + throw new ValidationException(ValidationRules.MaxLength, "KeyVaultId", 36); + } + if (KeyVaultId.Length < 36) + { + throw new ValidationException(ValidationRules.MinLength, "KeyVaultId", 36); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(KeyVaultId, "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "KeyVaultId", "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"); + } + } + } + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/KeyVaultStatus.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/KeyVaultStatus.cs new file mode 100644 index 000000000000..04e9c42a4fff --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/KeyVaultStatus.cs @@ -0,0 +1,40 @@ +// +// 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 KeyVaultStatus. + /// + public static class KeyVaultStatus + { + /// + /// KeyVault connection created but not in use + /// + public const string Created = "Created"; + /// + /// KeyVault connection in use by SMB Volume + /// + public const string InUse = "InUse"; + /// + /// KeyVault connection Deleted + /// + public const string Deleted = "Deleted"; + /// + /// Error with the KeyVault connection + /// + public const string Error = "Error"; + /// + /// KeyVault connection Updating + /// + public const string Updating = "Updating"; + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/NetAppAccount.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/NetAppAccount.cs index 92cc373accb4..5692b5979357 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/NetAppAccount.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/NetAppAccount.cs @@ -11,7 +11,6 @@ namespace Microsoft.Azure.Management.NetApp.Models { using Microsoft.Rest; - using Microsoft.Rest.Azure; using Microsoft.Rest.Serialization; using Newtonsoft.Json; using System.Collections; @@ -22,7 +21,7 @@ namespace Microsoft.Azure.Management.NetApp.Models /// NetApp account resource /// [Rest.Serialization.JsonTransformation] - public partial class NetAppAccount : IResource + public partial class NetAppAccount : TrackedResource { /// /// Initializes a new instance of the NetAppAccount class. @@ -35,30 +34,34 @@ public NetAppAccount() /// /// Initializes a new instance of the NetAppAccount class. /// - /// Resource location - /// Resource Id - /// Resource name + /// The geo-location where the resource + /// lives + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. + /// Resource tags. /// A unique read-only string that changes whenever /// the resource is updated. - /// Resource type - /// Resource tags /// Azure lifecycle management /// Active Directories /// Encryption settings - /// The system meta data relating to this - /// resource. - public NetAppAccount(string location, string id = default(string), string name = default(string), string etag = default(string), string type = default(string), IDictionary tags = default(IDictionary), string provisioningState = default(string), IList activeDirectories = default(IList), AccountEncryption encryption = default(AccountEncryption), SystemData systemData = default(SystemData)) + /// Shows the status of disableShowmount + /// for all volumes under the subscription, null equals false + /// The identity of the resource. + public NetAppAccount(string location, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), IDictionary tags = default(IDictionary), string etag = default(string), string provisioningState = default(string), IList activeDirectories = default(IList), AccountEncryption encryption = default(AccountEncryption), bool? disableShowmount = default(bool?), Identity identity = default(Identity)) + : base(location, id, name, type, systemData, tags) { - Location = location; - Id = id; - Name = name; Etag = etag; - Type = type; - Tags = tags; ProvisioningState = provisioningState; ActiveDirectories = activeDirectories; Encryption = encryption; - SystemData = systemData; + DisableShowmount = disableShowmount; + Identity = identity; CustomInit(); } @@ -67,24 +70,6 @@ public NetAppAccount() /// partial void CustomInit(); - /// - /// Gets or sets resource location - /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } - - /// - /// Gets resource Id - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } - - /// - /// Gets resource name - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } - /// /// Gets a unique read-only string that changes whenever the resource /// is updated. @@ -92,18 +77,6 @@ public NetAppAccount() [JsonProperty(PropertyName = "etag")] public string Etag { get; private set; } - /// - /// Gets resource type - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - - /// - /// Gets or sets resource tags - /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - /// /// Gets azure lifecycle management /// @@ -123,10 +96,17 @@ public NetAppAccount() public AccountEncryption Encryption { get; set; } /// - /// Gets the system meta data relating to this resource. + /// Gets shows the status of disableShowmount for all volumes under the + /// subscription, null equals false + /// + [JsonProperty(PropertyName = "properties.disableShowmount")] + public bool? DisableShowmount { get; private set; } + + /// + /// Gets or sets the identity of the resource. /// - [JsonProperty(PropertyName = "systemData")] - public SystemData SystemData { get; private set; } + [JsonProperty(PropertyName = "identity")] + public Identity Identity { get; set; } /// /// Validate the object. @@ -134,12 +114,9 @@ public NetAppAccount() /// /// Thrown if validation fails /// - public virtual void Validate() + public override void Validate() { - if (Location == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Location"); - } + base.Validate(); if (ActiveDirectories != null) { foreach (var element in ActiveDirectories) @@ -150,6 +127,14 @@ public virtual void Validate() } } } + if (Encryption != null) + { + Encryption.Validate(); + } + if (Identity != null) + { + Identity.Validate(); + } } } } diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/NetAppAccountPatch.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/NetAppAccountPatch.cs index ed422267b385..18286144e219 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/NetAppAccountPatch.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/NetAppAccountPatch.cs @@ -43,7 +43,9 @@ public NetAppAccountPatch() /// Azure lifecycle management /// Active Directories /// Encryption settings - public NetAppAccountPatch(string location = default(string), string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string provisioningState = default(string), IList activeDirectories = default(IList), AccountEncryption encryption = default(AccountEncryption)) + /// Shows the status of disableShowmount + /// for all volumes under the subscription, null equals false + public NetAppAccountPatch(string location = default(string), string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string provisioningState = default(string), IList activeDirectories = default(IList), AccountEncryption encryption = default(AccountEncryption), bool? disableShowmount = default(bool?)) { Location = location; Id = id; @@ -53,6 +55,7 @@ public NetAppAccountPatch() ProvisioningState = provisioningState; ActiveDirectories = activeDirectories; Encryption = encryption; + DisableShowmount = disableShowmount; CustomInit(); } @@ -109,5 +112,35 @@ public NetAppAccountPatch() [JsonProperty(PropertyName = "properties.encryption")] public AccountEncryption Encryption { get; set; } + /// + /// Gets shows the status of disableShowmount for all volumes under the + /// subscription, null equals false + /// + [JsonProperty(PropertyName = "properties.disableShowmount")] + public bool? DisableShowmount { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (ActiveDirectories != null) + { + foreach (var element in ActiveDirectories) + { + if (element != null) + { + element.Validate(); + } + } + } + if (Encryption != null) + { + Encryption.Validate(); + } + } } } diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Plan.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Plan.cs new file mode 100644 index 000000000000..43f0a7ce3aff --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Plan.cs @@ -0,0 +1,116 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.NetApp.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Plan for the resource. + /// + public partial class Plan + { + /// + /// Initializes a new instance of the Plan class. + /// + public Plan() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Plan class. + /// + /// A user defined name of the 3rd Party Artifact + /// that is being procured. + /// The publisher of the 3rd Party Artifact + /// that is being bought. E.g. NewRelic + /// The 3rd Party artifact that is being + /// procured. E.g. NewRelic. Product maps to the OfferID specified for + /// the artifact at the time of Data Market onboarding. + /// A publisher provided promotion code as + /// provisioned in Data Market for the said product/artifact. + /// The version of the desired + /// product/artifact. + public Plan(string name, string publisher, string product, string promotionCode = default(string), string version = default(string)) + { + Name = name; + Publisher = publisher; + Product = product; + PromotionCode = promotionCode; + Version = version; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets a user defined name of the 3rd Party Artifact that is + /// being procured. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the publisher of the 3rd Party Artifact that is being + /// bought. E.g. NewRelic + /// + [JsonProperty(PropertyName = "publisher")] + public string Publisher { get; set; } + + /// + /// Gets or sets the 3rd Party artifact that is being procured. E.g. + /// NewRelic. Product maps to the OfferID specified for the artifact at + /// the time of Data Market onboarding. + /// + [JsonProperty(PropertyName = "product")] + public string Product { get; set; } + + /// + /// Gets or sets a publisher provided promotion code as provisioned in + /// Data Market for the said product/artifact. + /// + [JsonProperty(PropertyName = "promotionCode")] + public string PromotionCode { get; set; } + + /// + /// Gets or sets the version of the desired product/artifact. + /// + [JsonProperty(PropertyName = "version")] + public string Version { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + } + if (Publisher == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Publisher"); + } + if (Product == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Product"); + } + } + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ProvisioningState.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ProvisioningState.cs new file mode 100644 index 000000000000..4f74a3c0e062 --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ProvisioningState.cs @@ -0,0 +1,90 @@ +// +// 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 Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for ProvisioningState. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum ProvisioningState + { + [EnumMember(Value = "Accepted")] + Accepted, + [EnumMember(Value = "Creating")] + Creating, + [EnumMember(Value = "Patching")] + Patching, + [EnumMember(Value = "Deleting")] + Deleting, + [EnumMember(Value = "Moving")] + Moving, + [EnumMember(Value = "Failed")] + Failed, + [EnumMember(Value = "Succeeded")] + Succeeded + } + internal static class ProvisioningStateEnumExtension + { + internal static string ToSerializedValue(this ProvisioningState? value) + { + return value == null ? null : ((ProvisioningState)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this ProvisioningState value) + { + switch( value ) + { + case ProvisioningState.Accepted: + return "Accepted"; + case ProvisioningState.Creating: + return "Creating"; + case ProvisioningState.Patching: + return "Patching"; + case ProvisioningState.Deleting: + return "Deleting"; + case ProvisioningState.Moving: + return "Moving"; + case ProvisioningState.Failed: + return "Failed"; + case ProvisioningState.Succeeded: + return "Succeeded"; + } + return null; + } + + internal static ProvisioningState? ParseProvisioningState(this string value) + { + switch( value ) + { + case "Accepted": + return ProvisioningState.Accepted; + case "Creating": + return ProvisioningState.Creating; + case "Patching": + return ProvisioningState.Patching; + case "Deleting": + return ProvisioningState.Deleting; + case "Moving": + return ProvisioningState.Moving; + case "Failed": + return ProvisioningState.Failed; + case "Succeeded": + return ProvisioningState.Succeeded; + } + return null; + } + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ProxyResource.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ProxyResource.cs index 478ee21867b8..e2a6dd01e7b5 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ProxyResource.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ProxyResource.cs @@ -38,8 +38,10 @@ public ProxyResource() /// The type of the resource. E.g. /// "Microsoft.Compute/virtualMachines" or /// "Microsoft.Storage/storageAccounts" - public ProxyResource(string id = default(string), string name = default(string), string type = default(string)) - : base(id, name, type) + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. + public ProxyResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData)) + : base(id, name, type, systemData) { CustomInit(); } diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ReestablishReplicationRequest.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ReestablishReplicationRequest.cs new file mode 100644 index 000000000000..89378c1cf0af --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ReestablishReplicationRequest.cs @@ -0,0 +1,54 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.NetApp.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Re-establish request object supplied in the body of the operation. + /// + public partial class ReestablishReplicationRequest + { + /// + /// Initializes a new instance of the ReestablishReplicationRequest + /// class. + /// + public ReestablishReplicationRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ReestablishReplicationRequest + /// class. + /// + /// Resource id of the source volume for + /// the replication + public ReestablishReplicationRequest(string sourceVolumeId = default(string)) + { + SourceVolumeId = sourceVolumeId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets resource id of the source volume for the replication + /// + [JsonProperty(PropertyName = "sourceVolumeId")] + public string SourceVolumeId { get; set; } + + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/RegionInfo.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/RegionInfo.cs new file mode 100644 index 000000000000..c57abc688ce9 --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/RegionInfo.cs @@ -0,0 +1,71 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.NetApp.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Provides region specific information. + /// + public partial class RegionInfo + { + /// + /// Initializes a new instance of the RegionInfo class. + /// + public RegionInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RegionInfo class. + /// + /// Storage to Network + /// Proximity + /// Logical availability zone + /// mappings. + public RegionInfo(string storageToNetworkProximity = default(string), IList availabilityZoneMappings = default(IList)) + { + StorageToNetworkProximity = storageToNetworkProximity; + AvailabilityZoneMappings = availabilityZoneMappings; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets storage to Network Proximity + /// + /// + /// Provides storage to network proximity information in the region. + /// Possible values include: 'Default', 'T1', 'T2', 'T1AndT2' + /// + [JsonProperty(PropertyName = "storageToNetworkProximity")] + public string StorageToNetworkProximity { get; set; } + + /// + /// Gets or sets logical availability zone mappings. + /// + /// + /// Provides logical availability zone mappings for the subscription + /// for a region. + /// + [JsonProperty(PropertyName = "availabilityZoneMappings")] + public IList AvailabilityZoneMappings { get; set; } + + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/RegionInfoAvailabilityZoneMappingsItem.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/RegionInfoAvailabilityZoneMappingsItem.cs new file mode 100644 index 000000000000..8708134fef71 --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/RegionInfoAvailabilityZoneMappingsItem.cs @@ -0,0 +1,58 @@ +// +// 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.Linq; + + public partial class RegionInfoAvailabilityZoneMappingsItem + { + /// + /// Initializes a new instance of the + /// RegionInfoAvailabilityZoneMappingsItem class. + /// + public RegionInfoAvailabilityZoneMappingsItem() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// RegionInfoAvailabilityZoneMappingsItem class. + /// + /// Logical availability zone. + /// Available availability zone + public RegionInfoAvailabilityZoneMappingsItem(string availabilityZone = default(string), bool? isAvailable = default(bool?)) + { + AvailabilityZone = availabilityZone; + IsAvailable = isAvailable; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets logical availability zone. + /// + [JsonProperty(PropertyName = "availabilityZone")] + public string AvailabilityZone { get; set; } + + /// + /// Gets or sets available availability zone + /// + [JsonProperty(PropertyName = "isAvailable")] + public bool? IsAvailable { get; set; } + + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/RegionStorageToNetworkProximity.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/RegionStorageToNetworkProximity.cs new file mode 100644 index 000000000000..13cb221a931d --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/RegionStorageToNetworkProximity.cs @@ -0,0 +1,36 @@ +// +// 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 RegionStorageToNetworkProximity. + /// + public static class RegionStorageToNetworkProximity + { + /// + /// Basic network connectivity. + /// + public const string Default = "Default"; + /// + /// Standard T1 network connectivity. + /// + public const string T1 = "T1"; + /// + /// Standard T2 network connectivity. + /// + public const string T2 = "T2"; + /// + /// Standard T1 and T2 network connectivity. + /// + public const string T1AndT2 = "T1AndT2"; + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/RelocateVolumeRequest.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/RelocateVolumeRequest.cs new file mode 100644 index 000000000000..7dc539761f1d --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/RelocateVolumeRequest.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.NetApp.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Relocate volume request + /// + public partial class RelocateVolumeRequest + { + /// + /// Initializes a new instance of the RelocateVolumeRequest class. + /// + public RelocateVolumeRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RelocateVolumeRequest class. + /// + /// New creation token for the volume that + /// controls the mount point name + public RelocateVolumeRequest(string creationToken = default(string)) + { + CreationToken = creationToken; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets new creation token for the volume that controls the + /// mount point name + /// + [JsonProperty(PropertyName = "creationToken")] + public string CreationToken { get; set; } + + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Replication.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Replication.cs new file mode 100644 index 000000000000..24031f63bbe3 --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Replication.cs @@ -0,0 +1,98 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.NetApp.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Replication properties + /// + public partial class Replication + { + /// + /// Initializes a new instance of the Replication class. + /// + public Replication() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Replication class. + /// + /// The resource ID of the remote + /// volume. + /// Indicates whether the local volume is + /// the source or destination for the Volume Replication. Possible + /// values include: 'src', 'dst' + /// Schedule. Possible values + /// include: '_10minutely', 'hourly', 'daily' + /// The remote region for the other + /// end of the Volume Replication. + public Replication(string remoteVolumeResourceId, string endpointType = default(string), string replicationSchedule = default(string), string remoteVolumeRegion = default(string)) + { + EndpointType = endpointType; + ReplicationSchedule = replicationSchedule; + RemoteVolumeResourceId = remoteVolumeResourceId; + RemoteVolumeRegion = remoteVolumeRegion; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets indicates whether the local volume is the source or + /// destination for the Volume Replication. Possible values include: + /// 'src', 'dst' + /// + [JsonProperty(PropertyName = "endpointType")] + public string EndpointType { get; set; } + + /// + /// Gets or sets schedule. Possible values include: '_10minutely', + /// 'hourly', 'daily' + /// + [JsonProperty(PropertyName = "replicationSchedule")] + public string ReplicationSchedule { get; set; } + + /// + /// Gets or sets the resource ID of the remote volume. + /// + [JsonProperty(PropertyName = "remoteVolumeResourceId")] + public string RemoteVolumeResourceId { get; set; } + + /// + /// Gets or sets the remote region for the other end of the Volume + /// Replication. + /// + [JsonProperty(PropertyName = "remoteVolumeRegion")] + public string RemoteVolumeRegion { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (RemoteVolumeResourceId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "RemoteVolumeResourceId"); + } + } + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Resource.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Resource.cs index 1be9bf578ed8..396ba16afb66 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Resource.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Resource.cs @@ -41,11 +41,14 @@ public Resource() /// The type of the resource. E.g. /// "Microsoft.Compute/virtualMachines" or /// "Microsoft.Storage/storageAccounts" - public Resource(string id = default(string), string name = default(string), string type = default(string)) + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. + public Resource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData)) { Id = id; Name = name; Type = type; + SystemData = systemData; CustomInit(); } @@ -75,5 +78,12 @@ public Resource() [JsonProperty(PropertyName = "type")] public string Type { get; private set; } + /// + /// Gets azure Resource Manager metadata containing createdBy and + /// modifiedBy information. + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; private set; } + } } diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ResourceModelWithAllowedPropertySet.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ResourceModelWithAllowedPropertySet.cs new file mode 100644 index 000000000000..2475207506c9 --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ResourceModelWithAllowedPropertySet.cs @@ -0,0 +1,145 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.NetApp.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The resource model definition containing the full set of allowed + /// properties for a resource. Except properties bag, there cannot be a top + /// level property outside of this set. + /// + public partial class ResourceModelWithAllowedPropertySet : IResource + { + /// + /// Initializes a new instance of the + /// ResourceModelWithAllowedPropertySet class. + /// + public ResourceModelWithAllowedPropertySet() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ResourceModelWithAllowedPropertySet class. + /// + /// The fully qualified resource ID of the + /// resource that manages this resource. Indicates if this resource is + /// managed by another Azure resource. If this is present, complete + /// mode deployment will not delete the resource if it is removed from + /// the template since it is managed by another resource. + /// Metadata used by portal/tooling/etc to render + /// different UX experiences for resources of the same type; e.g. + /// ApiApps are a kind of Microsoft.Web/sites type. If supported, the + /// resource provider must validate and persist this value. + /// The etag field is *not* required. If it is + /// provided in the response body, it must also be provided as a header + /// per the normal etag convention. Entity tags are used for comparing + /// two or more entities from the same requested resource. HTTP/1.1 + /// uses entity tags in the etag (section 14.19), If-Match (section + /// 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) + /// header fields. + public ResourceModelWithAllowedPropertySet(string managedBy = default(string), string kind = default(string), string etag = default(string), ResourceModelWithAllowedPropertySetIdentity identity = default(ResourceModelWithAllowedPropertySetIdentity), ResourceModelWithAllowedPropertySetSku sku = default(ResourceModelWithAllowedPropertySetSku), ResourceModelWithAllowedPropertySetPlan plan = default(ResourceModelWithAllowedPropertySetPlan)) + { + ManagedBy = managedBy; + Kind = kind; + Etag = etag; + Identity = identity; + Sku = sku; + Plan = plan; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the fully qualified resource ID of the resource that + /// manages this resource. Indicates if this resource is managed by + /// another Azure resource. If this is present, complete mode + /// deployment will not delete the resource if it is removed from the + /// template since it is managed by another resource. + /// + [JsonProperty(PropertyName = "managedBy")] + public string ManagedBy { get; set; } + + /// + /// Gets or sets metadata used by portal/tooling/etc to render + /// different UX experiences for resources of the same type; e.g. + /// ApiApps are a kind of Microsoft.Web/sites type. If supported, the + /// resource provider must validate and persist this value. + /// + [JsonProperty(PropertyName = "kind")] + public string Kind { get; set; } + + /// + /// Gets the etag field is *not* required. If it is provided in the + /// response body, it must also be provided as a header per the normal + /// etag convention. Entity tags are used for comparing two or more + /// entities from the same requested resource. HTTP/1.1 uses entity + /// tags in the etag (section 14.19), If-Match (section 14.24), + /// If-None-Match (section 14.26), and If-Range (section 14.27) header + /// fields. + /// + [JsonProperty(PropertyName = "etag")] + public string Etag { get; private set; } + + /// + /// + [JsonProperty(PropertyName = "identity")] + public ResourceModelWithAllowedPropertySetIdentity Identity { get; set; } + + /// + /// + [JsonProperty(PropertyName = "sku")] + public ResourceModelWithAllowedPropertySetSku Sku { get; set; } + + /// + /// + [JsonProperty(PropertyName = "plan")] + public ResourceModelWithAllowedPropertySetPlan Plan { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Kind != null) + { + if (!System.Text.RegularExpressions.Regex.IsMatch(Kind, "^[-\\w\\._,\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "Kind", "^[-\\w\\._,\\(\\)]+$"); + } + } + if (Identity != null) + { + Identity.Validate(); + } + if (Sku != null) + { + Sku.Validate(); + } + if (Plan != null) + { + Plan.Validate(); + } + } + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ResourceModelWithAllowedPropertySetIdentity.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ResourceModelWithAllowedPropertySetIdentity.cs new file mode 100644 index 000000000000..30a456ab7508 --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ResourceModelWithAllowedPropertySetIdentity.cs @@ -0,0 +1,65 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.NetApp.Models +{ + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + public partial class ResourceModelWithAllowedPropertySetIdentity : Identity + { + /// + /// Initializes a new instance of the + /// ResourceModelWithAllowedPropertySetIdentity class. + /// + public ResourceModelWithAllowedPropertySetIdentity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ResourceModelWithAllowedPropertySetIdentity class. + /// + /// The identity type. Possible values include: + /// 'None', 'SystemAssigned', 'UserAssigned', + /// 'SystemAssigned,UserAssigned' + /// The principal ID of resource + /// identity. + /// The tenant ID of resource. + /// Gets or sets a list of key + /// value pairs that describe the set of User Assigned identities that + /// will be used with this storage account. The key is the ARM resource + /// identifier of the identity. Only 1 User Assigned identity is + /// permitted here. + public ResourceModelWithAllowedPropertySetIdentity(string type, string principalId = default(string), string tenantId = default(string), IDictionary userAssignedIdentities = default(IDictionary)) + : base(type, principalId, tenantId, userAssignedIdentities) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ResourceModelWithAllowedPropertySetPlan.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ResourceModelWithAllowedPropertySetPlan.cs new file mode 100644 index 000000000000..66f4925b6486 --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ResourceModelWithAllowedPropertySetPlan.cs @@ -0,0 +1,63 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.NetApp.Models +{ + using System.Linq; + + public partial class ResourceModelWithAllowedPropertySetPlan : Plan + { + /// + /// Initializes a new instance of the + /// ResourceModelWithAllowedPropertySetPlan class. + /// + public ResourceModelWithAllowedPropertySetPlan() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ResourceModelWithAllowedPropertySetPlan class. + /// + /// A user defined name of the 3rd Party Artifact + /// that is being procured. + /// The publisher of the 3rd Party Artifact + /// that is being bought. E.g. NewRelic + /// The 3rd Party artifact that is being + /// procured. E.g. NewRelic. Product maps to the OfferID specified for + /// the artifact at the time of Data Market onboarding. + /// A publisher provided promotion code as + /// provisioned in Data Market for the said product/artifact. + /// The version of the desired + /// product/artifact. + public ResourceModelWithAllowedPropertySetPlan(string name, string publisher, string product, string promotionCode = default(string), string version = default(string)) + : base(name, publisher, product, promotionCode, version) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ResourceModelWithAllowedPropertySetSku.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ResourceModelWithAllowedPropertySetSku.cs new file mode 100644 index 000000000000..5b5a9d86f2b6 --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ResourceModelWithAllowedPropertySetSku.cs @@ -0,0 +1,64 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.NetApp.Models +{ + using System.Linq; + + public partial class ResourceModelWithAllowedPropertySetSku : Sku + { + /// + /// Initializes a new instance of the + /// ResourceModelWithAllowedPropertySetSku class. + /// + public ResourceModelWithAllowedPropertySetSku() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ResourceModelWithAllowedPropertySetSku class. + /// + /// The name of the SKU. Ex - P3. It is typically a + /// letter+number code + /// Possible values include: 'Free', 'Basic', + /// 'Standard', 'Premium' + /// The SKU size. When the name field is the + /// combination of tier and some other value, this would be the + /// standalone code. + /// If the service has different generations of + /// hardware, for the same SKU, then that can be captured here. + /// If the SKU supports scale out/in then the + /// capacity integer should be included. If scale out/in is not + /// possible for the resource this may be omitted. + public ResourceModelWithAllowedPropertySetSku(string name, SkuTier? tier = default(SkuTier?), string size = default(string), string family = default(string), int? capacity = default(int?)) + : base(name, tier, size, family, capacity) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Sku.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Sku.cs new file mode 100644 index 000000000000..266ecc344638 --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Sku.cs @@ -0,0 +1,110 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.NetApp.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// The resource model definition representing SKU + /// + public partial class Sku + { + /// + /// Initializes a new instance of the Sku class. + /// + public Sku() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Sku class. + /// + /// The name of the SKU. Ex - P3. It is typically a + /// letter+number code + /// Possible values include: 'Free', 'Basic', + /// 'Standard', 'Premium' + /// The SKU size. When the name field is the + /// combination of tier and some other value, this would be the + /// standalone code. + /// If the service has different generations of + /// hardware, for the same SKU, then that can be captured here. + /// If the SKU supports scale out/in then the + /// capacity integer should be included. If scale out/in is not + /// possible for the resource this may be omitted. + public Sku(string name, SkuTier? tier = default(SkuTier?), string size = default(string), string family = default(string), int? capacity = default(int?)) + { + Name = name; + Tier = tier; + Size = size; + Family = family; + Capacity = capacity; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the name of the SKU. Ex - P3. It is typically a + /// letter+number code + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets possible values include: 'Free', 'Basic', 'Standard', + /// 'Premium' + /// + [JsonProperty(PropertyName = "tier")] + public SkuTier? Tier { get; set; } + + /// + /// Gets or sets the SKU size. When the name field is the combination + /// of tier and some other value, this would be the standalone code. + /// + [JsonProperty(PropertyName = "size")] + public string Size { get; set; } + + /// + /// Gets or sets if the service has different generations of hardware, + /// for the same SKU, then that can be captured here. + /// + [JsonProperty(PropertyName = "family")] + public string Family { get; set; } + + /// + /// Gets or sets if the SKU supports scale out/in then the capacity + /// integer should be included. If scale out/in is not possible for the + /// resource this may be omitted. + /// + [JsonProperty(PropertyName = "capacity")] + public int? Capacity { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + } + } + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/SkuTier.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/SkuTier.cs new file mode 100644 index 000000000000..b134517f7632 --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/SkuTier.cs @@ -0,0 +1,72 @@ +// +// 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 Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for SkuTier. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum SkuTier + { + [EnumMember(Value = "Free")] + Free, + [EnumMember(Value = "Basic")] + Basic, + [EnumMember(Value = "Standard")] + Standard, + [EnumMember(Value = "Premium")] + Premium + } + internal static class SkuTierEnumExtension + { + internal static string ToSerializedValue(this SkuTier? value) + { + return value == null ? null : ((SkuTier)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this SkuTier value) + { + switch( value ) + { + case SkuTier.Free: + return "Free"; + case SkuTier.Basic: + return "Basic"; + case SkuTier.Standard: + return "Standard"; + case SkuTier.Premium: + return "Premium"; + } + return null; + } + + internal static SkuTier? ParseSkuTier(this string value) + { + switch( value ) + { + case "Free": + return SkuTier.Free; + case "Basic": + return SkuTier.Basic; + case "Standard": + return SkuTier.Standard; + case "Premium": + return SkuTier.Premium; + } + return null; + } + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/SmbAccessBasedEnumeration.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/SmbAccessBasedEnumeration.cs new file mode 100644 index 000000000000..5626bcb73c8e --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/SmbAccessBasedEnumeration.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 SmbAccessBasedEnumeration. + /// + public static class SmbAccessBasedEnumeration + { + /// + /// smbAccessBasedEnumeration share setting is disabled + /// + public const string Disabled = "Disabled"; + /// + /// smbAccessBasedEnumeration share setting is enabled + /// + public const string Enabled = "Enabled"; + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/SmbNonBrowsable.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/SmbNonBrowsable.cs new file mode 100644 index 000000000000..592ed0746d7a --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/SmbNonBrowsable.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 SmbNonBrowsable. + /// + public static class SmbNonBrowsable + { + /// + /// smbNonBrowsable share setting is disabled + /// + public const string Disabled = "Disabled"; + /// + /// smbNonBrowsable share setting is enabled + /// + public const string Enabled = "Enabled"; + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/SnapshotPolicy.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/SnapshotPolicy.cs index ce35be1a50e0..d1cd63de5d99 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/SnapshotPolicy.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/SnapshotPolicy.cs @@ -11,7 +11,6 @@ namespace Microsoft.Azure.Management.NetApp.Models { using Microsoft.Rest; - using Microsoft.Rest.Azure; using Microsoft.Rest.Serialization; using Newtonsoft.Json; using System.Collections; @@ -22,7 +21,7 @@ namespace Microsoft.Azure.Management.NetApp.Models /// Snapshot policy information /// [Rest.Serialization.JsonTransformation] - public partial class SnapshotPolicy : IResource + public partial class SnapshotPolicy : TrackedResource { /// /// Initializes a new instance of the SnapshotPolicy class. @@ -35,13 +34,19 @@ public SnapshotPolicy() /// /// Initializes a new instance of the SnapshotPolicy class. /// - /// Resource location - /// Resource Id - /// Resource name + /// The geo-location where the resource + /// lives + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. + /// Resource tags. /// A unique read-only string that changes whenever /// the resource is updated. - /// Resource type - /// Resource tags /// hourlySchedule /// dailySchedule /// weeklySchedule @@ -49,23 +54,16 @@ public SnapshotPolicy() /// The property to decide policy is enabled or /// not /// Azure lifecycle management - /// The system meta data relating to this - /// resource. - public SnapshotPolicy(string location, string id = default(string), string name = default(string), string etag = default(string), string type = default(string), IDictionary tags = default(IDictionary), HourlySchedule hourlySchedule = default(HourlySchedule), DailySchedule dailySchedule = default(DailySchedule), WeeklySchedule weeklySchedule = default(WeeklySchedule), MonthlySchedule monthlySchedule = default(MonthlySchedule), bool? enabled = default(bool?), string provisioningState = default(string), SystemData systemData = default(SystemData)) + public SnapshotPolicy(string location, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), IDictionary tags = default(IDictionary), string etag = default(string), HourlySchedule hourlySchedule = default(HourlySchedule), DailySchedule dailySchedule = default(DailySchedule), WeeklySchedule weeklySchedule = default(WeeklySchedule), MonthlySchedule monthlySchedule = default(MonthlySchedule), bool? enabled = default(bool?), string provisioningState = default(string)) + : base(location, id, name, type, systemData, tags) { - Location = location; - Id = id; - Name = name; Etag = etag; - Type = type; - Tags = tags; HourlySchedule = hourlySchedule; DailySchedule = dailySchedule; WeeklySchedule = weeklySchedule; MonthlySchedule = monthlySchedule; Enabled = enabled; ProvisioningState = provisioningState; - SystemData = systemData; CustomInit(); } @@ -74,24 +72,6 @@ public SnapshotPolicy() /// partial void CustomInit(); - /// - /// Gets or sets resource location - /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } - - /// - /// Gets resource Id - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } - - /// - /// Gets resource name - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } - /// /// Gets a unique read-only string that changes whenever the resource /// is updated. @@ -99,18 +79,6 @@ public SnapshotPolicy() [JsonProperty(PropertyName = "etag")] public string Etag { get; private set; } - /// - /// Gets resource type - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - - /// - /// Gets or sets resource tags - /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - /// /// Gets or sets hourlySchedule /// @@ -159,24 +127,15 @@ public SnapshotPolicy() [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; private set; } - /// - /// Gets the system meta data relating to this resource. - /// - [JsonProperty(PropertyName = "systemData")] - public SystemData SystemData { get; private set; } - /// /// Validate the object. /// /// /// Thrown if validation fails /// - public virtual void Validate() + public override void Validate() { - if (Location == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Location"); - } + base.Validate(); } } } diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/SubscriptionQuotaItem.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/SubscriptionQuotaItem.cs index 19eab209146d..cf833389e792 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/SubscriptionQuotaItem.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/SubscriptionQuotaItem.cs @@ -38,16 +38,15 @@ public SubscriptionQuotaItem() /// The type of the resource. E.g. /// "Microsoft.Compute/virtualMachines" or /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. /// The current quota value. /// The default quota value. - /// The system meta data relating to this - /// resource. - public SubscriptionQuotaItem(string id = default(string), string name = default(string), string type = default(string), int? current = default(int?), int? defaultProperty = default(int?), SystemData systemData = default(SystemData)) - : base(id, name, type) + public SubscriptionQuotaItem(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), int? current = default(int?), int? defaultProperty = default(int?)) + : base(id, name, type, systemData) { Current = current; DefaultProperty = defaultProperty; - SystemData = systemData; CustomInit(); } @@ -68,11 +67,5 @@ public SubscriptionQuotaItem() [JsonProperty(PropertyName = "properties.default")] public int? DefaultProperty { get; private set; } - /// - /// Gets the system meta data relating to this resource. - /// - [JsonProperty(PropertyName = "systemData")] - public SystemData SystemData { get; private set; } - } } diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/SubvolumeInfo.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/SubvolumeInfo.cs index 26b57d9ee29b..afb602a56744 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/SubvolumeInfo.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/SubvolumeInfo.cs @@ -38,20 +38,19 @@ public SubvolumeInfo() /// The type of the resource. E.g. /// "Microsoft.Compute/virtualMachines" or /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. /// path /// size /// name /// Azure lifecycle management - /// The system meta data relating to this - /// resource. - public SubvolumeInfo(string id = default(string), string name = default(string), string type = default(string), string path = default(string), long? size = default(long?), string parentPath = default(string), string provisioningState = default(string), SystemData systemData = default(SystemData)) - : base(id, name, type) + public SubvolumeInfo(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string path = default(string), long? size = default(long?), string parentPath = default(string), string provisioningState = default(string)) + : base(id, name, type, systemData) { Path = path; Size = size; ParentPath = parentPath; ProvisioningState = provisioningState; - SystemData = systemData; CustomInit(); } @@ -93,11 +92,5 @@ public SubvolumeInfo() [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; private set; } - /// - /// Gets the system meta data relating to this resource. - /// - [JsonProperty(PropertyName = "systemData")] - public SystemData SystemData { get; private set; } - } } diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/TrackedResource.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/TrackedResource.cs index 635439329179..900fcf33d8ec 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/TrackedResource.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/TrackedResource.cs @@ -44,9 +44,11 @@ public TrackedResource() /// The type of the resource. E.g. /// "Microsoft.Compute/virtualMachines" or /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. /// Resource tags. - public TrackedResource(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary)) - : base(id, name, type) + public TrackedResource(string location, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), IDictionary tags = default(IDictionary)) + : base(id, name, type, systemData) { Tags = tags; Location = location; diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Type.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Type.cs new file mode 100644 index 000000000000..4f04f83ff300 --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Type.cs @@ -0,0 +1,36 @@ +// +// 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 Type. + /// + public static class Type + { + /// + /// Default user quota + /// + public const string DefaultUserQuota = "DefaultUserQuota"; + /// + /// Default group quota + /// + public const string DefaultGroupQuota = "DefaultGroupQuota"; + /// + /// Individual user quota + /// + public const string IndividualUserQuota = "IndividualUserQuota"; + /// + /// Individual group quota + /// + public const string IndividualGroupQuota = "IndividualGroupQuota"; + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/UserAssignedIdentity.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/UserAssignedIdentity.cs new file mode 100644 index 000000000000..8511270429d3 --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/UserAssignedIdentity.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.NetApp.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// UserAssignedIdentity for the resource. + /// + public partial class UserAssignedIdentity + { + /// + /// Initializes a new instance of the UserAssignedIdentity class. + /// + public UserAssignedIdentity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the UserAssignedIdentity class. + /// + /// The principal ID of the identity. + /// The client ID of the identity. + public UserAssignedIdentity(string principalId = default(string), string clientId = default(string)) + { + PrincipalId = principalId; + ClientId = clientId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the principal ID of the identity. + /// + [JsonProperty(PropertyName = "principalId")] + public string PrincipalId { get; private set; } + + /// + /// Gets the client ID of the identity. + /// + [JsonProperty(PropertyName = "clientId")] + public string ClientId { get; private set; } + + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Vault.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Vault.cs index baa156b1b234..7a1f631967a3 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Vault.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Vault.cs @@ -33,14 +33,12 @@ public Vault() /// /// Initializes a new instance of the Vault class. /// - /// Resource location /// Resource Id /// Resource name /// Resource type /// Vault Name - public Vault(string location, string id = default(string), string name = default(string), string type = default(string), string vaultName = default(string)) + public Vault(string id = default(string), string name = default(string), string type = default(string), string vaultName = default(string)) { - Location = location; Id = id; Name = name; Type = type; @@ -53,12 +51,6 @@ public Vault() /// partial void CustomInit(); - /// - /// Gets or sets resource location - /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } - /// /// Gets resource Id /// @@ -83,18 +75,5 @@ public Vault() [JsonProperty(PropertyName = "properties.vaultName")] public string VaultName { 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/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Volume.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Volume.cs index 1251748664d9..a2b2c7607fa7 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 @@ -11,7 +11,6 @@ namespace Microsoft.Azure.Management.NetApp.Models { using Microsoft.Rest; - using Microsoft.Rest.Azure; using Microsoft.Rest.Serialization; using Newtonsoft.Json; using System.Collections; @@ -22,7 +21,7 @@ namespace Microsoft.Azure.Management.NetApp.Models /// Volume resource /// [Rest.Serialization.JsonTransformation] - public partial class Volume : IResource + public partial class Volume : TrackedResource { /// /// Initializes a new instance of the Volume class. @@ -35,23 +34,33 @@ public Volume() /// /// Initializes a new instance of the Volume class. /// - /// Resource location + /// The geo-location where the resource + /// lives /// Creation Token or File Path /// usageThreshold /// The Azure Resource URI for a delegated /// subnet. Must have the delegation Microsoft.NetApp/volumes - /// Resource Id - /// Resource name + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. + /// Resource tags. /// A unique read-only string that changes whenever /// the resource is updated. - /// Resource type - /// Resource tags + /// Availability Zone /// FileSystem ID /// serviceLevel /// exportPolicy /// protocolTypes /// Azure lifecycle management /// Snapshot ID + /// If enabled (true) the snapshot the + /// volume was created from will be automatically deleted after the + /// volume create operation has finished. Defaults to false /// Backup ID /// Baremetal Tenant ID /// Network features @@ -76,14 +85,25 @@ public Volume() /// Enables encryption for in-flight smb3 /// data. Only applicable for SMB/DualProtocol volume. To be used with /// swagger version 2020-08-01 or later + /// smbAccessBasedEnumeration + /// smbNonBrowsable /// Enables continuously /// available share property for smb volume. Only applicable for SMB /// volume - /// Maximum throughput in Mibps that can + /// Maximum throughput in MiB/s that can /// be achieved by this volume and this will be accepted as input only /// for manual qosType volume - /// Encryption Key Source. Possible - /// values are: 'Microsoft.NetApp' + /// Source of key used to encrypt + /// data in volume. Applicable if NetApp account has + /// encryption.keySource = 'Microsoft.KeyVault'. Possible values + /// (case-insensitive) are: 'Microsoft.NetApp, Microsoft.KeyVault'. + /// Possible values include: 'Microsoft.NetApp', + /// 'Microsoft.KeyVault' + /// The resource ID of + /// private endpoint for KeyVault. It must reside in the same VNET as + /// the volume. Only applicable if encryptionKeySource = + /// 'Microsoft.KeyVault'. /// Specifies whether LDAP is enabled or not /// for a given NFS volume. /// Specifies whether Cool Access(tiering) is @@ -124,20 +144,18 @@ public Volume() /// Volume spec name is the application /// specific designation or identifier for the particular volume in a /// volume group for e.g. data, log + /// Specifies if the volume is encrypted or + /// not. Only available on volumes created or updated after + /// 2022-01-01. /// Volume placement rules /// Flag indicating whether subvolume /// operations are enabled on the volume. Possible values include: /// 'Enabled', 'Disabled' - /// The system meta data relating to this - /// resource. - public Volume(string location, string creationToken, long usageThreshold, string subnetId, string id = default(string), string name = default(string), string etag = default(string), string type = default(string), IDictionary tags = default(IDictionary), string fileSystemId = default(string), string serviceLevel = default(string), VolumePropertiesExportPolicy exportPolicy = default(VolumePropertiesExportPolicy), IList protocolTypes = default(IList), string provisioningState = default(string), string snapshotId = default(string), string backupId = default(string), string baremetalTenantId = default(string), string networkFeatures = default(string), string networkSiblingSetId = default(string), string storageToNetworkProximity = default(string), IList mountTargets = default(IList), string volumeType = default(string), VolumePropertiesDataProtection dataProtection = default(VolumePropertiesDataProtection), bool? isRestoring = default(bool?), bool? snapshotDirectoryVisible = default(bool?), bool? kerberosEnabled = default(bool?), string securityStyle = default(string), bool? smbEncryption = default(bool?), bool? smbContinuouslyAvailable = default(bool?), double? throughputMibps = default(double?), string encryptionKeySource = default(string), bool? ldapEnabled = default(bool?), bool? coolAccess = default(bool?), int? coolnessPeriod = default(int?), string unixPermissions = default(string), int? cloneProgress = default(int?), string avsDataStore = default(string), bool? isDefaultQuotaEnabled = default(bool?), long? defaultUserQuotaInKiBs = default(long?), long? defaultGroupQuotaInKiBs = default(long?), long? maximumNumberOfFiles = default(long?), string volumeGroupName = default(string), string capacityPoolResourceId = default(string), string proximityPlacementGroup = default(string), string t2Network = default(string), string volumeSpecName = default(string), IList placementRules = default(IList), string enableSubvolumes = default(string), SystemData systemData = default(SystemData)) + public Volume(string location, string creationToken, long usageThreshold, string subnetId, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), IDictionary tags = default(IDictionary), string etag = default(string), IList zones = default(IList), string fileSystemId = default(string), string serviceLevel = default(string), VolumePropertiesExportPolicy exportPolicy = default(VolumePropertiesExportPolicy), IList protocolTypes = default(IList), string provisioningState = default(string), string snapshotId = default(string), bool? deleteBaseSnapshot = default(bool?), string backupId = default(string), string baremetalTenantId = default(string), string networkFeatures = default(string), string networkSiblingSetId = default(string), string storageToNetworkProximity = default(string), IList mountTargets = default(IList), string volumeType = default(string), VolumePropertiesDataProtection dataProtection = default(VolumePropertiesDataProtection), bool? isRestoring = default(bool?), bool? snapshotDirectoryVisible = default(bool?), bool? kerberosEnabled = default(bool?), string securityStyle = default(string), bool? smbEncryption = default(bool?), string smbAccessBasedEnumeration = default(string), string smbNonBrowsable = default(string), bool? smbContinuouslyAvailable = default(bool?), double? throughputMibps = default(double?), string encryptionKeySource = default(string), string keyVaultPrivateEndpointResourceId = default(string), bool? ldapEnabled = default(bool?), bool? coolAccess = default(bool?), int? coolnessPeriod = default(int?), string unixPermissions = default(string), int? cloneProgress = default(int?), string avsDataStore = default(string), bool? isDefaultQuotaEnabled = default(bool?), long? defaultUserQuotaInKiBs = default(long?), long? defaultGroupQuotaInKiBs = default(long?), long? maximumNumberOfFiles = default(long?), string volumeGroupName = default(string), string capacityPoolResourceId = default(string), string proximityPlacementGroup = default(string), string t2Network = default(string), string volumeSpecName = default(string), bool? encrypted = default(bool?), IList placementRules = default(IList), string enableSubvolumes = default(string)) + : base(location, id, name, type, systemData, tags) { - Location = location; - Id = id; - Name = name; Etag = etag; - Type = type; - Tags = tags; + Zones = zones; FileSystemId = fileSystemId; CreationToken = creationToken; ServiceLevel = serviceLevel; @@ -146,6 +164,7 @@ public Volume() ProtocolTypes = protocolTypes; ProvisioningState = provisioningState; SnapshotId = snapshotId; + DeleteBaseSnapshot = deleteBaseSnapshot; BackupId = backupId; BaremetalTenantId = baremetalTenantId; SubnetId = subnetId; @@ -160,9 +179,12 @@ public Volume() KerberosEnabled = kerberosEnabled; SecurityStyle = securityStyle; SmbEncryption = smbEncryption; + SmbAccessBasedEnumeration = smbAccessBasedEnumeration; + SmbNonBrowsable = smbNonBrowsable; SmbContinuouslyAvailable = smbContinuouslyAvailable; ThroughputMibps = throughputMibps; EncryptionKeySource = encryptionKeySource; + KeyVaultPrivateEndpointResourceId = keyVaultPrivateEndpointResourceId; LdapEnabled = ldapEnabled; CoolAccess = coolAccess; CoolnessPeriod = coolnessPeriod; @@ -178,9 +200,9 @@ public Volume() ProximityPlacementGroup = proximityPlacementGroup; T2Network = t2Network; VolumeSpecName = volumeSpecName; + Encrypted = encrypted; PlacementRules = placementRules; EnableSubvolumes = enableSubvolumes; - SystemData = systemData; CustomInit(); } @@ -189,24 +211,6 @@ public Volume() /// partial void CustomInit(); - /// - /// Gets or sets resource location - /// - [JsonProperty(PropertyName = "location")] - public string Location { get; set; } - - /// - /// Gets resource Id - /// - [JsonProperty(PropertyName = "id")] - public string Id { get; private set; } - - /// - /// Gets resource name - /// - [JsonProperty(PropertyName = "name")] - public string Name { get; private set; } - /// /// Gets a unique read-only string that changes whenever the resource /// is updated. @@ -215,16 +219,10 @@ public Volume() public string Etag { get; private set; } /// - /// Gets resource type - /// - [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } - - /// - /// Gets or sets resource tags + /// Gets or sets availability Zone /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } + [JsonProperty(PropertyName = "zones")] + public IList Zones { get; set; } /// /// Gets fileSystem ID @@ -259,8 +257,8 @@ public Volume() /// /// /// Maximum storage quota allowed for a file system in bytes. This is a - /// soft quota used for alerting only. Minimum size is 100 GiB. Upper - /// limit is 100TiB. Specified in bytes. + /// soft quota used for alerting only. Minimum size is 500 GiB. Upper + /// limit is 100TiB, 500Tib for LargeVolume. Specified in bytes. /// [JsonProperty(PropertyName = "properties.usageThreshold")] public long UsageThreshold { get; set; } @@ -298,6 +296,14 @@ public Volume() [JsonProperty(PropertyName = "properties.snapshotId")] public string SnapshotId { get; set; } + /// + /// Gets or sets if enabled (true) the snapshot the volume was created + /// from will be automatically deleted after the volume create + /// operation has finished. Defaults to false + /// + [JsonProperty(PropertyName = "properties.deleteBaseSnapshot")] + public bool? DeleteBaseSnapshot { get; set; } + /// /// Gets or sets backup ID /// @@ -416,6 +422,28 @@ public Volume() [JsonProperty(PropertyName = "properties.smbEncryption")] public bool? SmbEncryption { get; set; } + /// + /// Gets or sets smbAccessBasedEnumeration + /// + /// + /// Enables access based enumeration share property for SMB Shares. + /// Only applicable for SMB/DualProtocol volume. Possible values + /// include: 'Disabled', 'Enabled' + /// + [JsonProperty(PropertyName = "properties.smbAccessBasedEnumeration")] + public string SmbAccessBasedEnumeration { get; set; } + + /// + /// Gets or sets smbNonBrowsable + /// + /// + /// Enables non browsable property for SMB Shares. Only applicable for + /// SMB/DualProtocol volume. Possible values include: 'Disabled', + /// 'Enabled' + /// + [JsonProperty(PropertyName = "properties.smbNonBrowsable")] + public string SmbNonBrowsable { get; set; } + /// /// Gets or sets enables continuously available share property for smb /// volume. Only applicable for SMB volume @@ -424,7 +452,7 @@ public Volume() public bool? SmbContinuouslyAvailable { get; set; } /// - /// Gets or sets maximum throughput in Mibps that can be achieved by + /// Gets or sets maximum throughput in MiB/s that can be achieved by /// this volume and this will be accepted as input only for manual /// qosType volume /// @@ -432,12 +460,23 @@ public Volume() public double? ThroughputMibps { get; set; } /// - /// Gets or sets encryption Key Source. Possible values are: - /// 'Microsoft.NetApp' + /// Gets or sets source of key used to encrypt data in volume. + /// Applicable if NetApp account has encryption.keySource = + /// 'Microsoft.KeyVault'. Possible values (case-insensitive) are: + /// 'Microsoft.NetApp, Microsoft.KeyVault'. Possible values include: + /// 'Microsoft.NetApp', 'Microsoft.KeyVault' /// [JsonProperty(PropertyName = "properties.encryptionKeySource")] public string EncryptionKeySource { get; set; } + /// + /// Gets or sets the resource ID of private endpoint for KeyVault. It + /// must reside in the same VNET as the volume. Only applicable if + /// encryptionKeySource = 'Microsoft.KeyVault'. + /// + [JsonProperty(PropertyName = "properties.keyVaultPrivateEndpointResourceId")] + public string KeyVaultPrivateEndpointResourceId { get; set; } + /// /// Gets or sets specifies whether LDAP is enabled or not for a given /// NFS volume. @@ -553,6 +592,13 @@ public Volume() [JsonProperty(PropertyName = "properties.volumeSpecName")] public string VolumeSpecName { get; set; } + /// + /// Gets specifies if the volume is encrypted or not. Only available on + /// volumes created or updated after 2022-01-01. + /// + [JsonProperty(PropertyName = "properties.encrypted")] + public bool? Encrypted { get; private set; } + /// /// Gets or sets volume placement rules /// @@ -570,24 +616,15 @@ public Volume() [JsonProperty(PropertyName = "properties.enableSubvolumes")] public string EnableSubvolumes { get; set; } - /// - /// Gets the system meta data relating to this resource. - /// - [JsonProperty(PropertyName = "systemData")] - public SystemData SystemData { get; private set; } - /// /// Validate the object. /// /// /// Thrown if validation fails /// - public virtual void Validate() + public override void Validate() { - if (Location == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "Location"); - } + base.Validate(); if (CreationToken == null) { throw new ValidationException(ValidationRules.CannotBeNull, "CreationToken"); @@ -626,44 +663,14 @@ public virtual void Validate() throw new ValidationException(ValidationRules.Pattern, "CreationToken", "^[a-zA-Z][a-zA-Z0-9\\-]{0,79}$"); } } - if (UsageThreshold > 109951162777600) + if (UsageThreshold > 549755813888000) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "UsageThreshold", 109951162777600); + throw new ValidationException(ValidationRules.InclusiveMaximum, "UsageThreshold", 549755813888000); } if (UsageThreshold < 107374182400) { throw new ValidationException(ValidationRules.InclusiveMinimum, "UsageThreshold", 107374182400); } - if (SnapshotId != null) - { - if (SnapshotId.Length > 36) - { - throw new ValidationException(ValidationRules.MaxLength, "SnapshotId", 36); - } - if (SnapshotId.Length < 36) - { - throw new ValidationException(ValidationRules.MinLength, "SnapshotId", 36); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(SnapshotId, "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}|(\\\\?([^\\/]*[\\/])*)([^\\/]+)$")) - { - throw new ValidationException(ValidationRules.Pattern, "SnapshotId", "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}|(\\\\?([^\\/]*[\\/])*)([^\\/]+)$"); - } - } - if (BackupId != null) - { - if (BackupId.Length > 36) - { - throw new ValidationException(ValidationRules.MaxLength, "BackupId", 36); - } - if (BackupId.Length < 36) - { - throw new ValidationException(ValidationRules.MinLength, "BackupId", 36); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(BackupId, "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}|(\\\\?([^\\/]*[\\/])*)([^\\/]+)$")) - { - throw new ValidationException(ValidationRules.Pattern, "BackupId", "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}|(\\\\?([^\\/]*[\\/])*)([^\\/]+)$"); - } - } if (NetworkSiblingSetId != null) { if (NetworkSiblingSetId.Length > 36) @@ -693,16 +700,13 @@ public virtual void Validate() { DataProtection.Validate(); } - if (CoolnessPeriod != null) + if (CoolnessPeriod > 63) { - if (CoolnessPeriod > 63) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "CoolnessPeriod", 63); - } - if (CoolnessPeriod < 7) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "CoolnessPeriod", 7); - } + throw new ValidationException(ValidationRules.InclusiveMaximum, "CoolnessPeriod", 63); + } + if (CoolnessPeriod < 7) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "CoolnessPeriod", 7); } if (UnixPermissions != null) { diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumeGroup.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumeGroup.cs index 3eb9cce62dfd..5fb0f33a4d30 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumeGroup.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumeGroup.cs @@ -13,8 +13,6 @@ namespace Microsoft.Azure.Management.NetApp.Models using Microsoft.Rest; using Microsoft.Rest.Serialization; using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -38,16 +36,14 @@ public VolumeGroup() /// Resource Id /// Resource name /// Resource type - /// Resource tags /// Azure lifecycle management /// groupMetaData - public VolumeGroup(string location = default(string), string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string provisioningState = default(string), VolumeGroupMetaData groupMetaData = default(VolumeGroupMetaData)) + public VolumeGroup(string location = default(string), string id = default(string), string name = default(string), string type = default(string), string provisioningState = default(string), VolumeGroupMetaData groupMetaData = default(VolumeGroupMetaData)) { Location = location; Id = id; Name = name; Type = type; - Tags = tags; ProvisioningState = provisioningState; GroupMetaData = groupMetaData; CustomInit(); @@ -82,12 +78,6 @@ public VolumeGroup() [JsonProperty(PropertyName = "type")] public string Type { get; private set; } - /// - /// Gets or sets resource tags - /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - /// /// Gets azure lifecycle management /// diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumeGroupDetails.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumeGroupDetails.cs index 239013d35b2c..d55db318d471 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumeGroupDetails.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumeGroupDetails.cs @@ -38,17 +38,15 @@ public VolumeGroupDetails() /// Resource Id /// Resource name /// Resource type - /// Resource tags /// Azure lifecycle management /// groupMetaData /// List of volumes from group - public VolumeGroupDetails(string location = default(string), string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string provisioningState = default(string), VolumeGroupMetaData groupMetaData = default(VolumeGroupMetaData), IList volumes = default(IList)) + public VolumeGroupDetails(string location = default(string), string id = default(string), string name = default(string), string type = default(string), string provisioningState = default(string), VolumeGroupMetaData groupMetaData = default(VolumeGroupMetaData), IList volumes = default(IList)) { Location = location; Id = id; Name = name; Type = type; - Tags = tags; ProvisioningState = provisioningState; GroupMetaData = groupMetaData; Volumes = volumes; @@ -84,12 +82,6 @@ public VolumeGroupDetails() [JsonProperty(PropertyName = "type")] public string Type { get; private set; } - /// - /// Gets or sets resource tags - /// - [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } - /// /// Gets azure lifecycle management /// diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumeGroupVolumeProperties.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumeGroupVolumeProperties.cs index 53b840eaf49a..82acaf4d70d2 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumeGroupVolumeProperties.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumeGroupVolumeProperties.cs @@ -51,6 +51,9 @@ public VolumeGroupVolumeProperties() /// protocolTypes /// Azure lifecycle management /// Snapshot ID + /// If enabled (true) the snapshot the + /// volume was created from will be automatically deleted after the + /// volume create operation has finished. Defaults to false /// Backup ID /// Baremetal Tenant ID /// Network features @@ -75,14 +78,25 @@ public VolumeGroupVolumeProperties() /// Enables encryption for in-flight smb3 /// data. Only applicable for SMB/DualProtocol volume. To be used with /// swagger version 2020-08-01 or later + /// smbAccessBasedEnumeration + /// smbNonBrowsable /// Enables continuously /// available share property for smb volume. Only applicable for SMB /// volume - /// Maximum throughput in Mibps that can + /// Maximum throughput in MiB/s that can /// be achieved by this volume and this will be accepted as input only /// for manual qosType volume - /// Encryption Key Source. Possible - /// values are: 'Microsoft.NetApp' + /// Source of key used to encrypt + /// data in volume. Applicable if NetApp account has + /// encryption.keySource = 'Microsoft.KeyVault'. Possible values + /// (case-insensitive) are: 'Microsoft.NetApp, Microsoft.KeyVault'. + /// Possible values include: 'Microsoft.NetApp', + /// 'Microsoft.KeyVault' + /// The resource ID of + /// private endpoint for KeyVault. It must reside in the same VNET as + /// the volume. Only applicable if encryptionKeySource = + /// 'Microsoft.KeyVault'. /// Specifies whether LDAP is enabled or not /// for a given NFS volume. /// Specifies whether Cool Access(tiering) is @@ -123,11 +137,14 @@ public VolumeGroupVolumeProperties() /// Volume spec name is the application /// specific designation or identifier for the particular volume in a /// volume group for e.g. data, log + /// Specifies if the volume is encrypted or + /// not. Only available on volumes created or updated after + /// 2022-01-01. /// Volume placement rules /// Flag indicating whether subvolume /// operations are enabled on the volume. Possible values include: /// 'Enabled', 'Disabled' - public VolumeGroupVolumeProperties(string creationToken, long usageThreshold, string subnetId, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string fileSystemId = default(string), string serviceLevel = default(string), VolumePropertiesExportPolicy exportPolicy = default(VolumePropertiesExportPolicy), IList protocolTypes = default(IList), string provisioningState = default(string), string snapshotId = default(string), string backupId = default(string), string baremetalTenantId = default(string), string networkFeatures = default(string), string networkSiblingSetId = default(string), string storageToNetworkProximity = default(string), IList mountTargets = default(IList), string volumeType = default(string), VolumePropertiesDataProtection dataProtection = default(VolumePropertiesDataProtection), bool? isRestoring = default(bool?), bool? snapshotDirectoryVisible = default(bool?), bool? kerberosEnabled = default(bool?), string securityStyle = default(string), bool? smbEncryption = default(bool?), bool? smbContinuouslyAvailable = default(bool?), double? throughputMibps = default(double?), string encryptionKeySource = default(string), bool? ldapEnabled = default(bool?), bool? coolAccess = default(bool?), int? coolnessPeriod = default(int?), string unixPermissions = default(string), int? cloneProgress = default(int?), string avsDataStore = default(string), bool? isDefaultQuotaEnabled = default(bool?), long? defaultUserQuotaInKiBs = default(long?), long? defaultGroupQuotaInKiBs = default(long?), long? maximumNumberOfFiles = default(long?), string volumeGroupName = default(string), string capacityPoolResourceId = default(string), string proximityPlacementGroup = default(string), string t2Network = default(string), string volumeSpecName = default(string), IList placementRules = default(IList), string enableSubvolumes = default(string)) + public VolumeGroupVolumeProperties(string creationToken, long usageThreshold, string subnetId, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string fileSystemId = default(string), string serviceLevel = default(string), VolumePropertiesExportPolicy exportPolicy = default(VolumePropertiesExportPolicy), IList protocolTypes = default(IList), string provisioningState = default(string), string snapshotId = default(string), bool? deleteBaseSnapshot = default(bool?), string backupId = default(string), string baremetalTenantId = default(string), string networkFeatures = default(string), string networkSiblingSetId = default(string), string storageToNetworkProximity = default(string), IList mountTargets = default(IList), string volumeType = default(string), VolumePropertiesDataProtection dataProtection = default(VolumePropertiesDataProtection), bool? isRestoring = default(bool?), bool? snapshotDirectoryVisible = default(bool?), bool? kerberosEnabled = default(bool?), string securityStyle = default(string), bool? smbEncryption = default(bool?), string smbAccessBasedEnumeration = default(string), string smbNonBrowsable = default(string), bool? smbContinuouslyAvailable = default(bool?), double? throughputMibps = default(double?), string encryptionKeySource = default(string), string keyVaultPrivateEndpointResourceId = default(string), bool? ldapEnabled = default(bool?), bool? coolAccess = default(bool?), int? coolnessPeriod = default(int?), string unixPermissions = default(string), int? cloneProgress = default(int?), string avsDataStore = default(string), bool? isDefaultQuotaEnabled = default(bool?), long? defaultUserQuotaInKiBs = default(long?), long? defaultGroupQuotaInKiBs = default(long?), long? maximumNumberOfFiles = default(long?), string volumeGroupName = default(string), string capacityPoolResourceId = default(string), string proximityPlacementGroup = default(string), string t2Network = default(string), string volumeSpecName = default(string), bool? encrypted = default(bool?), IList placementRules = default(IList), string enableSubvolumes = default(string)) { Id = id; Name = name; @@ -141,6 +158,7 @@ public VolumeGroupVolumeProperties() ProtocolTypes = protocolTypes; ProvisioningState = provisioningState; SnapshotId = snapshotId; + DeleteBaseSnapshot = deleteBaseSnapshot; BackupId = backupId; BaremetalTenantId = baremetalTenantId; SubnetId = subnetId; @@ -155,9 +173,12 @@ public VolumeGroupVolumeProperties() KerberosEnabled = kerberosEnabled; SecurityStyle = securityStyle; SmbEncryption = smbEncryption; + SmbAccessBasedEnumeration = smbAccessBasedEnumeration; + SmbNonBrowsable = smbNonBrowsable; SmbContinuouslyAvailable = smbContinuouslyAvailable; ThroughputMibps = throughputMibps; EncryptionKeySource = encryptionKeySource; + KeyVaultPrivateEndpointResourceId = keyVaultPrivateEndpointResourceId; LdapEnabled = ldapEnabled; CoolAccess = coolAccess; CoolnessPeriod = coolnessPeriod; @@ -173,6 +194,7 @@ public VolumeGroupVolumeProperties() ProximityPlacementGroup = proximityPlacementGroup; T2Network = t2Network; VolumeSpecName = volumeSpecName; + Encrypted = encrypted; PlacementRules = placementRules; EnableSubvolumes = enableSubvolumes; CustomInit(); @@ -240,8 +262,8 @@ public VolumeGroupVolumeProperties() /// /// /// Maximum storage quota allowed for a file system in bytes. This is a - /// soft quota used for alerting only. Minimum size is 100 GiB. Upper - /// limit is 100TiB. Specified in bytes. + /// soft quota used for alerting only. Minimum size is 500 GiB. Upper + /// limit is 100TiB, 500Tib for LargeVolume. Specified in bytes. /// [JsonProperty(PropertyName = "properties.usageThreshold")] public long UsageThreshold { get; set; } @@ -279,6 +301,14 @@ public VolumeGroupVolumeProperties() [JsonProperty(PropertyName = "properties.snapshotId")] public string SnapshotId { get; set; } + /// + /// Gets or sets if enabled (true) the snapshot the volume was created + /// from will be automatically deleted after the volume create + /// operation has finished. Defaults to false + /// + [JsonProperty(PropertyName = "properties.deleteBaseSnapshot")] + public bool? DeleteBaseSnapshot { get; set; } + /// /// Gets or sets backup ID /// @@ -397,6 +427,28 @@ public VolumeGroupVolumeProperties() [JsonProperty(PropertyName = "properties.smbEncryption")] public bool? SmbEncryption { get; set; } + /// + /// Gets or sets smbAccessBasedEnumeration + /// + /// + /// Enables access based enumeration share property for SMB Shares. + /// Only applicable for SMB/DualProtocol volume. Possible values + /// include: 'Disabled', 'Enabled' + /// + [JsonProperty(PropertyName = "properties.smbAccessBasedEnumeration")] + public string SmbAccessBasedEnumeration { get; set; } + + /// + /// Gets or sets smbNonBrowsable + /// + /// + /// Enables non browsable property for SMB Shares. Only applicable for + /// SMB/DualProtocol volume. Possible values include: 'Disabled', + /// 'Enabled' + /// + [JsonProperty(PropertyName = "properties.smbNonBrowsable")] + public string SmbNonBrowsable { get; set; } + /// /// Gets or sets enables continuously available share property for smb /// volume. Only applicable for SMB volume @@ -405,7 +457,7 @@ public VolumeGroupVolumeProperties() public bool? SmbContinuouslyAvailable { get; set; } /// - /// Gets or sets maximum throughput in Mibps that can be achieved by + /// Gets or sets maximum throughput in MiB/s that can be achieved by /// this volume and this will be accepted as input only for manual /// qosType volume /// @@ -413,12 +465,23 @@ public VolumeGroupVolumeProperties() public double? ThroughputMibps { get; set; } /// - /// Gets or sets encryption Key Source. Possible values are: - /// 'Microsoft.NetApp' + /// Gets or sets source of key used to encrypt data in volume. + /// Applicable if NetApp account has encryption.keySource = + /// 'Microsoft.KeyVault'. Possible values (case-insensitive) are: + /// 'Microsoft.NetApp, Microsoft.KeyVault'. Possible values include: + /// 'Microsoft.NetApp', 'Microsoft.KeyVault' /// [JsonProperty(PropertyName = "properties.encryptionKeySource")] public string EncryptionKeySource { get; set; } + /// + /// Gets or sets the resource ID of private endpoint for KeyVault. It + /// must reside in the same VNET as the volume. Only applicable if + /// encryptionKeySource = 'Microsoft.KeyVault'. + /// + [JsonProperty(PropertyName = "properties.keyVaultPrivateEndpointResourceId")] + public string KeyVaultPrivateEndpointResourceId { get; set; } + /// /// Gets or sets specifies whether LDAP is enabled or not for a given /// NFS volume. @@ -534,6 +597,13 @@ public VolumeGroupVolumeProperties() [JsonProperty(PropertyName = "properties.volumeSpecName")] public string VolumeSpecName { get; set; } + /// + /// Gets specifies if the volume is encrypted or not. Only available on + /// volumes created or updated after 2022-01-01. + /// + [JsonProperty(PropertyName = "properties.encrypted")] + public bool? Encrypted { get; private set; } + /// /// Gets or sets volume placement rules /// @@ -597,44 +667,14 @@ public virtual void Validate() throw new ValidationException(ValidationRules.Pattern, "CreationToken", "^[a-zA-Z][a-zA-Z0-9\\-]{0,79}$"); } } - if (UsageThreshold > 109951162777600) + if (UsageThreshold > 549755813888000) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "UsageThreshold", 109951162777600); + throw new ValidationException(ValidationRules.InclusiveMaximum, "UsageThreshold", 549755813888000); } if (UsageThreshold < 107374182400) { throw new ValidationException(ValidationRules.InclusiveMinimum, "UsageThreshold", 107374182400); } - if (SnapshotId != null) - { - if (SnapshotId.Length > 36) - { - throw new ValidationException(ValidationRules.MaxLength, "SnapshotId", 36); - } - if (SnapshotId.Length < 36) - { - throw new ValidationException(ValidationRules.MinLength, "SnapshotId", 36); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(SnapshotId, "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}|(\\\\?([^\\/]*[\\/])*)([^\\/]+)$")) - { - throw new ValidationException(ValidationRules.Pattern, "SnapshotId", "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}|(\\\\?([^\\/]*[\\/])*)([^\\/]+)$"); - } - } - if (BackupId != null) - { - if (BackupId.Length > 36) - { - throw new ValidationException(ValidationRules.MaxLength, "BackupId", 36); - } - if (BackupId.Length < 36) - { - throw new ValidationException(ValidationRules.MinLength, "BackupId", 36); - } - if (!System.Text.RegularExpressions.Regex.IsMatch(BackupId, "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}|(\\\\?([^\\/]*[\\/])*)([^\\/]+)$")) - { - throw new ValidationException(ValidationRules.Pattern, "BackupId", "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}|(\\\\?([^\\/]*[\\/])*)([^\\/]+)$"); - } - } if (NetworkSiblingSetId != null) { if (NetworkSiblingSetId.Length > 36) @@ -664,16 +704,13 @@ public virtual void Validate() { DataProtection.Validate(); } - if (CoolnessPeriod != null) + if (CoolnessPeriod > 63) { - if (CoolnessPeriod > 63) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "CoolnessPeriod", 63); - } - if (CoolnessPeriod < 7) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "CoolnessPeriod", 7); - } + throw new ValidationException(ValidationRules.InclusiveMaximum, "CoolnessPeriod", 63); + } + if (CoolnessPeriod < 7) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "CoolnessPeriod", 7); } if (UnixPermissions != null) { 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 5b79a43b59e5..6b4a2a12ab8d 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 @@ -63,7 +63,11 @@ public VolumePatch() /// same group. the fourth for other users not in the group. 0755 - /// gives read/write/execute permissions to owner and read/execute to /// group and other users. - public VolumePatch(string location = default(string), string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string serviceLevel = default(string), long? usageThreshold = default(long?), VolumePatchPropertiesExportPolicy exportPolicy = default(VolumePatchPropertiesExportPolicy), double? throughputMibps = default(double?), VolumePatchPropertiesDataProtection dataProtection = default(VolumePatchPropertiesDataProtection), bool? isDefaultQuotaEnabled = default(bool?), long? defaultUserQuotaInKiBs = default(long?), long? defaultGroupQuotaInKiBs = default(long?), string unixPermissions = default(string)) + /// Specifies whether Cool Access(tiering) is + /// enabled for the volume. + /// Specifies the number of days after + /// which data that is not accessed by clients will be tiered. + public VolumePatch(string location = default(string), string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string serviceLevel = default(string), long? usageThreshold = default(long?), VolumePatchPropertiesExportPolicy exportPolicy = default(VolumePatchPropertiesExportPolicy), double? throughputMibps = default(double?), VolumePatchPropertiesDataProtection dataProtection = default(VolumePatchPropertiesDataProtection), bool? isDefaultQuotaEnabled = default(bool?), long? defaultUserQuotaInKiBs = default(long?), long? defaultGroupQuotaInKiBs = default(long?), string unixPermissions = default(string), bool? coolAccess = default(bool?), int? coolnessPeriod = default(int?)) { Location = location; Id = id; @@ -79,6 +83,8 @@ public VolumePatch() DefaultUserQuotaInKiBs = defaultUserQuotaInKiBs; DefaultGroupQuotaInKiBs = defaultGroupQuotaInKiBs; UnixPermissions = unixPermissions; + CoolAccess = coolAccess; + CoolnessPeriod = coolnessPeriod; CustomInit(); } @@ -133,7 +139,7 @@ public VolumePatch() /// /// Maximum storage quota allowed for a file system in bytes. This is a /// soft quota used for alerting only. Minimum size is 100 GiB. Upper - /// limit is 100TiB. Specified in bytes. + /// limit is 100TiB, 500Tib for LargeVolume. Specified in bytes. /// [JsonProperty(PropertyName = "properties.usageThreshold")] public long? UsageThreshold { get; set; } @@ -197,6 +203,20 @@ public VolumePatch() [JsonProperty(PropertyName = "properties.unixPermissions")] public string UnixPermissions { get; set; } + /// + /// Gets or sets specifies whether Cool Access(tiering) is enabled for + /// the volume. + /// + [JsonProperty(PropertyName = "properties.coolAccess")] + public bool? CoolAccess { get; set; } + + /// + /// Gets or sets specifies the number of days after which data that is + /// not accessed by clients will be tiered. + /// + [JsonProperty(PropertyName = "properties.coolnessPeriod")] + public int? CoolnessPeriod { get; set; } + /// /// Validate the object. /// @@ -205,16 +225,13 @@ public VolumePatch() /// public virtual void Validate() { - if (UsageThreshold != null) + if (UsageThreshold > 549755813888000) { - 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", 549755813888000); + } + if (UsageThreshold < 107374182400) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "UsageThreshold", 107374182400); } if (UnixPermissions != null) { @@ -227,6 +244,14 @@ public virtual void Validate() throw new ValidationException(ValidationRules.MinLength, "UnixPermissions", 4); } } + if (CoolnessPeriod > 63) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "CoolnessPeriod", 63); + } + if (CoolnessPeriod < 7) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "CoolnessPeriod", 7); + } } } } diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumeQuotaRule.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumeQuotaRule.cs new file mode 100644 index 000000000000..007e6c09e1ed --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumeQuotaRule.cs @@ -0,0 +1,116 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.NetApp.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Quota Rule of a Volume + /// + [Rest.Serialization.JsonTransformation] + public partial class VolumeQuotaRule : TrackedResource + { + /// + /// Initializes a new instance of the VolumeQuotaRule class. + /// + public VolumeQuotaRule() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VolumeQuotaRule class. + /// + /// The geo-location where the resource + /// lives + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// The name of the resource + /// The type of the resource. E.g. + /// "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// Azure Resource Manager metadata containing + /// createdBy and modifiedBy information. + /// Resource tags. + /// Possible values include: + /// 'Accepted', 'Creating', 'Patching', 'Deleting', 'Moving', 'Failed', + /// 'Succeeded' + /// Size of quota + /// quotaType + /// UserID/GroupID/SID based on the quota + /// target type. UserID and groupID can be found by running ‘id’ or + /// ‘getent’ command for the user or group and SID can be found by + /// running <wmic useraccount where name='user-name' get + /// sid> + public VolumeQuotaRule(string location, string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), IDictionary tags = default(IDictionary), ProvisioningState? provisioningState = default(ProvisioningState?), long? quotaSizeInKiBs = default(long?), string quotaType = default(string), string quotaTarget = default(string)) + : base(location, id, name, type, systemData, tags) + { + ProvisioningState = provisioningState; + QuotaSizeInKiBs = quotaSizeInKiBs; + QuotaType = quotaType; + QuotaTarget = quotaTarget; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets possible values include: 'Accepted', 'Creating', + /// 'Patching', 'Deleting', 'Moving', 'Failed', 'Succeeded' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public ProvisioningState? ProvisioningState { get; set; } + + /// + /// Gets or sets size of quota + /// + [JsonProperty(PropertyName = "properties.quotaSizeInKiBs")] + public long? QuotaSizeInKiBs { get; set; } + + /// + /// Gets or sets quotaType + /// + /// + /// Type of quota. Possible values include: 'DefaultUserQuota', + /// 'DefaultGroupQuota', 'IndividualUserQuota', 'IndividualGroupQuota' + /// + [JsonProperty(PropertyName = "properties.quotaType")] + public string QuotaType { get; set; } + + /// + /// Gets or sets userID/GroupID/SID based on the quota target type. + /// UserID and groupID can be found by running ‘id’ or ‘getent’ command + /// for the user or group and SID can be found by running &lt;wmic + /// useraccount where name='user-name' get sid&gt; + /// + [JsonProperty(PropertyName = "properties.quotaTarget")] + public string QuotaTarget { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumeQuotaRulePatch.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumeQuotaRulePatch.cs new file mode 100644 index 000000000000..f0cdf617647a --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumeQuotaRulePatch.cs @@ -0,0 +1,92 @@ +// +// 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 Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Patchable Quota Rule of a Volume + /// + [Rest.Serialization.JsonTransformation] + public partial class VolumeQuotaRulePatch + { + /// + /// Initializes a new instance of the VolumeQuotaRulePatch class. + /// + public VolumeQuotaRulePatch() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VolumeQuotaRulePatch class. + /// + /// Possible values include: + /// 'Accepted', 'Creating', 'Patching', 'Deleting', 'Moving', 'Failed', + /// 'Succeeded' + /// Size of quota + /// quotaType + /// UserID/GroupID/SID based on the quota + /// target type. UserID and groupID can be found by running ‘id’ or + /// ‘getent’ command for the user or group and SID can be found by + /// running <wmic useraccount where name='user-name' get + /// sid> + public VolumeQuotaRulePatch(ProvisioningState? provisioningState = default(ProvisioningState?), long? quotaSizeInKiBs = default(long?), string quotaType = default(string), string quotaTarget = default(string)) + { + ProvisioningState = provisioningState; + QuotaSizeInKiBs = quotaSizeInKiBs; + QuotaType = quotaType; + QuotaTarget = quotaTarget; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets possible values include: 'Accepted', 'Creating', + /// 'Patching', 'Deleting', 'Moving', 'Failed', 'Succeeded' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public ProvisioningState? ProvisioningState { get; set; } + + /// + /// Gets or sets size of quota + /// + [JsonProperty(PropertyName = "properties.quotaSizeInKiBs")] + public long? QuotaSizeInKiBs { get; set; } + + /// + /// Gets or sets quotaType + /// + /// + /// Type of quota. Possible values include: 'DefaultUserQuota', + /// 'DefaultGroupQuota', 'IndividualUserQuota', 'IndividualGroupQuota' + /// + [JsonProperty(PropertyName = "properties.quotaType")] + public string QuotaType { get; set; } + + /// + /// Gets or sets userID/GroupID/SID based on the quota target type. + /// UserID and groupID can be found by running ‘id’ or ‘getent’ command + /// for the user or group and SID can be found by running &lt;wmic + /// useraccount where name='user-name' get sid&gt; + /// + [JsonProperty(PropertyName = "properties.quotaTarget")] + public string QuotaTarget { get; set; } + + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumeRelocationProperties.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumeRelocationProperties.cs new file mode 100644 index 000000000000..f0728d848f56 --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumeRelocationProperties.cs @@ -0,0 +1,71 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.NetApp.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Volume relocation properties + /// + public partial class VolumeRelocationProperties + { + /// + /// Initializes a new instance of the VolumeRelocationProperties class. + /// + public VolumeRelocationProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VolumeRelocationProperties class. + /// + /// The id of the old volume that is being + /// relocated + /// The id of the bare metal tenant + /// owned by the existing volume + /// Has relocation been requested for + /// this volume + public VolumeRelocationProperties(string oldVolumeId = default(string), string oldBareMetalTenantId = default(string), bool? relocationRequested = default(bool?)) + { + OldVolumeId = oldVolumeId; + OldBareMetalTenantId = oldBareMetalTenantId; + RelocationRequested = relocationRequested; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the id of the old volume that is being relocated + /// + [JsonProperty(PropertyName = "oldVolumeId")] + public string OldVolumeId { get; set; } + + /// + /// Gets or sets the id of the bare metal tenant owned by the existing + /// volume + /// + [JsonProperty(PropertyName = "oldBareMetalTenantId")] + public string OldBareMetalTenantId { get; set; } + + /// + /// Gets or sets has relocation been requested for this volume + /// + [JsonProperty(PropertyName = "relocationRequested")] + public bool? RelocationRequested { get; set; } + + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/NetAppResourceOperations.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/NetAppResourceOperations.cs index 88b9e7cdbad4..8cfa9c5ae2b0 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/NetAppResourceOperations.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/NetAppResourceOperations.cs @@ -747,5 +747,202 @@ internal NetAppResourceOperations(AzureNetAppFilesManagementClient client) return _result; } + /// + /// Describes region specific information. + /// + /// + /// Provides storage to network proximity and logical zone mapping information. + /// + /// + /// The location + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> QueryRegionInfoWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "location"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("location", location); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "QueryRegionInfo", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.NetApp/locations/{location}/regionInfo").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("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/NetAppResourceOperationsExtensions.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/NetAppResourceOperationsExtensions.cs index 03af5547ccc3..ed59bfe50d9d 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/NetAppResourceOperationsExtensions.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/NetAppResourceOperationsExtensions.cs @@ -207,5 +207,45 @@ public static CheckAvailabilityResponse CheckQuotaAvailability(this INetAppResou } } + /// + /// Describes region specific information. + /// + /// + /// Provides storage to network proximity and logical zone mapping information. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location + /// + public static RegionInfo QueryRegionInfo(this INetAppResourceOperations operations, string location) + { + return operations.QueryRegionInfoAsync(location).GetAwaiter().GetResult(); + } + + /// + /// Describes region specific information. + /// + /// + /// Provides storage to network proximity and logical zone mapping information. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location + /// + /// + /// The cancellation token. + /// + public static async Task QueryRegionInfoAsync(this INetAppResourceOperations operations, string location, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.QueryRegionInfoWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } } 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 b442e42dd1eb..a2c829cc3302 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,33 +19,23 @@ public static IEnumerable> ApiInfo_NetAppManagemen { return new Tuple[] { - new Tuple("NetApp", "AccountBackups", "2021-10-01"), - new Tuple("NetApp", "Accounts", "2021-10-01"), - new Tuple("NetApp", "BackupPolicies", "2021-10-01"), - new Tuple("NetApp", "Backups", "2021-10-01"), - new Tuple("NetApp", "NetAppResource", "2021-10-01"), - new Tuple("NetApp", "NetAppResourceQuotaLimits", "2021-10-01"), - new Tuple("NetApp", "Operations", "2021-10-01"), - new Tuple("NetApp", "Pools", "2021-10-01"), - new Tuple("NetApp", "SnapshotPolicies", "2021-10-01"), - new Tuple("NetApp", "Snapshots", "2021-10-01"), - new Tuple("NetApp", "Subvolumes", "2021-10-01"), - new Tuple("NetApp", "Vaults", "2021-10-01"), - new Tuple("NetApp", "VolumeGroups", "2021-10-01"), - new Tuple("NetApp", "Volumes", "2021-10-01"), + new Tuple("NetApp", "AccountBackups", "2022-05-01"), + new Tuple("NetApp", "Accounts", "2022-05-01"), + new Tuple("NetApp", "BackupPolicies", "2022-05-01"), + new Tuple("NetApp", "Backups", "2022-05-01"), + new Tuple("NetApp", "NetAppResource", "2022-05-01"), + new Tuple("NetApp", "NetAppResourceQuotaLimits", "2022-05-01"), + new Tuple("NetApp", "Operations", "2022-05-01"), + new Tuple("NetApp", "Pools", "2022-05-01"), + new Tuple("NetApp", "SnapshotPolicies", "2022-05-01"), + new Tuple("NetApp", "Snapshots", "2022-05-01"), + new Tuple("NetApp", "Subvolumes", "2022-05-01"), + new Tuple("NetApp", "Vaults", "2022-05-01"), + new Tuple("NetApp", "VolumeGroups", "2022-05-01"), + new Tuple("NetApp", "VolumeQuotaRules", "2022-05-01"), + new Tuple("NetApp", "Volumes", "2022-05-01"), }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "v2"; - public static readonly String AutoRestBootStrapperVersion = "autorest@3.5.1"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/main/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 = "main"; - public static readonly String GithubCommidId = "4c50e693e709f9a88ed342abfdb54a67ed901ba5"; - 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/VolumeQuotaRulesOperations.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/VolumeQuotaRulesOperations.cs new file mode 100644 index 000000000000..889ab8a76c50 --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/VolumeQuotaRulesOperations.cs @@ -0,0 +1,1572 @@ +// +// 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; + + /// + /// VolumeQuotaRulesOperations operations. + /// + internal partial class VolumeQuotaRulesOperations : IServiceOperations, IVolumeQuotaRulesOperations + { + /// + /// Initializes a new instance of the VolumeQuotaRulesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal VolumeQuotaRulesOperations(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 all quota rules for a volume + /// + /// + /// List all quota rules associated with the 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>> ListByVolumeWithHttpMessagesAsync(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"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // 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, "ListByVolume", 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}/volumeQuotaRules").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; + } + + /// + /// Describe a quota rule + /// + /// + /// Get details of the specified quota rule + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of volume quota rule + /// + /// + /// 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, string volumeQuotaRuleName, 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 (volumeQuotaRuleName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "volumeQuotaRuleName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // 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("volumeQuotaRuleName", volumeQuotaRuleName); + 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}/volumeQuotaRules/{volumeQuotaRuleName}").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)); + _url = _url.Replace("{volumeQuotaRuleName}", System.Uri.EscapeDataString(volumeQuotaRuleName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Create a quota rule + /// + /// + /// Create the specified quota rule within the given volume + /// + /// + /// Quota rule object supplied in the body of the operation. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of volume quota rule + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateWithHttpMessagesAsync(VolumeQuotaRule body, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Update a quota rule + /// + /// + /// Patch a quota rule + /// + /// + /// Quota rule object supplied in the body of the operation. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of volume quota rule + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> UpdateWithHttpMessagesAsync(VolumeQuotaRulePatch body, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Delete a quota rule + /// + /// + /// Delete quota rule + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of volume quota rule + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Create a quota rule + /// + /// + /// Create the specified quota rule within the given volume + /// + /// + /// Quota rule object supplied in the body of the operation. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of volume quota rule + /// + /// + /// 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> BeginCreateWithHttpMessagesAsync(VolumeQuotaRule body, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (body == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "body"); + } + if (body != null) + { + body.Validate(); + } + 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 (volumeQuotaRuleName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "volumeQuotaRuleName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("body", body); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("poolName", poolName); + tracingParameters.Add("volumeName", volumeName); + tracingParameters.Add("volumeQuotaRuleName", volumeQuotaRuleName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreate", 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}/volumeQuotaRules/{volumeQuotaRuleName}").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)); + _url = _url.Replace("{volumeQuotaRuleName}", System.Uri.EscapeDataString(volumeQuotaRuleName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(body != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201) + { + 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); + } + } + // 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) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Update a quota rule + /// + /// + /// Patch a quota rule + /// + /// + /// Quota rule object supplied in the body of the operation. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of volume quota rule + /// + /// + /// 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> BeginUpdateWithHttpMessagesAsync(VolumeQuotaRulePatch body, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (body == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "body"); + } + 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 (volumeQuotaRuleName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "volumeQuotaRuleName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("body", body); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("poolName", poolName); + tracingParameters.Add("volumeName", volumeName); + tracingParameters.Add("volumeQuotaRuleName", volumeQuotaRuleName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", 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}/volumeQuotaRules/{volumeQuotaRuleName}").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)); + _url = _url.Replace("{volumeQuotaRuleName}", System.Uri.EscapeDataString(volumeQuotaRuleName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(body != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Delete a quota rule + /// + /// + /// Delete quota rule + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of volume quota rule + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, 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 (volumeQuotaRuleName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "volumeQuotaRuleName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // 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("volumeQuotaRuleName", volumeQuotaRuleName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/volumeQuotaRules/{volumeQuotaRuleName}").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)); + _url = _url.Replace("{volumeQuotaRuleName}", System.Uri.EscapeDataString(volumeQuotaRuleName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/VolumeQuotaRulesOperationsExtensions.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/VolumeQuotaRulesOperationsExtensions.cs new file mode 100644 index 000000000000..271851efd19c --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/VolumeQuotaRulesOperationsExtensions.cs @@ -0,0 +1,551 @@ +// +// 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; + + /// + /// Extension methods for VolumeQuotaRulesOperations. + /// + public static partial class VolumeQuotaRulesOperationsExtensions + { + /// + /// Get all quota rules for a volume + /// + /// + /// List all quota rules associated with the 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 IEnumerable ListByVolume(this IVolumeQuotaRulesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) + { + return operations.ListByVolumeAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); + } + + /// + /// Get all quota rules for a volume + /// + /// + /// List all quota rules associated with the 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> ListByVolumeAsync(this IVolumeQuotaRulesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByVolumeWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Describe a quota rule + /// + /// + /// Get details of the specified quota rule + /// + /// + /// 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 name of volume quota rule + /// + public static VolumeQuotaRule Get(this IVolumeQuotaRulesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName) + { + return operations.GetAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName).GetAwaiter().GetResult(); + } + + /// + /// Describe a quota rule + /// + /// + /// Get details of the specified quota rule + /// + /// + /// 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 name of volume quota rule + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IVolumeQuotaRulesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Create a quota rule + /// + /// + /// Create the specified quota rule within the given volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// Quota rule object supplied in the body of the operation. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of volume quota rule + /// + public static VolumeQuotaRule Create(this IVolumeQuotaRulesOperations operations, VolumeQuotaRule body, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName) + { + return operations.CreateAsync(body, resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName).GetAwaiter().GetResult(); + } + + /// + /// Create a quota rule + /// + /// + /// Create the specified quota rule within the given volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// Quota rule object supplied in the body of the operation. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of volume quota rule + /// + /// + /// The cancellation token. + /// + public static async Task CreateAsync(this IVolumeQuotaRulesOperations operations, VolumeQuotaRule body, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Update a quota rule + /// + /// + /// Patch a quota rule + /// + /// + /// The operations group for this extension method. + /// + /// + /// Quota rule object supplied in the body of the operation. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of volume quota rule + /// + public static VolumeQuotaRule Update(this IVolumeQuotaRulesOperations operations, VolumeQuotaRulePatch body, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName) + { + return operations.UpdateAsync(body, resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName).GetAwaiter().GetResult(); + } + + /// + /// Update a quota rule + /// + /// + /// Patch a quota rule + /// + /// + /// The operations group for this extension method. + /// + /// + /// Quota rule object supplied in the body of the operation. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of volume quota rule + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IVolumeQuotaRulesOperations operations, VolumeQuotaRulePatch body, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete a quota rule + /// + /// + /// Delete quota rule + /// + /// + /// 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 name of volume quota rule + /// + public static void Delete(this IVolumeQuotaRulesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName) + { + operations.DeleteAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName).GetAwaiter().GetResult(); + } + + /// + /// Delete a quota rule + /// + /// + /// Delete quota rule + /// + /// + /// 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 name of volume quota rule + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IVolumeQuotaRulesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Create a quota rule + /// + /// + /// Create the specified quota rule within the given volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// Quota rule object supplied in the body of the operation. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of volume quota rule + /// + public static VolumeQuotaRule BeginCreate(this IVolumeQuotaRulesOperations operations, VolumeQuotaRule body, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName) + { + return operations.BeginCreateAsync(body, resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName).GetAwaiter().GetResult(); + } + + /// + /// Create a quota rule + /// + /// + /// Create the specified quota rule within the given volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// Quota rule object supplied in the body of the operation. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of volume quota rule + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateAsync(this IVolumeQuotaRulesOperations operations, VolumeQuotaRule body, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Update a quota rule + /// + /// + /// Patch a quota rule + /// + /// + /// The operations group for this extension method. + /// + /// + /// Quota rule object supplied in the body of the operation. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of volume quota rule + /// + public static VolumeQuotaRule BeginUpdate(this IVolumeQuotaRulesOperations operations, VolumeQuotaRulePatch body, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName) + { + return operations.BeginUpdateAsync(body, resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName).GetAwaiter().GetResult(); + } + + /// + /// Update a quota rule + /// + /// + /// Patch a quota rule + /// + /// + /// The operations group for this extension method. + /// + /// + /// Quota rule object supplied in the body of the operation. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// The name of volume quota rule + /// + /// + /// The cancellation token. + /// + public static async Task BeginUpdateAsync(this IVolumeQuotaRulesOperations operations, VolumeQuotaRulePatch body, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete a quota rule + /// + /// + /// Delete quota rule + /// + /// + /// 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 name of volume quota rule + /// + public static void BeginDelete(this IVolumeQuotaRulesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName) + { + operations.BeginDeleteAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName).GetAwaiter().GetResult(); + } + + /// + /// Delete a quota rule + /// + /// + /// Delete quota rule + /// + /// + /// 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 name of volume quota rule + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IVolumeQuotaRulesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string volumeQuotaRuleName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, volumeQuotaRuleName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/VolumesOperations.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/VolumesOperations.cs index 15916d521f8c..6e5185d778b4 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/VolumesOperations.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/VolumesOperations.cs @@ -701,6 +701,37 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } + /// + /// Reset cifs password + /// + /// + /// Reset cifs password from 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. + /// + public async Task ResetCifsPasswordWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginResetCifsPasswordWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + /// /// Break volume replication /// @@ -735,6 +766,41 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } + /// + /// Re-establish volume replication + /// + /// + /// Re-establish a previously deleted replication between 2 volumes that have a + /// common ad-hoc or policy-based snapshots + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// body for the id of the source volume. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task ReestablishReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, ReestablishReplicationRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginReestablishReplicationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + /// /// Get volume replication status /// @@ -1005,12 +1071,10 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) } /// - /// Resync volume replication + /// List replications for volume /// /// - /// Resync the connection on the destination volume. If the operation is ran on - /// the source volume it will reverse-resync the connection and sync from - /// destination to source. + /// List all replications for a specified volume /// /// /// The name of the resource group. @@ -1025,70 +1089,341 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// The name of the volume /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task ResyncReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// 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>> ListReplicationsMethodWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginResyncReplicationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } + 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"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // 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, "ListReplicationsMethod", 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}/listReplications").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("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } - /// - /// Delete volume replication - /// - /// - /// Delete the replication connection on the destination volume, and send - /// release to the source replication - /// - /// - /// 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. - /// - public async Task DeleteReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginDeleteReplicationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, customHeaders, cancellationToken).ConfigureAwait(false); - return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); - } - /// - /// Authorize source volume replication - /// - /// - /// Authorize the replication connection on the source volume - /// - /// - /// The name of the resource group. - /// - /// - /// The name of the NetApp account - /// - /// - /// The name of the capacity pool - /// - /// - /// The name of the volume - /// - /// - /// Authorize request object supplied in the body of the operation. + 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; + } + + /// + /// Resync volume replication + /// + /// + /// Resync the connection on the destination volume. If the operation is ran on + /// the source volume it will reverse-resync the connection and sync from + /// destination to source. + /// + /// + /// 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. + /// + public async Task ResyncReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginResyncReplicationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Delete volume replication + /// + /// + /// Delete the replication connection on the destination volume, and send + /// release to the source replication + /// + /// + /// 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. + /// + public async Task DeleteReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteReplicationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Authorize source volume replication + /// + /// + /// Authorize the replication connection on the source volume + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// Authorize request object supplied in the body of the operation. /// /// /// The headers that will be added to request. @@ -1169,14 +1504,1463 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) } /// - /// Create or Update a volume + /// Relocate volume /// /// - /// Create or update the specified volume within the capacity pool + /// Relocates volume to a new stamp /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// /// - /// Volume object supplied in the body of the operation. + /// Relocate volume request + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task RelocateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, RelocateVolumeRequest body = default(RelocateVolumeRequest), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginRelocateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Finalize volume relocation + /// + /// + /// Finalizes the relocation of the volume and cleans up the old 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. + /// + public async Task FinalizeRelocationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginFinalizeRelocationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Revert volume relocation + /// + /// + /// Reverts the volume relocation process, cleans up the new volume and starts + /// using the former-existing 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. + /// + public async Task RevertRelocationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginRevertRelocationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Create or Update a volume + /// + /// + /// Create or update the specified volume within the capacity pool + /// + /// + /// Volume object supplied in the body of the operation. + /// + /// + /// 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> BeginCreateOrUpdateWithHttpMessagesAsync(Volume body, string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (body == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "body"); + } + if (body != null) + { + body.Validate(); + } + 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"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("body", body); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("poolName", poolName); + tracingParameters.Add("volumeName", volumeName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}").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("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(body != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + // 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) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Update a volume + /// + /// + /// Patch the specified volume + /// + /// + /// Volume object supplied in the body of the operation. + /// + /// + /// 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> BeginUpdateWithHttpMessagesAsync(VolumePatch body, string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (body == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "body"); + } + 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"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("body", body); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("poolName", poolName); + tracingParameters.Add("volumeName", volumeName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", 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}").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("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(body != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Delete a volume + /// + /// + /// Delete the specified volume + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// An option to force delete the volume. Will cleanup resources connected to + /// the particular volume + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, bool? forceDelete = default(bool?), 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"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // 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("forceDelete", forceDelete); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}").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 (forceDelete != null) + { + _queryParameters.Add(string.Format("forceDelete={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(forceDelete, Client.SerializationSettings).Trim('"')))); + } + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Revert a volume to one of its snapshots + /// + /// + /// Revert a volume to the snapshot specified in the body + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the capacity pool + /// + /// + /// The name of the volume + /// + /// + /// Object for snapshot to revert supplied in the body of the operation. + /// + /// + /// 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 BeginRevertWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, VolumeRevert body, 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"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + if (body == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "body"); + } + // 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("body", body); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginRevert", 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}/revert").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("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(body != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Reset cifs password + /// + /// + /// Reset cifs password from 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 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 BeginResetCifsPasswordWithHttpMessagesAsync(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"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // 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, "BeginResetCifsPassword", 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}/resetCifsPassword").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("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Break volume replication + /// + /// + /// Break the replication connection on the destination volume + /// /// /// The name of the resource group. /// @@ -1189,6 +2973,9 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// The name of the volume /// + /// + /// Optional body to force break the replication. + /// /// /// Headers that will be added to request. /// @@ -1198,9 +2985,6 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -1210,16 +2994,8 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(Volume body, string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginBreakReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, BreakReplicationRequest body = default(BreakReplicationRequest), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (body == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "body"); - } - if (body != null) - { - body.Validate(); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -1303,17 +3079,17 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("body", body); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); + tracingParameters.Add("body", body); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginBreakReplication", 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}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/breakReplication").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)); @@ -1331,7 +3107,7 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PUT"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1388,7 +3164,7 @@ internal VolumesOperations(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 @@ -1423,49 +3199,13 @@ internal VolumesOperations(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")) { _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) { ServiceClientTracing.Exit(_invocationId, _result); @@ -1474,14 +3214,12 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) } /// - /// Update a volume + /// Re-establish volume replication /// /// - /// Patch the specified volume + /// Re-establish a previously deleted replication between 2 volumes that have a + /// common ad-hoc or policy-based snapshots /// - /// - /// Volume object supplied in the body of the operation. - /// /// /// The name of the resource group. /// @@ -1494,6 +3232,9 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// The name of the volume /// + /// + /// body for the id of the source volume. + /// /// /// Headers that will be added to request. /// @@ -1503,9 +3244,6 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// Thrown when the operation returned an invalid status code /// - /// - /// Thrown when unable to deserialize the response - /// /// /// Thrown when a required parameter is null /// @@ -1515,12 +3253,8 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginUpdateWithHttpMessagesAsync(VolumePatch body, string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginReestablishReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, ReestablishReplicationRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (body == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "body"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); @@ -1597,6 +3331,10 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } + if (body == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "body"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1604,17 +3342,17 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("body", body); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); + tracingParameters.Add("body", body); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginReestablishReplication", 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}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/reestablishReplication").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)); @@ -1632,7 +3370,7 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1689,7 +3427,7 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -1724,31 +3462,13 @@ internal VolumesOperations(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")) { _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); @@ -1757,10 +3477,12 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) } /// - /// Delete a volume + /// Resync volume replication /// /// - /// Delete the specified volume + /// Resync the connection on the destination volume. If the operation is ran on + /// the source volume it will reverse-resync the connection and sync from + /// destination to source. /// /// /// The name of the resource group. @@ -1774,10 +3496,6 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// The name of the volume /// - /// - /// An option to force delete the volume. Will cleanup resources connected to - /// the particular volume - /// /// /// Headers that will be added to request. /// @@ -1796,7 +3514,7 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, bool? forceDelete = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginResyncReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -1885,23 +3603,18 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); - tracingParameters.Add("forceDelete", forceDelete); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginResyncReplication", 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}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/resyncReplication").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 (forceDelete != null) - { - _queryParameters.Add(string.Format("forceDelete={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(forceDelete, Client.SerializationSettings).Trim('"')))); - } if (Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); @@ -1913,7 +3626,7 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) // Create HTTP transport objects var _httpRequest = new HttpRequestMessage(); HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.Method = new HttpMethod("POST"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) @@ -1964,7 +3677,7 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try @@ -2014,10 +3727,11 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) } /// - /// Revert a volume to one of its snapshots + /// Delete volume replication /// /// - /// Revert a volume to the snapshot specified in the body + /// Delete the replication connection on the destination volume, and send + /// release to the source replication /// /// /// The name of the resource group. @@ -2031,9 +3745,6 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// The name of the volume /// - /// - /// Object for snapshot to revert supplied in the body of the operation. - /// /// /// Headers that will be added to request. /// @@ -2052,7 +3763,7 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginRevertWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, VolumeRevert body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginDeleteReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -2130,10 +3841,6 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } - if (body == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "body"); - } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2145,13 +3852,12 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); - tracingParameters.Add("body", body); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginRevert", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteReplication", 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}/revert").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/deleteReplication").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)); @@ -2200,12 +3906,6 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) // Serialize Request string _requestContent = null; - if(body != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, 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) { @@ -2276,10 +3976,10 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) } /// - /// Break volume replication + /// Authorize source volume replication /// /// - /// Break the replication connection on the destination volume + /// Authorize the replication connection on the source volume /// /// /// The name of the resource group. @@ -2294,7 +3994,7 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// The name of the volume /// /// - /// Optional body to force break the replication. + /// Authorize request object supplied in the body of the operation. /// /// /// Headers that will be added to request. @@ -2314,7 +4014,7 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginBreakReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, BreakReplicationRequest body = default(BreakReplicationRequest), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginAuthorizeReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, AuthorizeRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -2392,6 +4092,10 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } + if (body == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "body"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2405,11 +4109,11 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) tracingParameters.Add("volumeName", volumeName); tracingParameters.Add("body", body); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginBreakReplication", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginAuthorizeReplication", 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}/breakReplication").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/authorizeReplication").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)); @@ -2534,12 +4238,10 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) } /// - /// Resync volume replication + /// ReInitialize volume replication /// /// - /// Resync the connection on the destination volume. If the operation is ran on - /// the source volume it will reverse-resync the connection and sync from - /// destination to source. + /// Re-Initializes the replication connection on the destination volume /// /// /// The name of the resource group. @@ -2571,7 +4273,7 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginResyncReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginReInitializeReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -2661,11 +4363,11 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginResyncReplication", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginReInitializeReplication", 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}/resyncReplication").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/reinitializeReplication").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)); @@ -2784,11 +4486,10 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) } /// - /// Delete volume replication + /// Change pool for volume /// /// - /// Delete the replication connection on the destination volume, and send - /// release to the source replication + /// Moves volume to another pool /// /// /// The name of the resource group. @@ -2802,6 +4503,9 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// The name of the volume /// + /// + /// Move volume to the pool supplied in the body of the operation. + /// /// /// Headers that will be added to request. /// @@ -2820,7 +4524,7 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginDeleteReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginPoolChangeWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, PoolChangeRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -2898,6 +4602,14 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } + if (body == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "body"); + } + if (body != null) + { + body.Validate(); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -2909,12 +4621,13 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); + tracingParameters.Add("body", body); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteReplication", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginPoolChange", 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}/deleteReplication").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/poolChange").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)); @@ -2963,6 +4676,12 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) // Serialize Request string _requestContent = null; + if(body != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, 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) { @@ -3033,10 +4752,10 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) } /// - /// Authorize source volume replication + /// Relocate volume /// /// - /// Authorize the replication connection on the source volume + /// Relocates volume to a new stamp /// /// /// The name of the resource group. @@ -3051,7 +4770,7 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// The name of the volume /// /// - /// Authorize request object supplied in the body of the operation. + /// Relocate volume request /// /// /// Headers that will be added to request. @@ -3071,7 +4790,7 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginAuthorizeReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, AuthorizeRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginRelocateWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, RelocateVolumeRequest body = default(RelocateVolumeRequest), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -3149,10 +4868,6 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } - if (body == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "body"); - } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3166,11 +4881,11 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) tracingParameters.Add("volumeName", volumeName); tracingParameters.Add("body", body); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginAuthorizeReplication", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginRelocate", 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}/authorizeReplication").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/relocate").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)); @@ -3295,10 +5010,10 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) } /// - /// ReInitialize volume replication + /// Finalize volume relocation /// /// - /// Re-Initializes the replication connection on the destination volume + /// Finalizes the relocation of the volume and cleans up the old volume. /// /// /// The name of the resource group. @@ -3330,7 +5045,7 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginReInitializeReplicationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginFinalizeRelocationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -3420,11 +5135,11 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginReInitializeReplication", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginFinalizeRelocation", 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}/reinitializeReplication").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/finalizeRelocation").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)); @@ -3543,10 +5258,11 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) } /// - /// Change pool for volume + /// Revert volume relocation /// /// - /// Moves volume to another pool + /// Reverts the volume relocation process, cleans up the new volume and starts + /// using the former-existing volume. /// /// /// The name of the resource group. @@ -3560,9 +5276,6 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// The name of the volume /// - /// - /// Move volume to the pool supplied in the body of the operation. - /// /// /// Headers that will be added to request. /// @@ -3581,7 +5294,7 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginPoolChangeWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, PoolChangeRequest body, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginRevertRelocationWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -3659,14 +5372,6 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); } } - if (body == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "body"); - } - if (body != null) - { - body.Validate(); - } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -3678,13 +5383,12 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) tracingParameters.Add("accountName", accountName); tracingParameters.Add("poolName", poolName); tracingParameters.Add("volumeName", volumeName); - tracingParameters.Add("body", body); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginPoolChange", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginRevertRelocation", 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}/poolChange").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/capacityPools/{poolName}/volumes/{volumeName}/revertRelocation").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)); @@ -3733,12 +5437,6 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) // Serialize Request string _requestContent = null; - if(body != null) - { - _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(body, 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) { diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/VolumesOperationsExtensions.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/VolumesOperationsExtensions.cs index d9e64cc0bfdb..d71245aa3101 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/VolumesOperationsExtensions.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/VolumesOperationsExtensions.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; @@ -383,6 +385,61 @@ public static void Revert(this IVolumesOperations operations, string resourceGro (await operations.RevertWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, null, cancellationToken).ConfigureAwait(false)).Dispose(); } + /// + /// Reset cifs password + /// + /// + /// Reset cifs password from 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 void ResetCifsPassword(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) + { + operations.ResetCifsPasswordAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); + } + + /// + /// Reset cifs password + /// + /// + /// Reset cifs password from 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 ResetCifsPasswordAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.ResetCifsPasswordWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// /// Break volume replication /// @@ -444,6 +501,69 @@ public static void Revert(this IVolumesOperations operations, string resourceGro (await operations.BreakReplicationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, null, cancellationToken).ConfigureAwait(false)).Dispose(); } + /// + /// Re-establish volume replication + /// + /// + /// Re-establish a previously deleted replication between 2 volumes that have a + /// common ad-hoc or policy-based snapshots + /// + /// + /// 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 + /// + /// + /// body for the id of the source volume. + /// + public static void ReestablishReplication(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, ReestablishReplicationRequest body) + { + operations.ReestablishReplicationAsync(resourceGroupName, accountName, poolName, volumeName, body).GetAwaiter().GetResult(); + } + + /// + /// Re-establish volume replication + /// + /// + /// Re-establish a previously deleted replication between 2 volumes that have a + /// common ad-hoc or policy-based snapshots + /// + /// + /// 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 + /// + /// + /// body for the id of the source volume. + /// + /// + /// The cancellation token. + /// + public static async Task ReestablishReplicationAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, ReestablishReplicationRequest body, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.ReestablishReplicationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// /// Get volume replication status /// @@ -502,6 +622,64 @@ public static ReplicationStatus ReplicationStatusMethod(this IVolumesOperations } } + /// + /// List replications for volume + /// + /// + /// List all replications for a specified 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 IEnumerable ListReplicationsMethod(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) + { + return operations.ListReplicationsMethodAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); + } + + /// + /// List replications for volume + /// + /// + /// List all replications for a specified 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> ListReplicationsMethodAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListReplicationsMethodWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Resync volume replication /// @@ -738,7 +916,185 @@ public static void ReInitializeReplication(this IVolumesOperations operations, s /// Change pool for volume /// /// - /// Moves volume to another pool + /// Moves volume to another pool + /// + /// + /// 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 + /// + /// + /// Move volume to the pool supplied in the body of the operation. + /// + public static void PoolChange(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, PoolChangeRequest body) + { + operations.PoolChangeAsync(resourceGroupName, accountName, poolName, volumeName, body).GetAwaiter().GetResult(); + } + + /// + /// Change pool for volume + /// + /// + /// Moves volume to another pool + /// + /// + /// 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 + /// + /// + /// Move volume to the pool supplied in the body of the operation. + /// + /// + /// The cancellation token. + /// + public static async Task PoolChangeAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, PoolChangeRequest body, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.PoolChangeWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Relocate volume + /// + /// + /// Relocates volume to a new stamp + /// + /// + /// 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 + /// + /// + /// Relocate volume request + /// + public static void Relocate(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, RelocateVolumeRequest body = default(RelocateVolumeRequest)) + { + operations.RelocateAsync(resourceGroupName, accountName, poolName, volumeName, body).GetAwaiter().GetResult(); + } + + /// + /// Relocate volume + /// + /// + /// Relocates volume to a new stamp + /// + /// + /// 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 + /// + /// + /// Relocate volume request + /// + /// + /// The cancellation token. + /// + public static async Task RelocateAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, RelocateVolumeRequest body = default(RelocateVolumeRequest), CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.RelocateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Finalize volume relocation + /// + /// + /// Finalizes the relocation of the volume and cleans up the old 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 void FinalizeRelocation(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) + { + operations.FinalizeRelocationAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); + } + + /// + /// Finalize volume relocation + /// + /// + /// Finalizes the relocation of the volume and cleans up the old 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 FinalizeRelocationAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.FinalizeRelocationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Revert volume relocation + /// + /// + /// Reverts the volume relocation process, cleans up the new volume and starts + /// using the former-existing volume. /// /// /// The operations group for this extension method. @@ -755,19 +1111,17 @@ public static void ReInitializeReplication(this IVolumesOperations operations, s /// /// The name of the volume /// - /// - /// Move volume to the pool supplied in the body of the operation. - /// - public static void PoolChange(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, PoolChangeRequest body) + public static void RevertRelocation(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) { - operations.PoolChangeAsync(resourceGroupName, accountName, poolName, volumeName, body).GetAwaiter().GetResult(); + operations.RevertRelocationAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); } /// - /// Change pool for volume + /// Revert volume relocation /// /// - /// Moves volume to another pool + /// Reverts the volume relocation process, cleans up the new volume and starts + /// using the former-existing volume. /// /// /// The operations group for this extension method. @@ -784,15 +1138,12 @@ public static void PoolChange(this IVolumesOperations operations, string resourc /// /// The name of the volume /// - /// - /// Move volume to the pool supplied in the body of the operation. - /// /// /// The cancellation token. /// - public static async Task PoolChangeAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, PoolChangeRequest body, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task RevertRelocationAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.PoolChangeWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.RevertRelocationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -1047,6 +1398,61 @@ public static void BeginRevert(this IVolumesOperations operations, string resour (await operations.BeginRevertWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, null, cancellationToken).ConfigureAwait(false)).Dispose(); } + /// + /// Reset cifs password + /// + /// + /// Reset cifs password from 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 void BeginResetCifsPassword(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) + { + operations.BeginResetCifsPasswordAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); + } + + /// + /// Reset cifs password + /// + /// + /// Reset cifs password from 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 BeginResetCifsPasswordAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginResetCifsPasswordWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// /// Break volume replication /// @@ -1108,6 +1514,69 @@ public static void BeginRevert(this IVolumesOperations operations, string resour (await operations.BeginBreakReplicationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, null, cancellationToken).ConfigureAwait(false)).Dispose(); } + /// + /// Re-establish volume replication + /// + /// + /// Re-establish a previously deleted replication between 2 volumes that have a + /// common ad-hoc or policy-based snapshots + /// + /// + /// 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 + /// + /// + /// body for the id of the source volume. + /// + public static void BeginReestablishReplication(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, ReestablishReplicationRequest body) + { + operations.BeginReestablishReplicationAsync(resourceGroupName, accountName, poolName, volumeName, body).GetAwaiter().GetResult(); + } + + /// + /// Re-establish volume replication + /// + /// + /// Re-establish a previously deleted replication between 2 volumes that have a + /// common ad-hoc or policy-based snapshots + /// + /// + /// 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 + /// + /// + /// body for the id of the source volume. + /// + /// + /// The cancellation token. + /// + public static async Task BeginReestablishReplicationAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, ReestablishReplicationRequest body, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginReestablishReplicationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// /// Resync volume replication /// @@ -1401,6 +1870,179 @@ public static void BeginPoolChange(this IVolumesOperations operations, string re (await operations.BeginPoolChangeWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, null, cancellationToken).ConfigureAwait(false)).Dispose(); } + /// + /// Relocate volume + /// + /// + /// Relocates volume to a new stamp + /// + /// + /// 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 + /// + /// + /// Relocate volume request + /// + public static void BeginRelocate(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, RelocateVolumeRequest body = default(RelocateVolumeRequest)) + { + operations.BeginRelocateAsync(resourceGroupName, accountName, poolName, volumeName, body).GetAwaiter().GetResult(); + } + + /// + /// Relocate volume + /// + /// + /// Relocates volume to a new stamp + /// + /// + /// 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 + /// + /// + /// Relocate volume request + /// + /// + /// The cancellation token. + /// + public static async Task BeginRelocateAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, RelocateVolumeRequest body = default(RelocateVolumeRequest), CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginRelocateWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, body, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Finalize volume relocation + /// + /// + /// Finalizes the relocation of the volume and cleans up the old 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 void BeginFinalizeRelocation(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) + { + operations.BeginFinalizeRelocationAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); + } + + /// + /// Finalize volume relocation + /// + /// + /// Finalizes the relocation of the volume and cleans up the old 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 BeginFinalizeRelocationAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginFinalizeRelocationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Revert volume relocation + /// + /// + /// Reverts the volume relocation process, cleans up the new volume and starts + /// using the former-existing 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 void BeginRevertRelocation(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) + { + operations.BeginRevertRelocationAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); + } + + /// + /// Revert volume relocation + /// + /// + /// Reverts the volume relocation process, cleans up the new volume and starts + /// using the former-existing 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 BeginRevertRelocationAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginRevertRelocationWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// /// Describe all volumes ///