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 4c67da631b81..255ee670336e 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/AzureNetAppFilesManagementClient.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/AzureNetAppFilesManagementClient.cs @@ -141,6 +141,11 @@ public partial class AzureNetAppFilesManagementClient : ServiceClient public virtual IVolumeGroupsOperations VolumeGroups { get; private set; } + /// + /// Gets the ISubvolumesOperations. + /// + public virtual ISubvolumesOperations Subvolumes { get; private set; } + /// /// Initializes a new instance of the AzureNetAppFilesManagementClient class. /// @@ -395,8 +400,9 @@ private void Initialize() BackupPolicies = new BackupPoliciesOperations(this); Vaults = new VaultsOperations(this); VolumeGroups = new VolumeGroupsOperations(this); + Subvolumes = new SubvolumesOperations(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2021-08-01"; + ApiVersion = "2021-10-01"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; 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 a50a2c9d6f3b..b785b45f3494 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IAzureNetAppFilesManagementClient.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IAzureNetAppFilesManagementClient.cs @@ -136,5 +136,10 @@ public partial interface IAzureNetAppFilesManagementClient : System.IDisposable /// IVolumeGroupsOperations VolumeGroups { get; } + /// + /// Gets the ISubvolumesOperations. + /// + ISubvolumesOperations Subvolumes { get; } + } } diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/ISnapshotsOperations.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/ISnapshotsOperations.cs index d86fc80514e2..958d3c5382fa 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/ISnapshotsOperations.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/ISnapshotsOperations.cs @@ -209,6 +209,44 @@ public partial interface ISnapshotsOperations /// Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Create a new Snapshot Restore Files request + /// + /// + /// Restore the specified files from the specified snapshot to the + /// active filesystem + /// + /// + /// Restore payload 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 the snapshot + /// + /// + /// 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 RestoreFilesWithHttpMessagesAsync(SnapshotRestoreFiles body, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Create a snapshot /// /// @@ -322,5 +360,43 @@ public partial interface ISnapshotsOperations /// Thrown when a required parameter is null /// Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create a new Snapshot Restore Files request + /// + /// + /// Restore the specified files from the specified snapshot to the + /// active filesystem + /// + /// + /// Restore payload 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 the snapshot + /// + /// + /// 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 BeginRestoreFilesWithHttpMessagesAsync(SnapshotRestoreFiles body, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/ISubvolumesOperations.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/ISubvolumesOperations.cs new file mode 100644 index 000000000000..057f460dfa0d --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/ISubvolumesOperations.cs @@ -0,0 +1,427 @@ +// +// 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; + + /// + /// SubvolumesOperations operations. + /// + public partial interface ISubvolumesOperations + { + /// + /// List of all the subvolumes + /// + /// + /// Returns a list of the subvolumes in 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)); + /// + /// Get the path associated with the subvolumeName + /// + /// + /// Returns the path associated with the subvolumeName provided + /// + /// + /// 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 the subvolume. + /// + /// + /// 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 subvolumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create or clone a new subvolume + /// + /// + /// Creates a subvolume in the path or clones the subvolume mentioned + /// in the parentPath + /// + /// + /// Subvolume 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 the subvolume. + /// + /// + /// 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(SubvolumeInfo body, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update a subvolume + /// + /// + /// Patch a subvolume + /// + /// + /// Subvolume 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 the subvolume. + /// + /// + /// 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(SubvolumePatchRequest body, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete a subvolume + /// + /// + /// Delete subvolume + /// + /// + /// 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 the subvolume. + /// + /// + /// 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 subvolumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Describe a subvolume + /// + /// + /// Get details of the specified subvolume + /// + /// + /// 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 the subvolume. + /// + /// + /// 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> GetMetadataWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create or clone a new subvolume + /// + /// + /// Creates a subvolume in the path or clones the subvolume mentioned + /// in the parentPath + /// + /// + /// Subvolume 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 the subvolume. + /// + /// + /// 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(SubvolumeInfo body, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Update a subvolume + /// + /// + /// Patch a subvolume + /// + /// + /// Subvolume 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 the subvolume. + /// + /// + /// 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(SubvolumePatchRequest body, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete a subvolume + /// + /// + /// Delete subvolume + /// + /// + /// 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 the subvolume. + /// + /// + /// 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 subvolumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Describe a subvolume + /// + /// + /// Get details of the specified subvolume + /// + /// + /// 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 the subvolume. + /// + /// + /// 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> BeginGetMetadataWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// List of all the subvolumes + /// + /// + /// Returns a list of the subvolumes in the volume + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByVolumeNextWithHttpMessagesAsync(string nextPageLink, 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 d8e4bc3b08a0..b824ac54833e 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IVolumesOperations.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IVolumesOperations.cs @@ -180,6 +180,10 @@ public partial interface IVolumesOperations /// /// The name of the volume /// + /// + /// An option to force delete the volume. Will cleanup resources + /// connected to the particular volume + /// /// /// The headers that will be added to request. /// @@ -192,7 +196,7 @@ public partial interface IVolumesOperations /// /// Thrown when a required parameter is null /// - Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, bool? forceDelete = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Revert a volume to one of its snapshots /// @@ -552,6 +556,10 @@ public partial interface IVolumesOperations /// /// The name of the volume /// + /// + /// An option to force delete the volume. Will cleanup resources + /// connected to the particular volume + /// /// /// The headers that will be added to request. /// @@ -564,7 +572,7 @@ public partial interface IVolumesOperations /// /// Thrown when a required parameter is null /// - Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, bool? forceDelete = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Revert a volume to one of its snapshots /// diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ActiveDirectory.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ActiveDirectory.cs index 4e1a6f9878ae..63c70016b301 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ActiveDirectory.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ActiveDirectory.cs @@ -84,7 +84,8 @@ public ActiveDirectory() /// volumes. /// If enabled, Traffic between the /// SMB server to Domain Controller (DC) will be encrypted. - public ActiveDirectory(string activeDirectoryId = default(string), string username = default(string), string password = default(string), string domain = default(string), string dns = default(string), string status = default(string), string statusDetails = default(string), string smbServerName = default(string), string organizationalUnit = default(string), string site = default(string), IList backupOperators = default(IList), IList administrators = default(IList), string kdcIP = default(string), string adName = default(string), string serverRootCACertificate = default(string), bool? aesEncryption = default(bool?), bool? ldapSigning = default(bool?), IList securityOperators = default(IList), bool? ldapOverTLS = default(bool?), bool? allowLocalNfsUsersWithLdap = default(bool?), bool? encryptDCConnections = default(bool?)) + /// LDAP Search scope options + public ActiveDirectory(string activeDirectoryId = default(string), string username = default(string), string password = default(string), string domain = default(string), string dns = default(string), string status = default(string), string statusDetails = default(string), string smbServerName = default(string), string organizationalUnit = default(string), string site = default(string), IList backupOperators = default(IList), IList administrators = default(IList), string kdcIP = default(string), string adName = default(string), string serverRootCACertificate = default(string), bool? aesEncryption = default(bool?), bool? ldapSigning = default(bool?), IList securityOperators = default(IList), bool? ldapOverTLS = default(bool?), bool? allowLocalNfsUsersWithLdap = default(bool?), bool? encryptDCConnections = default(bool?), LdapSearchScopeOpt ldapSearchScope = default(LdapSearchScopeOpt)) { ActiveDirectoryId = activeDirectoryId; Username = username; @@ -107,6 +108,7 @@ public ActiveDirectory() LdapOverTLS = ldapOverTLS; AllowLocalNfsUsersWithLdap = allowLocalNfsUsersWithLdap; EncryptDCConnections = encryptDCConnections; + LdapSearchScope = ldapSearchScope; CustomInit(); } @@ -266,6 +268,12 @@ public ActiveDirectory() [JsonProperty(PropertyName = "encryptDCConnections")] public bool? EncryptDCConnections { get; set; } + /// + /// Gets or sets LDAP Search scope options + /// + [JsonProperty(PropertyName = "ldapSearchScope")] + public LdapSearchScopeOpt LdapSearchScope { get; set; } + /// /// Validate the object. /// @@ -310,6 +318,10 @@ public virtual void Validate() throw new ValidationException(ValidationRules.MinLength, "ServerRootCACertificate", 1); } } + if (LdapSearchScope != null) + { + LdapSearchScope.Validate(); + } } } } diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Backup.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Backup.cs index d49239bb6db3..79b46cae492d 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Backup.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/Backup.cs @@ -38,7 +38,7 @@ public Backup() /// Resource name /// Resource type /// backupId - /// name + /// creationDate /// Azure lifecycle management /// Size of backup /// Label for backup @@ -105,7 +105,7 @@ public Backup() public string BackupId { get; private set; } /// - /// Gets name + /// Gets creationDate /// /// /// The creation date of the backup diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/BackupPatch.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/BackupPatch.cs index 79354559e943..4a30768bbe3a 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/BackupPatch.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/BackupPatch.cs @@ -37,7 +37,7 @@ public BackupPatch() /// /// Resource tags /// backupId - /// name + /// creationDate /// Azure lifecycle management /// Size of backup /// Label for backup @@ -83,7 +83,7 @@ public BackupPatch() public string BackupId { get; private set; } /// - /// Gets name + /// Gets creationDate /// /// /// The creation date of the backup 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 9e82002a3342..2b442feb96ce 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 @@ -56,7 +56,9 @@ public BackupPolicy() /// not /// A list of volumes assigned to this /// policy - 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)) + /// 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)) { Location = location; Id = id; @@ -72,6 +74,7 @@ public BackupPolicy() VolumesAssigned = volumesAssigned; Enabled = enabled; VolumeBackups = volumeBackups; + SystemData = systemData; CustomInit(); } @@ -165,6 +168,12 @@ 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. /// 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 61b413745421..ba6f52e0f7d4 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 @@ -54,7 +54,9 @@ public CapacityPool() /// If enabled (true) the pool can contain /// cool Access enabled volumes. /// encryptionType - 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)) + /// 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)) { Location = location; Id = id; @@ -71,6 +73,7 @@ public CapacityPool() QosType = qosType; CoolAccess = coolAccess; EncryptionType = encryptionType; + SystemData = systemData; CustomInit(); } @@ -129,7 +132,7 @@ public CapacityPool() /// Gets or sets size /// /// - /// Provisioned size of the pool (in bytes). Allowed values are in 4TiB + /// Provisioned size of the pool (in bytes). Allowed values are in 1TiB /// chunks (value must be multiply of 4398046511104). /// [JsonProperty(PropertyName = "properties.size")] @@ -191,6 +194,12 @@ 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. /// @@ -222,14 +231,6 @@ public virtual void Validate() throw new ValidationException(ValidationRules.Pattern, "PoolId", "^[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 (Size > 549755813888000) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Size", 549755813888000); - } - if (Size < 4398046511104) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Size", 4398046511104); - } } } } diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/CapacityPoolPatch.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/CapacityPoolPatch.cs index b4113f746648..9ddec18ebdb1 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 @@ -93,7 +93,7 @@ public CapacityPoolPatch() /// Gets or sets size /// /// - /// Provisioned size of the pool (in bytes). Allowed values are in 4TiB + /// Provisioned size of the pool (in bytes). Allowed values are in 1TiB /// chunks (value must be multiply of 4398046511104). /// [JsonProperty(PropertyName = "properties.size")] @@ -108,25 +108,5 @@ public CapacityPoolPatch() [JsonProperty(PropertyName = "properties.qosType")] public string QosType { get; set; } - /// - /// Validate the object. - /// - /// - /// Thrown if validation fails - /// - public virtual void Validate() - { - if (Size != null) - { - if (Size > 549755813888000) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Size", 549755813888000); - } - if (Size < 4398046511104) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Size", 4398046511104); - } - } - } } } diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/EnableSubvolumes.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/EnableSubvolumes.cs new file mode 100644 index 000000000000..02409626c287 --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/EnableSubvolumes.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 EnableSubvolumes. + /// + public static class EnableSubvolumes + { + /// + /// subvolumes are enabled + /// + public const string Enabled = "Enabled"; + /// + /// subvolumes are not enabled + /// + public const string Disabled = "Disabled"; + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/LdapSearchScopeOpt.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/LdapSearchScopeOpt.cs new file mode 100644 index 000000000000..690f836aa36b --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/LdapSearchScopeOpt.cs @@ -0,0 +1,105 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.NetApp.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// LDAP search scope + /// + public partial class LdapSearchScopeOpt + { + /// + /// Initializes a new instance of the LdapSearchScopeOpt class. + /// + public LdapSearchScopeOpt() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LdapSearchScopeOpt class. + /// + /// This specifies the user DN, which overrides + /// the base DN for user lookups. + /// This specifies the group DN, which overrides + /// the base DN for group lookups. + /// This specifies the custom LDAP + /// search filter to be used when looking up group membership from LDAP + /// server. + public LdapSearchScopeOpt(string userDN = default(string), string groupDN = default(string), string groupMembershipFilter = default(string)) + { + UserDN = userDN; + GroupDN = groupDN; + GroupMembershipFilter = groupMembershipFilter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets this specifies the user DN, which overrides the base + /// DN for user lookups. + /// + [JsonProperty(PropertyName = "userDN")] + public string UserDN { get; set; } + + /// + /// Gets or sets this specifies the group DN, which overrides the base + /// DN for group lookups. + /// + [JsonProperty(PropertyName = "groupDN")] + public string GroupDN { get; set; } + + /// + /// Gets or sets this specifies the custom LDAP search filter to be + /// used when looking up group membership from LDAP server. + /// + [JsonProperty(PropertyName = "groupMembershipFilter")] + public string GroupMembershipFilter { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (UserDN != null) + { + if (UserDN.Length > 255) + { + throw new ValidationException(ValidationRules.MaxLength, "UserDN", 255); + } + } + if (GroupDN != null) + { + if (GroupDN.Length > 255) + { + throw new ValidationException(ValidationRules.MaxLength, "GroupDN", 255); + } + } + if (GroupMembershipFilter != null) + { + if (GroupMembershipFilter.Length > 255) + { + throw new ValidationException(ValidationRules.MaxLength, "GroupMembershipFilter", 255); + } + } + } + } +} 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 d7e26e947a6c..ce35be1a50e0 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 @@ -49,7 +49,9 @@ public SnapshotPolicy() /// The property to decide policy is enabled or /// not /// Azure lifecycle management - 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)) + /// 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)) { Location = location; Id = id; @@ -63,6 +65,7 @@ public SnapshotPolicy() MonthlySchedule = monthlySchedule; Enabled = enabled; ProvisioningState = provisioningState; + SystemData = systemData; CustomInit(); } @@ -156,6 +159,12 @@ 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. /// diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/SnapshotRestoreFiles.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/SnapshotRestoreFiles.cs new file mode 100644 index 000000000000..d675db6dfa3c --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/SnapshotRestoreFiles.cs @@ -0,0 +1,88 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// 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.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Restore payload for Single File Snapshot Restore + /// + public partial class SnapshotRestoreFiles : IResource + { + /// + /// Initializes a new instance of the SnapshotRestoreFiles class. + /// + public SnapshotRestoreFiles() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SnapshotRestoreFiles class. + /// + /// List of files to be restored + /// Destination folder where the files + /// will be restored + public SnapshotRestoreFiles(IList filePaths, string destinationPath = default(string)) + { + FilePaths = filePaths; + DestinationPath = destinationPath; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets list of files to be restored + /// + [JsonProperty(PropertyName = "filePaths")] + public IList FilePaths { get; set; } + + /// + /// Gets or sets destination folder where the files will be restored + /// + [JsonProperty(PropertyName = "destinationPath")] + public string DestinationPath { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (FilePaths == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "FilePaths"); + } + if (FilePaths != null) + { + if (FilePaths.Count > 10) + { + throw new ValidationException(ValidationRules.MaxItems, "FilePaths", 10); + } + if (FilePaths.Count < 1) + { + throw new ValidationException(ValidationRules.MinItems, "FilePaths", 1); + } + } + } + } +} 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 new file mode 100644 index 000000000000..26b57d9ee29b --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/SubvolumeInfo.cs @@ -0,0 +1,103 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.NetApp.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Subvolume Information properties + /// + [Rest.Serialization.JsonTransformation] + public partial class SubvolumeInfo : ProxyResource + { + /// + /// Initializes a new instance of the SubvolumeInfo class. + /// + public SubvolumeInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SubvolumeInfo class. + /// + /// 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" + /// 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) + { + Path = path; + Size = size; + ParentPath = parentPath; + ProvisioningState = provisioningState; + SystemData = systemData; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets path + /// + /// + /// Path to the subvolume + /// + [JsonProperty(PropertyName = "properties.path")] + public string Path { get; set; } + + /// + /// Gets or sets size + /// + /// + /// Truncate subvolume to the provided size in bytes + /// + [JsonProperty(PropertyName = "properties.size")] + public long? Size { get; set; } + + /// + /// Gets or sets name + /// + /// + /// parent path to the subvolume + /// + [JsonProperty(PropertyName = "properties.parentPath")] + public string ParentPath { get; set; } + + /// + /// Gets azure lifecycle management + /// + [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/SubvolumeModel.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/SubvolumeModel.cs new file mode 100644 index 000000000000..1002b92659a5 --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/SubvolumeModel.cs @@ -0,0 +1,178 @@ +// +// 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; + + /// + /// Result of the post subvolume and action is to get metadata of the + /// subvolume. + /// + [Rest.Serialization.JsonTransformation] + public partial class SubvolumeModel + { + /// + /// Initializes a new instance of the SubvolumeModel class. + /// + public SubvolumeModel() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SubvolumeModel class. + /// + /// Resource Id + /// Resource name + /// Resource type + /// path + /// parentpath + /// size + /// bytesUsed + /// permissions + /// creationTimeStamp + /// accessedTimeStamp + /// modifiedTimeStamp + /// changedTimeStamp + /// Azure lifecycle management + public SubvolumeModel(string id = default(string), string name = default(string), string type = default(string), string path = default(string), string parentPath = default(string), long? size = default(long?), long? bytesUsed = default(long?), string permissions = default(string), System.DateTime? creationTimeStamp = default(System.DateTime?), System.DateTime? accessedTimeStamp = default(System.DateTime?), System.DateTime? modifiedTimeStamp = default(System.DateTime?), System.DateTime? changedTimeStamp = default(System.DateTime?), string provisioningState = default(string)) + { + Id = id; + Name = name; + Type = type; + Path = path; + ParentPath = parentPath; + Size = size; + BytesUsed = bytesUsed; + Permissions = permissions; + CreationTimeStamp = creationTimeStamp; + AccessedTimeStamp = accessedTimeStamp; + ModifiedTimeStamp = modifiedTimeStamp; + ChangedTimeStamp = changedTimeStamp; + ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// 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 resource type + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets or sets path + /// + /// + /// Path to the subvolume + /// + [JsonProperty(PropertyName = "properties.path")] + public string Path { get; set; } + + /// + /// Gets or sets parentpath + /// + /// + /// Path to the parent subvolume + /// + [JsonProperty(PropertyName = "properties.parentPath")] + public string ParentPath { get; set; } + + /// + /// Gets or sets size + /// + /// + /// Size of subvolume + /// + [JsonProperty(PropertyName = "properties.size")] + public long? Size { get; set; } + + /// + /// Gets or sets bytesUsed + /// + /// + /// Bytes used + /// + [JsonProperty(PropertyName = "properties.bytesUsed")] + public long? BytesUsed { get; set; } + + /// + /// Gets or sets permissions + /// + /// + /// Permissions of the subvolume + /// + [JsonProperty(PropertyName = "properties.permissions")] + public string Permissions { get; set; } + + /// + /// Gets or sets creationTimeStamp + /// + /// + /// Creation time and date + /// + [JsonProperty(PropertyName = "properties.creationTimeStamp")] + public System.DateTime? CreationTimeStamp { get; set; } + + /// + /// Gets or sets accessedTimeStamp + /// + /// + /// Most recent access time and date + /// + [JsonProperty(PropertyName = "properties.accessedTimeStamp")] + public System.DateTime? AccessedTimeStamp { get; set; } + + /// + /// Gets or sets modifiedTimeStamp + /// + /// + /// Most recent modification time and date + /// + [JsonProperty(PropertyName = "properties.modifiedTimeStamp")] + public System.DateTime? ModifiedTimeStamp { get; set; } + + /// + /// Gets or sets changedTimeStamp + /// + /// + /// Most recent change time and date + /// + [JsonProperty(PropertyName = "properties.changedTimeStamp")] + public System.DateTime? ChangedTimeStamp { get; set; } + + /// + /// Gets or sets azure lifecycle management + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; set; } + + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/SubvolumePatchRequest.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/SubvolumePatchRequest.cs new file mode 100644 index 000000000000..d8629e376708 --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/SubvolumePatchRequest.cs @@ -0,0 +1,69 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.NetApp.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Subvolume Patch Request properties + /// + [Rest.Serialization.JsonTransformation] + public partial class SubvolumePatchRequest : IResource + { + /// + /// Initializes a new instance of the SubvolumePatchRequest class. + /// + public SubvolumePatchRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SubvolumePatchRequest class. + /// + /// size + /// path + public SubvolumePatchRequest(long? size = default(long?), string path = default(string)) + { + Size = size; + Path = path; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets size + /// + /// + /// Truncate subvolume to the provided size in bytes + /// + [JsonProperty(PropertyName = "properties.size")] + public long? Size { get; set; } + + /// + /// Gets or sets path + /// + /// + /// path to the subvolume + /// + [JsonProperty(PropertyName = "properties.path")] + public string Path { get; set; } + + } +} 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 2dd9e6a47c9a..f47a9847d873 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 @@ -112,6 +112,9 @@ public Volume() /// Default group quota for /// volume in KiBs. If isDefaultQuotaEnabled is set, the minimum value /// of 4 KiBs applies. + /// Maximum number of files allowed. + /// Needs a service request in order to be changed. Only allowed to be + /// changed if volume quota is more than 4TiB. /// Volume Group Name /// Pool Resource Id used in case /// of creating a volume through volume group @@ -122,7 +125,12 @@ public Volume() /// specific designation or identifier for the particular volume in a /// volume group for e.g. data, log /// Volume placement rules - 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?), string volumeGroupName = default(string), string capacityPoolResourceId = default(string), string proximityPlacementGroup = default(string), string t2Network = default(string), string volumeSpecName = default(string), IList placementRules = default(IList)) + /// 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)) { Location = location; Id = id; @@ -164,12 +172,15 @@ public Volume() IsDefaultQuotaEnabled = isDefaultQuotaEnabled; DefaultUserQuotaInKiBs = defaultUserQuotaInKiBs; DefaultGroupQuotaInKiBs = defaultGroupQuotaInKiBs; + MaximumNumberOfFiles = maximumNumberOfFiles; VolumeGroupName = volumeGroupName; CapacityPoolResourceId = capacityPoolResourceId; ProximityPlacementGroup = proximityPlacementGroup; T2Network = t2Network; VolumeSpecName = volumeSpecName; PlacementRules = placementRules; + EnableSubvolumes = enableSubvolumes; + SystemData = systemData; CustomInit(); } @@ -501,6 +512,14 @@ public Volume() [JsonProperty(PropertyName = "properties.defaultGroupQuotaInKiBs")] public long? DefaultGroupQuotaInKiBs { get; set; } + /// + /// Gets maximum number of files allowed. Needs a service request in + /// order to be changed. Only allowed to be changed if volume quota is + /// more than 4TiB. + /// + [JsonProperty(PropertyName = "properties.maximumNumberOfFiles")] + public long? MaximumNumberOfFiles { get; private set; } + /// /// Gets volume Group Name /// @@ -543,6 +562,20 @@ public Volume() [JsonProperty(PropertyName = "properties.placementRules")] public IList PlacementRules { get; set; } + /// + /// Gets or sets flag indicating whether subvolume operations are + /// enabled on the volume. Possible values include: 'Enabled', + /// 'Disabled' + /// + [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. /// @@ -660,16 +693,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/VolumeGroupVolumeProperties.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumeGroupVolumeProperties.cs index 6f251245affe..e4ddf94677c2 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 @@ -111,6 +111,9 @@ public VolumeGroupVolumeProperties() /// Default group quota for /// volume in KiBs. If isDefaultQuotaEnabled is set, the minimum value /// of 4 KiBs applies. + /// Maximum number of files allowed. + /// Needs a service request in order to be changed. Only allowed to be + /// changed if volume quota is more than 4TiB. /// Volume Group Name /// Pool Resource Id used in case /// of creating a volume through volume group @@ -121,7 +124,10 @@ public VolumeGroupVolumeProperties() /// specific designation or identifier for the particular volume in a /// volume group for e.g. data, log /// Volume placement rules - 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?), string volumeGroupName = default(string), string capacityPoolResourceId = default(string), string proximityPlacementGroup = default(string), string t2Network = default(string), string volumeSpecName = default(string), IList placementRules = default(IList)) + /// 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)) { Id = id; Name = name; @@ -161,12 +167,14 @@ public VolumeGroupVolumeProperties() IsDefaultQuotaEnabled = isDefaultQuotaEnabled; DefaultUserQuotaInKiBs = defaultUserQuotaInKiBs; DefaultGroupQuotaInKiBs = defaultGroupQuotaInKiBs; + MaximumNumberOfFiles = maximumNumberOfFiles; VolumeGroupName = volumeGroupName; CapacityPoolResourceId = capacityPoolResourceId; ProximityPlacementGroup = proximityPlacementGroup; T2Network = t2Network; VolumeSpecName = volumeSpecName; PlacementRules = placementRules; + EnableSubvolumes = enableSubvolumes; CustomInit(); } @@ -485,6 +493,14 @@ public VolumeGroupVolumeProperties() [JsonProperty(PropertyName = "properties.defaultGroupQuotaInKiBs")] public long? DefaultGroupQuotaInKiBs { get; set; } + /// + /// Gets maximum number of files allowed. Needs a service request in + /// order to be changed. Only allowed to be changed if volume quota is + /// more than 4TiB. + /// + [JsonProperty(PropertyName = "properties.maximumNumberOfFiles")] + public long? MaximumNumberOfFiles { get; private set; } + /// /// Gets volume Group Name /// @@ -527,6 +543,14 @@ public VolumeGroupVolumeProperties() [JsonProperty(PropertyName = "properties.placementRules")] public IList PlacementRules { get; set; } + /// + /// Gets or sets flag indicating whether subvolume operations are + /// enabled on the volume. Possible values include: 'Enabled', + /// 'Disabled' + /// + [JsonProperty(PropertyName = "properties.enableSubvolumes")] + public string EnableSubvolumes { get; set; } + /// /// Validate the object. /// @@ -640,16 +664,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 1f15e197c517..2910f2374f5f 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 @@ -55,7 +55,15 @@ public VolumePatch() /// Default group quota for /// volume in KiBs. If isDefaultQuotaEnabled is set, the minimum value /// of 4 KiBs applies. - 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?)) + /// UNIX permissions for NFS volume + /// accepted in octal 4 digit format. First digit selects the set user + /// ID(4), set group ID (2) and sticky (1) attributes. Second digit + /// selects permission for the owner of the file: read (4), write (2) + /// and execute (1). Third selects permissions for other users in the + /// 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)) { Location = location; Id = id; @@ -70,6 +78,7 @@ public VolumePatch() IsDefaultQuotaEnabled = isDefaultQuotaEnabled; DefaultUserQuotaInKiBs = defaultUserQuotaInKiBs; DefaultGroupQuotaInKiBs = defaultGroupQuotaInKiBs; + UnixPermissions = unixPermissions; CustomInit(); } @@ -176,6 +185,18 @@ public VolumePatch() [JsonProperty(PropertyName = "properties.defaultGroupQuotaInKiBs")] public long? DefaultGroupQuotaInKiBs { get; set; } + /// + /// Gets or sets UNIX permissions for NFS volume accepted in octal 4 + /// digit format. First digit selects the set user ID(4), set group ID + /// (2) and sticky (1) attributes. Second digit selects permission for + /// the owner of the file: read (4), write (2) and execute (1). Third + /// selects permissions for other users in the 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. + /// + [JsonProperty(PropertyName = "properties.unixPermissions")] + public string UnixPermissions { get; set; } + /// /// Validate the object. /// @@ -184,15 +205,23 @@ public VolumePatch() /// public virtual void Validate() { - if (UsageThreshold != null) + if (UsageThreshold > 109951162777600) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "UsageThreshold", 109951162777600); + } + if (UsageThreshold < 107374182400) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "UsageThreshold", 107374182400); + } + if (UnixPermissions != null) { - if (UsageThreshold > 109951162777600) + if (UnixPermissions.Length > 4) { - throw new ValidationException(ValidationRules.InclusiveMaximum, "UsageThreshold", 109951162777600); + throw new ValidationException(ValidationRules.MaxLength, "UnixPermissions", 4); } - if (UsageThreshold < 107374182400) + if (UnixPermissions.Length < 4) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "UsageThreshold", 107374182400); + throw new ValidationException(ValidationRules.MinLength, "UnixPermissions", 4); } } } 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 5fbeb5c92980..3a879368b434 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,32 +19,22 @@ public static IEnumerable> ApiInfo_NetAppManagemen { return new Tuple[] { - new Tuple("NetApp", "AccountBackups", "2021-08-01"), - new Tuple("NetApp", "Accounts", "2021-08-01"), - new Tuple("NetApp", "BackupPolicies", "2021-08-01"), - new Tuple("NetApp", "Backups", "2021-08-01"), - new Tuple("NetApp", "NetAppResource", "2021-08-01"), - new Tuple("NetApp", "NetAppResourceQuotaLimits", "2021-08-01"), - new Tuple("NetApp", "Operations", "2021-08-01"), - new Tuple("NetApp", "Pools", "2021-08-01"), - new Tuple("NetApp", "SnapshotPolicies", "2021-08-01"), - new Tuple("NetApp", "Snapshots", "2021-08-01"), - new Tuple("NetApp", "Vaults", "2021-08-01"), - new Tuple("NetApp", "VolumeGroups", "2021-08-01"), - new Tuple("NetApp", "Volumes", "2021-08-01"), + 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"), }.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 = "627150f8d136efe07ca7fe6b2501c9c394b437d0"; - 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/SnapshotsOperations.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/SnapshotsOperations.cs index 048c8cdd6b0d..9bcedaab2e89 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/SnapshotsOperations.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/SnapshotsOperations.cs @@ -705,6 +705,44 @@ internal SnapshotsOperations(AzureNetAppFilesManagementClient client) return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } + /// + /// Create a new Snapshot Restore Files request + /// + /// + /// Restore the specified files from the specified snapshot to the active + /// filesystem + /// + /// + /// Restore payload 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 the snapshot + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task RestoreFilesWithHttpMessagesAsync(SnapshotRestoreFiles body, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginRestoreFilesWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, volumeName, snapshotName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + /// /// Create a snapshot /// @@ -1550,5 +1588,281 @@ internal SnapshotsOperations(AzureNetAppFilesManagementClient client) return _result; } + /// + /// Create a new Snapshot Restore Files request + /// + /// + /// Restore the specified files from the specified snapshot to the active + /// filesystem + /// + /// + /// Restore payload 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 the snapshot + /// + /// + /// 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 BeginRestoreFilesWithHttpMessagesAsync(SnapshotRestoreFiles body, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, 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 (snapshotName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "snapshotName"); + } + 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("snapshotName", snapshotName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginRestoreFiles", 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}/snapshots/{snapshotName}/restoreFiles").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("{snapshotName}", System.Uri.EscapeDataString(snapshotName)); + 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; + } + } } diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/SnapshotsOperationsExtensions.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/SnapshotsOperationsExtensions.cs index f0dae4297a44..49425a9f5d02 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/SnapshotsOperationsExtensions.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/SnapshotsOperationsExtensions.cs @@ -346,6 +346,75 @@ public static void Delete(this ISnapshotsOperations operations, string resourceG (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } + /// + /// Create a new Snapshot Restore Files request + /// + /// + /// Restore the specified files from the specified snapshot to the active + /// filesystem + /// + /// + /// The operations group for this extension method. + /// + /// + /// Restore payload 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 the snapshot + /// + public static void RestoreFiles(this ISnapshotsOperations operations, SnapshotRestoreFiles body, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName) + { + operations.RestoreFilesAsync(body, resourceGroupName, accountName, poolName, volumeName, snapshotName).GetAwaiter().GetResult(); + } + + /// + /// Create a new Snapshot Restore Files request + /// + /// + /// Restore the specified files from the specified snapshot to the active + /// filesystem + /// + /// + /// The operations group for this extension method. + /// + /// + /// Restore payload 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 the snapshot + /// + /// + /// The cancellation token. + /// + public static async Task RestoreFilesAsync(this ISnapshotsOperations operations, SnapshotRestoreFiles body, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.RestoreFilesWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, volumeName, snapshotName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// /// Create a snapshot /// @@ -547,5 +616,74 @@ public static void BeginDelete(this ISnapshotsOperations operations, string reso (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, snapshotName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } + /// + /// Create a new Snapshot Restore Files request + /// + /// + /// Restore the specified files from the specified snapshot to the active + /// filesystem + /// + /// + /// The operations group for this extension method. + /// + /// + /// Restore payload 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 the snapshot + /// + public static void BeginRestoreFiles(this ISnapshotsOperations operations, SnapshotRestoreFiles body, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName) + { + operations.BeginRestoreFilesAsync(body, resourceGroupName, accountName, poolName, volumeName, snapshotName).GetAwaiter().GetResult(); + } + + /// + /// Create a new Snapshot Restore Files request + /// + /// + /// Restore the specified files from the specified snapshot to the active + /// filesystem + /// + /// + /// The operations group for this extension method. + /// + /// + /// Restore payload 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 the snapshot + /// + /// + /// The cancellation token. + /// + public static async Task BeginRestoreFilesAsync(this ISnapshotsOperations operations, SnapshotRestoreFiles body, string resourceGroupName, string accountName, string poolName, string volumeName, string snapshotName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginRestoreFilesWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, volumeName, snapshotName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + } } diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/SubvolumesOperations.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/SubvolumesOperations.cs new file mode 100644 index 000000000000..85830023b7d8 --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/SubvolumesOperations.cs @@ -0,0 +1,2133 @@ +// +// 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; + + /// + /// SubvolumesOperations operations. + /// + internal partial class SubvolumesOperations : IServiceOperations, ISubvolumesOperations + { + /// + /// Initializes a new instance of the SubvolumesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal SubvolumesOperations(AzureNetAppFilesManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AzureNetAppFilesManagementClient + /// + public AzureNetAppFilesManagementClient Client { get; private set; } + + /// + /// List of all the subvolumes + /// + /// + /// Returns a list of the subvolumes in 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}/subvolumes").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; + } + + /// + /// Get the path associated with the subvolumeName + /// + /// + /// Returns the path associated with the subvolumeName provided + /// + /// + /// 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 the subvolume. + /// + /// + /// 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 subvolumeName, 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 (subvolumeName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "subvolumeName"); + } + if (subvolumeName != null) + { + if (subvolumeName.Length > 64) + { + throw new ValidationException(ValidationRules.MaxLength, "subvolumeName", 64); + } + if (subvolumeName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "subvolumeName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(subvolumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) + { + throw new ValidationException(ValidationRules.Pattern, "subvolumeName", "^[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("subvolumeName", subvolumeName); + 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}/subvolumes/{subvolumeName}").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("{subvolumeName}", System.Uri.EscapeDataString(subvolumeName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Create or clone a new subvolume + /// + /// + /// Creates a subvolume in the path or clones the subvolume mentioned in the + /// parentPath + /// + /// + /// Subvolume 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 the subvolume. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateWithHttpMessagesAsync(SubvolumeInfo body, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, volumeName, subvolumeName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Update a subvolume + /// + /// + /// Patch a subvolume + /// + /// + /// Subvolume 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 the subvolume. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> UpdateWithHttpMessagesAsync(SubvolumePatchRequest body, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, volumeName, subvolumeName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Delete a subvolume + /// + /// + /// Delete subvolume + /// + /// + /// 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 the subvolume. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, subvolumeName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Describe a subvolume + /// + /// + /// Get details of the specified subvolume + /// + /// + /// 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 the subvolume. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> GetMetadataWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginGetMetadataWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, subvolumeName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Create or clone a new subvolume + /// + /// + /// Creates a subvolume in the path or clones the subvolume mentioned in the + /// parentPath + /// + /// + /// Subvolume 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 the subvolume. + /// + /// + /// 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(SubvolumeInfo body, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, 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 (subvolumeName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "subvolumeName"); + } + if (subvolumeName != null) + { + if (subvolumeName.Length > 64) + { + throw new ValidationException(ValidationRules.MaxLength, "subvolumeName", 64); + } + if (subvolumeName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "subvolumeName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(subvolumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) + { + throw new ValidationException(ValidationRules.Pattern, "subvolumeName", "^[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("subvolumeName", subvolumeName); + 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}/subvolumes/{subvolumeName}").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("{subvolumeName}", System.Uri.EscapeDataString(subvolumeName)); + 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 subvolume + /// + /// + /// Patch a subvolume + /// + /// + /// Subvolume 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 the subvolume. + /// + /// + /// 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(SubvolumePatchRequest body, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, 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 (subvolumeName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "subvolumeName"); + } + if (subvolumeName != null) + { + if (subvolumeName.Length > 64) + { + throw new ValidationException(ValidationRules.MaxLength, "subvolumeName", 64); + } + if (subvolumeName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "subvolumeName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(subvolumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) + { + throw new ValidationException(ValidationRules.Pattern, "subvolumeName", "^[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("subvolumeName", subvolumeName); + 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}/subvolumes/{subvolumeName}").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("{subvolumeName}", System.Uri.EscapeDataString(subvolumeName)); + 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 subvolume + /// + /// + /// Delete subvolume + /// + /// + /// 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 the subvolume. + /// + /// + /// 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 subvolumeName, 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 (subvolumeName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "subvolumeName"); + } + if (subvolumeName != null) + { + if (subvolumeName.Length > 64) + { + throw new ValidationException(ValidationRules.MaxLength, "subvolumeName", 64); + } + if (subvolumeName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "subvolumeName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(subvolumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) + { + throw new ValidationException(ValidationRules.Pattern, "subvolumeName", "^[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("subvolumeName", subvolumeName); + 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}/subvolumes/{subvolumeName}").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("{subvolumeName}", System.Uri.EscapeDataString(subvolumeName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("DELETE"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Describe a subvolume + /// + /// + /// Get details of the specified subvolume + /// + /// + /// 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 the subvolume. + /// + /// + /// 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> BeginGetMetadataWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, 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 (subvolumeName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "subvolumeName"); + } + if (subvolumeName != null) + { + if (subvolumeName.Length > 64) + { + throw new ValidationException(ValidationRules.MaxLength, "subvolumeName", 64); + } + if (subvolumeName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "subvolumeName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(subvolumeName, "^[a-zA-Z][a-zA-Z0-9\\-_]{0,63}$")) + { + throw new ValidationException(ValidationRules.Pattern, "subvolumeName", "^[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("subvolumeName", subvolumeName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginGetMetadata", 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}/subvolumes/{subvolumeName}/getMetadata").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("{subvolumeName}", System.Uri.EscapeDataString(subvolumeName)); + 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(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// List of all the subvolumes + /// + /// + /// Returns a list of the subvolumes in the volume + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListByVolumeNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByVolumeNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/SubvolumesOperationsExtensions.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/SubvolumesOperationsExtensions.cs new file mode 100644 index 000000000000..61be32d18d26 --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/SubvolumesOperationsExtensions.cs @@ -0,0 +1,721 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.NetApp +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for SubvolumesOperations. + /// + public static partial class SubvolumesOperationsExtensions + { + /// + /// List of all the subvolumes + /// + /// + /// Returns a list of the subvolumes in 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 IPage ListByVolume(this ISubvolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) + { + return operations.ListByVolumeAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); + } + + /// + /// List of all the subvolumes + /// + /// + /// Returns a list of the subvolumes in 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 ISubvolumesOperations 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; + } + } + + /// + /// Get the path associated with the subvolumeName + /// + /// + /// Returns the path associated with the subvolumeName provided + /// + /// + /// 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 the subvolume. + /// + public static SubvolumeInfo Get(this ISubvolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName) + { + return operations.GetAsync(resourceGroupName, accountName, poolName, volumeName, subvolumeName).GetAwaiter().GetResult(); + } + + /// + /// Get the path associated with the subvolumeName + /// + /// + /// Returns the path associated with the subvolumeName provided + /// + /// + /// 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 the subvolume. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this ISubvolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, subvolumeName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Create or clone a new subvolume + /// + /// + /// Creates a subvolume in the path or clones the subvolume mentioned in the + /// parentPath + /// + /// + /// The operations group for this extension method. + /// + /// + /// Subvolume 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 the subvolume. + /// + public static SubvolumeInfo Create(this ISubvolumesOperations operations, SubvolumeInfo body, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName) + { + return operations.CreateAsync(body, resourceGroupName, accountName, poolName, volumeName, subvolumeName).GetAwaiter().GetResult(); + } + + /// + /// Create or clone a new subvolume + /// + /// + /// Creates a subvolume in the path or clones the subvolume mentioned in the + /// parentPath + /// + /// + /// The operations group for this extension method. + /// + /// + /// Subvolume 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 the subvolume. + /// + /// + /// The cancellation token. + /// + public static async Task CreateAsync(this ISubvolumesOperations operations, SubvolumeInfo body, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, volumeName, subvolumeName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Update a subvolume + /// + /// + /// Patch a subvolume + /// + /// + /// The operations group for this extension method. + /// + /// + /// Subvolume 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 the subvolume. + /// + public static SubvolumeInfo Update(this ISubvolumesOperations operations, SubvolumePatchRequest body, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName) + { + return operations.UpdateAsync(body, resourceGroupName, accountName, poolName, volumeName, subvolumeName).GetAwaiter().GetResult(); + } + + /// + /// Update a subvolume + /// + /// + /// Patch a subvolume + /// + /// + /// The operations group for this extension method. + /// + /// + /// Subvolume 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 the subvolume. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this ISubvolumesOperations operations, SubvolumePatchRequest body, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, volumeName, subvolumeName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete a subvolume + /// + /// + /// Delete subvolume + /// + /// + /// 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 the subvolume. + /// + public static void Delete(this ISubvolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName) + { + operations.DeleteAsync(resourceGroupName, accountName, poolName, volumeName, subvolumeName).GetAwaiter().GetResult(); + } + + /// + /// Delete a subvolume + /// + /// + /// Delete subvolume + /// + /// + /// 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 the subvolume. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this ISubvolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, subvolumeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Describe a subvolume + /// + /// + /// Get details of the specified subvolume + /// + /// + /// 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 the subvolume. + /// + public static SubvolumeModel GetMetadata(this ISubvolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName) + { + return operations.GetMetadataAsync(resourceGroupName, accountName, poolName, volumeName, subvolumeName).GetAwaiter().GetResult(); + } + + /// + /// Describe a subvolume + /// + /// + /// Get details of the specified subvolume + /// + /// + /// 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 the subvolume. + /// + /// + /// The cancellation token. + /// + public static async Task GetMetadataAsync(this ISubvolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetMetadataWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, subvolumeName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Create or clone a new subvolume + /// + /// + /// Creates a subvolume in the path or clones the subvolume mentioned in the + /// parentPath + /// + /// + /// The operations group for this extension method. + /// + /// + /// Subvolume 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 the subvolume. + /// + public static SubvolumeInfo BeginCreate(this ISubvolumesOperations operations, SubvolumeInfo body, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName) + { + return operations.BeginCreateAsync(body, resourceGroupName, accountName, poolName, volumeName, subvolumeName).GetAwaiter().GetResult(); + } + + /// + /// Create or clone a new subvolume + /// + /// + /// Creates a subvolume in the path or clones the subvolume mentioned in the + /// parentPath + /// + /// + /// The operations group for this extension method. + /// + /// + /// Subvolume 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 the subvolume. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateAsync(this ISubvolumesOperations operations, SubvolumeInfo body, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, volumeName, subvolumeName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Update a subvolume + /// + /// + /// Patch a subvolume + /// + /// + /// The operations group for this extension method. + /// + /// + /// Subvolume 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 the subvolume. + /// + public static SubvolumeInfo BeginUpdate(this ISubvolumesOperations operations, SubvolumePatchRequest body, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName) + { + return operations.BeginUpdateAsync(body, resourceGroupName, accountName, poolName, volumeName, subvolumeName).GetAwaiter().GetResult(); + } + + /// + /// Update a subvolume + /// + /// + /// Patch a subvolume + /// + /// + /// The operations group for this extension method. + /// + /// + /// Subvolume 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 the subvolume. + /// + /// + /// The cancellation token. + /// + public static async Task BeginUpdateAsync(this ISubvolumesOperations operations, SubvolumePatchRequest body, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(body, resourceGroupName, accountName, poolName, volumeName, subvolumeName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete a subvolume + /// + /// + /// Delete subvolume + /// + /// + /// 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 the subvolume. + /// + public static void BeginDelete(this ISubvolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName) + { + operations.BeginDeleteAsync(resourceGroupName, accountName, poolName, volumeName, subvolumeName).GetAwaiter().GetResult(); + } + + /// + /// Delete a subvolume + /// + /// + /// Delete subvolume + /// + /// + /// 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 the subvolume. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this ISubvolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, subvolumeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Describe a subvolume + /// + /// + /// Get details of the specified subvolume + /// + /// + /// 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 the subvolume. + /// + public static SubvolumeModel BeginGetMetadata(this ISubvolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName) + { + return operations.BeginGetMetadataAsync(resourceGroupName, accountName, poolName, volumeName, subvolumeName).GetAwaiter().GetResult(); + } + + /// + /// Describe a subvolume + /// + /// + /// Get details of the specified subvolume + /// + /// + /// 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 the subvolume. + /// + /// + /// The cancellation token. + /// + public static async Task BeginGetMetadataAsync(this ISubvolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, string subvolumeName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginGetMetadataWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, subvolumeName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// List of all the subvolumes + /// + /// + /// Returns a list of the subvolumes in the volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByVolumeNext(this ISubvolumesOperations operations, string nextPageLink) + { + return operations.ListByVolumeNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// List of all the subvolumes + /// + /// + /// Returns a list of the subvolumes in the volume + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByVolumeNextAsync(this ISubvolumesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByVolumeNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} 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 b7a108e5d458..15916d521f8c 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/VolumesOperations.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/VolumesOperations.cs @@ -650,16 +650,20 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) /// /// The name of the volume /// + /// + /// An option to force delete the volume. Will cleanup resources connected to + /// the particular volume + /// /// /// The headers that will be added to request. /// /// /// The cancellation token. /// - public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string poolName, string volumeName, bool? forceDelete = default(bool?), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, forceDelete, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } @@ -1770,6 +1774,10 @@ 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. /// @@ -1788,7 +1796,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, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + 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) { @@ -1877,6 +1885,7 @@ 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); } @@ -1889,6 +1898,10 @@ internal VolumesOperations(AzureNetAppFilesManagementClient client) _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))); 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 87806f926117..d9e64cc0bfdb 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/VolumesOperationsExtensions.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/VolumesOperationsExtensions.cs @@ -280,9 +280,13 @@ public static Volume Update(this IVolumesOperations operations, VolumePatch body /// /// The name of the volume /// - public static void Delete(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) + /// + /// An option to force delete the volume. Will cleanup resources connected to + /// the particular volume + /// + public static void Delete(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, bool? forceDelete = default(bool?)) { - operations.DeleteAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); + operations.DeleteAsync(resourceGroupName, accountName, poolName, volumeName, forceDelete).GetAwaiter().GetResult(); } /// @@ -306,12 +310,16 @@ public static void Delete(this IVolumesOperations operations, string resourceGro /// /// The name of the volume /// + /// + /// An option to force delete the volume. Will cleanup resources connected to + /// the particular volume + /// /// /// The cancellation token. /// - public static async Task DeleteAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task DeleteAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, bool? forceDelete = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, forceDelete, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// @@ -936,9 +944,13 @@ public static Volume BeginUpdate(this IVolumesOperations operations, VolumePatch /// /// The name of the volume /// - public static void BeginDelete(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName) + /// + /// An option to force delete the volume. Will cleanup resources connected to + /// the particular volume + /// + public static void BeginDelete(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, bool? forceDelete = default(bool?)) { - operations.BeginDeleteAsync(resourceGroupName, accountName, poolName, volumeName).GetAwaiter().GetResult(); + operations.BeginDeleteAsync(resourceGroupName, accountName, poolName, volumeName, forceDelete).GetAwaiter().GetResult(); } /// @@ -962,12 +974,16 @@ public static void BeginDelete(this IVolumesOperations operations, string resour /// /// The name of the volume /// + /// + /// An option to force delete the volume. Will cleanup resources connected to + /// the particular volume + /// /// /// The cancellation token. /// - public static async Task BeginDeleteAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginDeleteAsync(this IVolumesOperations operations, string resourceGroupName, string accountName, string poolName, string volumeName, bool? forceDelete = default(bool?), CancellationToken cancellationToken = default(CancellationToken)) { - (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, poolName, volumeName, forceDelete, null, cancellationToken).ConfigureAwait(false)).Dispose(); } ///