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 d04a890e0bea..4c67da631b81 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/AzureNetAppFilesManagementClient.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/AzureNetAppFilesManagementClient.cs @@ -136,6 +136,11 @@ public partial class AzureNetAppFilesManagementClient : ServiceClient public virtual IVaultsOperations Vaults { get; private set; } + /// + /// Gets the IVolumeGroupsOperations. + /// + public virtual IVolumeGroupsOperations VolumeGroups { get; private set; } + /// /// Initializes a new instance of the AzureNetAppFilesManagementClient class. /// @@ -389,8 +394,9 @@ private void Initialize() AccountBackups = new AccountBackupsOperations(this); BackupPolicies = new BackupPoliciesOperations(this); Vaults = new VaultsOperations(this); + VolumeGroups = new VolumeGroupsOperations(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2021-06-01"; + ApiVersion = "2021-08-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 a712fdb0abbc..a50a2c9d6f3b 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IAzureNetAppFilesManagementClient.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IAzureNetAppFilesManagementClient.cs @@ -131,5 +131,10 @@ public partial interface IAzureNetAppFilesManagementClient : System.IDisposable /// IVaultsOperations Vaults { get; } + /// + /// Gets the IVolumeGroupsOperations. + /// + IVolumeGroupsOperations VolumeGroups { get; } + } } diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IVolumeGroupsOperations.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IVolumeGroupsOperations.cs new file mode 100644 index 000000000000..4eab234b7334 --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/IVolumeGroupsOperations.cs @@ -0,0 +1,218 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.NetApp +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// VolumeGroupsOperations operations. + /// + public partial interface IVolumeGroupsOperations + { + /// + /// Describe all volume groups + /// + /// + /// List all volume groups for given account + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListByNetAppAccountWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Describe a Volume Group + /// + /// + /// Get details of the specified volume group + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the volumeGroup + /// + /// + /// 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 volumeGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create the specified volume group and volumes. Creating volume + /// group will create all the volumes specified in request body + /// implicitly. Once volumes are created using volume group, those will + /// be treated as regular volumes thereafter. + /// + /// + /// Create a volume group along with specified volumes + /// + /// + /// Volume Group object supplied in the body of the operation. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the volumeGroup + /// + /// + /// 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(VolumeGroupDetails body, string resourceGroupName, string accountName, string volumeGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete a volume group + /// + /// + /// Delete the specified volume group only if there are no volumes + /// under volume group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the volumeGroup + /// + /// + /// 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 volumeGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Create the specified volume group and volumes. Creating volume + /// group will create all the volumes specified in request body + /// implicitly. Once volumes are created using volume group, those will + /// be treated as regular volumes thereafter. + /// + /// + /// Create a volume group along with specified volumes + /// + /// + /// Volume Group object supplied in the body of the operation. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the volumeGroup + /// + /// + /// 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(VolumeGroupDetails body, string resourceGroupName, string accountName, string volumeGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Delete a volume group + /// + /// + /// Delete the specified volume group only if there are no volumes + /// under volume group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the volumeGroup + /// + /// + /// 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 volumeGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} 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 dcc6fe63a817..4e1a6f9878ae 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 @@ -82,7 +82,9 @@ public ActiveDirectory() /// If enabled, NFS client /// local users can also (in addition to LDAP users) access the NFS /// volumes. - 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?)) + /// 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?)) { ActiveDirectoryId = activeDirectoryId; Username = username; @@ -104,6 +106,7 @@ public ActiveDirectory() SecurityOperators = securityOperators; LdapOverTLS = ldapOverTLS; AllowLocalNfsUsersWithLdap = allowLocalNfsUsersWithLdap; + EncryptDCConnections = encryptDCConnections; CustomInit(); } @@ -256,6 +259,13 @@ public ActiveDirectory() [JsonProperty(PropertyName = "allowLocalNfsUsersWithLdap")] public bool? AllowLocalNfsUsersWithLdap { get; set; } + /// + /// Gets or sets if enabled, Traffic between the SMB server to Domain + /// Controller (DC) will be encrypted. + /// + [JsonProperty(PropertyName = "encryptDCConnections")] + public bool? EncryptDCConnections { get; set; } + /// /// Validate the object. /// diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ApplicationType.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ApplicationType.cs new file mode 100644 index 000000000000..5bf9d7370a50 --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ApplicationType.cs @@ -0,0 +1,21 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.NetApp.Models +{ + + /// + /// Defines values for ApplicationType. + /// + public static class ApplicationType + { + public const string SAPHANA = "SAP-HANA"; + } +} 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 9339ff74f4e8..9e82002a3342 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 @@ -42,7 +42,6 @@ public BackupPolicy() /// the resource is updated. /// Resource type /// Resource tags - /// Name of backup policy /// Backup Policy Resource ID /// Azure lifecycle management /// Daily backups count to @@ -57,7 +56,7 @@ 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 name1 = default(string), string backupPolicyId = default(string), string provisioningState = default(string), int? dailyBackupsToKeep = default(int?), int? weeklyBackupsToKeep = default(int?), int? monthlyBackupsToKeep = default(int?), int? volumesAssigned = default(int?), bool? enabled = default(bool?), IList volumeBackups = default(IList)) + 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)) { Location = location; Id = id; @@ -65,7 +64,6 @@ public BackupPolicy() Etag = etag; Type = type; Tags = tags; - Name1 = name1; BackupPolicyId = backupPolicyId; ProvisioningState = provisioningState; DailyBackupsToKeep = dailyBackupsToKeep; @@ -119,12 +117,6 @@ public BackupPolicy() [JsonProperty(PropertyName = "tags")] public IDictionary Tags { get; set; } - /// - /// Gets name of backup policy - /// - [JsonProperty(PropertyName = "properties.name")] - public string Name1 { get; private set; } - /// /// Gets backup Policy Resource ID /// diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/BackupPolicyDetails.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/BackupPolicyDetails.cs index d91b6c5528c5..d975015bc134 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/BackupPolicyDetails.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/BackupPolicyDetails.cs @@ -40,7 +40,6 @@ public BackupPolicyDetails() /// Resource name /// Resource type /// Resource tags - /// Name of backup policy /// Backup Policy Resource ID /// Azure lifecycle management /// Daily backups count to @@ -55,14 +54,13 @@ public BackupPolicyDetails() /// not /// A list of volumes assigned to this /// policy - public BackupPolicyDetails(string location = default(string), string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string name1 = default(string), string backupPolicyId = default(string), string provisioningState = default(string), int? dailyBackupsToKeep = default(int?), int? weeklyBackupsToKeep = default(int?), int? monthlyBackupsToKeep = default(int?), int? volumesAssigned = default(int?), bool? enabled = default(bool?), IList volumeBackups = default(IList)) + public BackupPolicyDetails(string location = default(string), string id = default(string), string name = 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)) { Location = location; Id = id; Name = name; Type = type; Tags = tags; - Name1 = name1; BackupPolicyId = backupPolicyId; ProvisioningState = provisioningState; DailyBackupsToKeep = dailyBackupsToKeep; @@ -109,12 +107,6 @@ public BackupPolicyDetails() [JsonProperty(PropertyName = "tags")] public IDictionary Tags { get; set; } - /// - /// Gets name of backup policy - /// - [JsonProperty(PropertyName = "properties.name")] - public string Name1 { get; private set; } - /// /// Gets backup Policy Resource ID /// diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/BackupPolicyPatch.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/BackupPolicyPatch.cs index 2129f2c1eeda..eb0fc1e95c4f 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/BackupPolicyPatch.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/BackupPolicyPatch.cs @@ -40,7 +40,6 @@ public BackupPolicyPatch() /// Resource name /// Resource type /// Resource tags - /// Name of backup policy /// Backup Policy Resource ID /// Azure lifecycle management /// Daily backups count to @@ -55,14 +54,13 @@ public BackupPolicyPatch() /// not /// A list of volumes assigned to this /// policy - public BackupPolicyPatch(string location = default(string), string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string name1 = default(string), string backupPolicyId = default(string), string provisioningState = default(string), int? dailyBackupsToKeep = default(int?), int? weeklyBackupsToKeep = default(int?), int? monthlyBackupsToKeep = default(int?), int? volumesAssigned = default(int?), bool? enabled = default(bool?), IList volumeBackups = default(IList)) + public BackupPolicyPatch(string location = default(string), string id = default(string), string name = 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)) { Location = location; Id = id; Name = name; Type = type; Tags = tags; - Name1 = name1; BackupPolicyId = backupPolicyId; ProvisioningState = provisioningState; DailyBackupsToKeep = dailyBackupsToKeep; @@ -109,12 +107,6 @@ public BackupPolicyPatch() [JsonProperty(PropertyName = "tags")] public IDictionary Tags { get; set; } - /// - /// Gets name of backup policy - /// - [JsonProperty(PropertyName = "properties.name")] - public string Name1 { get; private set; } - /// /// Gets backup Policy Resource ID /// diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/CapacityPoolPatch.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/CapacityPoolPatch.cs index b4113f746648..a1824484d4bf 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/CapacityPoolPatch.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/CapacityPoolPatch.cs @@ -116,16 +116,13 @@ public CapacityPoolPatch() /// public virtual void Validate() { - if (Size != null) + if (Size > 549755813888000) { - if (Size > 549755813888000) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "Size", 549755813888000); - } - if (Size < 4398046511104) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "Size", 4398046511104); - } + throw new ValidationException(ValidationRules.InclusiveMaximum, "Size", 549755813888000); + } + if (Size < 4398046511104) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "Size", 4398046511104); } } } diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/LogSpecification.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/LogSpecification.cs index 3fbd0d051cf8..26eb5b9e27f7 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/LogSpecification.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/LogSpecification.cs @@ -29,6 +29,9 @@ public LogSpecification() /// /// Initializes a new instance of the LogSpecification class. /// + /// Name of log specification. + /// Display name of log + /// specification. public LogSpecification(string name = default(string), string displayName = default(string)) { Name = name; @@ -42,11 +45,13 @@ public LogSpecification() partial void CustomInit(); /// + /// Gets or sets name of log specification. /// [JsonProperty(PropertyName = "name")] public string Name { get; set; } /// + /// Gets or sets display name of log specification. /// [JsonProperty(PropertyName = "displayName")] public string DisplayName { get; set; } diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/PlacementKeyValuePairs.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/PlacementKeyValuePairs.cs new file mode 100644 index 000000000000..914e416ed968 --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/PlacementKeyValuePairs.cs @@ -0,0 +1,82 @@ +// +// 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; + + /// + /// Application specific parameters for the placement of volumes in the + /// volume group + /// + public partial class PlacementKeyValuePairs + { + /// + /// Initializes a new instance of the PlacementKeyValuePairs class. + /// + public PlacementKeyValuePairs() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PlacementKeyValuePairs class. + /// + /// Key for an application specific parameter for the + /// placement of volumes in the volume group + /// Value for an application specific parameter for + /// the placement of volumes in the volume group + public PlacementKeyValuePairs(string key, string value) + { + Key = key; + Value = value; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets key for an application specific parameter for the + /// placement of volumes in the volume group + /// + [JsonProperty(PropertyName = "key")] + public string Key { get; set; } + + /// + /// Gets or sets value for an application specific parameter for the + /// placement of volumes in the volume group + /// + [JsonProperty(PropertyName = "value")] + public string Value { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Key == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Key"); + } + if (Value == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Value"); + } + } + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ServiceSpecification.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ServiceSpecification.cs index a6ae379bd969..d8e7c8443912 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ServiceSpecification.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/ServiceSpecification.cs @@ -33,6 +33,8 @@ public ServiceSpecification() /// /// Metric specifications of /// operation. + /// Log specification of + /// operation. public ServiceSpecification(IList metricSpecifications = default(IList), IList logSpecifications = default(IList)) { MetricSpecifications = metricSpecifications; @@ -52,6 +54,7 @@ public ServiceSpecification() public IList MetricSpecifications { get; set; } /// + /// Gets or sets log specification of operation. /// [JsonProperty(PropertyName = "logSpecifications")] public IList LogSpecifications { get; set; } diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/SnapshotPolicyVolumeList.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/SnapshotPolicyVolumeList.cs index cb95cd72f1f3..9ad8d0974c63 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/SnapshotPolicyVolumeList.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/SnapshotPolicyVolumeList.cs @@ -32,7 +32,7 @@ public SnapshotPolicyVolumeList() /// Initializes a new instance of the SnapshotPolicyVolumeList class. /// /// List of volumes - public SnapshotPolicyVolumeList(IList value = default(IList)) + public SnapshotPolicyVolumeList(IList value = default(IList)) { Value = value; CustomInit(); @@ -47,7 +47,7 @@ public SnapshotPolicyVolumeList() /// Gets or sets list of volumes /// [JsonProperty(PropertyName = "value")] - public IList Value { get; set; } + public IList Value { get; set; } } } diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/SubscriptionQuotaItem.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/SubscriptionQuotaItem.cs index c31006ec1c61..19eab209146d 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/SubscriptionQuotaItem.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/SubscriptionQuotaItem.cs @@ -38,15 +38,13 @@ public SubscriptionQuotaItem() /// The type of the resource. E.g. /// "Microsoft.Compute/virtualMachines" or /// "Microsoft.Storage/storageAccounts" - /// Quota Item name /// The current quota value. /// The default quota value. /// The system meta data relating to this /// resource. - public SubscriptionQuotaItem(string id = default(string), string name = default(string), string type = default(string), string subscriptionQuotaItemName = default(string), int? current = default(int?), int? defaultProperty = default(int?), SystemData systemData = default(SystemData)) + public SubscriptionQuotaItem(string id = default(string), string name = default(string), string type = default(string), int? current = default(int?), int? defaultProperty = default(int?), SystemData systemData = default(SystemData)) : base(id, name, type) { - SubscriptionQuotaItemName = subscriptionQuotaItemName; Current = current; DefaultProperty = defaultProperty; SystemData = systemData; @@ -58,12 +56,6 @@ public SubscriptionQuotaItem() /// partial void CustomInit(); - /// - /// Gets quota Item name - /// - [JsonProperty(PropertyName = "properties.name")] - public string SubscriptionQuotaItemName { get; private set; } - /// /// Gets the current quota value. /// 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 aff7d3980bc8..ed56401b9f2a 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 @@ -80,7 +80,8 @@ public Volume() /// available share property for smb volume. Only applicable for SMB /// volume /// Maximum throughput in Mibps that can - /// be achieved by this volume + /// be achieved by this volume and this will be accepted as input only + /// for manual qosType volume /// Encryption Key Source. Possible /// values are: 'Microsoft.NetApp' /// Specifies whether LDAP is enabled or not @@ -111,7 +112,17 @@ public Volume() /// Default group quota for /// volume in KiBs. If isDefaultQuotaEnabled is set, the minimum value /// of 4 KiBs applies. - 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?)) + /// Volume Group Name + /// Pool Resource Id used in case + /// of creating a volume through volume group + /// Proximity placement group + /// associated with the volume + /// T2 network information + /// Volume spec name is the application + /// 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)) { Location = location; Id = id; @@ -153,6 +164,12 @@ public Volume() IsDefaultQuotaEnabled = isDefaultQuotaEnabled; DefaultUserQuotaInKiBs = defaultUserQuotaInKiBs; DefaultGroupQuotaInKiBs = defaultGroupQuotaInKiBs; + VolumeGroupName = volumeGroupName; + CapacityPoolResourceId = capacityPoolResourceId; + ProximityPlacementGroup = proximityPlacementGroup; + T2Network = t2Network; + VolumeSpecName = volumeSpecName; + PlacementRules = placementRules; CustomInit(); } @@ -397,7 +414,8 @@ public Volume() /// /// Gets or sets maximum throughput in Mibps that can be achieved by - /// this volume + /// this volume and this will be accepted as input only for manual + /// qosType volume /// [JsonProperty(PropertyName = "properties.throughputMibps")] public double? ThroughputMibps { get; set; } @@ -483,6 +501,48 @@ public Volume() [JsonProperty(PropertyName = "properties.defaultGroupQuotaInKiBs")] public long? DefaultGroupQuotaInKiBs { get; set; } + /// + /// Gets volume Group Name + /// + [JsonProperty(PropertyName = "properties.volumeGroupName")] + public string VolumeGroupName { get; private set; } + + /// + /// Gets or sets pool Resource Id used in case of creating a volume + /// through volume group + /// + [JsonProperty(PropertyName = "properties.capacityPoolResourceId")] + public string CapacityPoolResourceId { get; set; } + + /// + /// Gets or sets proximity placement group associated with the volume + /// + [JsonProperty(PropertyName = "properties.proximityPlacementGroup")] + public string ProximityPlacementGroup { get; set; } + + /// + /// Gets T2 network information + /// + [JsonProperty(PropertyName = "properties.t2Network")] + public string T2Network { get; private set; } + + /// + /// Gets or sets volume spec name is the application specific + /// designation or identifier for the particular volume in a volume + /// group for e.g. data, log + /// + [JsonProperty(PropertyName = "properties.volumeSpecName")] + public string VolumeSpecName { get; set; } + + /// + /// Gets or sets volume placement rules + /// + /// + /// Application specific placement rules for the particular volume + /// + [JsonProperty(PropertyName = "properties.placementRules")] + public IList PlacementRules { get; set; } + /// /// Validate the object. /// @@ -600,27 +660,13 @@ public virtual void Validate() { DataProtection.Validate(); } - if (ThroughputMibps != null) + if (CoolnessPeriod > 63) { - if (ThroughputMibps > 4500) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "ThroughputMibps", 4500); - } - if (ThroughputMibps < 0) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "ThroughputMibps", 0); - } + throw new ValidationException(ValidationRules.InclusiveMaximum, "CoolnessPeriod", 63); } - if (CoolnessPeriod != null) + if (CoolnessPeriod < 7) { - if (CoolnessPeriod > 63) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "CoolnessPeriod", 63); - } - if (CoolnessPeriod < 7) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "CoolnessPeriod", 7); - } + throw new ValidationException(ValidationRules.InclusiveMinimum, "CoolnessPeriod", 7); } if (UnixPermissions != null) { @@ -633,6 +679,16 @@ public virtual void Validate() throw new ValidationException(ValidationRules.MinLength, "UnixPermissions", 4); } } + if (PlacementRules != null) + { + foreach (var element1 in PlacementRules) + { + if (element1 != null) + { + element1.Validate(); + } + } + } } } } diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumeGroup.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumeGroup.cs new file mode 100644 index 000000000000..3eb9cce62dfd --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumeGroup.cs @@ -0,0 +1,107 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.NetApp.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Volume group resource + /// + [Rest.Serialization.JsonTransformation] + public partial class VolumeGroup + { + /// + /// Initializes a new instance of the VolumeGroup class. + /// + public VolumeGroup() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VolumeGroup class. + /// + /// Resource location + /// Resource Id + /// Resource name + /// Resource type + /// Resource tags + /// Azure lifecycle management + /// groupMetaData + public VolumeGroup(string location = default(string), string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string provisioningState = default(string), VolumeGroupMetaData groupMetaData = default(VolumeGroupMetaData)) + { + Location = location; + Id = id; + Name = name; + Type = type; + Tags = tags; + ProvisioningState = provisioningState; + GroupMetaData = groupMetaData; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets resource location + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; set; } + + /// + /// Gets resource Id + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets resource name + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets resource type + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets or sets resource tags + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// Gets azure lifecycle management + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets or sets groupMetaData + /// + /// + /// Volume group details + /// + [JsonProperty(PropertyName = "properties.groupMetaData")] + public VolumeGroupMetaData GroupMetaData { get; set; } + + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumeGroupDetails.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumeGroupDetails.cs new file mode 100644 index 000000000000..239013d35b2c --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumeGroupDetails.cs @@ -0,0 +1,115 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.NetApp.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Volume group resource for create + /// + [Rest.Serialization.JsonTransformation] + public partial class VolumeGroupDetails + { + /// + /// Initializes a new instance of the VolumeGroupDetails class. + /// + public VolumeGroupDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VolumeGroupDetails class. + /// + /// Resource location + /// Resource Id + /// Resource name + /// Resource type + /// Resource tags + /// Azure lifecycle management + /// groupMetaData + /// List of volumes from group + public VolumeGroupDetails(string location = default(string), string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string provisioningState = default(string), VolumeGroupMetaData groupMetaData = default(VolumeGroupMetaData), IList volumes = default(IList)) + { + Location = location; + Id = id; + Name = name; + Type = type; + Tags = tags; + ProvisioningState = provisioningState; + GroupMetaData = groupMetaData; + Volumes = volumes; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets resource location + /// + [JsonProperty(PropertyName = "location")] + public string Location { get; set; } + + /// + /// Gets resource Id + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets resource name + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets resource type + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets or sets resource tags + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// Gets azure lifecycle management + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets or sets groupMetaData + /// + /// + /// Volume group details + /// + [JsonProperty(PropertyName = "properties.groupMetaData")] + public VolumeGroupMetaData GroupMetaData { get; set; } + + /// + /// Gets or sets list of volumes from group + /// + [JsonProperty(PropertyName = "properties.volumes")] + public IList Volumes { get; set; } + + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumeGroupMetaData.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumeGroupMetaData.cs new file mode 100644 index 000000000000..b66d6ae63b8a --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumeGroupMetaData.cs @@ -0,0 +1,102 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.NetApp.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Volume group properties + /// + public partial class VolumeGroupMetaData + { + /// + /// Initializes a new instance of the VolumeGroupMetaData class. + /// + public VolumeGroupMetaData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VolumeGroupMetaData class. + /// + /// Group Description + /// Application Type. Possible values + /// include: 'SAP-HANA' + /// Application specific + /// identifier + /// Global volume placement + /// rules + /// Application specific identifier of + /// deployment rules for the volume group + /// Number of volumes in volume + /// group + public VolumeGroupMetaData(string groupDescription = default(string), string applicationType = default(string), string applicationIdentifier = default(string), IList globalPlacementRules = default(IList), string deploymentSpecId = default(string), long? volumesCount = default(long?)) + { + GroupDescription = groupDescription; + ApplicationType = applicationType; + ApplicationIdentifier = applicationIdentifier; + GlobalPlacementRules = globalPlacementRules; + DeploymentSpecId = deploymentSpecId; + VolumesCount = volumesCount; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets group Description + /// + [JsonProperty(PropertyName = "groupDescription")] + public string GroupDescription { get; set; } + + /// + /// Gets or sets application Type. Possible values include: 'SAP-HANA' + /// + [JsonProperty(PropertyName = "applicationType")] + public string ApplicationType { get; set; } + + /// + /// Gets or sets application specific identifier + /// + [JsonProperty(PropertyName = "applicationIdentifier")] + public string ApplicationIdentifier { get; set; } + + /// + /// Gets or sets global volume placement rules + /// + /// + /// Application specific placement rules for the volume group + /// + [JsonProperty(PropertyName = "globalPlacementRules")] + public IList GlobalPlacementRules { get; set; } + + /// + /// Gets or sets application specific identifier of deployment rules + /// for the volume group + /// + [JsonProperty(PropertyName = "deploymentSpecId")] + public string DeploymentSpecId { get; set; } + + /// + /// Gets number of volumes in volume group + /// + [JsonProperty(PropertyName = "volumesCount")] + public long? VolumesCount { get; private set; } + + } +} 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 new file mode 100644 index 000000000000..3083c16e97d8 --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/Models/VolumeGroupVolumeProperties.cs @@ -0,0 +1,674 @@ +// +// 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.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Volume resource + /// + [Rest.Serialization.JsonTransformation] + public partial class VolumeGroupVolumeProperties : IResource + { + /// + /// Initializes a new instance of the VolumeGroupVolumeProperties + /// class. + /// + public VolumeGroupVolumeProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VolumeGroupVolumeProperties + /// class. + /// + /// Creation Token or File Path + /// usageThreshold + /// The Azure Resource URI for a delegated + /// subnet. Must have the delegation Microsoft.NetApp/volumes + /// Resource Id + /// Resource name + /// Resource type + /// Resource tags + /// FileSystem ID + /// serviceLevel + /// exportPolicy + /// protocolTypes + /// Azure lifecycle management + /// Snapshot ID + /// Backup ID + /// Baremetal Tenant ID + /// Network features + /// Network Sibling Set ID + /// Storage to Network + /// Proximity + /// mountTargets + /// What type of volume is this. For + /// destination volumes in Cross Region Replication, set type to + /// DataProtection + /// DataProtection + /// Restoring + /// If enabled (true) the volume + /// will contain a read-only snapshot directory which provides access + /// to each of the volume's snapshots (default to true). + /// Describe if a volume is + /// KerberosEnabled. To be use with swagger version 2020-05-01 or + /// later + /// The security style of volume, default + /// unix, defaults to ntfs for dual protocol or CIFS protocol. Possible + /// values include: 'ntfs', 'unix' + /// Enables encryption for in-flight smb3 + /// data. Only applicable for SMB/DualProtocol volume. To be used with + /// swagger version 2020-08-01 or later + /// Enables continuously + /// available share property for smb volume. Only applicable for SMB + /// volume + /// Maximum throughput in Mibps that can + /// be achieved by this volume and this will be accepted as input only + /// for manual qosType volume + /// Encryption Key Source. Possible + /// values are: 'Microsoft.NetApp' + /// Specifies whether LDAP is enabled or not + /// for a given NFS volume. + /// Specifies whether Cool Access(tiering) is + /// enabled for the volume. + /// Specifies the number of days after + /// which data that is not accessed by clients will be tiered. + /// 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. + /// When a volume is being restored from + /// another volume's snapshot, will show the percentage completion of + /// this cloning process. When this value is empty/null there is no + /// cloning process currently happening on this volume. This value will + /// update every 5 minutes during cloning. + /// avsDataStore + /// Specifies if default quota is + /// enabled for the volume. + /// Default user quota for volume + /// in KiBs. If isDefaultQuotaEnabled is set, the minimum value of 4 + /// KiBs applies . + /// Default group quota for + /// volume in KiBs. If isDefaultQuotaEnabled is set, the minimum value + /// of 4 KiBs applies. + /// Volume Group Name + /// Pool Resource Id used in case + /// of creating a volume through volume group + /// Proximity placement group + /// associated with the volume + /// T2 network information + /// Volume spec name is the application + /// 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)) + { + Id = id; + Name = name; + Type = type; + Tags = tags; + FileSystemId = fileSystemId; + CreationToken = creationToken; + ServiceLevel = serviceLevel; + UsageThreshold = usageThreshold; + ExportPolicy = exportPolicy; + ProtocolTypes = protocolTypes; + ProvisioningState = provisioningState; + SnapshotId = snapshotId; + BackupId = backupId; + BaremetalTenantId = baremetalTenantId; + SubnetId = subnetId; + NetworkFeatures = networkFeatures; + NetworkSiblingSetId = networkSiblingSetId; + StorageToNetworkProximity = storageToNetworkProximity; + MountTargets = mountTargets; + VolumeType = volumeType; + DataProtection = dataProtection; + IsRestoring = isRestoring; + SnapshotDirectoryVisible = snapshotDirectoryVisible; + KerberosEnabled = kerberosEnabled; + SecurityStyle = securityStyle; + SmbEncryption = smbEncryption; + SmbContinuouslyAvailable = smbContinuouslyAvailable; + ThroughputMibps = throughputMibps; + EncryptionKeySource = encryptionKeySource; + LdapEnabled = ldapEnabled; + CoolAccess = coolAccess; + CoolnessPeriod = coolnessPeriod; + UnixPermissions = unixPermissions; + CloneProgress = cloneProgress; + AvsDataStore = avsDataStore; + IsDefaultQuotaEnabled = isDefaultQuotaEnabled; + DefaultUserQuotaInKiBs = defaultUserQuotaInKiBs; + DefaultGroupQuotaInKiBs = defaultGroupQuotaInKiBs; + VolumeGroupName = volumeGroupName; + CapacityPoolResourceId = capacityPoolResourceId; + ProximityPlacementGroup = proximityPlacementGroup; + T2Network = t2Network; + VolumeSpecName = volumeSpecName; + PlacementRules = placementRules; + 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 or sets resource name + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets resource type + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets or sets resource tags + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// Gets fileSystem ID + /// + /// + /// Unique FileSystem Identifier. + /// + [JsonProperty(PropertyName = "properties.fileSystemId")] + public string FileSystemId { get; private set; } + + /// + /// Gets or sets creation Token or File Path + /// + /// + /// A unique file path for the volume. Used when creating mount targets + /// + [JsonProperty(PropertyName = "properties.creationToken")] + public string CreationToken { get; set; } + + /// + /// Gets or sets serviceLevel + /// + /// + /// Possible values include: 'Standard', 'Premium', 'Ultra', + /// 'StandardZRS' + /// + [JsonProperty(PropertyName = "properties.serviceLevel")] + public string ServiceLevel { get; set; } + + /// + /// Gets or sets usageThreshold + /// + /// + /// Maximum storage quota allowed for a file system in bytes. This is a + /// soft quota used for alerting only. Minimum size is 100 GiB. Upper + /// limit is 100TiB. Specified in bytes. + /// + [JsonProperty(PropertyName = "properties.usageThreshold")] + public long UsageThreshold { get; set; } + + /// + /// Gets or sets exportPolicy + /// + /// + /// Set of export policy rules + /// + [JsonProperty(PropertyName = "properties.exportPolicy")] + public VolumePropertiesExportPolicy ExportPolicy { get; set; } + + /// + /// Gets or sets protocolTypes + /// + /// + /// Set of protocol types, default NFSv3, CIFS for SMB protocol + /// + [JsonProperty(PropertyName = "properties.protocolTypes")] + public IList ProtocolTypes { get; set; } + + /// + /// Gets azure lifecycle management + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets or sets snapshot ID + /// + /// + /// UUID v4 or resource identifier used to identify the Snapshot. + /// + [JsonProperty(PropertyName = "properties.snapshotId")] + public string SnapshotId { get; set; } + + /// + /// Gets or sets backup ID + /// + /// + /// UUID v4 or resource identifier used to identify the Backup. + /// + [JsonProperty(PropertyName = "properties.backupId")] + public string BackupId { get; set; } + + /// + /// Gets baremetal Tenant ID + /// + /// + /// Unique Baremetal Tenant Identifier. + /// + [JsonProperty(PropertyName = "properties.baremetalTenantId")] + public string BaremetalTenantId { get; private set; } + + /// + /// Gets or sets the Azure Resource URI for a delegated subnet. Must + /// have the delegation Microsoft.NetApp/volumes + /// + [JsonProperty(PropertyName = "properties.subnetId")] + public string SubnetId { get; set; } + + /// + /// Gets or sets network features + /// + /// + /// Basic network, or Standard features available to the volume. + /// Possible values include: 'Basic', 'Standard' + /// + [JsonProperty(PropertyName = "properties.networkFeatures")] + public string NetworkFeatures { get; set; } + + /// + /// Gets network Sibling Set ID + /// + /// + /// Network Sibling Set ID for the the group of volumes sharing + /// networking resources. + /// + [JsonProperty(PropertyName = "properties.networkSiblingSetId")] + public string NetworkSiblingSetId { get; private set; } + + /// + /// Gets storage to Network Proximity + /// + /// + /// Provides storage to network proximity information for the volume. + /// Possible values include: 'Default', 'T1', 'T2' + /// + [JsonProperty(PropertyName = "properties.storageToNetworkProximity")] + public string StorageToNetworkProximity { get; private set; } + + /// + /// Gets mountTargets + /// + /// + /// List of mount targets + /// + [JsonProperty(PropertyName = "properties.mountTargets")] + public IList MountTargets { get; private set; } + + /// + /// Gets or sets what type of volume is this. For destination volumes + /// in Cross Region Replication, set type to DataProtection + /// + [JsonProperty(PropertyName = "properties.volumeType")] + public string VolumeType { get; set; } + + /// + /// Gets or sets dataProtection + /// + /// + /// DataProtection type volumes include an object containing details of + /// the replication + /// + [JsonProperty(PropertyName = "properties.dataProtection")] + public VolumePropertiesDataProtection DataProtection { get; set; } + + /// + /// Gets or sets restoring + /// + [JsonProperty(PropertyName = "properties.isRestoring")] + public bool? IsRestoring { get; set; } + + /// + /// Gets or sets if enabled (true) the volume will contain a read-only + /// snapshot directory which provides access to each of the volume's + /// snapshots (default to true). + /// + [JsonProperty(PropertyName = "properties.snapshotDirectoryVisible")] + public bool? SnapshotDirectoryVisible { get; set; } + + /// + /// Gets or sets describe if a volume is KerberosEnabled. To be use + /// with swagger version 2020-05-01 or later + /// + [JsonProperty(PropertyName = "properties.kerberosEnabled")] + public bool? KerberosEnabled { get; set; } + + /// + /// Gets or sets the security style of volume, default unix, defaults + /// to ntfs for dual protocol or CIFS protocol. Possible values + /// include: 'ntfs', 'unix' + /// + [JsonProperty(PropertyName = "properties.securityStyle")] + public string SecurityStyle { get; set; } + + /// + /// Gets or sets enables encryption for in-flight smb3 data. Only + /// applicable for SMB/DualProtocol volume. To be used with swagger + /// version 2020-08-01 or later + /// + [JsonProperty(PropertyName = "properties.smbEncryption")] + public bool? SmbEncryption { get; set; } + + /// + /// Gets or sets enables continuously available share property for smb + /// volume. Only applicable for SMB volume + /// + [JsonProperty(PropertyName = "properties.smbContinuouslyAvailable")] + public bool? SmbContinuouslyAvailable { get; set; } + + /// + /// Gets or sets maximum throughput in Mibps that can be achieved by + /// this volume and this will be accepted as input only for manual + /// qosType volume + /// + [JsonProperty(PropertyName = "properties.throughputMibps")] + public double? ThroughputMibps { get; set; } + + /// + /// Gets or sets encryption Key Source. Possible values are: + /// 'Microsoft.NetApp' + /// + [JsonProperty(PropertyName = "properties.encryptionKeySource")] + public string EncryptionKeySource { get; set; } + + /// + /// Gets or sets specifies whether LDAP is enabled or not for a given + /// NFS volume. + /// + [JsonProperty(PropertyName = "properties.ldapEnabled")] + public bool? LdapEnabled { get; set; } + + /// + /// Gets or sets specifies whether Cool Access(tiering) is enabled for + /// the volume. + /// + [JsonProperty(PropertyName = "properties.coolAccess")] + public bool? CoolAccess { get; set; } + + /// + /// Gets or sets specifies the number of days after which data that is + /// not accessed by clients will be tiered. + /// + [JsonProperty(PropertyName = "properties.coolnessPeriod")] + public int? CoolnessPeriod { get; set; } + + /// + /// 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; } + + /// + /// Gets when a volume is being restored from another volume's + /// snapshot, will show the percentage completion of this cloning + /// process. When this value is empty/null there is no cloning process + /// currently happening on this volume. This value will update every 5 + /// minutes during cloning. + /// + [JsonProperty(PropertyName = "properties.cloneProgress")] + public int? CloneProgress { get; private set; } + + /// + /// Gets or sets avsDataStore + /// + /// + /// Specifies whether the volume is enabled for Azure VMware Solution + /// (AVS) datastore purpose. Possible values include: 'Enabled', + /// 'Disabled' + /// + [JsonProperty(PropertyName = "properties.avsDataStore")] + public string AvsDataStore { get; set; } + + /// + /// Gets or sets specifies if default quota is enabled for the volume. + /// + [JsonProperty(PropertyName = "properties.isDefaultQuotaEnabled")] + public bool? IsDefaultQuotaEnabled { get; set; } + + /// + /// Gets or sets default user quota for volume in KiBs. If + /// isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies . + /// + [JsonProperty(PropertyName = "properties.defaultUserQuotaInKiBs")] + public long? DefaultUserQuotaInKiBs { get; set; } + + /// + /// Gets or sets default group quota for volume in KiBs. If + /// isDefaultQuotaEnabled is set, the minimum value of 4 KiBs applies. + /// + [JsonProperty(PropertyName = "properties.defaultGroupQuotaInKiBs")] + public long? DefaultGroupQuotaInKiBs { get; set; } + + /// + /// Gets volume Group Name + /// + [JsonProperty(PropertyName = "properties.volumeGroupName")] + public string VolumeGroupName { get; private set; } + + /// + /// Gets or sets pool Resource Id used in case of creating a volume + /// through volume group + /// + [JsonProperty(PropertyName = "properties.capacityPoolResourceId")] + public string CapacityPoolResourceId { get; set; } + + /// + /// Gets or sets proximity placement group associated with the volume + /// + [JsonProperty(PropertyName = "properties.proximityPlacementGroup")] + public string ProximityPlacementGroup { get; set; } + + /// + /// Gets T2 network information + /// + [JsonProperty(PropertyName = "properties.t2Network")] + public string T2Network { get; private set; } + + /// + /// Gets or sets volume spec name is the application specific + /// designation or identifier for the particular volume in a volume + /// group for e.g. data, log + /// + [JsonProperty(PropertyName = "properties.volumeSpecName")] + public string VolumeSpecName { get; set; } + + /// + /// Gets or sets volume placement rules + /// + /// + /// Application specific placement rules for the particular volume + /// + [JsonProperty(PropertyName = "properties.placementRules")] + public IList PlacementRules { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (CreationToken == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "CreationToken"); + } + if (SubnetId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "SubnetId"); + } + if (FileSystemId != null) + { + if (FileSystemId.Length > 36) + { + throw new ValidationException(ValidationRules.MaxLength, "FileSystemId", 36); + } + if (FileSystemId.Length < 36) + { + throw new ValidationException(ValidationRules.MinLength, "FileSystemId", 36); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(FileSystemId, "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "FileSystemId", "^[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 (CreationToken != null) + { + if (CreationToken.Length > 80) + { + throw new ValidationException(ValidationRules.MaxLength, "CreationToken", 80); + } + if (CreationToken.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "CreationToken", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(CreationToken, "^[a-zA-Z][a-zA-Z0-9\\-]{0,79}$")) + { + throw new ValidationException(ValidationRules.Pattern, "CreationToken", "^[a-zA-Z][a-zA-Z0-9\\-]{0,79}$"); + } + } + if (UsageThreshold > 109951162777600) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "UsageThreshold", 109951162777600); + } + if (UsageThreshold < 107374182400) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "UsageThreshold", 107374182400); + } + if (SnapshotId != null) + { + if (SnapshotId.Length > 36) + { + throw new ValidationException(ValidationRules.MaxLength, "SnapshotId", 36); + } + if (SnapshotId.Length < 36) + { + throw new ValidationException(ValidationRules.MinLength, "SnapshotId", 36); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(SnapshotId, "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}|(\\\\?([^\\/]*[\\/])*)([^\\/]+)$")) + { + throw new ValidationException(ValidationRules.Pattern, "SnapshotId", "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}|(\\\\?([^\\/]*[\\/])*)([^\\/]+)$"); + } + } + if (BackupId != null) + { + if (BackupId.Length > 36) + { + throw new ValidationException(ValidationRules.MaxLength, "BackupId", 36); + } + if (BackupId.Length < 36) + { + throw new ValidationException(ValidationRules.MinLength, "BackupId", 36); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(BackupId, "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}|(\\\\?([^\\/]*[\\/])*)([^\\/]+)$")) + { + throw new ValidationException(ValidationRules.Pattern, "BackupId", "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}|(\\\\?([^\\/]*[\\/])*)([^\\/]+)$"); + } + } + if (NetworkSiblingSetId != null) + { + if (NetworkSiblingSetId.Length > 36) + { + throw new ValidationException(ValidationRules.MaxLength, "NetworkSiblingSetId", 36); + } + if (NetworkSiblingSetId.Length < 36) + { + throw new ValidationException(ValidationRules.MinLength, "NetworkSiblingSetId", 36); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(NetworkSiblingSetId, "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$")) + { + throw new ValidationException(ValidationRules.Pattern, "NetworkSiblingSetId", "^[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 (MountTargets != null) + { + foreach (var element in MountTargets) + { + if (element != null) + { + element.Validate(); + } + } + } + if (DataProtection != null) + { + DataProtection.Validate(); + } + if (CoolnessPeriod > 63) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "CoolnessPeriod", 63); + } + if (CoolnessPeriod < 7) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "CoolnessPeriod", 7); + } + if (UnixPermissions != null) + { + if (UnixPermissions.Length > 4) + { + throw new ValidationException(ValidationRules.MaxLength, "UnixPermissions", 4); + } + if (UnixPermissions.Length < 4) + { + throw new ValidationException(ValidationRules.MinLength, "UnixPermissions", 4); + } + } + if (PlacementRules != null) + { + foreach (var element1 in PlacementRules) + { + if (element1 != null) + { + element1.Validate(); + } + } + } + } + } +} 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 6261d0dcdaa9..56c1dc32839b 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 @@ -44,7 +44,8 @@ public VolumePatch() /// usageThreshold /// exportPolicy /// Maximum throughput in Mibps that can - /// be achieved by this volume + /// be achieved by this volume and this will be accepted as input only + /// for manual qosType volume /// DataProtection /// Specifies if default quota is /// enabled for the volume. @@ -139,7 +140,8 @@ public VolumePatch() /// /// Gets or sets maximum throughput in Mibps that can be achieved by - /// this volume + /// this volume and this will be accepted as input only for manual + /// qosType volume /// [JsonProperty(PropertyName = "properties.throughputMibps")] public double? ThroughputMibps { get; set; } @@ -182,27 +184,13 @@ public VolumePatch() /// public virtual void Validate() { - if (UsageThreshold != null) + if (UsageThreshold > 109951162777600) { - if (UsageThreshold > 109951162777600) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "UsageThreshold", 109951162777600); - } - if (UsageThreshold < 107374182400) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "UsageThreshold", 107374182400); - } + throw new ValidationException(ValidationRules.InclusiveMaximum, "UsageThreshold", 109951162777600); } - if (ThroughputMibps != null) + if (UsageThreshold < 107374182400) { - if (ThroughputMibps > 4500) - { - throw new ValidationException(ValidationRules.InclusiveMaximum, "ThroughputMibps", 4500); - } - if (ThroughputMibps < 1) - { - throw new ValidationException(ValidationRules.InclusiveMinimum, "ThroughputMibps", 1); - } + throw new ValidationException(ValidationRules.InclusiveMinimum, "UsageThreshold", 107374182400); } } } 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 f2f0f66cb1a3..1edff80e1d33 100644 --- a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/SdkInfo_NetAppManagementClient.cs +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/SdkInfo_NetAppManagementClient.cs @@ -19,31 +19,21 @@ public static IEnumerable> ApiInfo_NetAppManagemen { return new Tuple[] { - new Tuple("NetApp", "AccountBackups", "2021-06-01"), - new Tuple("NetApp", "Accounts", "2021-06-01"), - new Tuple("NetApp", "BackupPolicies", "2021-06-01"), - new Tuple("NetApp", "Backups", "2021-06-01"), - new Tuple("NetApp", "NetAppResource", "2021-06-01"), - new Tuple("NetApp", "NetAppResourceQuotaLimits", "2021-06-01"), - new Tuple("NetApp", "Operations", "2021-06-01"), - new Tuple("NetApp", "Pools", "2021-06-01"), - new Tuple("NetApp", "SnapshotPolicies", "2021-06-01"), - new Tuple("NetApp", "Snapshots", "2021-06-01"), - new Tuple("NetApp", "Vaults", "2021-06-01"), - new Tuple("NetApp", "Volumes", "2021-06-01"), + 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"), }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "v2"; - public static readonly String AutoRestBootStrapperVersion = "autorest@1.9.1"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/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 = "ce90f9b45945c73b8f38649ee6ead390ff6efe7b"; - 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/VolumeGroupsOperations.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/VolumeGroupsOperations.cs new file mode 100644 index 000000000000..d979a73f281f --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/VolumeGroupsOperations.cs @@ -0,0 +1,1070 @@ +// +// 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; + + /// + /// VolumeGroupsOperations operations. + /// + internal partial class VolumeGroupsOperations : IServiceOperations, IVolumeGroupsOperations + { + /// + /// Initializes a new instance of the VolumeGroupsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal VolumeGroupsOperations(AzureNetAppFilesManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the AzureNetAppFilesManagementClient + /// + public AzureNetAppFilesManagementClient Client { get; private set; } + + /// + /// Describe all volume groups + /// + /// + /// List all volume groups for given account + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when 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>> ListByNetAppAccountWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new ValidationException(ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$")) + { + throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$"); + } + } + if (accountName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "accountName"); + } + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.ApiVersion != null) + { + if (Client.ApiVersion.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1); + } + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("accountName", accountName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByNetAppAccount", 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}/volumeGroups").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{accountName}", System.Uri.EscapeDataString(accountName)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Describe a Volume Group + /// + /// + /// Get details of the specified volume group + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the volumeGroup + /// + /// + /// 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 volumeGroupName, 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 (volumeGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "volumeGroupName"); + } + if (volumeGroupName != null) + { + if (volumeGroupName.Length > 64) + { + throw new ValidationException(ValidationRules.MaxLength, "volumeGroupName", 64); + } + if (volumeGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "volumeGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(volumeGroupName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) + { + throw new ValidationException(ValidationRules.Pattern, "volumeGroupName", "^[a-zA-Z0-9][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("volumeGroupName", volumeGroupName); + 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}/volumeGroups/{volumeGroupName}").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("{volumeGroupName}", System.Uri.EscapeDataString(volumeGroupName)); + 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 the specified volume group and volumes. Creating volume group will + /// create all the volumes specified in request body implicitly. Once volumes + /// are created using volume group, those will be treated as regular volumes + /// thereafter. + /// + /// + /// Create a volume group along with specified volumes + /// + /// + /// Volume Group object supplied in the body of the operation. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the volumeGroup + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateWithHttpMessagesAsync(VolumeGroupDetails body, string resourceGroupName, string accountName, string volumeGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateWithHttpMessagesAsync(body, resourceGroupName, accountName, volumeGroupName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Delete a volume group + /// + /// + /// Delete the specified volume group only if there are no volumes under volume + /// group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the volumeGroup + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string accountName, string volumeGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, volumeGroupName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Create the specified volume group and volumes. Creating volume group will + /// create all the volumes specified in request body implicitly. Once volumes + /// are created using volume group, those will be treated as regular volumes + /// thereafter. + /// + /// + /// Create a volume group along with specified volumes + /// + /// + /// Volume Group object supplied in the body of the operation. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the volumeGroup + /// + /// + /// 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(VolumeGroupDetails body, string resourceGroupName, string accountName, string volumeGroupName, 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 (volumeGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "volumeGroupName"); + } + if (volumeGroupName != null) + { + if (volumeGroupName.Length > 64) + { + throw new ValidationException(ValidationRules.MaxLength, "volumeGroupName", 64); + } + if (volumeGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "volumeGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(volumeGroupName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) + { + throw new ValidationException(ValidationRules.Pattern, "volumeGroupName", "^[a-zA-Z0-9][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("volumeGroupName", volumeGroupName); + 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}/volumeGroups/{volumeGroupName}").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("{volumeGroupName}", System.Uri.EscapeDataString(volumeGroupName)); + 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 != 201) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 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; + } + + /// + /// Delete a volume group + /// + /// + /// Delete the specified volume group only if there are no volumes under volume + /// group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the volumeGroup + /// + /// + /// 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 volumeGroupName, 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 (volumeGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "volumeGroupName"); + } + if (volumeGroupName != null) + { + if (volumeGroupName.Length > 64) + { + throw new ValidationException(ValidationRules.MaxLength, "volumeGroupName", 64); + } + if (volumeGroupName.Length < 1) + { + throw new ValidationException(ValidationRules.MinLength, "volumeGroupName", 1); + } + if (!System.Text.RegularExpressions.Regex.IsMatch(volumeGroupName, "^[a-zA-Z0-9][a-zA-Z0-9\\-_]{0,63}$")) + { + throw new ValidationException(ValidationRules.Pattern, "volumeGroupName", "^[a-zA-Z0-9][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("volumeGroupName", volumeGroupName); + 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}/volumeGroups/{volumeGroupName}").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("{volumeGroupName}", System.Uri.EscapeDataString(volumeGroupName)); + 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; + } + + } +} diff --git a/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/VolumeGroupsOperationsExtensions.cs b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/VolumeGroupsOperationsExtensions.cs new file mode 100644 index 000000000000..85f3991fa2ae --- /dev/null +++ b/sdk/netapp/Microsoft.Azure.Management.NetApp/src/Generated/VolumeGroupsOperationsExtensions.cs @@ -0,0 +1,355 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.NetApp +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for VolumeGroupsOperations. + /// + public static partial class VolumeGroupsOperationsExtensions + { + /// + /// Describe all volume groups + /// + /// + /// List all volume groups for given account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + public static IEnumerable ListByNetAppAccount(this IVolumeGroupsOperations operations, string resourceGroupName, string accountName) + { + return operations.ListByNetAppAccountAsync(resourceGroupName, accountName).GetAwaiter().GetResult(); + } + + /// + /// Describe all volume groups + /// + /// + /// List all volume groups for given account + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The cancellation token. + /// + public static async Task> ListByNetAppAccountAsync(this IVolumeGroupsOperations operations, string resourceGroupName, string accountName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByNetAppAccountWithHttpMessagesAsync(resourceGroupName, accountName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Describe a Volume Group + /// + /// + /// Get details of the specified volume group + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the volumeGroup + /// + public static VolumeGroupDetails Get(this IVolumeGroupsOperations operations, string resourceGroupName, string accountName, string volumeGroupName) + { + return operations.GetAsync(resourceGroupName, accountName, volumeGroupName).GetAwaiter().GetResult(); + } + + /// + /// Describe a Volume Group + /// + /// + /// Get details of the specified volume group + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the volumeGroup + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IVolumeGroupsOperations operations, string resourceGroupName, string accountName, string volumeGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, accountName, volumeGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Create the specified volume group and volumes. Creating volume group will + /// create all the volumes specified in request body implicitly. Once volumes + /// are created using volume group, those will be treated as regular volumes + /// thereafter. + /// + /// + /// Create a volume group along with specified volumes + /// + /// + /// The operations group for this extension method. + /// + /// + /// Volume Group object supplied in the body of the operation. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the volumeGroup + /// + public static VolumeGroupDetails Create(this IVolumeGroupsOperations operations, VolumeGroupDetails body, string resourceGroupName, string accountName, string volumeGroupName) + { + return operations.CreateAsync(body, resourceGroupName, accountName, volumeGroupName).GetAwaiter().GetResult(); + } + + /// + /// Create the specified volume group and volumes. Creating volume group will + /// create all the volumes specified in request body implicitly. Once volumes + /// are created using volume group, those will be treated as regular volumes + /// thereafter. + /// + /// + /// Create a volume group along with specified volumes + /// + /// + /// The operations group for this extension method. + /// + /// + /// Volume Group object supplied in the body of the operation. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the volumeGroup + /// + /// + /// The cancellation token. + /// + public static async Task CreateAsync(this IVolumeGroupsOperations operations, VolumeGroupDetails body, string resourceGroupName, string accountName, string volumeGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateWithHttpMessagesAsync(body, resourceGroupName, accountName, volumeGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete a volume group + /// + /// + /// Delete the specified volume group only if there are no volumes under volume + /// group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the volumeGroup + /// + public static void Delete(this IVolumeGroupsOperations operations, string resourceGroupName, string accountName, string volumeGroupName) + { + operations.DeleteAsync(resourceGroupName, accountName, volumeGroupName).GetAwaiter().GetResult(); + } + + /// + /// Delete a volume group + /// + /// + /// Delete the specified volume group only if there are no volumes under volume + /// group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the volumeGroup + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IVolumeGroupsOperations operations, string resourceGroupName, string accountName, string volumeGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, accountName, volumeGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Create the specified volume group and volumes. Creating volume group will + /// create all the volumes specified in request body implicitly. Once volumes + /// are created using volume group, those will be treated as regular volumes + /// thereafter. + /// + /// + /// Create a volume group along with specified volumes + /// + /// + /// The operations group for this extension method. + /// + /// + /// Volume Group object supplied in the body of the operation. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the volumeGroup + /// + public static VolumeGroupDetails BeginCreate(this IVolumeGroupsOperations operations, VolumeGroupDetails body, string resourceGroupName, string accountName, string volumeGroupName) + { + return operations.BeginCreateAsync(body, resourceGroupName, accountName, volumeGroupName).GetAwaiter().GetResult(); + } + + /// + /// Create the specified volume group and volumes. Creating volume group will + /// create all the volumes specified in request body implicitly. Once volumes + /// are created using volume group, those will be treated as regular volumes + /// thereafter. + /// + /// + /// Create a volume group along with specified volumes + /// + /// + /// The operations group for this extension method. + /// + /// + /// Volume Group object supplied in the body of the operation. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the volumeGroup + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateAsync(this IVolumeGroupsOperations operations, VolumeGroupDetails body, string resourceGroupName, string accountName, string volumeGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateWithHttpMessagesAsync(body, resourceGroupName, accountName, volumeGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Delete a volume group + /// + /// + /// Delete the specified volume group only if there are no volumes under volume + /// group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the volumeGroup + /// + public static void BeginDelete(this IVolumeGroupsOperations operations, string resourceGroupName, string accountName, string volumeGroupName) + { + operations.BeginDeleteAsync(resourceGroupName, accountName, volumeGroupName).GetAwaiter().GetResult(); + } + + /// + /// Delete a volume group + /// + /// + /// Delete the specified volume group only if there are no volumes under volume + /// group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the NetApp account + /// + /// + /// The name of the volumeGroup + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IVolumeGroupsOperations operations, string resourceGroupName, string accountName, string volumeGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, accountName, volumeGroupName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + } +}