diff --git a/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/INodeTypeSkusOperations.cs b/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/INodeTypeSkusOperations.cs new file mode 100644 index 000000000000..e376ccce1eb4 --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/INodeTypeSkusOperations.cs @@ -0,0 +1,83 @@ +// +// 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.ServiceFabricManagedClusters +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// NodeTypeSkusOperations operations. + /// + public partial interface INodeTypeSkusOperations + { + /// + /// Gets a Service Fabric node type SKUs. + /// + /// + /// Get a Service Fabric node type supported SKUs. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// The name of the node type. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListWithHttpMessagesAsync(string resourceGroupName, string clusterName, string nodeTypeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a Service Fabric node type SKUs. + /// + /// + /// Get a Service Fabric node type supported SKUs. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/INodeTypesOperations.cs b/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/INodeTypesOperations.cs index 08c0e874fcb9..826306bfdfea 100644 --- a/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/INodeTypesOperations.cs +++ b/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/INodeTypesOperations.cs @@ -232,8 +232,8 @@ public partial interface INodeTypesOperations /// /// The name of the node type. /// - /// - /// Node type update parameters + /// + /// The parameters to update the node type configuration. /// /// /// The headers that will be added to request. @@ -250,7 +250,7 @@ public partial interface INodeTypesOperations /// /// Thrown when a required parameter is null /// - Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, string nodeTypeName, IDictionary tags = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Deletes a Service Fabric node type. /// diff --git a/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/IServiceFabricManagedClustersManagementClient.cs b/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/IServiceFabricManagedClustersManagementClient.cs index a6f5ee33f297..cd33519ea490 100644 --- a/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/IServiceFabricManagedClustersManagementClient.cs +++ b/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/IServiceFabricManagedClustersManagementClient.cs @@ -42,8 +42,8 @@ public partial interface IServiceFabricManagedClustersManagementClient : System. /// /// The version of the Service Fabric resource provider API. This is a - /// required parameter and it's value must be "2021-05-01" for this - /// specification. + /// required parameter and it's value must be "2021-07-01-preview" for + /// this specification. /// string ApiVersion { get; } @@ -111,5 +111,10 @@ public partial interface IServiceFabricManagedClustersManagementClient : System. /// INodeTypesOperations NodeTypes { get; } + /// + /// Gets the INodeTypeSkusOperations. + /// + INodeTypeSkusOperations NodeTypeSkus { get; } + } } diff --git a/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/Models/FrontendConfiguration.cs b/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/Models/FrontendConfiguration.cs new file mode 100644 index 000000000000..815c23fda648 --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/Models/FrontendConfiguration.cs @@ -0,0 +1,83 @@ +// +// 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.ServiceFabricManagedClusters.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Describes the frontend configurations for the node type. + /// + public partial class FrontendConfiguration + { + /// + /// Initializes a new instance of the FrontendConfiguration class. + /// + public FrontendConfiguration() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the FrontendConfiguration class. + /// + /// The IP address type of this frontend + /// configuration. If omitted the default value is IPv4. Possible + /// values include: 'IPv4', 'IPv6' + /// The resource Id of + /// the Load Balancer backend address pool that the VM instances of the + /// node type are associated with. The format of the resource Id is + /// '/subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>/providers/Microsoft.Network/loadBalancers/<loadBalancerName>/backendAddressPools/<backendAddressPoolName>'. + /// The resource Id of the + /// Load Balancer inbound NAT pool that the VM instances of the node + /// type are associated with. The format of the resource Id is + /// '/subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>/providers/Microsoft.Network/loadBalancers/<loadBalancerName>/inboundNatPools/<inboundNatPoolName>'. + public FrontendConfiguration(string ipAddressType = default(string), string loadBalancerBackendAddressPoolId = default(string), string loadBalancerInboundNatPoolId = default(string)) + { + IpAddressType = ipAddressType; + LoadBalancerBackendAddressPoolId = loadBalancerBackendAddressPoolId; + LoadBalancerInboundNatPoolId = loadBalancerInboundNatPoolId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the IP address type of this frontend configuration. If + /// omitted the default value is IPv4. Possible values include: 'IPv4', + /// 'IPv6' + /// + [JsonProperty(PropertyName = "ipAddressType")] + public string IpAddressType { get; set; } + + /// + /// Gets or sets the resource Id of the Load Balancer backend address + /// pool that the VM instances of the node type are associated with. + /// The format of the resource Id is + /// '/subscriptions/&lt;subscriptionId&gt;/resourceGroups/&lt;resourceGroupName&gt;/providers/Microsoft.Network/loadBalancers/&lt;loadBalancerName&gt;/backendAddressPools/&lt;backendAddressPoolName&gt;'. + /// + [JsonProperty(PropertyName = "loadBalancerBackendAddressPoolId")] + public string LoadBalancerBackendAddressPoolId { get; set; } + + /// + /// Gets or sets the resource Id of the Load Balancer inbound NAT pool + /// that the VM instances of the node type are associated with. The + /// format of the resource Id is + /// '/subscriptions/&lt;subscriptionId&gt;/resourceGroups/&lt;resourceGroupName&gt;/providers/Microsoft.Network/loadBalancers/&lt;loadBalancerName&gt;/inboundNatPools/&lt;inboundNatPoolName&gt;'. + /// + [JsonProperty(PropertyName = "loadBalancerInboundNatPoolId")] + public string LoadBalancerInboundNatPoolId { get; set; } + + } +} diff --git a/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/Models/IPAddressType.cs b/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/Models/IPAddressType.cs new file mode 100644 index 000000000000..b9fd703ed15c --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/Models/IPAddressType.cs @@ -0,0 +1,28 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.ServiceFabricManagedClusters.Models +{ + + /// + /// Defines values for IPAddressType. + /// + public static class IPAddressType + { + /// + /// IPv4 address type. + /// + public const string IPv4 = "IPv4"; + /// + /// IPv6 address type. + /// + public const string IPv6 = "IPv6"; + } +} diff --git a/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/Models/IPTag.cs b/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/Models/IPTag.cs new file mode 100644 index 000000000000..8dd7c0a320a3 --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/Models/IPTag.cs @@ -0,0 +1,77 @@ +// +// 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.ServiceFabricManagedClusters.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// IPTag associated with the object. + /// + public partial class IPTag + { + /// + /// Initializes a new instance of the IPTag class. + /// + public IPTag() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the IPTag class. + /// + /// The IP tag type. + /// The value of the IP tag. + public IPTag(string ipTagType, string tag) + { + IpTagType = ipTagType; + Tag = tag; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the IP tag type. + /// + [JsonProperty(PropertyName = "ipTagType")] + public string IpTagType { get; set; } + + /// + /// Gets or sets the value of the IP tag. + /// + [JsonProperty(PropertyName = "tag")] + public string Tag { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (IpTagType == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "IpTagType"); + } + if (Tag == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Tag"); + } + } + } +} diff --git a/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/Models/ManagedCluster.cs b/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/Models/ManagedCluster.cs index d15d12f185b1..acb06a55283b 100644 --- a/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/Models/ManagedCluster.cs +++ b/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/Models/ManagedCluster.cs @@ -62,11 +62,11 @@ public ManagedCluster() /// Load balancing rules that are /// applied to the public load balancer of the cluster. /// Setting this to true enables RDP - /// access to the VM. The default NSG rule opens RDP port to internet + /// access to the VM. The default NSG rule opens RDP port to Internet /// which can be overridden with custom Network Security Rules. The /// default value for this setting is false. /// Custom Network Security Rules - /// that are applied to the virtual network of the cluster. + /// that are applied to the Virtual Network of the cluster. /// Client certificates that are allowed to /// manage the cluster. /// The AAD authentication settings @@ -100,8 +100,19 @@ public ManagedCluster() /// resiliency. /// The policy used /// to clean up unused versions. + /// Setting this to true creates IPv6 address + /// space for the default VNet used by the cluster. This setting cannot + /// be changed once the cluster is created. The default value for this + /// setting is false. + /// If specified, the node types for the cluster + /// are created in this subnet instead of the default VNet. The + /// **networkSecurityRules** specified for the cluster are also applied + /// to this subnet. This setting cannot be changed once the cluster is + /// created. + /// The list of IP tags associated with the + /// default public IP address of the cluster. /// The sku of the managed cluster - public ManagedCluster(string location, string dnsName, string adminUserName, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string etag = default(string), SystemData systemData = default(SystemData), string fqdn = default(string), string ipv4Address = default(string), string clusterId = default(string), string clusterState = default(string), IList clusterCertificateThumbprints = default(IList), int? clientConnectionPort = default(int?), int? httpGatewayConnectionPort = default(int?), string adminPassword = default(string), IList loadBalancingRules = default(IList), bool? allowRdpAccess = default(bool?), IList networkSecurityRules = default(IList), IList clients = default(IList), AzureActiveDirectory azureActiveDirectory = default(AzureActiveDirectory), IList fabricSettings = default(IList), string provisioningState = default(string), string clusterCodeVersion = default(string), string clusterUpgradeMode = default(string), string clusterUpgradeCadence = default(string), IList addonFeatures = default(IList), bool? enableAutoOSUpgrade = default(bool?), bool? zonalResiliency = default(bool?), ApplicationTypeVersionsCleanupPolicy applicationTypeVersionsCleanupPolicy = default(ApplicationTypeVersionsCleanupPolicy), Sku sku = default(Sku)) + public ManagedCluster(string location, string dnsName, string adminUserName, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string etag = default(string), SystemData systemData = default(SystemData), string fqdn = default(string), string ipv4Address = default(string), string clusterId = default(string), string clusterState = default(string), IList clusterCertificateThumbprints = default(IList), int? clientConnectionPort = default(int?), int? httpGatewayConnectionPort = default(int?), string adminPassword = default(string), IList loadBalancingRules = default(IList), bool? allowRdpAccess = default(bool?), IList networkSecurityRules = default(IList), IList clients = default(IList), AzureActiveDirectory azureActiveDirectory = default(AzureActiveDirectory), IList fabricSettings = default(IList), string provisioningState = default(string), string clusterCodeVersion = default(string), string clusterUpgradeMode = default(string), string clusterUpgradeCadence = default(string), IList addonFeatures = default(IList), bool? enableAutoOSUpgrade = default(bool?), bool? zonalResiliency = default(bool?), ApplicationTypeVersionsCleanupPolicy applicationTypeVersionsCleanupPolicy = default(ApplicationTypeVersionsCleanupPolicy), bool? enableIpv6 = default(bool?), string subnetId = default(string), IList ipTags = default(IList), Sku sku = default(Sku)) : base(location, id, name, type, tags, etag, systemData) { DnsName = dnsName; @@ -128,6 +139,9 @@ public ManagedCluster() EnableAutoOSUpgrade = enableAutoOSUpgrade; ZonalResiliency = zonalResiliency; ApplicationTypeVersionsCleanupPolicy = applicationTypeVersionsCleanupPolicy; + EnableIpv6 = enableIpv6; + SubnetId = subnetId; + IpTags = ipTags; Sku = sku; CustomInit(); } @@ -211,7 +225,7 @@ public ManagedCluster() /// /// Gets or sets setting this to true enables RDP access to the VM. The - /// default NSG rule opens RDP port to internet which can be overridden + /// default NSG rule opens RDP port to Internet which can be overridden /// with custom Network Security Rules. The default value for this /// setting is false. /// @@ -220,7 +234,7 @@ public ManagedCluster() /// /// Gets or sets custom Network Security Rules that are applied to the - /// virtual network of the cluster. + /// Virtual Network of the cluster. /// [JsonProperty(PropertyName = "properties.networkSecurityRules")] public IList NetworkSecurityRules { get; set; } @@ -305,6 +319,32 @@ public ManagedCluster() [JsonProperty(PropertyName = "properties.applicationTypeVersionsCleanupPolicy")] public ApplicationTypeVersionsCleanupPolicy ApplicationTypeVersionsCleanupPolicy { get; set; } + /// + /// Gets or sets setting this to true creates IPv6 address space for + /// the default VNet used by the cluster. This setting cannot be + /// changed once the cluster is created. The default value for this + /// setting is false. + /// + [JsonProperty(PropertyName = "properties.enableIpv6")] + public bool? EnableIpv6 { get; set; } + + /// + /// Gets or sets if specified, the node types for the cluster are + /// created in this subnet instead of the default VNet. The + /// **networkSecurityRules** specified for the cluster are also applied + /// to this subnet. This setting cannot be changed once the cluster is + /// created. + /// + [JsonProperty(PropertyName = "properties.subnetId")] + public string SubnetId { get; set; } + + /// + /// Gets or sets the list of IP tags associated with the default public + /// IP address of the cluster. + /// + [JsonProperty(PropertyName = "properties.ipTags")] + public IList IpTags { get; set; } + /// /// Gets or sets the sku of the managed cluster /// @@ -372,6 +412,16 @@ public override void Validate() { ApplicationTypeVersionsCleanupPolicy.Validate(); } + if (IpTags != null) + { + foreach (var element4 in IpTags) + { + if (element4 != null) + { + element4.Validate(); + } + } + } if (Sku != null) { Sku.Validate(); diff --git a/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/Models/NodeType.cs b/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/Models/NodeType.cs index 5f40f4e6829f..a65f8ccb3b7d 100644 --- a/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/Models/NodeType.cs +++ b/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/Models/NodeType.cs @@ -35,19 +35,22 @@ public NodeType() /// /// Initializes a new instance of the NodeType class. /// - /// The node type on which system services will - /// run. Only one node type should be marked as primary. Primary node - /// type cannot be deleted or changed for existing clusters. - /// The number of nodes in the node - /// type. + /// Indicates the Service Fabric system + /// services for the cluster will run on this node type. This setting + /// cannot be changed once the node type is created. + /// The number of nodes in the node type. + /// <br /><br />**Values:** <br />-1 - Use when auto + /// scale rules are configured or sku.capacity is defined <br /> + /// 0 - Not supported <br /> >0 - Use for manual + /// scale. /// Disk size for each vm in the node type /// in GBs. /// Azure resource identifier. /// Azure resource name. /// Azure resource type. /// Azure resource tags. - /// Possible values include: 'Standard_LRS', - /// 'StandardSSD_LRS', 'Premium_LRS' + /// Managed data disk type. Possible values + /// include: 'Standard_LRS', 'StandardSSD_LRS', 'Premium_LRS' /// The placement tags applied to /// nodes in the node type, which can be used to indicate where certain /// services (workload) should run. @@ -76,16 +79,27 @@ public NodeType() /// 'latest'. /// virtual machine secretes. /// virtual machine extensions. + /// Identities to assign to the virtual + /// machine scale set under the node type. /// Indicates if the node type can only host /// Stateless workloads. /// Indicates if scale set /// associated with the node type can be composed of multiple placement /// groups. - /// The provisioning state of the - /// managed cluster resource. Possible values include: 'None', - /// 'Creating', 'Created', 'Updating', 'Succeeded', 'Failed', - /// 'Canceled', 'Deleting', 'Deleted', 'Other' - public NodeType(bool isPrimary, int vmInstanceCount, int dataDiskSizeGB, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), SystemData systemData = default(SystemData), string dataDiskType = default(string), IDictionary placementProperties = default(IDictionary), IDictionary capacities = default(IDictionary), EndpointRangeDescription applicationPorts = default(EndpointRangeDescription), EndpointRangeDescription ephemeralPorts = default(EndpointRangeDescription), string vmSize = default(string), string vmImagePublisher = default(string), string vmImageOffer = default(string), string vmImageSku = default(string), string vmImageVersion = default(string), IList vmSecrets = default(IList), IList vmExtensions = default(IList), VmManagedIdentity vmManagedIdentity = default(VmManagedIdentity), bool? isStateless = default(bool?), bool? multiplePlacementGroups = default(bool?), string provisioningState = default(string)) + /// Indicates the node type uses + /// its own frontend configurations instead of the default one for the + /// cluster. This setting can only be specified for non-primary node + /// types and can not be added or removed after the node type is + /// created. + /// The Network Security Rules for + /// this node type. This setting can only be specified for node types + /// that are configured with frontend configurations. + /// The provisioning state of the node + /// type resource. Possible values include: 'None', 'Creating', + /// 'Created', 'Updating', 'Succeeded', 'Failed', 'Canceled', + /// 'Deleting', 'Deleted', 'Other' + /// The node type sku. + public NodeType(bool isPrimary, int vmInstanceCount, int dataDiskSizeGB, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), SystemData systemData = default(SystemData), string dataDiskType = default(string), IDictionary placementProperties = default(IDictionary), IDictionary capacities = default(IDictionary), EndpointRangeDescription applicationPorts = default(EndpointRangeDescription), EndpointRangeDescription ephemeralPorts = default(EndpointRangeDescription), string vmSize = default(string), string vmImagePublisher = default(string), string vmImageOffer = default(string), string vmImageSku = default(string), string vmImageVersion = default(string), IList vmSecrets = default(IList), IList vmExtensions = default(IList), VmManagedIdentity vmManagedIdentity = default(VmManagedIdentity), bool? isStateless = default(bool?), bool? multiplePlacementGroups = default(bool?), IList frontendConfigurations = default(IList), IList networkSecurityRules = default(IList), string provisioningState = default(string), NodeTypeSku sku = default(NodeTypeSku)) : base(id, name, type, tags, systemData) { IsPrimary = isPrimary; @@ -106,7 +120,10 @@ public NodeType() VmManagedIdentity = vmManagedIdentity; IsStateless = isStateless; MultiplePlacementGroups = multiplePlacementGroups; + FrontendConfigurations = frontendConfigurations; + NetworkSecurityRules = networkSecurityRules; ProvisioningState = provisioningState; + Sku = sku; CustomInit(); } @@ -116,15 +133,19 @@ public NodeType() partial void CustomInit(); /// - /// Gets or sets the node type on which system services will run. Only - /// one node type should be marked as primary. Primary node type cannot - /// be deleted or changed for existing clusters. + /// Gets or sets indicates the Service Fabric system services for the + /// cluster will run on this node type. This setting cannot be changed + /// once the node type is created. /// [JsonProperty(PropertyName = "properties.isPrimary")] public bool IsPrimary { get; set; } /// - /// Gets or sets the number of nodes in the node type. + /// Gets or sets the number of nodes in the node type. &lt;br + /// /&gt;&lt;br /&gt;**Values:** &lt;br /&gt;-1 - + /// Use when auto scale rules are configured or sku.capacity is defined + /// &lt;br /&gt; 0 - Not supported &lt;br /&gt; + /// &gt;0 - Use for manual scale. /// [JsonProperty(PropertyName = "properties.vmInstanceCount")] public int VmInstanceCount { get; set; } @@ -136,8 +157,8 @@ public NodeType() public int DataDiskSizeGB { get; set; } /// - /// Gets or sets possible values include: 'Standard_LRS', - /// 'StandardSSD_LRS', 'Premium_LRS' + /// Gets or sets managed data disk type. Possible values include: + /// 'Standard_LRS', 'StandardSSD_LRS', 'Premium_LRS' /// [JsonProperty(PropertyName = "properties.dataDiskType")] public string DataDiskType { get; set; } @@ -229,6 +250,8 @@ public NodeType() public IList VmExtensions { get; set; } /// + /// Gets or sets identities to assign to the virtual machine scale set + /// under the node type. /// [JsonProperty(PropertyName = "properties.vmManagedIdentity")] public VmManagedIdentity VmManagedIdentity { get; set; } @@ -248,13 +271,36 @@ public NodeType() public bool? MultiplePlacementGroups { get; set; } /// - /// Gets the provisioning state of the managed cluster resource. - /// Possible values include: 'None', 'Creating', 'Created', 'Updating', + /// Gets or sets indicates the node type uses its own frontend + /// configurations instead of the default one for the cluster. This + /// setting can only be specified for non-primary node types and can + /// not be added or removed after the node type is created. + /// + [JsonProperty(PropertyName = "properties.frontendConfigurations")] + public IList FrontendConfigurations { get; set; } + + /// + /// Gets or sets the Network Security Rules for this node type. This + /// setting can only be specified for node types that are configured + /// with frontend configurations. + /// + [JsonProperty(PropertyName = "properties.networkSecurityRules")] + public IList NetworkSecurityRules { get; set; } + + /// + /// Gets the provisioning state of the node type resource. Possible + /// values include: 'None', 'Creating', 'Created', 'Updating', /// 'Succeeded', 'Failed', 'Canceled', 'Deleting', 'Deleted', 'Other' /// [JsonProperty(PropertyName = "properties.provisioningState")] public string ProvisioningState { get; private set; } + /// + /// Gets or sets the node type sku. + /// + [JsonProperty(PropertyName = "sku")] + public NodeTypeSku Sku { get; set; } + /// /// Validate the object. /// @@ -267,9 +313,9 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.InclusiveMaximum, "VmInstanceCount", 2147483647); } - if (VmInstanceCount < 1) + if (VmInstanceCount < -1) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "VmInstanceCount", 1); + throw new ValidationException(ValidationRules.InclusiveMinimum, "VmInstanceCount", -1); } if (ApplicationPorts != null) { @@ -299,6 +345,20 @@ public virtual void Validate() } } } + if (NetworkSecurityRules != null) + { + foreach (var element2 in NetworkSecurityRules) + { + if (element2 != null) + { + element2.Validate(); + } + } + } + if (Sku != null) + { + Sku.Validate(); + } } } } diff --git a/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeAvailableSku.cs b/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeAvailableSku.cs new file mode 100644 index 000000000000..7aaf3cc2e17d --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeAvailableSku.cs @@ -0,0 +1,72 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.ServiceFabricManagedClusters.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Defines the type of sku available for a node type + /// + public partial class NodeTypeAvailableSku + { + /// + /// Initializes a new instance of the NodeTypeAvailableSku class. + /// + public NodeTypeAvailableSku() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NodeTypeAvailableSku class. + /// + /// The type of resource the sku applies to. + /// <br /><br />Value: + /// Microsoft.ServiceFabric/managedClusters/nodeTypes. + /// The supported SKU for a for node type. + /// Provides information about how the node + /// count can be scaled. + public NodeTypeAvailableSku(string resourceType = default(string), NodeTypeSupportedSku sku = default(NodeTypeSupportedSku), NodeTypeSkuCapacity capacity = default(NodeTypeSkuCapacity)) + { + ResourceType = resourceType; + Sku = sku; + Capacity = capacity; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the type of resource the sku applies to. &lt;br + /// /&gt;&lt;br /&gt;Value: + /// Microsoft.ServiceFabric/managedClusters/nodeTypes. + /// + [JsonProperty(PropertyName = "resourceType")] + public string ResourceType { get; private set; } + + /// + /// Gets the supported SKU for a for node type. + /// + [JsonProperty(PropertyName = "sku")] + public NodeTypeSupportedSku Sku { get; private set; } + + /// + /// Gets provides information about how the node count can be scaled. + /// + [JsonProperty(PropertyName = "capacity")] + public NodeTypeSkuCapacity Capacity { get; private set; } + + } +} diff --git a/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeSku.cs b/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeSku.cs new file mode 100644 index 000000000000..4e78921cf27a --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeSku.cs @@ -0,0 +1,100 @@ +// +// 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.ServiceFabricManagedClusters.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Describes a node type sku. + /// + public partial class NodeTypeSku + { + /// + /// Initializes a new instance of the NodeTypeSku class. + /// + public NodeTypeSku() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NodeTypeSku class. + /// + /// The number of nodes in the node type.<br + /// /><br />If present in request it will override + /// properties.vmInstanceCount. + /// The sku name. <br /><br />Name is + /// internally generated and is used in auto-scale scenarios.<br + /// /> Property does not allow to be changed to other values than + /// generated.<br /> To avoid deployment errors please omit the + /// property. + /// Specifies the tier of the node type. <br + /// /><br /> Possible Values:<br /> **Standard** + public NodeTypeSku(int capacity, string name = default(string), string tier = default(string)) + { + Name = name; + Tier = tier; + Capacity = capacity; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the sku name. &lt;br /&gt;&lt;br + /// /&gt;Name is internally generated and is used in auto-scale + /// scenarios.&lt;br /&gt; Property does not allow to be + /// changed to other values than generated.&lt;br /&gt; To + /// avoid deployment errors please omit the property. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets specifies the tier of the node type. &lt;br + /// /&gt;&lt;br /&gt; Possible Values:&lt;br /&gt; + /// **Standard** + /// + [JsonProperty(PropertyName = "tier")] + public string Tier { get; set; } + + /// + /// Gets or sets the number of nodes in the node type.&lt;br + /// /&gt;&lt;br /&gt;If present in request it will override + /// properties.vmInstanceCount. + /// + [JsonProperty(PropertyName = "capacity")] + public int Capacity { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Capacity > 2147483647) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "Capacity", 2147483647); + } + if (Capacity < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "Capacity", 1); + } + } + } +} diff --git a/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeSkuCapacity.cs b/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeSkuCapacity.cs new file mode 100644 index 000000000000..fe6de922288b --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeSkuCapacity.cs @@ -0,0 +1,80 @@ +// +// 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.ServiceFabricManagedClusters.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Provides information about how node type can be scaled. + /// + public partial class NodeTypeSkuCapacity + { + /// + /// Initializes a new instance of the NodeTypeSkuCapacity class. + /// + public NodeTypeSkuCapacity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NodeTypeSkuCapacity class. + /// + /// Lowest permitted node count in a node + /// type. + /// Highest permitted node count in a node + /// type. + /// Default node count in a node + /// type. + /// Node type capacity scale type. Possible + /// values include: 'None', 'Manual', 'Automatic' + public NodeTypeSkuCapacity(int? minimum = default(int?), int? maximum = default(int?), int? defaultProperty = default(int?), string scaleType = default(string)) + { + Minimum = minimum; + Maximum = maximum; + DefaultProperty = defaultProperty; + ScaleType = scaleType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets lowest permitted node count in a node type. + /// + [JsonProperty(PropertyName = "minimum")] + public int? Minimum { get; private set; } + + /// + /// Gets highest permitted node count in a node type. + /// + [JsonProperty(PropertyName = "maximum")] + public int? Maximum { get; private set; } + + /// + /// Gets default node count in a node type. + /// + [JsonProperty(PropertyName = "default")] + public int? DefaultProperty { get; private set; } + + /// + /// Gets node type capacity scale type. Possible values include: + /// 'None', 'Manual', 'Automatic' + /// + [JsonProperty(PropertyName = "scaleType")] + public string ScaleType { get; private set; } + + } +} diff --git a/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeSkuScaleType.cs b/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeSkuScaleType.cs new file mode 100644 index 000000000000..91a6ed8c05f4 --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeSkuScaleType.cs @@ -0,0 +1,32 @@ +// +// 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.ServiceFabricManagedClusters.Models +{ + + /// + /// Defines values for NodeTypeSkuScaleType. + /// + public static class NodeTypeSkuScaleType + { + /// + /// Node count is not adjustable in any way (e.g. it is fixed). + /// + public const string None = "None"; + /// + /// The user must manually scale out/in. + /// + public const string Manual = "Manual"; + /// + /// Automatic scale is allowed. + /// + public const string Automatic = "Automatic"; + } +} diff --git a/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeSupportedSku.cs b/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeSupportedSku.cs new file mode 100644 index 000000000000..c7d98f093a0b --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeSupportedSku.cs @@ -0,0 +1,62 @@ +// +// 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.ServiceFabricManagedClusters.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Describes a node type supported sku. + /// + public partial class NodeTypeSupportedSku + { + /// + /// Initializes a new instance of the NodeTypeSupportedSku class. + /// + public NodeTypeSupportedSku() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NodeTypeSupportedSku class. + /// + /// The sku name. + /// Specifies the tier of the node type. <br + /// /><br /> Possible Values:<br /> **Standard** + public NodeTypeSupportedSku(string name = default(string), string tier = default(string)) + { + Name = name; + Tier = tier; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the sku name. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets specifies the tier of the node type. &lt;br + /// /&gt;&lt;br /&gt; Possible Values:&lt;br /&gt; + /// **Standard** + /// + [JsonProperty(PropertyName = "tier")] + public string Tier { get; private set; } + + } +} diff --git a/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeUpdateParameters.cs b/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeUpdateParameters.cs index 4576057eb15b..e4a1e78ad351 100644 --- a/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeUpdateParameters.cs +++ b/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeUpdateParameters.cs @@ -11,8 +11,6 @@ namespace Microsoft.Azure.Management.ServiceFabricManagedClusters.Models { using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; using System.Linq; /// @@ -32,9 +30,12 @@ public NodeTypeUpdateParameters() /// Initializes a new instance of the NodeTypeUpdateParameters class. /// /// Node type update parameters - public NodeTypeUpdateParameters(IDictionary tags = default(IDictionary)) + /// The node type sku. + public NodeTypeUpdateParameters(object tags = default(object), NodeTypeSku sku = default(NodeTypeSku), string additionalProperties = default(string)) { Tags = tags; + Sku = sku; + AdditionalProperties = additionalProperties; CustomInit(); } @@ -47,7 +48,31 @@ public NodeTypeUpdateParameters() /// Gets or sets node type update parameters /// [JsonProperty(PropertyName = "tags")] - public IDictionary Tags { get; set; } + public object Tags { get; set; } + /// + /// Gets or sets the node type sku. + /// + [JsonProperty(PropertyName = "sku")] + public NodeTypeSku Sku { get; set; } + + /// + /// + [JsonProperty(PropertyName = "additionalProperties")] + public string AdditionalProperties { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Sku != null) + { + Sku.Validate(); + } + } } } diff --git a/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/NodeTypeSkusOperations.cs b/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/NodeTypeSkusOperations.cs new file mode 100644 index 000000000000..8ac8d8e2ba13 --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/NodeTypeSkusOperations.cs @@ -0,0 +1,424 @@ +// +// 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.ServiceFabricManagedClusters +{ + 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; + + /// + /// NodeTypeSkusOperations operations. + /// + internal partial class NodeTypeSkusOperations : IServiceOperations, INodeTypeSkusOperations + { + /// + /// Initializes a new instance of the NodeTypeSkusOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal NodeTypeSkusOperations(ServiceFabricManagedClustersManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the ServiceFabricManagedClustersManagementClient + /// + public ServiceFabricManagedClustersManagementClient Client { get; private set; } + + /// + /// Gets a Service Fabric node type SKUs. + /// + /// + /// Get a Service Fabric node type supported SKUs. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// The name of the node type. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListWithHttpMessagesAsync(string resourceGroupName, string clusterName, string nodeTypeName, 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 (clusterName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); + } + if (nodeTypeName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nodeTypeName"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("clusterName", clusterName); + tracingParameters.Add("nodeTypeName", nodeTypeName); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/skus").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); + _url = _url.Replace("{nodeTypeName}", System.Uri.EscapeDataString(nodeTypeName)); + 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 ErrorModelException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorModel _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + 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; + } + + /// + /// Gets a Service Fabric node type SKUs. + /// + /// + /// Get a Service Fabric node type supported SKUs. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (nextPageLink == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + List _queryParameters = new List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new ErrorModelException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorModel _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse>(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/NodeTypeSkusOperationsExtensions.cs b/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/NodeTypeSkusOperationsExtensions.cs new file mode 100644 index 000000000000..17e9db73e554 --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/NodeTypeSkusOperationsExtensions.cs @@ -0,0 +1,117 @@ +// +// 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.ServiceFabricManagedClusters +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for NodeTypeSkusOperations. + /// + public static partial class NodeTypeSkusOperationsExtensions + { + /// + /// Gets a Service Fabric node type SKUs. + /// + /// + /// Get a Service Fabric node type supported SKUs. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// The name of the node type. + /// + public static IPage List(this INodeTypeSkusOperations operations, string resourceGroupName, string clusterName, string nodeTypeName) + { + return operations.ListAsync(resourceGroupName, clusterName, nodeTypeName).GetAwaiter().GetResult(); + } + + /// + /// Gets a Service Fabric node type SKUs. + /// + /// + /// Get a Service Fabric node type supported SKUs. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// The name of the node type. + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this INodeTypeSkusOperations operations, string resourceGroupName, string clusterName, string nodeTypeName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, clusterName, nodeTypeName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a Service Fabric node type SKUs. + /// + /// + /// Get a Service Fabric node type supported SKUs. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this INodeTypeSkusOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets a Service Fabric node type SKUs. + /// + /// + /// Get a Service Fabric node type supported SKUs. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListNextAsync(this INodeTypeSkusOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/NodeTypesOperations.cs b/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/NodeTypesOperations.cs index 77a7b53ad3f9..e86c5b42e672 100644 --- a/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/NodeTypesOperations.cs +++ b/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/NodeTypesOperations.cs @@ -582,8 +582,8 @@ internal NodeTypesOperations(ServiceFabricManagedClustersManagementClient client /// /// The name of the node type. /// - /// - /// Node type update parameters + /// + /// The parameters to update the node type configuration. /// /// /// Headers that will be added to request. @@ -606,7 +606,7 @@ internal NodeTypesOperations(ServiceFabricManagedClustersManagementClient client /// /// A response object containing the response body and response headers. /// - public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, string nodeTypeName, IDictionary tags = default(IDictionary), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.SubscriptionId == null) { @@ -624,10 +624,9 @@ internal NodeTypesOperations(ServiceFabricManagedClustersManagementClient client { throw new ValidationException(ValidationRules.CannotBeNull, "nodeTypeName"); } - NodeTypeUpdateParameters parameters = new NodeTypeUpdateParameters(); - if (tags != null) + if (parameters == null) { - parameters.Tags = tags; + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; diff --git a/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/NodeTypesOperationsExtensions.cs b/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/NodeTypesOperationsExtensions.cs index 41f1d0b8e1ce..5ccdb317863f 100644 --- a/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/NodeTypesOperationsExtensions.cs +++ b/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/NodeTypesOperationsExtensions.cs @@ -13,8 +13,6 @@ namespace Microsoft.Azure.Management.ServiceFabricManagedClusters using Microsoft.Rest; using Microsoft.Rest.Azure; using Models; - using System.Collections; - using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; @@ -369,12 +367,12 @@ public static NodeType CreateOrUpdate(this INodeTypesOperations operations, stri /// /// The name of the node type. /// - /// - /// Node type update parameters + /// + /// The parameters to update the node type configuration. /// - public static NodeType Update(this INodeTypesOperations operations, string resourceGroupName, string clusterName, string nodeTypeName, IDictionary tags = default(IDictionary)) + public static NodeType Update(this INodeTypesOperations operations, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeUpdateParameters parameters) { - return operations.UpdateAsync(resourceGroupName, clusterName, nodeTypeName, tags).GetAwaiter().GetResult(); + return operations.UpdateAsync(resourceGroupName, clusterName, nodeTypeName, parameters).GetAwaiter().GetResult(); } /// @@ -396,15 +394,15 @@ public static NodeType CreateOrUpdate(this INodeTypesOperations operations, stri /// /// The name of the node type. /// - /// - /// Node type update parameters + /// + /// The parameters to update the node type configuration. /// /// /// The cancellation token. /// - public static async Task UpdateAsync(this INodeTypesOperations operations, string resourceGroupName, string clusterName, string nodeTypeName, IDictionary tags = default(IDictionary), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpdateAsync(this INodeTypesOperations operations, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, clusterName, nodeTypeName, tags, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, clusterName, nodeTypeName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/SdkInfo_ServiceFabricManagedClustersManagementClient.cs b/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/SdkInfo_ServiceFabricManagedClustersManagementClient.cs index 876448f101a2..727a9b4be7c3 100644 --- a/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/SdkInfo_ServiceFabricManagedClustersManagementClient.cs +++ b/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/SdkInfo_ServiceFabricManagedClustersManagementClient.cs @@ -19,27 +19,17 @@ public static IEnumerable> ApiInfo_ServiceFabricMa { return new Tuple[] { - new Tuple("ServiceFabric", "ApplicationTypeVersions", "2021-05-01"), - new Tuple("ServiceFabric", "ApplicationTypes", "2021-05-01"), - new Tuple("ServiceFabric", "Applications", "2021-05-01"), - new Tuple("ServiceFabric", "ManagedClusterVersion", "2021-05-01"), - new Tuple("ServiceFabric", "ManagedClusters", "2021-05-01"), - new Tuple("ServiceFabric", "NodeTypes", "2021-05-01"), - new Tuple("ServiceFabric", "Operations", "2021-05-01"), - new Tuple("ServiceFabric", "Services", "2021-05-01"), + new Tuple("ServiceFabric", "ApplicationTypeVersions", "2021-07-01-preview"), + new Tuple("ServiceFabric", "ApplicationTypes", "2021-07-01-preview"), + new Tuple("ServiceFabric", "Applications", "2021-07-01-preview"), + new Tuple("ServiceFabric", "ManagedClusterVersion", "2021-07-01-preview"), + new Tuple("ServiceFabric", "ManagedClusters", "2021-07-01-preview"), + new Tuple("ServiceFabric", "NodeTypeSkus", "2021-07-01-preview"), + new Tuple("ServiceFabric", "NodeTypes", "2021-07-01-preview"), + new Tuple("ServiceFabric", "Operations", "2021-07-01-preview"), + new Tuple("ServiceFabric", "Services", "2021-07-01-preview"), }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "v2"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4413"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/servicefabricmanagedclusters/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=E:\\code\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "5047dfdf585969892ac035ffdfbc57623f0bf1c5"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - diff --git a/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedClustersManagementClient.cs b/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedClustersManagementClient.cs index 00047866e9a2..6e561ce55a4a 100644 --- a/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedClustersManagementClient.cs +++ b/sdk/servicefabricmanagedclusters/Microsoft.Azure.Management.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedClustersManagementClient.cs @@ -48,7 +48,8 @@ public partial class ServiceFabricManagedClustersManagementClient : ServiceClien /// /// The version of the Service Fabric resource provider API. This is a required - /// parameter and it's value must be "2021-05-01" for this specification. + /// parameter and it's value must be "2021-07-01-preview" for this + /// specification. /// public string ApiVersion { get; private set; } @@ -115,6 +116,11 @@ public partial class ServiceFabricManagedClustersManagementClient : ServiceClien /// public virtual INodeTypesOperations NodeTypes { get; private set; } + /// + /// Gets the INodeTypeSkusOperations. + /// + public virtual INodeTypeSkusOperations NodeTypeSkus { get; private set; } + /// /// Initializes a new instance of the ServiceFabricManagedClustersManagementClient class. /// @@ -364,8 +370,9 @@ private void Initialize() ManagedClusterVersion = new ManagedClusterVersionOperations(this); Operations = new Operations(this); NodeTypes = new NodeTypesOperations(this); + NodeTypeSkus = new NodeTypeSkusOperations(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2021-05-01"; + ApiVersion = "2021-07-01-preview"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true;