diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ApplicationTypeVersionsOperations.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ApplicationTypeVersionsOperations.cs index 72abb86831ab..8fdd4e338b30 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ApplicationTypeVersionsOperations.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ApplicationTypeVersionsOperations.cs @@ -113,6 +113,7 @@ internal ApplicationTypeVersionsOperations(ServiceFabricManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "version"); } + string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -124,6 +125,7 @@ internal ApplicationTypeVersionsOperations(ServiceFabricManagementClient client) tracingParameters.Add("clusterName", clusterName); tracingParameters.Add("applicationTypeName", applicationTypeName); tracingParameters.Add("version", version); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -136,9 +138,9 @@ internal ApplicationTypeVersionsOperations(ServiceFabricManagementClient client) _url = _url.Replace("{applicationTypeName}", System.Uri.EscapeDataString(applicationTypeName)); _url = _url.Replace("{version}", System.Uri.EscapeDataString(version)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -383,6 +385,7 @@ internal ApplicationTypeVersionsOperations(ServiceFabricManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "applicationTypeName"); } + string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -393,6 +396,7 @@ internal ApplicationTypeVersionsOperations(ServiceFabricManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("clusterName", clusterName); tracingParameters.Add("applicationTypeName", applicationTypeName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -404,9 +408,9 @@ internal ApplicationTypeVersionsOperations(ServiceFabricManagementClient client) _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); _url = _url.Replace("{applicationTypeName}", System.Uri.EscapeDataString(applicationTypeName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -601,6 +605,7 @@ internal ApplicationTypeVersionsOperations(ServiceFabricManagementClient client) { parameters.Validate(); } + string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -612,6 +617,7 @@ internal ApplicationTypeVersionsOperations(ServiceFabricManagementClient client) tracingParameters.Add("clusterName", clusterName); tracingParameters.Add("applicationTypeName", applicationTypeName); tracingParameters.Add("version", version); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); @@ -625,9 +631,9 @@ internal ApplicationTypeVersionsOperations(ServiceFabricManagementClient client) _url = _url.Replace("{applicationTypeName}", System.Uri.EscapeDataString(applicationTypeName)); _url = _url.Replace("{version}", System.Uri.EscapeDataString(version)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -814,6 +820,7 @@ internal ApplicationTypeVersionsOperations(ServiceFabricManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "version"); } + string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -825,6 +832,7 @@ internal ApplicationTypeVersionsOperations(ServiceFabricManagementClient client) tracingParameters.Add("clusterName", clusterName); tracingParameters.Add("applicationTypeName", applicationTypeName); tracingParameters.Add("version", version); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } @@ -837,9 +845,9 @@ internal ApplicationTypeVersionsOperations(ServiceFabricManagementClient client) _url = _url.Replace("{applicationTypeName}", System.Uri.EscapeDataString(applicationTypeName)); _url = _url.Replace("{version}", System.Uri.EscapeDataString(version)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ApplicationTypesOperations.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ApplicationTypesOperations.cs index e9f43e1c7420..c858e7b22e04 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ApplicationTypesOperations.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ApplicationTypesOperations.cs @@ -105,6 +105,7 @@ internal ApplicationTypesOperations(ServiceFabricManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "applicationTypeName"); } + string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -115,6 +116,7 @@ internal ApplicationTypesOperations(ServiceFabricManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("clusterName", clusterName); tracingParameters.Add("applicationTypeName", applicationTypeName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -126,9 +128,9 @@ internal ApplicationTypesOperations(ServiceFabricManagementClient client) _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); _url = _url.Replace("{applicationTypeName}", System.Uri.EscapeDataString(applicationTypeName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -312,6 +314,7 @@ internal ApplicationTypesOperations(ServiceFabricManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } + string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -322,6 +325,7 @@ internal ApplicationTypesOperations(ServiceFabricManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("clusterName", clusterName); tracingParameters.Add("applicationTypeName", applicationTypeName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); @@ -334,9 +338,9 @@ internal ApplicationTypesOperations(ServiceFabricManagementClient client) _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); _url = _url.Replace("{applicationTypeName}", System.Uri.EscapeDataString(applicationTypeName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -542,6 +546,7 @@ internal ApplicationTypesOperations(ServiceFabricManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); } + string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -551,6 +556,7 @@ internal ApplicationTypesOperations(ServiceFabricManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("clusterName", clusterName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -561,9 +567,9 @@ internal ApplicationTypesOperations(ServiceFabricManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -737,6 +743,7 @@ internal ApplicationTypesOperations(ServiceFabricManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "applicationTypeName"); } + string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -747,6 +754,7 @@ internal ApplicationTypesOperations(ServiceFabricManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("clusterName", clusterName); tracingParameters.Add("applicationTypeName", applicationTypeName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } @@ -758,9 +766,9 @@ internal ApplicationTypesOperations(ServiceFabricManagementClient client) _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); _url = _url.Replace("{applicationTypeName}", System.Uri.EscapeDataString(applicationTypeName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ApplicationsOperations.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ApplicationsOperations.cs index a0d8bbb0939b..62a784fac12f 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ApplicationsOperations.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ApplicationsOperations.cs @@ -105,6 +105,7 @@ internal ApplicationsOperations(ServiceFabricManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "applicationName"); } + string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -115,6 +116,7 @@ internal ApplicationsOperations(ServiceFabricManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("clusterName", clusterName); tracingParameters.Add("applicationName", applicationName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -126,9 +128,9 @@ internal ApplicationsOperations(ServiceFabricManagementClient client) _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); _url = _url.Replace("{applicationName}", System.Uri.EscapeDataString(applicationName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -390,6 +392,7 @@ internal ApplicationsOperations(ServiceFabricManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); } + string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -399,6 +402,7 @@ internal ApplicationsOperations(ServiceFabricManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("clusterName", clusterName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -409,9 +413,9 @@ internal ApplicationsOperations(ServiceFabricManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -599,6 +603,7 @@ internal ApplicationsOperations(ServiceFabricManagementClient client) { parameters.Validate(); } + string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -609,6 +614,7 @@ internal ApplicationsOperations(ServiceFabricManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("clusterName", clusterName); tracingParameters.Add("applicationName", applicationName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); @@ -621,9 +627,9 @@ internal ApplicationsOperations(ServiceFabricManagementClient client) _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); _url = _url.Replace("{applicationName}", System.Uri.EscapeDataString(applicationName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -812,6 +818,7 @@ internal ApplicationsOperations(ServiceFabricManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } + string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -822,6 +829,7 @@ internal ApplicationsOperations(ServiceFabricManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("clusterName", clusterName); tracingParameters.Add("applicationName", applicationName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); @@ -834,9 +842,9 @@ internal ApplicationsOperations(ServiceFabricManagementClient client) _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); _url = _url.Replace("{applicationName}", System.Uri.EscapeDataString(applicationName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -1015,6 +1023,7 @@ internal ApplicationsOperations(ServiceFabricManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "applicationName"); } + string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1025,6 +1034,7 @@ internal ApplicationsOperations(ServiceFabricManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("clusterName", clusterName); tracingParameters.Add("applicationName", applicationName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } @@ -1036,9 +1046,9 @@ internal ApplicationsOperations(ServiceFabricManagementClient client) _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); _url = _url.Replace("{applicationName}", System.Uri.EscapeDataString(applicationName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ClusterVersionsOperations.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ClusterVersionsOperations.cs index c0a0133cd9aa..518267c68118 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ClusterVersionsOperations.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ClusterVersionsOperations.cs @@ -99,6 +99,7 @@ internal ClusterVersionsOperations(ServiceFabricManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "clusterVersion"); } + string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -107,6 +108,7 @@ internal ClusterVersionsOperations(ServiceFabricManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("location", location); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("clusterVersion", clusterVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); @@ -118,9 +120,9 @@ internal ClusterVersionsOperations(ServiceFabricManagementClient client) _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{clusterVersion}", System.Uri.EscapeDataString(clusterVersion)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -305,6 +307,7 @@ internal ClusterVersionsOperations(ServiceFabricManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "clusterVersion"); } + string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -314,6 +317,7 @@ internal ClusterVersionsOperations(ServiceFabricManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("location", location); tracingParameters.Add("environment", environment); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("clusterVersion", clusterVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "GetByEnvironment", tracingParameters); @@ -326,9 +330,9 @@ internal ClusterVersionsOperations(ServiceFabricManagementClient client) _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{clusterVersion}", System.Uri.EscapeDataString(clusterVersion)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -498,6 +502,7 @@ internal ClusterVersionsOperations(ServiceFabricManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -506,6 +511,7 @@ internal ClusterVersionsOperations(ServiceFabricManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("location", location); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -515,9 +521,9 @@ internal ClusterVersionsOperations(ServiceFabricManagementClient client) _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -695,6 +701,7 @@ internal ClusterVersionsOperations(ServiceFabricManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -704,6 +711,7 @@ internal ClusterVersionsOperations(ServiceFabricManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("location", location); tracingParameters.Add("environment", environment); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListByEnvironment", tracingParameters); } @@ -714,9 +722,9 @@ internal ClusterVersionsOperations(ServiceFabricManagementClient client) _url = _url.Replace("{environment}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(environment, Client.SerializationSettings).Trim('"'))); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ClustersOperations.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ClustersOperations.cs index 41a3f51c2aff..db4a7a10ebff 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ClustersOperations.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ClustersOperations.cs @@ -98,6 +98,7 @@ internal ClustersOperations(ServiceFabricManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -107,6 +108,7 @@ internal ClustersOperations(ServiceFabricManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("clusterName", clusterName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -117,9 +119,9 @@ internal ClustersOperations(ServiceFabricManagementClient client) _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -343,6 +345,7 @@ internal ClustersOperations(ServiceFabricManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -352,6 +355,7 @@ internal ClustersOperations(ServiceFabricManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("clusterName", clusterName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } @@ -362,9 +366,9 @@ internal ClustersOperations(ServiceFabricManagementClient client) _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -510,6 +514,7 @@ internal ClustersOperations(ServiceFabricManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -518,6 +523,7 @@ internal ClustersOperations(ServiceFabricManagementClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", tracingParameters); } @@ -527,9 +533,9 @@ internal ClustersOperations(ServiceFabricManagementClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -686,6 +692,7 @@ internal ClustersOperations(ServiceFabricManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -693,6 +700,7 @@ internal ClustersOperations(ServiceFabricManagementClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -701,9 +709,9 @@ internal ClustersOperations(ServiceFabricManagementClient client) var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/clusters").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -883,6 +891,7 @@ internal ClustersOperations(ServiceFabricManagementClient client) { parameters.Validate(); } + string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -892,6 +901,7 @@ internal ClustersOperations(ServiceFabricManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("clusterName", clusterName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); @@ -903,9 +913,9 @@ internal ClustersOperations(ServiceFabricManagementClient client) _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -1107,6 +1117,7 @@ internal ClustersOperations(ServiceFabricManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } + string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1116,6 +1127,7 @@ internal ClustersOperations(ServiceFabricManagementClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("clusterName", clusterName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); @@ -1127,9 +1139,9 @@ internal ClustersOperations(ServiceFabricManagementClient client) _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/IManagedClusterVersionsOperations.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/IManagedClusterVersionsOperations.cs new file mode 100644 index 000000000000..73d22099ddb8 --- /dev/null +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/IManagedClusterVersionsOperations.cs @@ -0,0 +1,59 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.ServiceFabric +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ManagedClusterVersionsOperations operations. + /// + public partial interface IManagedClusterVersionsOperations + { + /// + /// Gets the list of Service Fabric cluster code versions available for + /// the specified OS type. + /// + /// + /// Gets all available code versions for Service Fabric cluster + /// resources by OS type. + /// + /// + /// The location for the cluster code versions. This is different from + /// cluster location. + /// + /// + /// The operating system of the cluster. Possible values include: + /// 'Windows', 'Ubuntu', 'RedHat', 'Ubuntu18_04' + /// + /// + /// 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>> ListByOSWithHttpMessagesAsync(string location, string osType, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/IManagedClustersOperations.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/IManagedClustersOperations.cs new file mode 100644 index 000000000000..adb857271d01 --- /dev/null +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/IManagedClustersOperations.cs @@ -0,0 +1,343 @@ +// +// 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.ServiceFabric +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// ManagedClustersOperations operations. + /// + public partial interface IManagedClustersOperations + { + /// + /// Gets the list of Service Fabric cluster resources created in the + /// specified resource group. + /// + /// + /// Gets all Service Fabric cluster resources created or in the process + /// of being created in the resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// 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>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the list of Service Fabric cluster resources created in the + /// specified subscription. + /// + /// + /// Gets all Service Fabric cluster resources created or in the process + /// of being created in the subscription. + /// + /// + /// 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>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a Service Fabric managed cluster resource. + /// + /// + /// Get a Service Fabric managed cluster resource created or in the + /// process of being created in the specified resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// 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 clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a Service Fabric managed cluster resource. + /// + /// + /// Create or update a Service Fabric managed cluster resource with the + /// specified name. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// The cluster resource. + /// + /// + /// 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> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, ManagedCluster parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates the configuration of a Service Fabric managed cluster + /// resource. + /// + /// + /// Update the configuration of a Service Fabric managed cluster + /// resource with the specified name. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// The parameters to update the managed cluster configuration. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, ManagedClusterUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a Service Fabric managed cluster resource. + /// + /// + /// Delete a Service Fabric managed cluster resource with the specified + /// name. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// 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 clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a Service Fabric managed cluster resource. + /// + /// + /// Create or update a Service Fabric managed cluster resource with the + /// specified name. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// The cluster resource. + /// + /// + /// 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> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, ManagedCluster parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates the configuration of a Service Fabric managed cluster + /// resource. + /// + /// + /// Update the configuration of a Service Fabric managed cluster + /// resource with the specified name. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// The parameters to update the managed cluster configuration. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, ManagedClusterUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a Service Fabric managed cluster resource. + /// + /// + /// Delete a Service Fabric managed cluster resource with the specified + /// name. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// 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 clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the list of Service Fabric cluster resources created in the + /// specified resource group. + /// + /// + /// Gets all Service Fabric cluster resources created or in the process + /// of being created in the resource group. + /// + /// + /// 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>> ListByResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the list of Service Fabric cluster resources created in the + /// specified subscription. + /// + /// + /// Gets all Service Fabric cluster resources created or in the process + /// of being created in the subscription. + /// + /// + /// 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>> ListBySubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/INodeTypesOperations.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/INodeTypesOperations.cs new file mode 100644 index 000000000000..d05275923e42 --- /dev/null +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/INodeTypesOperations.cs @@ -0,0 +1,505 @@ +// +// 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.ServiceFabric +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// NodeTypesOperations operations. + /// + public partial interface INodeTypesOperations + { + /// + /// Gets the list of Node types of the specified managed cluster. + /// + /// + /// Gets all Node types of the specified managed cluster. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// 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>> ListByManagedClustersWithHttpMessagesAsync(string resourceGroupName, string clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Restarts one or more nodes on the node type. + /// + /// + /// Restarts one or more nodes on the node type. It will disable the + /// fabric nodes, trigger a restart on the VMs and activate the nodes + /// back again. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// The name of the node type. + /// + /// + /// parameters for restart action. + /// + /// + /// 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 RestartWithHttpMessagesAsync(string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Reimages one or more nodes on the node type. + /// + /// + /// Reimages one or more nodes on the node type. It will disable the + /// fabric nodes, trigger a reimage on the VMs and activate the nodes + /// back again. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// The name of the node type. + /// + /// + /// parameters for reimage action. + /// + /// + /// 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 ReimageWithHttpMessagesAsync(string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes one or more nodes on the node type. + /// + /// + /// Deletes one or more nodes on the node type. It will disable the + /// fabric nodes, trigger a delete on the VMs and removes the state + /// from the cluster. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// The name of the node type. + /// + /// + /// parameters for delete action. + /// + /// + /// 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 DeleteNodeWithHttpMessagesAsync(string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a Service Fabric node type. + /// + /// + /// Get a Service Fabric node type of a given managed cluster. + /// + /// + /// 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> GetWithHttpMessagesAsync(string resourceGroupName, string clusterName, string nodeTypeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a Service Fabric node type. + /// + /// + /// Create or update a Service Fabric node type of a given managed + /// cluster. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// The name of the node type. + /// + /// + /// The node type resource. + /// + /// + /// 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> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, string nodeTypeName, NodeType parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates the configuration of a node type of a given managed + /// cluster. + /// + /// + /// Update the configuration of a node type of a given managed cluster. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// The name of the node type. + /// + /// + /// The parameters to update the node type configuration. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a Service Fabric node type. + /// + /// + /// Delete a Service Fabric node type of a given managed cluster. + /// + /// + /// 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 a required parameter is null + /// + Task DeleteWithHttpMessagesAsync(string resourceGroupName, string clusterName, string nodeTypeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Restarts one or more nodes on the node type. + /// + /// + /// Restarts one or more nodes on the node type. It will disable the + /// fabric nodes, trigger a restart on the VMs and activate the nodes + /// back again. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// The name of the node type. + /// + /// + /// parameters for restart action. + /// + /// + /// 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 BeginRestartWithHttpMessagesAsync(string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Reimages one or more nodes on the node type. + /// + /// + /// Reimages one or more nodes on the node type. It will disable the + /// fabric nodes, trigger a reimage on the VMs and activate the nodes + /// back again. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// The name of the node type. + /// + /// + /// parameters for reimage action. + /// + /// + /// 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 BeginReimageWithHttpMessagesAsync(string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes one or more nodes on the node type. + /// + /// + /// Deletes one or more nodes on the node type. It will disable the + /// fabric nodes, trigger a delete on the VMs and removes the state + /// from the cluster. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// The name of the node type. + /// + /// + /// parameters for delete action. + /// + /// + /// 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 BeginDeleteNodeWithHttpMessagesAsync(string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Creates or updates a Service Fabric node type. + /// + /// + /// Create or update a Service Fabric node type of a given managed + /// cluster. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// The name of the node type. + /// + /// + /// The node type resource. + /// + /// + /// 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> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, string nodeTypeName, NodeType parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Updates the configuration of a node type of a given managed + /// cluster. + /// + /// + /// Update the configuration of a node type of a given managed cluster. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// The name of the node type. + /// + /// + /// The parameters to update the node type configuration. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Deletes a Service Fabric node type. + /// + /// + /// Delete a Service Fabric node type of a given managed cluster. + /// + /// + /// 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 a required parameter is null + /// + Task BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string clusterName, string nodeTypeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets the list of Node types of the specified managed cluster. + /// + /// + /// Gets all Node types of the specified managed cluster. + /// + /// + /// 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>> ListByManagedClustersNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/IServiceFabricManagementClient.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/IServiceFabricManagementClient.cs index 670d1f1f781b..f068f72c04d3 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/IServiceFabricManagementClient.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/IServiceFabricManagementClient.cs @@ -40,13 +40,6 @@ public partial interface IServiceFabricManagementClient : System.IDisposable /// ServiceClientCredentials Credentials { get; } - /// - /// The version of the Service Fabric resource provider API. This is a - /// required parameter and it's value must be "2019-03-01" for this - /// specification. - /// - string ApiVersion { get; } - /// /// The customer subscription identifier. /// @@ -106,5 +99,20 @@ public partial interface IServiceFabricManagementClient : System.IDisposable /// IServicesOperations Services { get; } + /// + /// Gets the IManagedClustersOperations. + /// + IManagedClustersOperations ManagedClusters { get; } + + /// + /// Gets the IManagedClusterVersionsOperations. + /// + IManagedClusterVersionsOperations ManagedClusterVersions { get; } + + /// + /// Gets the INodeTypesOperations. + /// + INodeTypesOperations NodeTypes { get; } + } } diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ManagedClusterVersionsOperations.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ManagedClusterVersionsOperations.cs new file mode 100644 index 000000000000..40fbbd86a103 --- /dev/null +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ManagedClusterVersionsOperations.cs @@ -0,0 +1,250 @@ +// +// 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.ServiceFabric +{ + 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; + + /// + /// ManagedClusterVersionsOperations operations. + /// + internal partial class ManagedClusterVersionsOperations : IServiceOperations, IManagedClusterVersionsOperations + { + /// + /// Initializes a new instance of the ManagedClusterVersionsOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ManagedClusterVersionsOperations(ServiceFabricManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the ServiceFabricManagementClient + /// + public ServiceFabricManagementClient Client { get; private set; } + + /// + /// Gets the list of Service Fabric cluster code versions available for the + /// specified OS type. + /// + /// + /// Gets all available code versions for Service Fabric cluster resources by OS + /// type. + /// + /// + /// The location for the cluster code versions. This is different from cluster + /// location. + /// + /// + /// The operating system of the cluster. Possible values include: 'Windows', + /// 'Ubuntu', 'RedHat', 'Ubuntu18_04' + /// + /// + /// 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>> ListByOSWithHttpMessagesAsync(string location, string osType, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "location"); + } + if (osType == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "osType"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2020-01-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("location", location); + tracingParameters.Add("osType", osType); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByOS", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/managedclusters/locations/{location}/osType/{osType}/clusterVersions").ToString(); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + _url = _url.Replace("{osType}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(osType, Client.SerializationSettings).Trim('"'))); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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; + } + + } +} diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ManagedClusterVersionsOperationsExtensions.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ManagedClusterVersionsOperationsExtensions.cs new file mode 100644 index 000000000000..1149fc00d213 --- /dev/null +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ManagedClusterVersionsOperationsExtensions.cs @@ -0,0 +1,81 @@ +// +// 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.ServiceFabric +{ + 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 ManagedClusterVersionsOperations. + /// + public static partial class ManagedClusterVersionsOperationsExtensions + { + /// + /// Gets the list of Service Fabric cluster code versions available for the + /// specified OS type. + /// + /// + /// Gets all available code versions for Service Fabric cluster resources by OS + /// type. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location for the cluster code versions. This is different from cluster + /// location. + /// + /// + /// The operating system of the cluster. Possible values include: 'Windows', + /// 'Ubuntu', 'RedHat', 'Ubuntu18_04' + /// + public static IList ListByOS(this IManagedClusterVersionsOperations operations, string location, string osType) + { + return operations.ListByOSAsync(location, osType).GetAwaiter().GetResult(); + } + + /// + /// Gets the list of Service Fabric cluster code versions available for the + /// specified OS type. + /// + /// + /// Gets all available code versions for Service Fabric cluster resources by OS + /// type. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The location for the cluster code versions. This is different from cluster + /// location. + /// + /// + /// The operating system of the cluster. Possible values include: 'Windows', + /// 'Ubuntu', 'RedHat', 'Ubuntu18_04' + /// + /// + /// The cancellation token. + /// + public static async Task> ListByOSAsync(this IManagedClusterVersionsOperations operations, string location, string osType, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByOSWithHttpMessagesAsync(location, osType, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ManagedClustersOperations.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ManagedClustersOperations.cs new file mode 100644 index 000000000000..be4febcb0491 --- /dev/null +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ManagedClustersOperations.cs @@ -0,0 +1,1680 @@ +// +// 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.ServiceFabric +{ + 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; + + /// + /// ManagedClustersOperations operations. + /// + internal partial class ManagedClustersOperations : IServiceOperations, IManagedClustersOperations + { + /// + /// Initializes a new instance of the ManagedClustersOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ManagedClustersOperations(ServiceFabricManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the ServiceFabricManagementClient + /// + public ServiceFabricManagementClient Client { get; private set; } + + /// + /// Gets the list of Service Fabric cluster resources created in the specified + /// resource group. + /// + /// + /// Gets all Service Fabric cluster resources created or in the process of + /// being created in the resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// 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>> ListByResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2020-01-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByResourceGroup", 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").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 the list of Service Fabric cluster resources created in the specified + /// subscription. + /// + /// + /// Gets all Service Fabric cluster resources created or in the process of + /// being created in the subscription. + /// + /// + /// 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>> ListBySubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2020-01-01-preview"; + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListBySubscription", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/managedClusters").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 managed cluster resource. + /// + /// + /// Get a Service Fabric managed cluster resource created or in the process of + /// being created in the specified resource group. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// 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 clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (clusterName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2020-01-01-preview"; + // 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("apiVersion", apiVersion); + 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.ServiceFabric/managedClusters/{clusterName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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; + } + + /// + /// Creates or updates a Service Fabric managed cluster resource. + /// + /// + /// Create or update a Service Fabric managed cluster resource with the + /// specified name. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// The cluster resource. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, ManagedCluster parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Updates the configuration of a Service Fabric managed cluster resource. + /// + /// + /// Update the configuration of a Service Fabric managed cluster resource with + /// the specified name. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// The parameters to update the managed cluster configuration. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, ManagedClusterUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes a Service Fabric managed cluster resource. + /// + /// + /// Delete a Service Fabric managed cluster resource with the specified name. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, clusterName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Creates or updates a Service Fabric managed cluster resource. + /// + /// + /// Create or update a Service Fabric managed cluster resource with the + /// specified name. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// The cluster resource. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, ManagedCluster parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (clusterName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + string apiVersion = "2020-01-01-preview"; + // 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("apiVersion", apiVersion); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) + { + var ex = new 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); + } + } + // 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); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _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; + } + + /// + /// Updates the configuration of a Service Fabric managed cluster resource. + /// + /// + /// Update the configuration of a Service Fabric managed cluster resource with + /// the specified name. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// The parameters to update the managed cluster configuration. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, ManagedClusterUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (clusterName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + string apiVersion = "2020-01-01-preview"; + // 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("apiVersion", apiVersion); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new 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); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _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; + } + + /// + /// Deletes a Service Fabric managed cluster resource. + /// + /// + /// Delete a Service Fabric managed cluster resource with the specified name. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// 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 clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (clusterName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + string apiVersion = "2020-01-01-preview"; + // 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("apiVersion", apiVersion); + 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.ServiceFabric/managedClusters/{clusterName}").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets the list of Service Fabric cluster resources created in the specified + /// resource group. + /// + /// + /// Gets all Service Fabric cluster resources created or in the process of + /// being created in the resource group. + /// + /// + /// 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>> ListByResourceGroupNextWithHttpMessagesAsync(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, "ListByResourceGroupNext", 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; + } + + /// + /// Gets the list of Service Fabric cluster resources created in the specified + /// subscription. + /// + /// + /// Gets all Service Fabric cluster resources created or in the process of + /// being created in the subscription. + /// + /// + /// 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>> ListBySubscriptionNextWithHttpMessagesAsync(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, "ListBySubscriptionNext", 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/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ManagedClustersOperationsExtensions.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ManagedClustersOperationsExtensions.cs new file mode 100644 index 000000000000..b9e87120ac01 --- /dev/null +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ManagedClustersOperationsExtensions.cs @@ -0,0 +1,545 @@ +// +// 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.ServiceFabric +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ManagedClustersOperations. + /// + public static partial class ManagedClustersOperationsExtensions + { + /// + /// Gets the list of Service Fabric cluster resources created in the specified + /// resource group. + /// + /// + /// Gets all Service Fabric cluster resources created or in the process of + /// being created in the resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + public static IPage ListByResourceGroup(this IManagedClustersOperations operations, string resourceGroupName) + { + return operations.ListByResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + } + + /// + /// Gets the list of Service Fabric cluster resources created in the specified + /// resource group. + /// + /// + /// Gets all Service Fabric cluster resources created or in the process of + /// being created in the resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupAsync(this IManagedClustersOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the list of Service Fabric cluster resources created in the specified + /// subscription. + /// + /// + /// Gets all Service Fabric cluster resources created or in the process of + /// being created in the subscription. + /// + /// + /// The operations group for this extension method. + /// + public static IPage ListBySubscription(this IManagedClustersOperations operations) + { + return operations.ListBySubscriptionAsync().GetAwaiter().GetResult(); + } + + /// + /// Gets the list of Service Fabric cluster resources created in the specified + /// subscription. + /// + /// + /// Gets all Service Fabric cluster resources created or in the process of + /// being created in the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The cancellation token. + /// + public static async Task> ListBySubscriptionAsync(this IManagedClustersOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a Service Fabric managed cluster resource. + /// + /// + /// Get a Service Fabric managed cluster resource created or in the process of + /// being created in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + public static ManagedCluster Get(this IManagedClustersOperations operations, string resourceGroupName, string clusterName) + { + return operations.GetAsync(resourceGroupName, clusterName).GetAwaiter().GetResult(); + } + + /// + /// Gets a Service Fabric managed cluster resource. + /// + /// + /// Get a Service Fabric managed cluster resource created or in the process of + /// being created in the specified resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IManagedClustersOperations operations, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, clusterName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates a Service Fabric managed cluster resource. + /// + /// + /// Create or update a Service Fabric managed cluster resource with the + /// specified name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// The cluster resource. + /// + public static ManagedCluster CreateOrUpdate(this IManagedClustersOperations operations, string resourceGroupName, string clusterName, ManagedCluster parameters) + { + return operations.CreateOrUpdateAsync(resourceGroupName, clusterName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a Service Fabric managed cluster resource. + /// + /// + /// Create or update a Service Fabric managed cluster resource with the + /// specified name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// The cluster resource. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this IManagedClustersOperations operations, string resourceGroupName, string clusterName, ManagedCluster parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates the configuration of a Service Fabric managed cluster resource. + /// + /// + /// Update the configuration of a Service Fabric managed cluster resource with + /// the specified name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// The parameters to update the managed cluster configuration. + /// + public static ManagedCluster Update(this IManagedClustersOperations operations, string resourceGroupName, string clusterName, ManagedClusterUpdateParameters parameters) + { + return operations.UpdateAsync(resourceGroupName, clusterName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates the configuration of a Service Fabric managed cluster resource. + /// + /// + /// Update the configuration of a Service Fabric managed cluster resource with + /// the specified name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// The parameters to update the managed cluster configuration. + /// + /// + /// The cancellation token. + /// + public static async Task UpdateAsync(this IManagedClustersOperations operations, string resourceGroupName, string clusterName, ManagedClusterUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, clusterName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a Service Fabric managed cluster resource. + /// + /// + /// Delete a Service Fabric managed cluster resource with the specified name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + public static void Delete(this IManagedClustersOperations operations, string resourceGroupName, string clusterName) + { + operations.DeleteAsync(resourceGroupName, clusterName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a Service Fabric managed cluster resource. + /// + /// + /// Delete a Service Fabric managed cluster resource with the specified name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteAsync(this IManagedClustersOperations operations, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, clusterName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Creates or updates a Service Fabric managed cluster resource. + /// + /// + /// Create or update a Service Fabric managed cluster resource with the + /// specified name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// The cluster resource. + /// + public static ManagedCluster BeginCreateOrUpdate(this IManagedClustersOperations operations, string resourceGroupName, string clusterName, ManagedCluster parameters) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, clusterName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a Service Fabric managed cluster resource. + /// + /// + /// Create or update a Service Fabric managed cluster resource with the + /// specified name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// The cluster resource. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this IManagedClustersOperations operations, string resourceGroupName, string clusterName, ManagedCluster parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates the configuration of a Service Fabric managed cluster resource. + /// + /// + /// Update the configuration of a Service Fabric managed cluster resource with + /// the specified name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// The parameters to update the managed cluster configuration. + /// + public static ManagedCluster BeginUpdate(this IManagedClustersOperations operations, string resourceGroupName, string clusterName, ManagedClusterUpdateParameters parameters) + { + return operations.BeginUpdateAsync(resourceGroupName, clusterName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates the configuration of a Service Fabric managed cluster resource. + /// + /// + /// Update the configuration of a Service Fabric managed cluster resource with + /// the specified name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// The parameters to update the managed cluster configuration. + /// + /// + /// The cancellation token. + /// + public static async Task BeginUpdateAsync(this IManagedClustersOperations operations, string resourceGroupName, string clusterName, ManagedClusterUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a Service Fabric managed cluster resource. + /// + /// + /// Delete a Service Fabric managed cluster resource with the specified name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + public static void BeginDelete(this IManagedClustersOperations operations, string resourceGroupName, string clusterName) + { + operations.BeginDeleteAsync(resourceGroupName, clusterName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a Service Fabric managed cluster resource. + /// + /// + /// Delete a Service Fabric managed cluster resource with the specified name. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteAsync(this IManagedClustersOperations operations, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, clusterName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets the list of Service Fabric cluster resources created in the specified + /// resource group. + /// + /// + /// Gets all Service Fabric cluster resources created or in the process of + /// being created in the resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByResourceGroupNext(this IManagedClustersOperations operations, string nextPageLink) + { + return operations.ListByResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the list of Service Fabric cluster resources created in the specified + /// resource group. + /// + /// + /// Gets all Service Fabric cluster resources created or in the process of + /// being created in the resource group. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByResourceGroupNextAsync(this IManagedClustersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets the list of Service Fabric cluster resources created in the specified + /// subscription. + /// + /// + /// Gets all Service Fabric cluster resources created or in the process of + /// being created in the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListBySubscriptionNext(this IManagedClustersOperations operations, string nextPageLink) + { + return operations.ListBySubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the list of Service Fabric cluster resources created in the specified + /// subscription. + /// + /// + /// Gets all Service Fabric cluster resources created or in the process of + /// being created in the subscription. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListBySubscriptionNextAsync(this IManagedClustersOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListBySubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ApplicationResource.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ApplicationResource.cs index 9419c2d89731..e877808d936a 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ApplicationResource.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ApplicationResource.cs @@ -41,6 +41,8 @@ public ApplicationResource() /// location depends on the parent resource. /// Azure resource tags. /// Azure resource etag. + /// Describes the managed identities for an + /// Azure resource. /// The version of the application type as /// defined in the application manifest. /// List of application parameters with @@ -64,13 +66,16 @@ public ApplicationResource() /// application capacity settings. /// List of application capacity metric /// description. + /// List of user assigned identities + /// for the application, each mapped to a friendly name. /// The current deployment or /// provisioning state, which only appears in the response /// The application type name as defined in the /// application manifest. - public ApplicationResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string etag = default(string), string typeVersion = default(string), IDictionary parameters = default(IDictionary), ApplicationUpgradePolicy upgradePolicy = default(ApplicationUpgradePolicy), long? minimumNodes = default(long?), long? maximumNodes = default(long?), bool? removeApplicationCapacity = default(bool?), IList metrics = default(IList), string provisioningState = default(string), string typeName = default(string)) + public ApplicationResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string etag = default(string), ManagedIdentity identity = default(ManagedIdentity), string typeVersion = default(string), IDictionary parameters = default(IDictionary), ApplicationUpgradePolicy upgradePolicy = default(ApplicationUpgradePolicy), long? minimumNodes = default(long?), long? maximumNodes = default(long?), bool? removeApplicationCapacity = default(bool?), IList metrics = default(IList), IList managedIdentities = default(IList), string provisioningState = default(string), string typeName = default(string)) : base(id, name, type, location, tags, etag) { + Identity = identity; TypeVersion = typeVersion; Parameters = parameters; UpgradePolicy = upgradePolicy; @@ -78,6 +83,7 @@ public ApplicationResource() MaximumNodes = maximumNodes; RemoveApplicationCapacity = removeApplicationCapacity; Metrics = metrics; + ManagedIdentities = managedIdentities; ProvisioningState = provisioningState; TypeName = typeName; CustomInit(); @@ -88,6 +94,13 @@ public ApplicationResource() /// partial void CustomInit(); + /// + /// Gets or sets describes the managed identities for an Azure + /// resource. + /// + [JsonProperty(PropertyName = "identity")] + public ManagedIdentity Identity { get; set; } + /// /// Gets or sets the version of the application type as defined in the /// application manifest. @@ -142,6 +155,13 @@ public ApplicationResource() [JsonProperty(PropertyName = "properties.metrics")] public IList Metrics { get; set; } + /// + /// Gets or sets list of user assigned identities for the application, + /// each mapped to a friendly name. + /// + [JsonProperty(PropertyName = "properties.managedIdentities")] + public IList ManagedIdentities { get; set; } + /// /// Gets the current deployment or provisioning state, which only /// appears in the response @@ -176,6 +196,16 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.InclusiveMinimum, "MaximumNodes", 0); } + if (ManagedIdentities != null) + { + foreach (var element in ManagedIdentities) + { + if (element != null) + { + element.Validate(); + } + } + } } } } diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ApplicationResourceUpdate.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ApplicationResourceUpdate.cs index 5048e6cc3e1e..f25a17c9d83d 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ApplicationResourceUpdate.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ApplicationResourceUpdate.cs @@ -64,7 +64,9 @@ public ApplicationResourceUpdate() /// application capacity settings. /// List of application capacity metric /// description. - public ApplicationResourceUpdate(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string etag = default(string), string typeVersion = default(string), IDictionary parameters = default(IDictionary), ApplicationUpgradePolicy upgradePolicy = default(ApplicationUpgradePolicy), long? minimumNodes = default(long?), long? maximumNodes = default(long?), bool? removeApplicationCapacity = default(bool?), IList metrics = default(IList)) + /// List of user assigned identities + /// for the application, each mapped to a friendly name. + public ApplicationResourceUpdate(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string etag = default(string), string typeVersion = default(string), IDictionary parameters = default(IDictionary), ApplicationUpgradePolicy upgradePolicy = default(ApplicationUpgradePolicy), long? minimumNodes = default(long?), long? maximumNodes = default(long?), bool? removeApplicationCapacity = default(bool?), IList metrics = default(IList), IList managedIdentities = default(IList)) : base(id, name, type, location, tags, etag) { TypeVersion = typeVersion; @@ -74,6 +76,7 @@ public ApplicationResourceUpdate() MaximumNodes = maximumNodes; RemoveApplicationCapacity = removeApplicationCapacity; Metrics = metrics; + ManagedIdentities = managedIdentities; CustomInit(); } @@ -136,6 +139,13 @@ public ApplicationResourceUpdate() [JsonProperty(PropertyName = "properties.metrics")] public IList Metrics { get; set; } + /// + /// Gets or sets list of user assigned identities for the application, + /// each mapped to a friendly name. + /// + [JsonProperty(PropertyName = "properties.managedIdentities")] + public IList ManagedIdentities { get; set; } + /// /// Validate the object. /// @@ -156,6 +166,16 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.InclusiveMinimum, "MaximumNodes", 0); } + if (ManagedIdentities != null) + { + foreach (var element in ManagedIdentities) + { + if (element != null) + { + element.Validate(); + } + } + } } } } diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ApplicationTypeVersionsCleanupPolicy.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ApplicationTypeVersionsCleanupPolicy.cs new file mode 100644 index 000000000000..fe33e63dc415 --- /dev/null +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ApplicationTypeVersionsCleanupPolicy.cs @@ -0,0 +1,66 @@ +// +// 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.ServiceFabric.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + public partial class ApplicationTypeVersionsCleanupPolicy + { + /// + /// Initializes a new instance of the + /// ApplicationTypeVersionsCleanupPolicy class. + /// + public ApplicationTypeVersionsCleanupPolicy() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ApplicationTypeVersionsCleanupPolicy class. + /// + /// Number of unused versions per + /// application type to keep. + public ApplicationTypeVersionsCleanupPolicy(int maxUnusedVersionsToKeep) + { + MaxUnusedVersionsToKeep = maxUnusedVersionsToKeep; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets number of unused versions per application type to + /// keep. + /// + [JsonProperty(PropertyName = "maxUnusedVersionsToKeep")] + public int MaxUnusedVersionsToKeep { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (MaxUnusedVersionsToKeep < 0) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "MaxUnusedVersionsToKeep", 0); + } + } + } +} diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ApplicationUpgradePolicy.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ApplicationUpgradePolicy.cs index d02093daa32c..a8505cc0965b 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ApplicationUpgradePolicy.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ApplicationUpgradePolicy.cs @@ -45,12 +45,17 @@ public ApplicationUpgradePolicy() /// to evaluate the health of an application or one of its children /// entities. /// - public ApplicationUpgradePolicy(string upgradeReplicaSetCheckTimeout = default(string), bool? forceRestart = default(bool?), ArmRollingUpgradeMonitoringPolicy rollingUpgradeMonitoringPolicy = default(ArmRollingUpgradeMonitoringPolicy), ArmApplicationHealthPolicy applicationHealthPolicy = default(ArmApplicationHealthPolicy)) + /// The mode used to monitor health during a + /// rolling upgrade. The values are UnmonitoredAuto, UnmonitoredManual, + /// and Monitored. Possible values include: 'Invalid', + /// 'UnmonitoredAuto', 'UnmonitoredManual', 'Monitored' + public ApplicationUpgradePolicy(string upgradeReplicaSetCheckTimeout = default(string), bool? forceRestart = default(bool?), ArmRollingUpgradeMonitoringPolicy rollingUpgradeMonitoringPolicy = default(ArmRollingUpgradeMonitoringPolicy), ArmApplicationHealthPolicy applicationHealthPolicy = default(ArmApplicationHealthPolicy), string upgradeMode = default(string)) { UpgradeReplicaSetCheckTimeout = upgradeReplicaSetCheckTimeout; ForceRestart = forceRestart; RollingUpgradeMonitoringPolicy = rollingUpgradeMonitoringPolicy; ApplicationHealthPolicy = applicationHealthPolicy; + UpgradeMode = upgradeMode; CustomInit(); } @@ -93,6 +98,15 @@ public ApplicationUpgradePolicy() [JsonProperty(PropertyName = "applicationHealthPolicy")] public ArmApplicationHealthPolicy ApplicationHealthPolicy { get; set; } + /// + /// Gets or sets the mode used to monitor health during a rolling + /// upgrade. The values are UnmonitoredAuto, UnmonitoredManual, and + /// Monitored. Possible values include: 'Invalid', 'UnmonitoredAuto', + /// 'UnmonitoredManual', 'Monitored' + /// + [JsonProperty(PropertyName = "upgradeMode")] + public string UpgradeMode { get; set; } + /// /// Validate the object. /// diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ApplicationUserAssignedIdentity.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ApplicationUserAssignedIdentity.cs new file mode 100644 index 000000000000..8815063ff01c --- /dev/null +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ApplicationUserAssignedIdentity.cs @@ -0,0 +1,78 @@ +// +// 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.ServiceFabric.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + public partial class ApplicationUserAssignedIdentity + { + /// + /// Initializes a new instance of the ApplicationUserAssignedIdentity + /// class. + /// + public ApplicationUserAssignedIdentity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ApplicationUserAssignedIdentity + /// class. + /// + /// The friendly name of user assigned + /// identity. + /// The principal id of user assigned + /// identity. + public ApplicationUserAssignedIdentity(string name, string principalId) + { + Name = name; + PrincipalId = principalId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the friendly name of user assigned identity. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets the principal id of user assigned identity. + /// + [JsonProperty(PropertyName = "principalId")] + public string PrincipalId { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + } + if (PrincipalId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "PrincipalId"); + } + } + } +} diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ClientCertificate.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ClientCertificate.cs new file mode 100644 index 000000000000..219753afd690 --- /dev/null +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ClientCertificate.cs @@ -0,0 +1,88 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.ServiceFabric.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Client Certificate definition. + /// + public partial class ClientCertificate + { + /// + /// Initializes a new instance of the ClientCertificate class. + /// + public ClientCertificate() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ClientCertificate class. + /// + /// Whether the certificate is admin or + /// not. + /// Certificate Thumbprint. + /// Certificate Common name. + /// Issuer thumbprint for the + /// certificate. Its only use ehn CommonName is used. + public ClientCertificate(bool isAdmin, string thumbprint = default(string), string commonName = default(string), string issuerThumbprint = default(string)) + { + IsAdmin = isAdmin; + Thumbprint = thumbprint; + CommonName = commonName; + IssuerThumbprint = issuerThumbprint; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets whether the certificate is admin or not. + /// + [JsonProperty(PropertyName = "isAdmin")] + public bool IsAdmin { get; set; } + + /// + /// Gets or sets certificate Thumbprint. + /// + [JsonProperty(PropertyName = "thumbprint")] + public string Thumbprint { get; set; } + + /// + /// Gets or sets certificate Common name. + /// + [JsonProperty(PropertyName = "commonName")] + public string CommonName { get; set; } + + /// + /// Gets or sets issuer thumbprint for the certificate. Its only use + /// ehn CommonName is used. + /// + [JsonProperty(PropertyName = "issuerThumbprint")] + public string IssuerThumbprint { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + //Nothing to validate + } + } +} diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/Cluster.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/Cluster.cs index 62511b3034b0..21874a177a0d 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/Cluster.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/Cluster.cs @@ -117,7 +117,7 @@ public Cluster() /// 'Failed', 'Canceled' /// The reliability level sets the /// replica set size of system services. Learn about - /// [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). + /// [ReliabilityLevel](https://docs.microsoft.com/azure/service-fabric/service-fabric-cluster-capacity). /// /// - None - Run the System services with a target replica set count of /// 1. This should only be used for test clusters. @@ -148,9 +148,11 @@ public Cluster() /// setting the **clusterCodeVersion** property in the cluster /// resource. /// . Possible values include: 'Automatic', 'Manual' + /// The policy used + /// to clean up unused versions. /// The VM image VMSS has been configured with. /// Generic names such as Windows or Linux can be used. - public Cluster(string location, string managementEndpoint, IList nodeTypes, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string etag = default(string), IList addOnFeatures = default(IList), IList availableClusterVersions = default(IList), AzureActiveDirectory azureActiveDirectory = default(AzureActiveDirectory), CertificateDescription certificate = default(CertificateDescription), ServerCertificateCommonNames certificateCommonNames = default(ServerCertificateCommonNames), IList clientCertificateCommonNames = default(IList), IList clientCertificateThumbprints = default(IList), string clusterCodeVersion = default(string), string clusterEndpoint = default(string), string clusterId = default(string), string clusterState = default(string), DiagnosticsStorageAccountConfig diagnosticsStorageAccountConfig = default(DiagnosticsStorageAccountConfig), bool? eventStoreServiceEnabled = default(bool?), IList fabricSettings = default(IList), string provisioningState = default(string), string reliabilityLevel = default(string), CertificateDescription reverseProxyCertificate = default(CertificateDescription), ServerCertificateCommonNames reverseProxyCertificateCommonNames = default(ServerCertificateCommonNames), ClusterUpgradePolicy upgradeDescription = default(ClusterUpgradePolicy), string upgradeMode = default(string), string vmImage = default(string)) + public Cluster(string location, string managementEndpoint, IList nodeTypes, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string etag = default(string), IList addOnFeatures = default(IList), IList availableClusterVersions = default(IList), AzureActiveDirectory azureActiveDirectory = default(AzureActiveDirectory), CertificateDescription certificate = default(CertificateDescription), ServerCertificateCommonNames certificateCommonNames = default(ServerCertificateCommonNames), IList clientCertificateCommonNames = default(IList), IList clientCertificateThumbprints = default(IList), string clusterCodeVersion = default(string), string clusterEndpoint = default(string), string clusterId = default(string), string clusterState = default(string), DiagnosticsStorageAccountConfig diagnosticsStorageAccountConfig = default(DiagnosticsStorageAccountConfig), bool? eventStoreServiceEnabled = default(bool?), IList fabricSettings = default(IList), string provisioningState = default(string), string reliabilityLevel = default(string), CertificateDescription reverseProxyCertificate = default(CertificateDescription), ServerCertificateCommonNames reverseProxyCertificateCommonNames = default(ServerCertificateCommonNames), ClusterUpgradePolicy upgradeDescription = default(ClusterUpgradePolicy), string upgradeMode = default(string), ApplicationTypeVersionsCleanupPolicy applicationTypeVersionsCleanupPolicy = default(ApplicationTypeVersionsCleanupPolicy), string vmImage = default(string)) : base(location, id, name, type, tags, etag) { AddOnFeatures = addOnFeatures; @@ -175,6 +177,7 @@ public Cluster() ReverseProxyCertificateCommonNames = reverseProxyCertificateCommonNames; UpgradeDescription = upgradeDescription; UpgradeMode = upgradeMode; + ApplicationTypeVersionsCleanupPolicy = applicationTypeVersionsCleanupPolicy; VmImage = vmImage; CustomInit(); } @@ -337,7 +340,7 @@ public Cluster() /// /// Gets or sets the reliability level sets the replica set size of /// system services. Learn about - /// [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). + /// [ReliabilityLevel](https://docs.microsoft.com/azure/service-fabric/service-fabric-cluster-capacity). /// /// - None - Run the System services with a target replica set count of /// 1. This should only be used for test clusters. @@ -389,6 +392,12 @@ public Cluster() [JsonProperty(PropertyName = "properties.upgradeMode")] public string UpgradeMode { get; set; } + /// + /// Gets or sets the policy used to clean up unused versions. + /// + [JsonProperty(PropertyName = "properties.applicationTypeVersionsCleanupPolicy")] + public ApplicationTypeVersionsCleanupPolicy ApplicationTypeVersionsCleanupPolicy { get; set; } + /// /// Gets or sets the VM image VMSS has been configured with. Generic /// names such as Windows or Linux can be used. @@ -469,6 +478,10 @@ public override void Validate() { UpgradeDescription.Validate(); } + if (ApplicationTypeVersionsCleanupPolicy != null) + { + ApplicationTypeVersionsCleanupPolicy.Validate(); + } } } } diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ClusterUpdateParameters.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ClusterUpdateParameters.cs index b7a96dbbab95..0a02e941e967 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ClusterUpdateParameters.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ClusterUpdateParameters.cs @@ -64,7 +64,7 @@ public ClusterUpdateParameters() /// will overwrite the existing list. /// The reliability level sets the /// replica set size of system services. Learn about - /// [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). + /// [ReliabilityLevel](https://docs.microsoft.com/azure/service-fabric/service-fabric-cluster-capacity). /// /// - None - Run the System services with a target replica set count of /// 1. This should only be used for test clusters. @@ -92,8 +92,10 @@ public ClusterUpdateParameters() /// setting the **clusterCodeVersion** property in the cluster /// resource. /// . Possible values include: 'Automatic', 'Manual' + /// The policy used + /// to clean up unused versions. /// Cluster update parameters - public ClusterUpdateParameters(IList addOnFeatures = default(IList), CertificateDescription certificate = default(CertificateDescription), ServerCertificateCommonNames certificateCommonNames = default(ServerCertificateCommonNames), IList clientCertificateCommonNames = default(IList), IList clientCertificateThumbprints = default(IList), string clusterCodeVersion = default(string), bool? eventStoreServiceEnabled = default(bool?), IList fabricSettings = default(IList), IList nodeTypes = default(IList), string reliabilityLevel = default(string), CertificateDescription reverseProxyCertificate = default(CertificateDescription), ClusterUpgradePolicy upgradeDescription = default(ClusterUpgradePolicy), string upgradeMode = default(string), IDictionary tags = default(IDictionary)) + public ClusterUpdateParameters(IList addOnFeatures = default(IList), CertificateDescription certificate = default(CertificateDescription), ServerCertificateCommonNames certificateCommonNames = default(ServerCertificateCommonNames), IList clientCertificateCommonNames = default(IList), IList clientCertificateThumbprints = default(IList), string clusterCodeVersion = default(string), bool? eventStoreServiceEnabled = default(bool?), IList fabricSettings = default(IList), IList nodeTypes = default(IList), string reliabilityLevel = default(string), CertificateDescription reverseProxyCertificate = default(CertificateDescription), ClusterUpgradePolicy upgradeDescription = default(ClusterUpgradePolicy), string upgradeMode = default(string), ApplicationTypeVersionsCleanupPolicy applicationTypeVersionsCleanupPolicy = default(ApplicationTypeVersionsCleanupPolicy), IDictionary tags = default(IDictionary)) { AddOnFeatures = addOnFeatures; Certificate = certificate; @@ -108,6 +110,7 @@ public ClusterUpdateParameters() ReverseProxyCertificate = reverseProxyCertificate; UpgradeDescription = upgradeDescription; UpgradeMode = upgradeMode; + ApplicationTypeVersionsCleanupPolicy = applicationTypeVersionsCleanupPolicy; Tags = tags; CustomInit(); } @@ -189,7 +192,7 @@ public ClusterUpdateParameters() /// /// Gets or sets the reliability level sets the replica set size of /// system services. Learn about - /// [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). + /// [ReliabilityLevel](https://docs.microsoft.com/azure/service-fabric/service-fabric-cluster-capacity). /// /// - None - Run the System services with a target replica set count of /// 1. This should only be used for test clusters. @@ -234,6 +237,12 @@ public ClusterUpdateParameters() [JsonProperty(PropertyName = "properties.upgradeMode")] public string UpgradeMode { get; set; } + /// + /// Gets or sets the policy used to clean up unused versions. + /// + [JsonProperty(PropertyName = "properties.applicationTypeVersionsCleanupPolicy")] + public ApplicationTypeVersionsCleanupPolicy ApplicationTypeVersionsCleanupPolicy { get; set; } + /// /// Gets or sets cluster update parameters /// @@ -300,6 +309,10 @@ public virtual void Validate() { UpgradeDescription.Validate(); } + if (ApplicationTypeVersionsCleanupPolicy != null) + { + ApplicationTypeVersionsCleanupPolicy.Validate(); + } } } } diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/DiagnosticsStorageAccountConfig.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/DiagnosticsStorageAccountConfig.cs index 40401df6d664..abcf7bb40550 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/DiagnosticsStorageAccountConfig.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/DiagnosticsStorageAccountConfig.cs @@ -43,10 +43,14 @@ public DiagnosticsStorageAccountConfig() /// account. /// The table endpoint of the azure storage /// account. - public DiagnosticsStorageAccountConfig(string storageAccountName, string protectedAccountKeyName, string blobEndpoint, string queueEndpoint, string tableEndpoint) + /// The secondary protected + /// diagnostics storage key name. If one of the storage account keys is + /// rotated the cluster will fallback to using the other. + public DiagnosticsStorageAccountConfig(string storageAccountName, string protectedAccountKeyName, string blobEndpoint, string queueEndpoint, string tableEndpoint, string protectedAccountKeyName2 = default(string)) { StorageAccountName = storageAccountName; ProtectedAccountKeyName = protectedAccountKeyName; + ProtectedAccountKeyName2 = protectedAccountKeyName2; BlobEndpoint = blobEndpoint; QueueEndpoint = queueEndpoint; TableEndpoint = tableEndpoint; @@ -70,6 +74,14 @@ public DiagnosticsStorageAccountConfig(string storageAccountName, string protect [JsonProperty(PropertyName = "protectedAccountKeyName")] public string ProtectedAccountKeyName { get; set; } + /// + /// Gets or sets the secondary protected diagnostics storage key name. + /// If one of the storage account keys is rotated the cluster will + /// fallback to using the other. + /// + [JsonProperty(PropertyName = "protectedAccountKeyName2")] + public string ProtectedAccountKeyName2 { get; set; } + /// /// Gets or sets the blob endpoint of the azure storage account. /// diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/LoadBalancingRule.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/LoadBalancingRule.cs new file mode 100644 index 000000000000..0b30373445ca --- /dev/null +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/LoadBalancingRule.cs @@ -0,0 +1,132 @@ +// +// 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.ServiceFabric.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Describes a load balancing rule. + /// + public partial class LoadBalancingRule + { + /// + /// Initializes a new instance of the LoadBalancingRule class. + /// + public LoadBalancingRule() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the LoadBalancingRule class. + /// + /// The port for the external endpoint. Port + /// numbers for each rule must be unique within the Load Balancer. + /// Acceptable values are between 1 and 65534. + /// The port used for internal connections on + /// the endpoint. Acceptable values are between 1 and 65535. + /// The reference to the transport protocol used + /// by the load balancing rule. Possible values include: 'tcp', + /// 'udp' + /// the reference to the load balancer + /// probe used by the load balancing rule. Possible values include: + /// 'tcp', 'http', 'https' + /// The probe request path. Only + /// supported for HTTP/HTTPS probes. + public LoadBalancingRule(int frontendPort, int backendPort, string protocol, string probeProtocol, string probeRequestPath = default(string)) + { + FrontendPort = frontendPort; + BackendPort = backendPort; + Protocol = protocol; + ProbeProtocol = probeProtocol; + ProbeRequestPath = probeRequestPath; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the port for the external endpoint. Port numbers for + /// each rule must be unique within the Load Balancer. Acceptable + /// values are between 1 and 65534. + /// + [JsonProperty(PropertyName = "frontendPort")] + public int FrontendPort { get; set; } + + /// + /// Gets or sets the port used for internal connections on the + /// endpoint. Acceptable values are between 1 and 65535. + /// + [JsonProperty(PropertyName = "backendPort")] + public int BackendPort { get; set; } + + /// + /// Gets or sets the reference to the transport protocol used by the + /// load balancing rule. Possible values include: 'tcp', 'udp' + /// + [JsonProperty(PropertyName = "protocol")] + public string Protocol { get; set; } + + /// + /// Gets or sets the reference to the load balancer probe used by the + /// load balancing rule. Possible values include: 'tcp', 'http', + /// 'https' + /// + [JsonProperty(PropertyName = "probeProtocol")] + public string ProbeProtocol { get; set; } + + /// + /// Gets or sets the probe request path. Only supported for HTTP/HTTPS + /// probes. + /// + [JsonProperty(PropertyName = "probeRequestPath")] + public string ProbeRequestPath { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Protocol == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Protocol"); + } + if (ProbeProtocol == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "ProbeProtocol"); + } + if (FrontendPort > 65534) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "FrontendPort", 65534); + } + if (FrontendPort < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "FrontendPort", 1); + } + if (BackendPort > 65534) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "BackendPort", 65534); + } + if (BackendPort < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "BackendPort", 1); + } + } + } +} diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ManagedCluster.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ManagedCluster.cs new file mode 100644 index 000000000000..fce7281fcb49 --- /dev/null +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ManagedCluster.cs @@ -0,0 +1,380 @@ +// +// 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.ServiceFabric.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The manged cluster resource + /// + /// + [Rest.Serialization.JsonTransformation] + public partial class ManagedCluster : Resource + { + /// + /// Initializes a new instance of the ManagedCluster class. + /// + public ManagedCluster() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ManagedCluster class. + /// + /// Azure resource location. + /// The cluster dns name. + /// vm admin user name. + /// Azure resource identifier. + /// Azure resource name. + /// Azure resource type. + /// Azure resource tags. + /// Azure resource etag. + /// the cluster Fully qualified domain name. + /// A service generated unique identifier for + /// the cluster resource. + /// The current state of the cluster. + /// + /// - WaitingForNodes - Indicates that the cluster resource is created + /// and the resource provider is waiting for Service Fabric VM + /// extension to boot up and report to it. + /// - Deploying - Indicates that the Service Fabric runtime is being + /// installed on the VMs. Cluster resource will be in this state until + /// the cluster boots up and system services are up. + /// - BaselineUpgrade - Indicates that the cluster is upgrading to + /// establishes the cluster version. This upgrade is automatically + /// initiated when the cluster boots up for the first time. + /// - UpdatingUserConfiguration - Indicates that the cluster is being + /// upgraded with the user provided configuration. + /// - UpdatingUserCertificate - Indicates that the cluster is being + /// upgraded with the user provided certificate. + /// - UpdatingInfrastructure - Indicates that the cluster is being + /// upgraded with the latest Service Fabric runtime version. This + /// happens only when the **upgradeMode** is set to 'Automatic'. + /// - EnforcingClusterVersion - Indicates that cluster is on a + /// different version than expected and the cluster is being upgraded + /// to the expected version. + /// - UpgradeServiceUnreachable - Indicates that the system service in + /// the cluster is no longer polling the Resource Provider. Clusters in + /// this state cannot be managed by the Resource Provider. + /// - AutoScale - Indicates that the ReliabilityLevel of the cluster is + /// being adjusted. + /// - Ready - Indicates that the cluster is in a stable state. + /// . Possible values include: 'WaitingForNodes', 'Deploying', + /// 'BaselineUpgrade', 'UpdatingUserConfiguration', + /// 'UpdatingUserCertificate', 'UpdatingInfrastructure', + /// 'EnforcingClusterVersion', 'UpgradeServiceUnreachable', + /// 'AutoScale', 'Ready' + /// The cluster certificate + /// thumbprint used node to node communication. + /// The port used for client + /// connections to the cluster. + /// The port used for http + /// connections to the cluster. + /// vm admin user password. + /// Describes load balancing + /// rules. + /// client certificates for the cluster. + /// Azure active directory. + /// The list of custom fabric settings to + /// configure the cluster. + /// Use service fabric test vm + /// extension, by default it's false. + /// The provisioning state of the + /// managed cluster resource. Possible values include: 'None', + /// 'Creating', 'Created', 'Updating', 'Succeeded', 'Failed', + /// 'Canceled', 'Deleting', 'Deleted', 'Other' + /// The Service Fabric runtime version + /// of the cluster. This property can only by set the user when + /// **upgradeMode** is set to 'Manual'. To get list of available + /// Service Fabric versions for new clusters use [ClusterVersion + /// API](./ClusterVersion.md). To get the list of available version for + /// existing clusters use **availableClusterVersions**. + /// The upgrade mode of the cluster + /// when new Service Fabric runtime version is available. + /// + /// - Automatic - The cluster will be automatically upgraded to the + /// latest Service Fabric runtime version as soon as it is available. + /// - Manual - The cluster will not be automatically upgraded to the + /// latest Service Fabric runtime version. The cluster is upgraded by + /// setting the **clusterCodeVersion** property in the cluster + /// resource. + /// . Possible values include: 'Automatic', 'Manual' + /// Describes the policy used + /// when upgrading the cluster. + /// The endpoint used by reverse + /// proxy. + /// 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), string fqdn = default(string), string clusterId = default(string), string clusterState = default(string), string clusterCertificateThumbprint = default(string), int? clientConnectionPort = default(int?), int? httpGatewayConnectionPort = default(int?), string adminPassword = default(string), IList loadBalancingRules = default(IList), IList clients = default(IList), AzureActiveDirectory azureActiveDirectory = default(AzureActiveDirectory), IList fabricSettings = default(IList), bool? useTestExtension = default(bool?), string provisioningState = default(string), string clusterCodeVersion = default(string), string clusterUpgradeMode = default(string), ClusterUpgradePolicy clusterUpgradeDescription = default(ClusterUpgradePolicy), int? reverseProxyEndpointPort = default(int?), Sku sku = default(Sku)) + : base(location, id, name, type, tags, etag) + { + DnsName = dnsName; + Fqdn = fqdn; + ClusterId = clusterId; + ClusterState = clusterState; + ClusterCertificateThumbprint = clusterCertificateThumbprint; + ClientConnectionPort = clientConnectionPort; + HttpGatewayConnectionPort = httpGatewayConnectionPort; + AdminUserName = adminUserName; + AdminPassword = adminPassword; + LoadBalancingRules = loadBalancingRules; + Clients = clients; + AzureActiveDirectory = azureActiveDirectory; + FabricSettings = fabricSettings; + UseTestExtension = useTestExtension; + ProvisioningState = provisioningState; + ClusterCodeVersion = clusterCodeVersion; + ClusterUpgradeMode = clusterUpgradeMode; + ClusterUpgradeDescription = clusterUpgradeDescription; + ReverseProxyEndpointPort = reverseProxyEndpointPort; + Sku = sku; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the cluster dns name. + /// + [JsonProperty(PropertyName = "properties.dnsName")] + public string DnsName { get; set; } + + /// + /// Gets the cluster Fully qualified domain name. + /// + [JsonProperty(PropertyName = "properties.fqdn")] + public string Fqdn { get; private set; } + + /// + /// Gets a service generated unique identifier for the cluster + /// resource. + /// + [JsonProperty(PropertyName = "properties.clusterId")] + public string ClusterId { get; private set; } + + /// + /// Gets the current state of the cluster. + /// + /// - WaitingForNodes - Indicates that the cluster resource is created + /// and the resource provider is waiting for Service Fabric VM + /// extension to boot up and report to it. + /// - Deploying - Indicates that the Service Fabric runtime is being + /// installed on the VMs. Cluster resource will be in this state until + /// the cluster boots up and system services are up. + /// - BaselineUpgrade - Indicates that the cluster is upgrading to + /// establishes the cluster version. This upgrade is automatically + /// initiated when the cluster boots up for the first time. + /// - UpdatingUserConfiguration - Indicates that the cluster is being + /// upgraded with the user provided configuration. + /// - UpdatingUserCertificate - Indicates that the cluster is being + /// upgraded with the user provided certificate. + /// - UpdatingInfrastructure - Indicates that the cluster is being + /// upgraded with the latest Service Fabric runtime version. This + /// happens only when the **upgradeMode** is set to 'Automatic'. + /// - EnforcingClusterVersion - Indicates that cluster is on a + /// different version than expected and the cluster is being upgraded + /// to the expected version. + /// - UpgradeServiceUnreachable - Indicates that the system service in + /// the cluster is no longer polling the Resource Provider. Clusters in + /// this state cannot be managed by the Resource Provider. + /// - AutoScale - Indicates that the ReliabilityLevel of the cluster is + /// being adjusted. + /// - Ready - Indicates that the cluster is in a stable state. + /// . Possible values include: 'WaitingForNodes', 'Deploying', + /// 'BaselineUpgrade', 'UpdatingUserConfiguration', + /// 'UpdatingUserCertificate', 'UpdatingInfrastructure', + /// 'EnforcingClusterVersion', 'UpgradeServiceUnreachable', + /// 'AutoScale', 'Ready' + /// + [JsonProperty(PropertyName = "properties.clusterState")] + public string ClusterState { get; private set; } + + /// + /// Gets the cluster certificate thumbprint used node to node + /// communication. + /// + [JsonProperty(PropertyName = "properties.clusterCertificateThumbprint")] + public string ClusterCertificateThumbprint { get; private set; } + + /// + /// Gets or sets the port used for client connections to the cluster. + /// + [JsonProperty(PropertyName = "properties.clientConnectionPort")] + public int? ClientConnectionPort { get; set; } + + /// + /// Gets or sets the port used for http connections to the cluster. + /// + [JsonProperty(PropertyName = "properties.httpGatewayConnectionPort")] + public int? HttpGatewayConnectionPort { get; set; } + + /// + /// Gets or sets vm admin user name. + /// + [JsonProperty(PropertyName = "properties.adminUserName")] + public string AdminUserName { get; set; } + + /// + /// Gets or sets vm admin user password. + /// + [JsonProperty(PropertyName = "properties.adminPassword")] + public string AdminPassword { get; set; } + + /// + /// Gets or sets describes load balancing rules. + /// + [JsonProperty(PropertyName = "properties.loadBalancingRules")] + public IList LoadBalancingRules { get; set; } + + /// + /// Gets or sets client certificates for the cluster. + /// + [JsonProperty(PropertyName = "properties.clients")] + public IList Clients { get; set; } + + /// + /// Gets or sets azure active directory. + /// + [JsonProperty(PropertyName = "properties.azureActiveDirectory")] + public AzureActiveDirectory AzureActiveDirectory { get; set; } + + /// + /// Gets or sets the list of custom fabric settings to configure the + /// cluster. + /// + [JsonProperty(PropertyName = "properties.fabricSettings")] + public IList FabricSettings { get; set; } + + /// + /// Gets or sets use service fabric test vm extension, by default it's + /// false. + /// + [JsonProperty(PropertyName = "properties.useTestExtension")] + public bool? UseTestExtension { get; set; } + + /// + /// Gets the provisioning state of the managed cluster 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 Service Fabric runtime version of the cluster. + /// This property can only by set the user when **upgradeMode** is set + /// to 'Manual'. To get list of available Service Fabric versions for + /// new clusters use [ClusterVersion API](./ClusterVersion.md). To get + /// the list of available version for existing clusters use + /// **availableClusterVersions**. + /// + [JsonProperty(PropertyName = "properties.clusterCodeVersion")] + public string ClusterCodeVersion { get; set; } + + /// + /// Gets or sets the upgrade mode of the cluster when new Service + /// Fabric runtime version is available. + /// + /// - Automatic - The cluster will be automatically upgraded to the + /// latest Service Fabric runtime version as soon as it is available. + /// - Manual - The cluster will not be automatically upgraded to the + /// latest Service Fabric runtime version. The cluster is upgraded by + /// setting the **clusterCodeVersion** property in the cluster + /// resource. + /// . Possible values include: 'Automatic', 'Manual' + /// + [JsonProperty(PropertyName = "properties.clusterUpgradeMode")] + public string ClusterUpgradeMode { get; set; } + + /// + /// Gets or sets describes the policy used when upgrading the cluster. + /// + [JsonProperty(PropertyName = "properties.clusterUpgradeDescription")] + public ClusterUpgradePolicy ClusterUpgradeDescription { get; set; } + + /// + /// Gets or sets the endpoint used by reverse proxy. + /// + [JsonProperty(PropertyName = "properties.reverseProxyEndpointPort")] + public int? ReverseProxyEndpointPort { get; set; } + + /// + /// Gets or sets the sku of the managed cluster + /// + [JsonProperty(PropertyName = "sku")] + public Sku Sku { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + if (DnsName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "DnsName"); + } + if (AdminUserName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "AdminUserName"); + } + if (LoadBalancingRules != null) + { + foreach (var element in LoadBalancingRules) + { + if (element != null) + { + element.Validate(); + } + } + } + if (Clients != null) + { + foreach (var element1 in Clients) + { + if (element1 != null) + { + element1.Validate(); + } + } + } + if (FabricSettings != null) + { + foreach (var element2 in FabricSettings) + { + if (element2 != null) + { + element2.Validate(); + } + } + } + if (ClusterUpgradeDescription != null) + { + ClusterUpgradeDescription.Validate(); + } + if (Sku != null) + { + Sku.Validate(); + } + } + } +} diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ManagedClusterUpdateParameters.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ManagedClusterUpdateParameters.cs new file mode 100644 index 000000000000..83e88b714816 --- /dev/null +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ManagedClusterUpdateParameters.cs @@ -0,0 +1,216 @@ +// +// 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.ServiceFabric.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Managed cluster update request + /// + [Rest.Serialization.JsonTransformation] + public partial class ManagedClusterUpdateParameters + { + /// + /// Initializes a new instance of the ManagedClusterUpdateParameters + /// class. + /// + public ManagedClusterUpdateParameters() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ManagedClusterUpdateParameters + /// class. + /// + /// The port used for client + /// connections to the cluster. + /// The port used for http + /// connections to the cluster. + /// Describes a load balancing + /// rule. + /// client certificates for the cluster. + /// Azure active directory. + /// The list of custom fabric settings to + /// configure the cluster. + /// The Service Fabric runtime version + /// of the cluster. This property can only by set the user when + /// **upgradeMode** is set to 'Manual'. To get list of available + /// Service Fabric versions for new clusters use [ClusterVersion + /// API](./ClusterVersion.md). To get the list of available version for + /// existing clusters use **availableClusterVersions**. + /// The upgrade mode of the cluster + /// when new Service Fabric runtime version is available. + /// + /// - Automatic - The cluster will be automatically upgraded to the + /// latest Service Fabric runtime version as soon as it is available. + /// - Manual - The cluster will not be automatically upgraded to the + /// latest Service Fabric runtime version. The cluster is upgraded by + /// setting the **clusterCodeVersion** property in the cluster + /// resource. + /// . Possible values include: 'Automatic', 'Manual' + /// Describes the policy used + /// when upgrading the cluster. + /// The endpoint used by reverse + /// proxy. + /// Managed cluster update parameters + public ManagedClusterUpdateParameters(int? clientConnectionPort = default(int?), int? httpGatewayConnectionPort = default(int?), IList loadBalancingRules = default(IList), IList clients = default(IList), AzureActiveDirectory azureActiveDirectory = default(AzureActiveDirectory), IList fabricSettings = default(IList), string clusterCodeVersion = default(string), string clusterUpgradeMode = default(string), ClusterUpgradePolicy clusterUpgradeDescription = default(ClusterUpgradePolicy), int? reverseProxyEndpointPort = default(int?), IDictionary tags = default(IDictionary)) + { + ClientConnectionPort = clientConnectionPort; + HttpGatewayConnectionPort = httpGatewayConnectionPort; + LoadBalancingRules = loadBalancingRules; + Clients = clients; + AzureActiveDirectory = azureActiveDirectory; + FabricSettings = fabricSettings; + ClusterCodeVersion = clusterCodeVersion; + ClusterUpgradeMode = clusterUpgradeMode; + ClusterUpgradeDescription = clusterUpgradeDescription; + ReverseProxyEndpointPort = reverseProxyEndpointPort; + Tags = tags; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the port used for client connections to the cluster. + /// + [JsonProperty(PropertyName = "properties.clientConnectionPort")] + public int? ClientConnectionPort { get; set; } + + /// + /// Gets or sets the port used for http connections to the cluster. + /// + [JsonProperty(PropertyName = "properties.httpGatewayConnectionPort")] + public int? HttpGatewayConnectionPort { get; set; } + + /// + /// Gets or sets describes a load balancing rule. + /// + [JsonProperty(PropertyName = "properties.loadBalancingRules")] + public IList LoadBalancingRules { get; set; } + + /// + /// Gets or sets client certificates for the cluster. + /// + [JsonProperty(PropertyName = "properties.clients")] + public IList Clients { get; set; } + + /// + /// Gets or sets azure active directory. + /// + [JsonProperty(PropertyName = "properties.azureActiveDirectory")] + public AzureActiveDirectory AzureActiveDirectory { get; set; } + + /// + /// Gets or sets the list of custom fabric settings to configure the + /// cluster. + /// + [JsonProperty(PropertyName = "properties.fabricSettings")] + public IList FabricSettings { get; set; } + + /// + /// Gets or sets the Service Fabric runtime version of the cluster. + /// This property can only by set the user when **upgradeMode** is set + /// to 'Manual'. To get list of available Service Fabric versions for + /// new clusters use [ClusterVersion API](./ClusterVersion.md). To get + /// the list of available version for existing clusters use + /// **availableClusterVersions**. + /// + [JsonProperty(PropertyName = "properties.clusterCodeVersion")] + public string ClusterCodeVersion { get; set; } + + /// + /// Gets or sets the upgrade mode of the cluster when new Service + /// Fabric runtime version is available. + /// + /// - Automatic - The cluster will be automatically upgraded to the + /// latest Service Fabric runtime version as soon as it is available. + /// - Manual - The cluster will not be automatically upgraded to the + /// latest Service Fabric runtime version. The cluster is upgraded by + /// setting the **clusterCodeVersion** property in the cluster + /// resource. + /// . Possible values include: 'Automatic', 'Manual' + /// + [JsonProperty(PropertyName = "properties.clusterUpgradeMode")] + public string ClusterUpgradeMode { get; set; } + + /// + /// Gets or sets describes the policy used when upgrading the cluster. + /// + [JsonProperty(PropertyName = "properties.clusterUpgradeDescription")] + public ClusterUpgradePolicy ClusterUpgradeDescription { get; set; } + + /// + /// Gets or sets the endpoint used by reverse proxy. + /// + [JsonProperty(PropertyName = "properties.reverseProxyEndpointPort")] + public int? ReverseProxyEndpointPort { get; set; } + + /// + /// Gets or sets managed cluster update parameters + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (LoadBalancingRules != null) + { + foreach (var element in LoadBalancingRules) + { + if (element != null) + { + element.Validate(); + } + } + } + if (Clients != null) + { + foreach (var element1 in Clients) + { + if (element1 != null) + { + element1.Validate(); + } + } + } + if (FabricSettings != null) + { + foreach (var element2 in FabricSettings) + { + if (element2 != null) + { + element2.Validate(); + } + } + } + if (ClusterUpgradeDescription != null) + { + ClusterUpgradeDescription.Validate(); + } + } + } +} diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ManagedClusterVersionDetails.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ManagedClusterVersionDetails.cs new file mode 100644 index 000000000000..0af7fd691b96 --- /dev/null +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ManagedClusterVersionDetails.cs @@ -0,0 +1,75 @@ +// +// 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.ServiceFabric.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// The detail of the Service Fabric runtime version. + /// + public partial class ManagedClusterVersionDetails + { + /// + /// Initializes a new instance of the ManagedClusterVersionDetails + /// class. + /// + public ManagedClusterVersionDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ManagedClusterVersionDetails + /// class. + /// + /// The Service Fabric runtime version of the + /// cluster. + /// The date of expiry of support of the + /// version. + /// Indicates the operating system of the cluster. + /// Possible values include: 'Windows', 'Ubuntu', 'RedHat', + /// 'Ubuntu18_04' + public ManagedClusterVersionDetails(string msiVersion = default(string), string supportExpiryUtc = default(string), string osType = default(string)) + { + MsiVersion = msiVersion; + SupportExpiryUtc = supportExpiryUtc; + OsType = osType; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the Service Fabric runtime version of the cluster. + /// + [JsonProperty(PropertyName = "msiVersion")] + public string MsiVersion { get; set; } + + /// + /// Gets or sets the date of expiry of support of the version. + /// + [JsonProperty(PropertyName = "supportExpiryUtc")] + public string SupportExpiryUtc { get; set; } + + /// + /// Gets or sets indicates the operating system of the cluster. + /// Possible values include: 'Windows', 'Ubuntu', 'RedHat', + /// 'Ubuntu18_04' + /// + [JsonProperty(PropertyName = "osType")] + public string OsType { get; set; } + + } +} diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ManagedIdentity.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ManagedIdentity.cs new file mode 100644 index 000000000000..eae2ff53e366 --- /dev/null +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ManagedIdentity.cs @@ -0,0 +1,95 @@ +// +// 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.ServiceFabric.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Describes the managed identities for an Azure resource. + /// + public partial class ManagedIdentity + { + /// + /// Initializes a new instance of the ManagedIdentity class. + /// + public ManagedIdentity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ManagedIdentity class. + /// + /// The principal id of the managed identity. + /// This property will only be provided for a system assigned + /// identity. + /// The tenant id of the managed identity. This + /// property will only be provided for a system assigned + /// identity. + /// The type of managed identity for the resource. + /// Possible values include: 'SystemAssigned', 'UserAssigned', + /// 'SystemAssigned, UserAssigned', 'None' + /// The list of user identities + /// associated with the resource. The user identity dictionary key + /// references will be ARM resource ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// + public ManagedIdentity(string principalId = default(string), string tenantId = default(string), ManagedIdentityType? type = default(ManagedIdentityType?), IDictionary userAssignedIdentities = default(IDictionary)) + { + PrincipalId = principalId; + TenantId = tenantId; + Type = type; + UserAssignedIdentities = userAssignedIdentities; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the principal id of the managed identity. This property will + /// only be provided for a system assigned identity. + /// + [JsonProperty(PropertyName = "principalId")] + public string PrincipalId { get; private set; } + + /// + /// Gets the tenant id of the managed identity. This property will only + /// be provided for a system assigned identity. + /// + [JsonProperty(PropertyName = "tenantId")] + public string TenantId { get; private set; } + + /// + /// Gets or sets the type of managed identity for the resource. + /// Possible values include: 'SystemAssigned', 'UserAssigned', + /// 'SystemAssigned, UserAssigned', 'None' + /// + [JsonProperty(PropertyName = "type")] + public ManagedIdentityType? Type { get; set; } + + /// + /// Gets or sets the list of user identities associated with the + /// resource. The user identity dictionary key references will be ARM + /// resource ids in the form: + /// '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// + /// + [JsonProperty(PropertyName = "userAssignedIdentities")] + public IDictionary UserAssignedIdentities { get; set; } + + } +} diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ManagedIdentityType.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ManagedIdentityType.cs new file mode 100644 index 000000000000..09b2a2711340 --- /dev/null +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ManagedIdentityType.cs @@ -0,0 +1,87 @@ +// +// 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.ServiceFabric.Models +{ + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using System.Runtime; + using System.Runtime.Serialization; + + /// + /// Defines values for ManagedIdentityType. + /// + [JsonConverter(typeof(StringEnumConverter))] + public enum ManagedIdentityType + { + /// + /// Indicates that system assigned identity is associated with the + /// resource. + /// + [EnumMember(Value = "SystemAssigned")] + SystemAssigned, + /// + /// Indicates that user assigned identity is associated with the + /// resource. + /// + [EnumMember(Value = "UserAssigned")] + UserAssigned, + /// + /// Indicates that both system assigned and user assigned identity are + /// associated with the resource. + /// + [EnumMember(Value = "SystemAssigned, UserAssigned")] + SystemAssignedUserAssigned, + /// + /// Indicates that no identity is associated with the resource. + /// + [EnumMember(Value = "None")] + None + } + internal static class ManagedIdentityTypeEnumExtension + { + internal static string ToSerializedValue(this ManagedIdentityType? value) + { + return value == null ? null : ((ManagedIdentityType)value).ToSerializedValue(); + } + + internal static string ToSerializedValue(this ManagedIdentityType value) + { + switch( value ) + { + case ManagedIdentityType.SystemAssigned: + return "SystemAssigned"; + case ManagedIdentityType.UserAssigned: + return "UserAssigned"; + case ManagedIdentityType.SystemAssignedUserAssigned: + return "SystemAssigned, UserAssigned"; + case ManagedIdentityType.None: + return "None"; + } + return null; + } + + internal static ManagedIdentityType? ParseManagedIdentityType(this string value) + { + switch( value ) + { + case "SystemAssigned": + return ManagedIdentityType.SystemAssigned; + case "UserAssigned": + return ManagedIdentityType.UserAssigned; + case "SystemAssigned, UserAssigned": + return ManagedIdentityType.SystemAssignedUserAssigned; + case "None": + return ManagedIdentityType.None; + } + return null; + } + } +} diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ManagedProxyResource.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ManagedProxyResource.cs new file mode 100644 index 000000000000..054f3804a13b --- /dev/null +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ManagedProxyResource.cs @@ -0,0 +1,79 @@ +// +// 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.ServiceFabric.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// The resource model definition for proxy-only resource. + /// + public partial class ManagedProxyResource : IResource + { + /// + /// Initializes a new instance of the ManagedProxyResource class. + /// + public ManagedProxyResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ManagedProxyResource class. + /// + /// Azure resource identifier. + /// Azure resource name. + /// Azure resource type. + /// Azure resource tags. + public ManagedProxyResource(string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary)) + { + Id = id; + Name = name; + Type = type; + Tags = tags; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets azure resource identifier. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; private set; } + + /// + /// Gets azure resource name. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; private set; } + + /// + /// Gets azure resource type. + /// + [JsonProperty(PropertyName = "type")] + public string Type { get; private set; } + + /// + /// Gets or sets azure resource tags. + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + } +} diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/NamedPartitionSchemeDescription.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/NamedPartitionSchemeDescription.cs index 37010987ee4a..5d73be3bcdbe 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/NamedPartitionSchemeDescription.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/NamedPartitionSchemeDescription.cs @@ -36,7 +36,7 @@ public NamedPartitionSchemeDescription() /// class. /// /// The number of partitions. - /// Array of size specified by the ‘Count’ + /// Array of size specified by the ‘count’ /// parameter, for the names of the partitions. public NamedPartitionSchemeDescription(int count, IList names) { @@ -53,14 +53,14 @@ public NamedPartitionSchemeDescription(int count, IList names) /// /// Gets or sets the number of partitions. /// - [JsonProperty(PropertyName = "Count")] + [JsonProperty(PropertyName = "count")] public int Count { get; set; } /// - /// Gets or sets array of size specified by the ‘Count’ parameter, for + /// Gets or sets array of size specified by the ‘count’ parameter, for /// the names of the partitions. /// - [JsonProperty(PropertyName = "Names")] + [JsonProperty(PropertyName = "names")] public IList Names { get; set; } /// diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/NodeType.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/NodeType.cs new file mode 100644 index 000000000000..25135392265c --- /dev/null +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/NodeType.cs @@ -0,0 +1,270 @@ +// +// 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.ServiceFabric.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Describes a node type in the cluster, each node type represents sub set + /// of nodes in the cluster. + /// + [Rest.Serialization.JsonTransformation] + public partial class NodeType : ManagedProxyResource + { + /// + /// Initializes a new instance of the NodeType class. + /// + public NodeType() + { + CustomInit(); + } + + /// + /// 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. + /// This count should match the capacity property in the corresponding + /// VirtualMachineScaleSet resource. + /// Disk size for each vm in the node type + /// in GBs. + /// Azure resource identifier. + /// Azure resource name. + /// Azure resource type. + /// Azure resource tags. + /// The placement tags applied to + /// nodes in the node type, which can be used to indicate where certain + /// services (workload) should run. + /// The capacity tags applied to the nodes in + /// the node type, the cluster resource manager uses these tags to + /// understand how much resource a node has. + /// The range of ports from which + /// cluster assigned port to Service Fabric applications. + /// The range of ephemeral ports that + /// nodes in this node type should be configured with. + /// The size of virtual machines in the pool. All + /// virtual machines in a pool are the same size. For example, + /// Standard_D3. + /// The publisher of the Azure Virtual + /// Machines Marketplace image. For example, Canonical or + /// MicrosoftWindowsServer. + /// The offer type of the Azure Virtual + /// Machines Marketplace image. For example, UbuntuServer or + /// WindowsServer. + /// The SKU of the Azure Virtual Machines + /// Marketplace image. For example, 14.04.0-LTS or + /// 2012-R2-Datacenter. + /// The version of the Azure Virtual + /// Machines Marketplace image. A value of 'latest' can be specified to + /// select the latest version of an image. If omitted, the default is + /// 'latest'. + /// virtual machine secretes. + /// virtual machine extensions. + /// 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), 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), string provisioningState = default(string)) + : base(id, name, type, tags) + { + IsPrimary = isPrimary; + VmInstanceCount = vmInstanceCount; + DataDiskSizeGB = dataDiskSizeGB; + PlacementProperties = placementProperties; + Capacities = capacities; + ApplicationPorts = applicationPorts; + EphemeralPorts = ephemeralPorts; + VmSize = vmSize; + VmImagePublisher = vmImagePublisher; + VmImageOffer = vmImageOffer; + VmImageSku = vmImageSku; + VmImageVersion = vmImageVersion; + VmSecrets = vmSecrets; + VmExtensions = vmExtensions; + ProvisioningState = provisioningState; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + 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. + /// + [JsonProperty(PropertyName = "properties.isPrimary")] + public bool IsPrimary { get; set; } + + /// + /// Gets or sets the number of nodes in the node type. This count + /// should match the capacity property in the corresponding + /// VirtualMachineScaleSet resource. + /// + [JsonProperty(PropertyName = "properties.vmInstanceCount")] + public int VmInstanceCount { get; set; } + + /// + /// Gets or sets disk size for each vm in the node type in GBs. + /// + [JsonProperty(PropertyName = "properties.dataDiskSizeGB")] + public int DataDiskSizeGB { get; set; } + + /// + /// Gets or sets the placement tags applied to nodes in the node type, + /// which can be used to indicate where certain services (workload) + /// should run. + /// + [JsonProperty(PropertyName = "properties.placementProperties")] + public IDictionary PlacementProperties { get; set; } + + /// + /// Gets or sets the capacity tags applied to the nodes in the node + /// type, the cluster resource manager uses these tags to understand + /// how much resource a node has. + /// + [JsonProperty(PropertyName = "properties.capacities")] + public IDictionary Capacities { get; set; } + + /// + /// Gets or sets the range of ports from which cluster assigned port to + /// Service Fabric applications. + /// + [JsonProperty(PropertyName = "properties.applicationPorts")] + public EndpointRangeDescription ApplicationPorts { get; set; } + + /// + /// Gets or sets the range of ephemeral ports that nodes in this node + /// type should be configured with. + /// + [JsonProperty(PropertyName = "properties.ephemeralPorts")] + public EndpointRangeDescription EphemeralPorts { get; set; } + + /// + /// Gets or sets the size of virtual machines in the pool. All virtual + /// machines in a pool are the same size. For example, Standard_D3. + /// + [JsonProperty(PropertyName = "properties.vmSize")] + public string VmSize { get; set; } + + /// + /// Gets or sets the publisher of the Azure Virtual Machines + /// Marketplace image. For example, Canonical or + /// MicrosoftWindowsServer. + /// + [JsonProperty(PropertyName = "properties.vmImagePublisher")] + public string VmImagePublisher { get; set; } + + /// + /// Gets or sets the offer type of the Azure Virtual Machines + /// Marketplace image. For example, UbuntuServer or WindowsServer. + /// + [JsonProperty(PropertyName = "properties.vmImageOffer")] + public string VmImageOffer { get; set; } + + /// + /// Gets or sets the SKU of the Azure Virtual Machines Marketplace + /// image. For example, 14.04.0-LTS or 2012-R2-Datacenter. + /// + [JsonProperty(PropertyName = "properties.vmImageSku")] + public string VmImageSku { get; set; } + + /// + /// Gets or sets the version of the Azure Virtual Machines Marketplace + /// image. A value of 'latest' can be specified to select the latest + /// version of an image. If omitted, the default is 'latest'. + /// + [JsonProperty(PropertyName = "properties.vmImageVersion")] + public string VmImageVersion { get; set; } + + /// + /// Gets or sets virtual machine secretes. + /// + /// + /// The secrets to install in the virtual machines. + /// + [JsonProperty(PropertyName = "properties.vmSecrets")] + public IList VmSecrets { get; set; } + + /// + /// Gets or sets virtual machine extensions. + /// + /// + /// Set of extensions that should be installed onto the virtual + /// machines. + /// + [JsonProperty(PropertyName = "properties.vmExtensions")] + public IList VmExtensions { get; set; } + + /// + /// Gets the provisioning state of the managed cluster resource. + /// Possible values include: 'None', 'Creating', 'Created', 'Updating', + /// 'Succeeded', 'Failed', 'Canceled', 'Deleting', 'Deleted', 'Other' + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (VmInstanceCount > 2147483647) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "VmInstanceCount", 2147483647); + } + if (VmInstanceCount < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "VmInstanceCount", 1); + } + if (ApplicationPorts != null) + { + ApplicationPorts.Validate(); + } + if (EphemeralPorts != null) + { + EphemeralPorts.Validate(); + } + if (VmSecrets != null) + { + foreach (var element in VmSecrets) + { + if (element != null) + { + element.Validate(); + } + } + } + if (VmExtensions != null) + { + foreach (var element1 in VmExtensions) + { + if (element1 != null) + { + element1.Validate(); + } + } + } + } + } +} diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/NodeTypeActionParameters.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/NodeTypeActionParameters.cs new file mode 100644 index 000000000000..c9b42fb6ce7b --- /dev/null +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/NodeTypeActionParameters.cs @@ -0,0 +1,75 @@ +// +// 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.ServiceFabric.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Parameters for Node type action. + /// + public partial class NodeTypeActionParameters + { + /// + /// Initializes a new instance of the NodeTypeActionParameters class. + /// + public NodeTypeActionParameters() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NodeTypeActionParameters class. + /// + /// List of node names from the node type. + /// Force the action to go through. + public NodeTypeActionParameters(IList nodes, bool? force = default(bool?)) + { + Nodes = nodes; + Force = force; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets list of node names from the node type. + /// + [JsonProperty(PropertyName = "nodes")] + public IList Nodes { get; set; } + + /// + /// Gets or sets force the action to go through. + /// + [JsonProperty(PropertyName = "force")] + public bool? Force { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Nodes == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Nodes"); + } + } + } +} diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/NodeTypeDescription.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/NodeTypeDescription.cs index 8f1cdbf2853a..56889572bf67 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/NodeTypeDescription.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/NodeTypeDescription.cs @@ -52,7 +52,7 @@ public NodeTypeDescription() /// understand how much resource a node has. /// The durability level of the node /// type. Learn about - /// [DurabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). + /// [DurabilityLevel](https://docs.microsoft.com/azure/service-fabric/service-fabric-cluster-capacity). /// /// - Bronze - No privileges. This is the default. /// - Silver - The infrastructure jobs can be paused for a duration of @@ -124,7 +124,7 @@ public NodeTypeDescription() /// /// Gets or sets the durability level of the node type. Learn about - /// [DurabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). + /// [DurabilityLevel](https://docs.microsoft.com/azure/service-fabric/service-fabric-cluster-capacity). /// /// - Bronze - No privileges. This is the default. /// - Silver - The infrastructure jobs can be paused for a duration of diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/NodeTypeUpdateParameters.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/NodeTypeUpdateParameters.cs new file mode 100644 index 000000000000..4d643802bf94 --- /dev/null +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/NodeTypeUpdateParameters.cs @@ -0,0 +1,180 @@ +// +// 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.ServiceFabric.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Node type update request + /// + [Rest.Serialization.JsonTransformation] + public partial class NodeTypeUpdateParameters + { + /// + /// Initializes a new instance of the NodeTypeUpdateParameters class. + /// + public NodeTypeUpdateParameters() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NodeTypeUpdateParameters class. + /// + /// The number of nodes in the node type. + /// This count should match the capacity property in the corresponding + /// VirtualMachineScaleSet resource. + /// The placement tags applied to + /// nodes in the node type, which can be used to indicate where certain + /// services (workload) should run. + /// The capacity tags applied to the nodes in + /// the node type, the cluster resource manager uses these tags to + /// understand how much resource a node has. + /// The range of ports from which + /// cluster assigned port to Service Fabric applications. + /// The range of ephemeral ports that + /// nodes in this node type should be configured with. + /// virtual machine secretes. + /// virtual machine extensions. + /// Node type update parameters + public NodeTypeUpdateParameters(int? vmInstanceCount = default(int?), IDictionary placementProperties = default(IDictionary), IDictionary capacities = default(IDictionary), EndpointRangeDescription applicationPorts = default(EndpointRangeDescription), EndpointRangeDescription ephemeralPorts = default(EndpointRangeDescription), IList vmSecrets = default(IList), IList vmExtensions = default(IList), IDictionary tags = default(IDictionary)) + { + VmInstanceCount = vmInstanceCount; + PlacementProperties = placementProperties; + Capacities = capacities; + ApplicationPorts = applicationPorts; + EphemeralPorts = ephemeralPorts; + VmSecrets = vmSecrets; + VmExtensions = vmExtensions; + Tags = tags; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the number of nodes in the node type. This count + /// should match the capacity property in the corresponding + /// VirtualMachineScaleSet resource. + /// + [JsonProperty(PropertyName = "properties.vmInstanceCount")] + public int? VmInstanceCount { get; set; } + + /// + /// Gets or sets the placement tags applied to nodes in the node type, + /// which can be used to indicate where certain services (workload) + /// should run. + /// + [JsonProperty(PropertyName = "properties.placementProperties")] + public IDictionary PlacementProperties { get; set; } + + /// + /// Gets or sets the capacity tags applied to the nodes in the node + /// type, the cluster resource manager uses these tags to understand + /// how much resource a node has. + /// + [JsonProperty(PropertyName = "properties.capacities")] + public IDictionary Capacities { get; set; } + + /// + /// Gets or sets the range of ports from which cluster assigned port to + /// Service Fabric applications. + /// + [JsonProperty(PropertyName = "properties.applicationPorts")] + public EndpointRangeDescription ApplicationPorts { get; set; } + + /// + /// Gets or sets the range of ephemeral ports that nodes in this node + /// type should be configured with. + /// + [JsonProperty(PropertyName = "properties.ephemeralPorts")] + public EndpointRangeDescription EphemeralPorts { get; set; } + + /// + /// Gets or sets virtual machine secretes. + /// + /// + /// The secrets to install in the virtual machines. + /// + [JsonProperty(PropertyName = "properties.vmSecrets")] + public IList VmSecrets { get; set; } + + /// + /// Gets or sets virtual machine extensions. + /// + /// + /// Set of extensions that should be installed onto the virtual + /// machines. + /// + [JsonProperty(PropertyName = "properties.vmExtensions")] + public IList VmExtensions { get; set; } + + /// + /// Gets or sets node type update parameters + /// + [JsonProperty(PropertyName = "tags")] + public IDictionary Tags { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (VmInstanceCount > 2147483647) + { + throw new ValidationException(ValidationRules.InclusiveMaximum, "VmInstanceCount", 2147483647); + } + if (VmInstanceCount < 1) + { + throw new ValidationException(ValidationRules.InclusiveMinimum, "VmInstanceCount", 1); + } + if (ApplicationPorts != null) + { + ApplicationPorts.Validate(); + } + if (EphemeralPorts != null) + { + EphemeralPorts.Validate(); + } + if (VmSecrets != null) + { + foreach (var element in VmSecrets) + { + if (element != null) + { + element.Validate(); + } + } + } + if (VmExtensions != null) + { + foreach (var element1 in VmExtensions) + { + if (element1 != null) + { + element1.Validate(); + } + } + } + } + } +} diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ProbeProtocol.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ProbeProtocol.cs new file mode 100644 index 000000000000..e0d04814ef61 --- /dev/null +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ProbeProtocol.cs @@ -0,0 +1,23 @@ +// +// 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.ServiceFabric.Models +{ + + /// + /// Defines values for ProbeProtocol. + /// + public static class ProbeProtocol + { + public const string Tcp = "tcp"; + public const string Http = "http"; + public const string Https = "https"; + } +} diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/Protocol.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/Protocol.cs new file mode 100644 index 000000000000..581968ebbc84 --- /dev/null +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/Protocol.cs @@ -0,0 +1,22 @@ +// +// 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.ServiceFabric.Models +{ + + /// + /// Defines values for Protocol. + /// + public static class Protocol + { + public const string Tcp = "tcp"; + public const string Udp = "udp"; + } +} diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/RollingUpgradeMode.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/RollingUpgradeMode.cs new file mode 100644 index 000000000000..7c43e41f1f18 --- /dev/null +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/RollingUpgradeMode.cs @@ -0,0 +1,41 @@ +// +// 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.ServiceFabric.Models +{ + + /// + /// Defines values for RollingUpgradeMode. + /// + public static class RollingUpgradeMode + { + /// + /// Indicates the upgrade mode is invalid. All Service Fabric + /// enumerations have the invalid type. The value is zero. + /// + public const string Invalid = "Invalid"; + /// + /// The upgrade will proceed automatically without performing any + /// health monitoring. The value is 1 + /// + public const string UnmonitoredAuto = "UnmonitoredAuto"; + /// + /// The upgrade will stop after completing each upgrade domain, giving + /// the opportunity to manually monitor health before proceeding. The + /// value is 2 + /// + public const string UnmonitoredManual = "UnmonitoredManual"; + /// + /// The upgrade will stop after completing each upgrade domain and + /// automatically monitor health before proceeding. The value is 3 + /// + public const string Monitored = "Monitored"; + } +} diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ServiceResource.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ServiceResource.cs index 70752316c5ad..c2ab3714de54 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ServiceResource.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ServiceResource.cs @@ -64,7 +64,10 @@ public ServiceResource() /// The activation Mode of /// the service package. Possible values include: 'SharedProcess', /// 'ExclusiveProcess' - public ServiceResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string etag = default(string), string placementConstraints = default(string), IList correlationScheme = default(IList), IList serviceLoadMetrics = default(IList), IList servicePlacementPolicies = default(IList), string defaultMoveCost = default(string), string provisioningState = default(string), string serviceTypeName = default(string), PartitionSchemeDescription partitionDescription = default(PartitionSchemeDescription), string servicePackageActivationMode = default(string)) + /// Dns name used for the service. If this + /// is specified, then the service can be accessed via its DNS name + /// instead of service name. + public ServiceResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string etag = default(string), string placementConstraints = default(string), IList correlationScheme = default(IList), IList serviceLoadMetrics = default(IList), IList servicePlacementPolicies = default(IList), string defaultMoveCost = default(string), string provisioningState = default(string), string serviceTypeName = default(string), PartitionSchemeDescription partitionDescription = default(PartitionSchemeDescription), string servicePackageActivationMode = default(string), string serviceDnsName = default(string)) : base(id, name, type, location, tags, etag) { PlacementConstraints = placementConstraints; @@ -76,6 +79,7 @@ public ServiceResource() ServiceTypeName = serviceTypeName; PartitionDescription = partitionDescription; ServicePackageActivationMode = servicePackageActivationMode; + ServiceDnsName = serviceDnsName; CustomInit(); } @@ -148,5 +152,13 @@ public ServiceResource() [JsonProperty(PropertyName = "properties.servicePackageActivationMode")] public string ServicePackageActivationMode { get; set; } + /// + /// Gets or sets dns name used for the service. If this is specified, + /// then the service can be accessed via its DNS name instead of + /// service name. + /// + [JsonProperty(PropertyName = "properties.serviceDnsName")] + public string ServiceDnsName { get; set; } + } } diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ServiceResourceProperties.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ServiceResourceProperties.cs index e4ac4c863728..8bf965b85044 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ServiceResourceProperties.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ServiceResourceProperties.cs @@ -54,13 +54,17 @@ public ServiceResourceProperties() /// The activation Mode of /// the service package. Possible values include: 'SharedProcess', /// 'ExclusiveProcess' - public ServiceResourceProperties(string placementConstraints = default(string), IList correlationScheme = default(IList), IList serviceLoadMetrics = default(IList), IList servicePlacementPolicies = default(IList), string defaultMoveCost = default(string), string provisioningState = default(string), string serviceTypeName = default(string), PartitionSchemeDescription partitionDescription = default(PartitionSchemeDescription), string servicePackageActivationMode = default(string)) + /// Dns name used for the service. If this + /// is specified, then the service can be accessed via its DNS name + /// instead of service name. + public ServiceResourceProperties(string placementConstraints = default(string), IList correlationScheme = default(IList), IList serviceLoadMetrics = default(IList), IList servicePlacementPolicies = default(IList), string defaultMoveCost = default(string), string provisioningState = default(string), string serviceTypeName = default(string), PartitionSchemeDescription partitionDescription = default(PartitionSchemeDescription), string servicePackageActivationMode = default(string), string serviceDnsName = default(string)) : base(placementConstraints, correlationScheme, serviceLoadMetrics, servicePlacementPolicies, defaultMoveCost) { ProvisioningState = provisioningState; ServiceTypeName = serviceTypeName; PartitionDescription = partitionDescription; ServicePackageActivationMode = servicePackageActivationMode; + ServiceDnsName = serviceDnsName; CustomInit(); } @@ -95,5 +99,13 @@ public ServiceResourceProperties() [JsonProperty(PropertyName = "servicePackageActivationMode")] public string ServicePackageActivationMode { get; set; } + /// + /// Gets or sets dns name used for the service. If this is specified, + /// then the service can be accessed via its DNS name instead of + /// service name. + /// + [JsonProperty(PropertyName = "serviceDnsName")] + public string ServiceDnsName { get; set; } + } } diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/Sku.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/Sku.cs new file mode 100644 index 000000000000..04cc20c4e280 --- /dev/null +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/Sku.cs @@ -0,0 +1,69 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.ServiceFabric.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Sku definition + /// + public partial class Sku + { + /// + /// Initializes a new instance of the Sku class. + /// + public Sku() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Sku class. + /// + /// Sku Name. Basic will hav a minimum of 3 seed + /// nodes and Standard a minimum of 5. Basic only allows 1 node type. + /// Possible values include: 'Basic', 'Standard' + public Sku(string name) + { + Name = name; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets sku Name. Basic will hav a minimum of 3 seed nodes and + /// Standard a minimum of 5. Basic only allows 1 node type. Possible + /// values include: 'Basic', 'Standard' + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + } + } + } +} diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/StatefulServiceProperties.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/StatefulServiceProperties.cs index bf7d89094452..230ffdaf3462 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/StatefulServiceProperties.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/StatefulServiceProperties.cs @@ -56,6 +56,9 @@ public StatefulServiceProperties() /// The activation Mode of /// the service package. Possible values include: 'SharedProcess', /// 'ExclusiveProcess' + /// Dns name used for the service. If this + /// is specified, then the service can be accessed via its DNS name + /// instead of service name. /// A flag indicating whether this is a /// persistent service which stores states on the local disk. If it is /// then the value of this property is true, if not it is @@ -73,8 +76,8 @@ public StatefulServiceProperties() /// The definition on how long /// StandBy replicas should be maintained before being removed, /// represented in ISO 8601 format (hh:mm:ss.s). - public StatefulServiceProperties(string placementConstraints = default(string), IList correlationScheme = default(IList), IList serviceLoadMetrics = default(IList), IList servicePlacementPolicies = default(IList), string defaultMoveCost = default(string), string provisioningState = default(string), string serviceTypeName = default(string), PartitionSchemeDescription partitionDescription = default(PartitionSchemeDescription), string servicePackageActivationMode = default(string), bool? hasPersistedState = default(bool?), int? targetReplicaSetSize = default(int?), int? minReplicaSetSize = default(int?), System.DateTime? replicaRestartWaitDuration = default(System.DateTime?), System.DateTime? quorumLossWaitDuration = default(System.DateTime?), System.DateTime? standByReplicaKeepDuration = default(System.DateTime?)) - : base(placementConstraints, correlationScheme, serviceLoadMetrics, servicePlacementPolicies, defaultMoveCost, provisioningState, serviceTypeName, partitionDescription, servicePackageActivationMode) + public StatefulServiceProperties(string placementConstraints = default(string), IList correlationScheme = default(IList), IList serviceLoadMetrics = default(IList), IList servicePlacementPolicies = default(IList), string defaultMoveCost = default(string), string provisioningState = default(string), string serviceTypeName = default(string), PartitionSchemeDescription partitionDescription = default(PartitionSchemeDescription), string servicePackageActivationMode = default(string), string serviceDnsName = default(string), bool? hasPersistedState = default(bool?), int? targetReplicaSetSize = default(int?), int? minReplicaSetSize = default(int?), System.DateTime? replicaRestartWaitDuration = default(System.DateTime?), System.DateTime? quorumLossWaitDuration = default(System.DateTime?), System.DateTime? standByReplicaKeepDuration = default(System.DateTime?)) + : base(placementConstraints, correlationScheme, serviceLoadMetrics, servicePlacementPolicies, defaultMoveCost, provisioningState, serviceTypeName, partitionDescription, servicePackageActivationMode, serviceDnsName) { HasPersistedState = hasPersistedState; TargetReplicaSetSize = targetReplicaSetSize; diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/StatelessServiceProperties.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/StatelessServiceProperties.cs index d082e34a3fa1..5c69d7913c6a 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/StatelessServiceProperties.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/StatelessServiceProperties.cs @@ -56,11 +56,24 @@ public StatelessServiceProperties() /// The activation Mode of /// the service package. Possible values include: 'SharedProcess', /// 'ExclusiveProcess' + /// Dns name used for the service. If this + /// is specified, then the service can be accessed via its DNS name + /// instead of service name. /// The instance count. - public StatelessServiceProperties(string placementConstraints = default(string), IList correlationScheme = default(IList), IList serviceLoadMetrics = default(IList), IList servicePlacementPolicies = default(IList), string defaultMoveCost = default(string), string provisioningState = default(string), string serviceTypeName = default(string), PartitionSchemeDescription partitionDescription = default(PartitionSchemeDescription), string servicePackageActivationMode = default(string), int? instanceCount = default(int?)) - : base(placementConstraints, correlationScheme, serviceLoadMetrics, servicePlacementPolicies, defaultMoveCost, provisioningState, serviceTypeName, partitionDescription, servicePackageActivationMode) + /// Delay duration for + /// RequestDrain feature to ensures that the endpoint advertised by the + /// stateless instance is removed before the delay starts prior to + /// closing the instance. This delay enables existing requests to drain + /// gracefully before the instance actually goes down + /// (https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-application-upgrade-advanced#avoid-connection-drops-during-stateless-service-planned-downtime-preview). + /// It is first interpreted as a string representing an ISO 8601 + /// duration. If that fails, then it is interpreted as a number + /// representing the total number of milliseconds. + public StatelessServiceProperties(string placementConstraints = default(string), IList correlationScheme = default(IList), IList serviceLoadMetrics = default(IList), IList servicePlacementPolicies = default(IList), string defaultMoveCost = default(string), string provisioningState = default(string), string serviceTypeName = default(string), PartitionSchemeDescription partitionDescription = default(PartitionSchemeDescription), string servicePackageActivationMode = default(string), string serviceDnsName = default(string), int? instanceCount = default(int?), string instanceCloseDelayDuration = default(string)) + : base(placementConstraints, correlationScheme, serviceLoadMetrics, servicePlacementPolicies, defaultMoveCost, provisioningState, serviceTypeName, partitionDescription, servicePackageActivationMode, serviceDnsName) { InstanceCount = instanceCount; + InstanceCloseDelayDuration = instanceCloseDelayDuration; CustomInit(); } @@ -75,6 +88,20 @@ public StatelessServiceProperties() [JsonProperty(PropertyName = "instanceCount")] public int? InstanceCount { get; set; } + /// + /// Gets or sets delay duration for RequestDrain feature to ensures + /// that the endpoint advertised by the stateless instance is removed + /// before the delay starts prior to closing the instance. This delay + /// enables existing requests to drain gracefully before the instance + /// actually goes down + /// (https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-application-upgrade-advanced#avoid-connection-drops-during-stateless-service-planned-downtime-preview). + /// It is first interpreted as a string representing an ISO 8601 + /// duration. If that fails, then it is interpreted as a number + /// representing the total number of milliseconds. + /// + [JsonProperty(PropertyName = "instanceCloseDelayDuration")] + public string InstanceCloseDelayDuration { get; set; } + /// /// Validate the object. /// diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/StatelessServiceUpdateProperties.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/StatelessServiceUpdateProperties.cs index d0ff8bdc0535..d0562f1baebd 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/StatelessServiceUpdateProperties.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/StatelessServiceUpdateProperties.cs @@ -51,10 +51,20 @@ public StatelessServiceUpdateProperties() /// service. Possible values include: 'Zero', 'Low', 'Medium', /// 'High' /// The instance count. - public StatelessServiceUpdateProperties(string placementConstraints = default(string), IList correlationScheme = default(IList), IList serviceLoadMetrics = default(IList), IList servicePlacementPolicies = default(IList), string defaultMoveCost = default(string), int? instanceCount = default(int?)) + /// Delay duration for + /// RequestDrain feature to ensures that the endpoint advertised by the + /// stateless instance is removed before the delay starts prior to + /// closing the instance. This delay enables existing requests to drain + /// gracefully before the instance actually goes down + /// (https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-application-upgrade-advanced#avoid-connection-drops-during-stateless-service-planned-downtime-preview). + /// It is first interpreted as a string representing an ISO 8601 + /// duration. If that fails, then it is interpreted as a number + /// representing the total number of milliseconds. + public StatelessServiceUpdateProperties(string placementConstraints = default(string), IList correlationScheme = default(IList), IList serviceLoadMetrics = default(IList), IList servicePlacementPolicies = default(IList), string defaultMoveCost = default(string), int? instanceCount = default(int?), string instanceCloseDelayDuration = default(string)) : base(placementConstraints, correlationScheme, serviceLoadMetrics, servicePlacementPolicies, defaultMoveCost) { InstanceCount = instanceCount; + InstanceCloseDelayDuration = instanceCloseDelayDuration; CustomInit(); } @@ -69,6 +79,20 @@ public StatelessServiceUpdateProperties() [JsonProperty(PropertyName = "instanceCount")] public int? InstanceCount { get; set; } + /// + /// Gets or sets delay duration for RequestDrain feature to ensures + /// that the endpoint advertised by the stateless instance is removed + /// before the delay starts prior to closing the instance. This delay + /// enables existing requests to drain gracefully before the instance + /// actually goes down + /// (https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-application-upgrade-advanced#avoid-connection-drops-during-stateless-service-planned-downtime-preview). + /// It is first interpreted as a string representing an ISO 8601 + /// duration. If that fails, then it is interpreted as a number + /// representing the total number of milliseconds. + /// + [JsonProperty(PropertyName = "instanceCloseDelayDuration")] + public string InstanceCloseDelayDuration { get; set; } + /// /// Validate the object. /// diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/SubResource.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/SubResource.cs new file mode 100644 index 000000000000..80278c6283e6 --- /dev/null +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/SubResource.cs @@ -0,0 +1,53 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.ServiceFabric.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Azure resource identifier. + /// + public partial class SubResource : IResource + { + /// + /// Initializes a new instance of the SubResource class. + /// + public SubResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SubResource class. + /// + /// Azure resource identifier. + public SubResource(string id = default(string)) + { + Id = id; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets azure resource identifier. + /// + [JsonProperty(PropertyName = "id")] + public string Id { get; set; } + + } +} diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/UniformInt64RangePartitionSchemeDescription.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/UniformInt64RangePartitionSchemeDescription.cs index 95d124facd5f..4c6e2e60310a 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/UniformInt64RangePartitionSchemeDescription.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/UniformInt64RangePartitionSchemeDescription.cs @@ -37,11 +37,11 @@ public UniformInt64RangePartitionSchemeDescription() /// The number of partitions. /// String indicating the lower bound of the /// partition key range that - /// should be split between the partition ‘Count’ + /// should be split between the partition ‘count’ /// /// String indicating the upper bound of the /// partition key range that - /// should be split between the partition ‘Count’ + /// should be split between the partition ‘count’ /// public UniformInt64RangePartitionSchemeDescription(int count, string lowKey, string highKey) { @@ -59,25 +59,25 @@ public UniformInt64RangePartitionSchemeDescription(int count, string lowKey, str /// /// Gets or sets the number of partitions. /// - [JsonProperty(PropertyName = "Count")] + [JsonProperty(PropertyName = "count")] public int Count { get; set; } /// /// Gets or sets string indicating the lower bound of the partition key /// range that - /// should be split between the partition ‘Count’ + /// should be split between the partition ‘count’ /// /// - [JsonProperty(PropertyName = "LowKey")] + [JsonProperty(PropertyName = "lowKey")] public string LowKey { get; set; } /// /// Gets or sets string indicating the upper bound of the partition key /// range that - /// should be split between the partition ‘Count’ + /// should be split between the partition ‘count’ /// /// - [JsonProperty(PropertyName = "HighKey")] + [JsonProperty(PropertyName = "highKey")] public string HighKey { get; set; } /// diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/UserAssignedIdentity.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/UserAssignedIdentity.cs new file mode 100644 index 000000000000..d418caf00a06 --- /dev/null +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/UserAssignedIdentity.cs @@ -0,0 +1,58 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.ServiceFabric.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class UserAssignedIdentity + { + /// + /// Initializes a new instance of the UserAssignedIdentity class. + /// + public UserAssignedIdentity() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the UserAssignedIdentity class. + /// + /// The principal id of user assigned + /// identity. + /// The client id of user assigned + /// identity. + public UserAssignedIdentity(string principalId = default(string), string clientId = default(string)) + { + PrincipalId = principalId; + ClientId = clientId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the principal id of user assigned identity. + /// + [JsonProperty(PropertyName = "principalId")] + public string PrincipalId { get; private set; } + + /// + /// Gets the client id of user assigned identity. + /// + [JsonProperty(PropertyName = "clientId")] + public string ClientId { get; private set; } + + } +} diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/VMSSExtension.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/VMSSExtension.cs new file mode 100644 index 000000000000..34ca919e65f6 --- /dev/null +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/VMSSExtension.cs @@ -0,0 +1,177 @@ +// +// 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.ServiceFabric.Models +{ + using Microsoft.Rest; + using Microsoft.Rest.Serialization; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Specifies set of extensions that should be installed onto the virtual + /// machines. + /// + [Rest.Serialization.JsonTransformation] + public partial class VMSSExtension + { + /// + /// Initializes a new instance of the VMSSExtension class. + /// + public VMSSExtension() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VMSSExtension class. + /// + /// The name of the extension. + /// The name of the extension handler + /// publisher. + /// Specifies the type of the extension; an example + /// is "CustomScriptExtension". + /// Specifies the version of the + /// script handler. + /// If a value is provided and is + /// different from the previous value, the extension handler will be + /// forced to update even if the extension configuration has not + /// changed. + /// Indicates whether the + /// extension should use a newer minor version if one is available at + /// deployment time. Once deployed, however, the extension will not + /// upgrade minor versions unless redeployed, even with this property + /// set to true. + /// Json formatted public settings for the + /// extension. + /// The extension can contain either + /// protectedSettings or protectedSettingsFromKeyVault or no protected + /// settings at all. + /// The provisioning state, which only + /// appears in the response. + /// Collection of extension + /// names after which this extension needs to be provisioned. + public VMSSExtension(string name, string publisher, string type, string typeHandlerVersion, string forceUpdateTag = default(string), bool? autoUpgradeMinorVersion = default(bool?), object settings = default(object), object protectedSettings = default(object), string provisioningState = default(string), IList provisionAfterExtensions = default(IList)) + { + Name = name; + ForceUpdateTag = forceUpdateTag; + Publisher = publisher; + Type = type; + TypeHandlerVersion = typeHandlerVersion; + AutoUpgradeMinorVersion = autoUpgradeMinorVersion; + Settings = settings; + ProtectedSettings = protectedSettings; + ProvisioningState = provisioningState; + ProvisionAfterExtensions = provisionAfterExtensions; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the name of the extension. + /// + [JsonProperty(PropertyName = "name")] + public string Name { get; set; } + + /// + /// Gets or sets if a value is provided and is different from the + /// previous value, the extension handler will be forced to update even + /// if the extension configuration has not changed. + /// + [JsonProperty(PropertyName = "properties.forceUpdateTag")] + public string ForceUpdateTag { get; set; } + + /// + /// Gets or sets the name of the extension handler publisher. + /// + [JsonProperty(PropertyName = "properties.publisher")] + public string Publisher { get; set; } + + /// + /// Gets or sets specifies the type of the extension; an example is + /// "CustomScriptExtension". + /// + [JsonProperty(PropertyName = "properties.type")] + public string Type { get; set; } + + /// + /// Gets or sets specifies the version of the script handler. + /// + [JsonProperty(PropertyName = "properties.typeHandlerVersion")] + public string TypeHandlerVersion { get; set; } + + /// + /// Gets or sets indicates whether the extension should use a newer + /// minor version if one is available at deployment time. Once + /// deployed, however, the extension will not upgrade minor versions + /// unless redeployed, even with this property set to true. + /// + [JsonProperty(PropertyName = "properties.autoUpgradeMinorVersion")] + public bool? AutoUpgradeMinorVersion { get; set; } + + /// + /// Gets or sets json formatted public settings for the extension. + /// + [JsonProperty(PropertyName = "properties.settings")] + public object Settings { get; set; } + + /// + /// Gets or sets the extension can contain either protectedSettings or + /// protectedSettingsFromKeyVault or no protected settings at all. + /// + [JsonProperty(PropertyName = "properties.protectedSettings")] + public object ProtectedSettings { get; set; } + + /// + /// Gets the provisioning state, which only appears in the response. + /// + [JsonProperty(PropertyName = "properties.provisioningState")] + public string ProvisioningState { get; private set; } + + /// + /// Gets or sets collection of extension names after which this + /// extension needs to be provisioned. + /// + [JsonProperty(PropertyName = "properties.provisionAfterExtensions")] + public IList ProvisionAfterExtensions { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (Name == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + } + if (Publisher == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Publisher"); + } + if (Type == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Type"); + } + if (TypeHandlerVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "TypeHandlerVersion"); + } + } + } +} diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/VaultCertificate.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/VaultCertificate.cs new file mode 100644 index 000000000000..96da69c220f4 --- /dev/null +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/VaultCertificate.cs @@ -0,0 +1,110 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.ServiceFabric.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Linq; + + /// + /// Describes a single certificate reference in a Key Vault, and where the + /// certificate should reside on the VM. + /// + public partial class VaultCertificate + { + /// + /// Initializes a new instance of the VaultCertificate class. + /// + public VaultCertificate() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VaultCertificate class. + /// + /// This is the URL of a certificate that + /// has been uploaded to Key Vault as a secret. For adding a secret to + /// the Key Vault, see [Add a key or secret to the key + /// vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). + /// In this case, your certificate needs to be It is the Base64 + /// encoding of the following JSON Object which is encoded in UTF-8: + /// <br><br> {<br> + /// "data":"<Base64-encoded-certificate>",<br> + /// "dataType":"pfx",<br> + /// "password":"<pfx-file-password>"<br>} + /// For Windows VMs, specifies the + /// certificate store on the Virtual Machine to which the certificate + /// should be added. The specified certificate store is implicitly in + /// the LocalMachine account. <br><br>For Linux VMs, the + /// certificate file is placed under the /var/lib/waagent directory, + /// with the file name <UppercaseThumbprint>.crt for the X509 + /// certificate file and <UppercaseThumbprint>.prv for private + /// key. Both of these files are .pem formatted. + public VaultCertificate(string certificateUrl, string certificateStore) + { + CertificateUrl = certificateUrl; + CertificateStore = certificateStore; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets this is the URL of a certificate that has been + /// uploaded to Key Vault as a secret. For adding a secret to the Key + /// Vault, see [Add a key or secret to the key + /// vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). + /// In this case, your certificate needs to be It is the Base64 + /// encoding of the following JSON Object which is encoded in UTF-8: + /// &lt;br&gt;&lt;br&gt; {&lt;br&gt; + /// "data":"&lt;Base64-encoded-certificate&gt;",&lt;br&gt; + /// "dataType":"pfx",&lt;br&gt; + /// "password":"&lt;pfx-file-password&gt;"&lt;br&gt;} + /// + [JsonProperty(PropertyName = "certificateUrl")] + public string CertificateUrl { get; set; } + + /// + /// Gets or sets for Windows VMs, specifies the certificate store on + /// the Virtual Machine to which the certificate should be added. The + /// specified certificate store is implicitly in the LocalMachine + /// account. &lt;br&gt;&lt;br&gt;For Linux VMs, the + /// certificate file is placed under the /var/lib/waagent directory, + /// with the file name &lt;UppercaseThumbprint&gt;.crt for the + /// X509 certificate file and &lt;UppercaseThumbprint&gt;.prv + /// for private key. Both of these files are .pem formatted. + /// + [JsonProperty(PropertyName = "certificateStore")] + public string CertificateStore { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (CertificateUrl == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "CertificateUrl"); + } + if (CertificateStore == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "CertificateStore"); + } + } + } +} diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/VaultSecretGroup.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/VaultSecretGroup.cs new file mode 100644 index 000000000000..42351c4d4eea --- /dev/null +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/VaultSecretGroup.cs @@ -0,0 +1,94 @@ +// +// 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.ServiceFabric.Models +{ + using Microsoft.Rest; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Specifies set of certificates that should be installed onto the virtual + /// machines. + /// + public partial class VaultSecretGroup + { + /// + /// Initializes a new instance of the VaultSecretGroup class. + /// + public VaultSecretGroup() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VaultSecretGroup class. + /// + /// The relative URL of the Key Vault + /// containing all of the certificates in VaultCertificates. + /// The list of key vault references in + /// SourceVault which contain certificates. + public VaultSecretGroup(SubResource sourceVault, IList vaultCertificates) + { + SourceVault = sourceVault; + VaultCertificates = vaultCertificates; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the relative URL of the Key Vault containing all of + /// the certificates in VaultCertificates. + /// + [JsonProperty(PropertyName = "sourceVault")] + public SubResource SourceVault { get; set; } + + /// + /// Gets or sets the list of key vault references in SourceVault which + /// contain certificates. + /// + [JsonProperty(PropertyName = "vaultCertificates")] + public IList VaultCertificates { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (SourceVault == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "SourceVault"); + } + if (VaultCertificates == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "VaultCertificates"); + } + if (VaultCertificates != null) + { + foreach (var element in VaultCertificates) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } +} diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/NodeTypesOperations.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/NodeTypesOperations.cs new file mode 100644 index 000000000000..06fa233439b6 --- /dev/null +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/NodeTypesOperations.cs @@ -0,0 +1,2069 @@ +// +// 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.ServiceFabric +{ + 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; + + /// + /// NodeTypesOperations operations. + /// + internal partial class NodeTypesOperations : IServiceOperations, INodeTypesOperations + { + /// + /// Initializes a new instance of the NodeTypesOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal NodeTypesOperations(ServiceFabricManagementClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the ServiceFabricManagementClient + /// + public ServiceFabricManagementClient Client { get; private set; } + + /// + /// Gets the list of Node types of the specified managed cluster. + /// + /// + /// Gets all Node types of the specified managed cluster. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// 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>> ListByManagedClustersWithHttpMessagesAsync(string resourceGroupName, string clusterName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (clusterName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); + } + string apiVersion = "2020-01-01-preview"; + // 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("apiVersion", apiVersion); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListByManagedClusters", 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").ToString(); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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; + } + + /// + /// Restarts one or more nodes on the node type. + /// + /// + /// Restarts one or more nodes on the node type. It will disable the fabric + /// nodes, trigger a restart on the VMs and activate the nodes back again. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// The name of the node type. + /// + /// + /// parameters for restart action. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task RestartWithHttpMessagesAsync(string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginRestartWithHttpMessagesAsync(resourceGroupName, clusterName, nodeTypeName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Reimages one or more nodes on the node type. + /// + /// + /// Reimages one or more nodes on the node type. It will disable the fabric + /// nodes, trigger a reimage on the VMs and activate the nodes back again. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// The name of the node type. + /// + /// + /// parameters for reimage action. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task ReimageWithHttpMessagesAsync(string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginReimageWithHttpMessagesAsync(resourceGroupName, clusterName, nodeTypeName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes one or more nodes on the node type. + /// + /// + /// Deletes one or more nodes on the node type. It will disable the fabric + /// nodes, trigger a delete on the VMs and removes the state from the cluster. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// The name of the node type. + /// + /// + /// parameters for delete action. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task DeleteNodeWithHttpMessagesAsync(string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteNodeWithHttpMessagesAsync(resourceGroupName, clusterName, nodeTypeName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a Service Fabric node type. + /// + /// + /// Get a Service Fabric node type of a given managed cluster. + /// + /// + /// 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> GetWithHttpMessagesAsync(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"); + } + string apiVersion = "2020-01-01-preview"; + // 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("apiVersion", apiVersion); + 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.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}").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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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; + } + + /// + /// Creates or updates a Service Fabric node type. + /// + /// + /// Create or update a Service Fabric node type of a given managed cluster. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// The name of the node type. + /// + /// + /// The node type resource. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, string nodeTypeName, NodeType parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, nodeTypeName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Updates the configuration of a node type of a given managed cluster. + /// + /// + /// Update the configuration of a node type of a given managed cluster. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// The name of the node type. + /// + /// + /// The parameters to update the node type configuration. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeUpdateParameters parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send Request + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, nodeTypeName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Deletes a Service Fabric node type. + /// + /// + /// Delete a Service Fabric node type of a given managed cluster. + /// + /// + /// 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. + /// + public async Task DeleteWithHttpMessagesAsync(string resourceGroupName, string clusterName, string nodeTypeName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, clusterName, nodeTypeName, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Restarts one or more nodes on the node type. + /// + /// + /// Restarts one or more nodes on the node type. It will disable the fabric + /// nodes, trigger a restart on the VMs and activate the nodes back again. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// The name of the node type. + /// + /// + /// parameters for restart action. + /// + /// + /// 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 BeginRestartWithHttpMessagesAsync(string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionParameters parameters, 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"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + string apiVersion = "2020-01-01-preview"; + // 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("apiVersion", apiVersion); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginRestart", 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}/restart").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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new 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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Reimages one or more nodes on the node type. + /// + /// + /// Reimages one or more nodes on the node type. It will disable the fabric + /// nodes, trigger a reimage on the VMs and activate the nodes back again. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// The name of the node type. + /// + /// + /// parameters for reimage action. + /// + /// + /// 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 BeginReimageWithHttpMessagesAsync(string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionParameters parameters, 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"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + string apiVersion = "2020-01-01-preview"; + // 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("apiVersion", apiVersion); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginReimage", 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}/reimage").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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new 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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Deletes one or more nodes on the node type. + /// + /// + /// Deletes one or more nodes on the node type. It will disable the fabric + /// nodes, trigger a delete on the VMs and removes the state from the cluster. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// The name of the node type. + /// + /// + /// parameters for delete action. + /// + /// + /// 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 BeginDeleteNodeWithHttpMessagesAsync(string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionParameters parameters, 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"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + string apiVersion = "2020-01-01-preview"; + // 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("apiVersion", apiVersion); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginDeleteNode", 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}/deleteNode").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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new 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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Creates or updates a Service Fabric node type. + /// + /// + /// Create or update a Service Fabric node type of a given managed cluster. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// The name of the node type. + /// + /// + /// The node type resource. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, string nodeTypeName, NodeType parameters, 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"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + string apiVersion = "2020-01-01-preview"; + // 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("apiVersion", apiVersion); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}").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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 201 && (int)_statusCode != 202) + { + var ex = new 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); + } + } + // 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); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _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; + } + + /// + /// Updates the configuration of a node type of a given managed cluster. + /// + /// + /// Update the configuration of a node type of a given managed cluster. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// The name of the node type. + /// + /// + /// The parameters to update the node type configuration. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> BeginUpdateWithHttpMessagesAsync(string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeUpdateParameters parameters, 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"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + string apiVersion = "2020-01-01-preview"; + // 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("apiVersion", apiVersion); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}").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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("PATCH"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200 && (int)_statusCode != 202) + { + var ex = new 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); + } + } + // Deserialize Response + if ((int)_statusCode == 202) + { + _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; + } + + /// + /// Deletes a Service Fabric node type. + /// + /// + /// Delete a Service Fabric node type of a given managed cluster. + /// + /// + /// 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 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 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"); + } + string apiVersion = "2020-01-01-preview"; + // 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("apiVersion", apiVersion); + 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.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}").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 (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(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 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(); + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + /// + /// Gets the list of Node types of the specified managed cluster. + /// + /// + /// Gets all Node types of the specified managed cluster. + /// + /// + /// 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>> ListByManagedClustersNextWithHttpMessagesAsync(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, "ListByManagedClustersNext", 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/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/NodeTypesOperationsExtensions.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/NodeTypesOperationsExtensions.cs new file mode 100644 index 000000000000..23ad256f683d --- /dev/null +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/NodeTypesOperationsExtensions.cs @@ -0,0 +1,835 @@ +// +// 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.ServiceFabric +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for NodeTypesOperations. + /// + public static partial class NodeTypesOperationsExtensions + { + /// + /// Gets the list of Node types of the specified managed cluster. + /// + /// + /// Gets all Node types of the specified managed cluster. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + public static IPage ListByManagedClusters(this INodeTypesOperations operations, string resourceGroupName, string clusterName) + { + return operations.ListByManagedClustersAsync(resourceGroupName, clusterName).GetAwaiter().GetResult(); + } + + /// + /// Gets the list of Node types of the specified managed cluster. + /// + /// + /// Gets all Node types of the specified managed cluster. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByManagedClustersAsync(this INodeTypesOperations operations, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByManagedClustersWithHttpMessagesAsync(resourceGroupName, clusterName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Restarts one or more nodes on the node type. + /// + /// + /// Restarts one or more nodes on the node type. It will disable the fabric + /// nodes, trigger a restart on the VMs and activate the nodes back again. + /// + /// + /// 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. + /// + /// + /// parameters for restart action. + /// + public static void Restart(this INodeTypesOperations operations, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionParameters parameters) + { + operations.RestartAsync(resourceGroupName, clusterName, nodeTypeName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Restarts one or more nodes on the node type. + /// + /// + /// Restarts one or more nodes on the node type. It will disable the fabric + /// nodes, trigger a restart on the VMs and activate the nodes back again. + /// + /// + /// 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. + /// + /// + /// parameters for restart action. + /// + /// + /// The cancellation token. + /// + public static async Task RestartAsync(this INodeTypesOperations operations, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.RestartWithHttpMessagesAsync(resourceGroupName, clusterName, nodeTypeName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Reimages one or more nodes on the node type. + /// + /// + /// Reimages one or more nodes on the node type. It will disable the fabric + /// nodes, trigger a reimage on the VMs and activate the nodes back again. + /// + /// + /// 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. + /// + /// + /// parameters for reimage action. + /// + public static void Reimage(this INodeTypesOperations operations, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionParameters parameters) + { + operations.ReimageAsync(resourceGroupName, clusterName, nodeTypeName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Reimages one or more nodes on the node type. + /// + /// + /// Reimages one or more nodes on the node type. It will disable the fabric + /// nodes, trigger a reimage on the VMs and activate the nodes back again. + /// + /// + /// 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. + /// + /// + /// parameters for reimage action. + /// + /// + /// The cancellation token. + /// + public static async Task ReimageAsync(this INodeTypesOperations operations, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.ReimageWithHttpMessagesAsync(resourceGroupName, clusterName, nodeTypeName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Deletes one or more nodes on the node type. + /// + /// + /// Deletes one or more nodes on the node type. It will disable the fabric + /// nodes, trigger a delete on the VMs and removes the state from the cluster. + /// + /// + /// 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. + /// + /// + /// parameters for delete action. + /// + public static void DeleteNode(this INodeTypesOperations operations, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionParameters parameters) + { + operations.DeleteNodeAsync(resourceGroupName, clusterName, nodeTypeName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Deletes one or more nodes on the node type. + /// + /// + /// Deletes one or more nodes on the node type. It will disable the fabric + /// nodes, trigger a delete on the VMs and removes the state from the cluster. + /// + /// + /// 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. + /// + /// + /// parameters for delete action. + /// + /// + /// The cancellation token. + /// + public static async Task DeleteNodeAsync(this INodeTypesOperations operations, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteNodeWithHttpMessagesAsync(resourceGroupName, clusterName, nodeTypeName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets a Service Fabric node type. + /// + /// + /// Get a Service Fabric node type of a given managed cluster. + /// + /// + /// 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 NodeType Get(this INodeTypesOperations operations, string resourceGroupName, string clusterName, string nodeTypeName) + { + return operations.GetAsync(resourceGroupName, clusterName, nodeTypeName).GetAwaiter().GetResult(); + } + + /// + /// Gets a Service Fabric node type. + /// + /// + /// Get a Service Fabric node type of a given managed cluster. + /// + /// + /// 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 GetAsync(this INodeTypesOperations operations, string resourceGroupName, string clusterName, string nodeTypeName, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, clusterName, nodeTypeName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Creates or updates a Service Fabric node type. + /// + /// + /// Create or update a Service Fabric node type of a given managed cluster. + /// + /// + /// 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 node type resource. + /// + public static NodeType CreateOrUpdate(this INodeTypesOperations operations, string resourceGroupName, string clusterName, string nodeTypeName, NodeType parameters) + { + return operations.CreateOrUpdateAsync(resourceGroupName, clusterName, nodeTypeName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a Service Fabric node type. + /// + /// + /// Create or update a Service Fabric node type of a given managed cluster. + /// + /// + /// 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 node type resource. + /// + /// + /// The cancellation token. + /// + public static async Task CreateOrUpdateAsync(this INodeTypesOperations operations, string resourceGroupName, string clusterName, string nodeTypeName, NodeType parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, nodeTypeName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates the configuration of a node type of a given managed cluster. + /// + /// + /// Update the configuration of a node type of a given managed cluster. + /// + /// + /// 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 parameters to update the node type configuration. + /// + public static NodeType Update(this INodeTypesOperations operations, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeUpdateParameters parameters) + { + return operations.UpdateAsync(resourceGroupName, clusterName, nodeTypeName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates the configuration of a node type of a given managed cluster. + /// + /// + /// Update the configuration of a node type of a given managed cluster. + /// + /// + /// 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 parameters to update the node type configuration. + /// + /// + /// The cancellation token. + /// + 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, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a Service Fabric node type. + /// + /// + /// Delete a Service Fabric node type of a given managed cluster. + /// + /// + /// 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 void Delete(this INodeTypesOperations operations, string resourceGroupName, string clusterName, string nodeTypeName) + { + operations.DeleteAsync(resourceGroupName, clusterName, nodeTypeName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a Service Fabric node type. + /// + /// + /// Delete a Service Fabric node type of a given managed cluster. + /// + /// + /// 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 DeleteAsync(this INodeTypesOperations operations, string resourceGroupName, string clusterName, string nodeTypeName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, clusterName, nodeTypeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Restarts one or more nodes on the node type. + /// + /// + /// Restarts one or more nodes on the node type. It will disable the fabric + /// nodes, trigger a restart on the VMs and activate the nodes back again. + /// + /// + /// 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. + /// + /// + /// parameters for restart action. + /// + public static void BeginRestart(this INodeTypesOperations operations, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionParameters parameters) + { + operations.BeginRestartAsync(resourceGroupName, clusterName, nodeTypeName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Restarts one or more nodes on the node type. + /// + /// + /// Restarts one or more nodes on the node type. It will disable the fabric + /// nodes, trigger a restart on the VMs and activate the nodes back again. + /// + /// + /// 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. + /// + /// + /// parameters for restart action. + /// + /// + /// The cancellation token. + /// + public static async Task BeginRestartAsync(this INodeTypesOperations operations, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginRestartWithHttpMessagesAsync(resourceGroupName, clusterName, nodeTypeName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Reimages one or more nodes on the node type. + /// + /// + /// Reimages one or more nodes on the node type. It will disable the fabric + /// nodes, trigger a reimage on the VMs and activate the nodes back again. + /// + /// + /// 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. + /// + /// + /// parameters for reimage action. + /// + public static void BeginReimage(this INodeTypesOperations operations, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionParameters parameters) + { + operations.BeginReimageAsync(resourceGroupName, clusterName, nodeTypeName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Reimages one or more nodes on the node type. + /// + /// + /// Reimages one or more nodes on the node type. It will disable the fabric + /// nodes, trigger a reimage on the VMs and activate the nodes back again. + /// + /// + /// 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. + /// + /// + /// parameters for reimage action. + /// + /// + /// The cancellation token. + /// + public static async Task BeginReimageAsync(this INodeTypesOperations operations, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginReimageWithHttpMessagesAsync(resourceGroupName, clusterName, nodeTypeName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Deletes one or more nodes on the node type. + /// + /// + /// Deletes one or more nodes on the node type. It will disable the fabric + /// nodes, trigger a delete on the VMs and removes the state from the cluster. + /// + /// + /// 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. + /// + /// + /// parameters for delete action. + /// + public static void BeginDeleteNode(this INodeTypesOperations operations, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionParameters parameters) + { + operations.BeginDeleteNodeAsync(resourceGroupName, clusterName, nodeTypeName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Deletes one or more nodes on the node type. + /// + /// + /// Deletes one or more nodes on the node type. It will disable the fabric + /// nodes, trigger a delete on the VMs and removes the state from the cluster. + /// + /// + /// 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. + /// + /// + /// parameters for delete action. + /// + /// + /// The cancellation token. + /// + public static async Task BeginDeleteNodeAsync(this INodeTypesOperations operations, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteNodeWithHttpMessagesAsync(resourceGroupName, clusterName, nodeTypeName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Creates or updates a Service Fabric node type. + /// + /// + /// Create or update a Service Fabric node type of a given managed cluster. + /// + /// + /// 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 node type resource. + /// + public static NodeType BeginCreateOrUpdate(this INodeTypesOperations operations, string resourceGroupName, string clusterName, string nodeTypeName, NodeType parameters) + { + return operations.BeginCreateOrUpdateAsync(resourceGroupName, clusterName, nodeTypeName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Creates or updates a Service Fabric node type. + /// + /// + /// Create or update a Service Fabric node type of a given managed cluster. + /// + /// + /// 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 node type resource. + /// + /// + /// The cancellation token. + /// + public static async Task BeginCreateOrUpdateAsync(this INodeTypesOperations operations, string resourceGroupName, string clusterName, string nodeTypeName, NodeType parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, nodeTypeName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Updates the configuration of a node type of a given managed cluster. + /// + /// + /// Update the configuration of a node type of a given managed cluster. + /// + /// + /// 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 parameters to update the node type configuration. + /// + public static NodeType BeginUpdate(this INodeTypesOperations operations, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeUpdateParameters parameters) + { + return operations.BeginUpdateAsync(resourceGroupName, clusterName, nodeTypeName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Updates the configuration of a node type of a given managed cluster. + /// + /// + /// Update the configuration of a node type of a given managed cluster. + /// + /// + /// 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 parameters to update the node type configuration. + /// + /// + /// The cancellation token. + /// + public static async Task BeginUpdateAsync(this INodeTypesOperations operations, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeUpdateParameters parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, clusterName, nodeTypeName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Deletes a Service Fabric node type. + /// + /// + /// Delete a Service Fabric node type of a given managed cluster. + /// + /// + /// 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 void BeginDelete(this INodeTypesOperations operations, string resourceGroupName, string clusterName, string nodeTypeName) + { + operations.BeginDeleteAsync(resourceGroupName, clusterName, nodeTypeName).GetAwaiter().GetResult(); + } + + /// + /// Deletes a Service Fabric node type. + /// + /// + /// Delete a Service Fabric node type of a given managed cluster. + /// + /// + /// 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 BeginDeleteAsync(this INodeTypesOperations operations, string resourceGroupName, string clusterName, string nodeTypeName, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, clusterName, nodeTypeName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Gets the list of Node types of the specified managed cluster. + /// + /// + /// Gets all Node types of the specified managed cluster. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListByManagedClustersNext(this INodeTypesOperations operations, string nextPageLink) + { + return operations.ListByManagedClustersNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Gets the list of Node types of the specified managed cluster. + /// + /// + /// Gets all Node types of the specified managed cluster. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async Task> ListByManagedClustersNextAsync(this INodeTypesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListByManagedClustersNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/SdkInfo_ServiceFabricManagementClient.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/SdkInfo_ServiceFabricManagementClient.cs index 14ab08a0facb..005177d499cb 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/SdkInfo_ServiceFabricManagementClient.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/SdkInfo_ServiceFabricManagementClient.cs @@ -19,26 +19,19 @@ public static IEnumerable> ApiInfo_ServiceFabricMa { return new Tuple[] { - new Tuple("ServiceFabric", "ApplicationTypeVersions", "2019-03-01"), - new Tuple("ServiceFabric", "ApplicationTypes", "2019-03-01"), - new Tuple("ServiceFabric", "Applications", "2019-03-01"), - new Tuple("ServiceFabric", "ClusterVersions", "2019-03-01"), - new Tuple("ServiceFabric", "Clusters", "2019-03-01"), - new Tuple("ServiceFabric", "Operations", "2019-03-01"), - new Tuple("ServiceFabric", "Services", "2019-03-01"), + new Tuple("ServiceFabric", "ApplicationTypeVersions", "2020-03-01"), + new Tuple("ServiceFabric", "ApplicationTypes", "2020-03-01"), + new Tuple("ServiceFabric", "Applications", "2020-03-01"), + new Tuple("ServiceFabric", "ClusterVersions", "2020-03-01"), + new Tuple("ServiceFabric", "Clusters", "2020-03-01"), + new Tuple("ServiceFabric", "ManagedClusterVersions", "2020-01-01-preview"), + new Tuple("ServiceFabric", "ManagedClusters", "2020-01-01-preview"), + new Tuple("ServiceFabric", "NodeTypes", "2020-01-01-preview"), + new Tuple("ServiceFabric", "Operations", "2020-01-01-preview"), + new Tuple("ServiceFabric", "Operations", "2020-03-01"), + new Tuple("ServiceFabric", "Services", "2020-03-01"), }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "latest"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4283"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/servicefabric/resource-manager/readme.md --csharp --version=latest --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 = "397e41997764b35729dd4f39ec80a0f98c4456eb"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ServiceFabricManagementClient.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ServiceFabricManagementClient.cs index 63b63fa33027..18f36768399c 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ServiceFabricManagementClient.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ServiceFabricManagementClient.cs @@ -46,12 +46,6 @@ public partial class ServiceFabricManagementClient : ServiceClient public ServiceClientCredentials Credentials { get; private set; } - /// - /// The version of the Service Fabric resource provider API. This is a required - /// parameter and it's value must be "2019-03-01" for this specification. - /// - public string ApiVersion { get; private set; } - /// /// The customer subscription identifier. /// @@ -110,6 +104,21 @@ public partial class ServiceFabricManagementClient : ServiceClient public virtual IServicesOperations Services { get; private set; } + /// + /// Gets the IManagedClustersOperations. + /// + public virtual IManagedClustersOperations ManagedClusters { get; private set; } + + /// + /// Gets the IManagedClusterVersionsOperations. + /// + public virtual IManagedClusterVersionsOperations ManagedClusterVersions { get; private set; } + + /// + /// Gets the INodeTypesOperations. + /// + public virtual INodeTypesOperations NodeTypes { get; private set; } + /// /// Initializes a new instance of the ServiceFabricManagementClient class. /// @@ -358,8 +367,10 @@ private void Initialize() ApplicationTypeVersions = new ApplicationTypeVersionsOperations(this); Applications = new ApplicationsOperations(this); Services = new ServicesOperations(this); + ManagedClusters = new ManagedClustersOperations(this); + ManagedClusterVersions = new ManagedClusterVersionsOperations(this); + NodeTypes = new NodeTypesOperations(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2019-03-01"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; @@ -391,8 +402,8 @@ private void Initialize() }; SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("partitionScheme")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("partitionScheme")); - SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("Type")); - DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("Type")); + SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("type")); + DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("type")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("serviceKind")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("serviceKind")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("serviceKind")); diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ServicesOperations.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ServicesOperations.cs index c3d8f2571a41..7397bab3a264 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ServicesOperations.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ServicesOperations.cs @@ -113,6 +113,7 @@ internal ServicesOperations(ServiceFabricManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "serviceName"); } + string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -124,6 +125,7 @@ internal ServicesOperations(ServiceFabricManagementClient client) tracingParameters.Add("clusterName", clusterName); tracingParameters.Add("applicationName", applicationName); tracingParameters.Add("serviceName", serviceName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } @@ -136,9 +138,9 @@ internal ServicesOperations(ServiceFabricManagementClient client) _url = _url.Replace("{applicationName}", System.Uri.EscapeDataString(applicationName)); _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -418,6 +420,7 @@ internal ServicesOperations(ServiceFabricManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "applicationName"); } + string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -428,6 +431,7 @@ internal ServicesOperations(ServiceFabricManagementClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("clusterName", clusterName); tracingParameters.Add("applicationName", applicationName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -439,9 +443,9 @@ internal ServicesOperations(ServiceFabricManagementClient client) _url = _url.Replace("{clusterName}", System.Uri.EscapeDataString(clusterName)); _url = _url.Replace("{applicationName}", System.Uri.EscapeDataString(applicationName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -632,6 +636,7 @@ internal ServicesOperations(ServiceFabricManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } + string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -643,6 +648,7 @@ internal ServicesOperations(ServiceFabricManagementClient client) tracingParameters.Add("clusterName", clusterName); tracingParameters.Add("applicationName", applicationName); tracingParameters.Add("serviceName", serviceName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); @@ -656,9 +662,9 @@ internal ServicesOperations(ServiceFabricManagementClient client) _url = _url.Replace("{applicationName}", System.Uri.EscapeDataString(applicationName)); _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -855,6 +861,7 @@ internal ServicesOperations(ServiceFabricManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } + string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -866,6 +873,7 @@ internal ServicesOperations(ServiceFabricManagementClient client) tracingParameters.Add("clusterName", clusterName); tracingParameters.Add("applicationName", applicationName); tracingParameters.Add("serviceName", serviceName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); @@ -879,9 +887,9 @@ internal ServicesOperations(ServiceFabricManagementClient client) _url = _url.Replace("{applicationName}", System.Uri.EscapeDataString(applicationName)); _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) { @@ -1068,6 +1076,7 @@ internal ServicesOperations(ServiceFabricManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "serviceName"); } + string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1079,6 +1088,7 @@ internal ServicesOperations(ServiceFabricManagementClient client) tracingParameters.Add("clusterName", clusterName); tracingParameters.Add("applicationName", applicationName); tracingParameters.Add("serviceName", serviceName); + tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginDelete", tracingParameters); } @@ -1091,9 +1101,9 @@ internal ServicesOperations(ServiceFabricManagementClient client) _url = _url.Replace("{applicationName}", System.Uri.EscapeDataString(applicationName)); _url = _url.Replace("{serviceName}", System.Uri.EscapeDataString(serviceName)); List _queryParameters = new List(); - if (Client.ApiVersion != null) + if (apiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); } if (_queryParameters.Count > 0) {