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 8fdd4e338b30..72abb86831ab 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ApplicationTypeVersionsOperations.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ApplicationTypeVersionsOperations.cs @@ -113,7 +113,6 @@ internal ApplicationTypeVersionsOperations(ServiceFabricManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "version"); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -125,7 +124,6 @@ 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); } @@ -138,9 +136,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -385,7 +383,6 @@ internal ApplicationTypeVersionsOperations(ServiceFabricManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "applicationTypeName"); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -396,7 +393,6 @@ 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); } @@ -408,9 +404,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -605,7 +601,6 @@ internal ApplicationTypeVersionsOperations(ServiceFabricManagementClient client) { parameters.Validate(); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -617,7 +612,6 @@ 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); @@ -631,9 +625,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -820,7 +814,6 @@ internal ApplicationTypeVersionsOperations(ServiceFabricManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "version"); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -832,7 +825,6 @@ 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); } @@ -845,9 +837,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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 c858e7b22e04..e9f43e1c7420 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ApplicationTypesOperations.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ApplicationTypesOperations.cs @@ -105,7 +105,6 @@ internal ApplicationTypesOperations(ServiceFabricManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "applicationTypeName"); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -116,7 +115,6 @@ 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); } @@ -128,9 +126,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -314,7 +312,6 @@ internal ApplicationTypesOperations(ServiceFabricManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -325,7 +322,6 @@ 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); @@ -338,9 +334,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -546,7 +542,6 @@ internal ApplicationTypesOperations(ServiceFabricManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -556,7 +551,6 @@ 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); } @@ -567,9 +561,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -743,7 +737,6 @@ internal ApplicationTypesOperations(ServiceFabricManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "applicationTypeName"); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -754,7 +747,6 @@ 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); } @@ -766,9 +758,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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 62a784fac12f..a0d8bbb0939b 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ApplicationsOperations.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ApplicationsOperations.cs @@ -105,7 +105,6 @@ internal ApplicationsOperations(ServiceFabricManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "applicationName"); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -116,7 +115,6 @@ 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); } @@ -128,9 +126,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -392,7 +390,6 @@ internal ApplicationsOperations(ServiceFabricManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "clusterName"); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -402,7 +399,6 @@ 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); } @@ -413,9 +409,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -603,7 +599,6 @@ internal ApplicationsOperations(ServiceFabricManagementClient client) { parameters.Validate(); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -614,7 +609,6 @@ 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); @@ -627,9 +621,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -818,7 +812,6 @@ internal ApplicationsOperations(ServiceFabricManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -829,7 +822,6 @@ 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); @@ -842,9 +834,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1023,7 +1015,6 @@ internal ApplicationsOperations(ServiceFabricManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "applicationName"); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1034,7 +1025,6 @@ 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); } @@ -1046,9 +1036,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.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 518267c68118..1e21c1b577b1 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ClusterVersionsOperations.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ClusterVersionsOperations.cs @@ -70,7 +70,7 @@ internal ClusterVersionsOperations(ServiceFabricManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -99,7 +99,6 @@ internal ClusterVersionsOperations(ServiceFabricManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "clusterVersion"); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -108,7 +107,6 @@ 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); @@ -120,9 +118,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -184,14 +182,13 @@ internal ClusterVersionsOperations(ServiceFabricManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorModelException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorModel _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -201,10 +198,6 @@ internal ClusterVersionsOperations(ServiceFabricManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -274,7 +267,7 @@ internal ClusterVersionsOperations(ServiceFabricManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -307,7 +300,6 @@ internal ClusterVersionsOperations(ServiceFabricManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "clusterVersion"); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -317,7 +309,6 @@ 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); @@ -330,9 +321,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -394,14 +385,13 @@ internal ClusterVersionsOperations(ServiceFabricManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorModelException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorModel _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -411,10 +401,6 @@ internal ClusterVersionsOperations(ServiceFabricManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -477,7 +463,7 @@ internal ClusterVersionsOperations(ServiceFabricManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -502,7 +488,6 @@ 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; @@ -511,7 +496,6 @@ 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); } @@ -521,9 +505,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -585,14 +569,13 @@ internal ClusterVersionsOperations(ServiceFabricManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorModelException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorModel _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -602,10 +585,6 @@ internal ClusterVersionsOperations(ServiceFabricManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -672,7 +651,7 @@ internal ClusterVersionsOperations(ServiceFabricManagementClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -701,7 +680,6 @@ 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; @@ -711,7 +689,6 @@ 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); } @@ -722,9 +699,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -786,14 +763,13 @@ internal ClusterVersionsOperations(ServiceFabricManagementClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorModelException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + ErrorModel _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -803,10 +779,6 @@ internal ClusterVersionsOperations(ServiceFabricManagementClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); 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 db4a7a10ebff..e72f62989959 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ClustersOperations.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ClustersOperations.cs @@ -98,7 +98,6 @@ 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; @@ -108,7 +107,6 @@ 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); } @@ -119,9 +117,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -345,7 +343,6 @@ 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; @@ -355,7 +352,6 @@ 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); } @@ -366,9 +362,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -514,7 +510,6 @@ 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; @@ -523,7 +518,6 @@ 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); } @@ -533,9 +527,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -692,7 +686,6 @@ 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; @@ -700,7 +693,6 @@ 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); } @@ -709,9 +701,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -833,6 +825,221 @@ internal ClustersOperations(ServiceFabricManagementClient client) return _result; } + /// + /// Operation to get the minimum and maximum upgradable version from the + /// current cluster version, or the required path to get to the an specific + /// target version. + /// + /// + /// If a target is not provided, it will get the minimum and maximum versions + /// available from the current cluster version. If a target is given, it will + /// provide the required path to get from the current cluster version to the + /// target version. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// The target code version. + /// + /// + /// 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> ListUpgradableVersionsWithHttpMessagesAsync(string resourceGroupName, string clusterName, string targetVersion, 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 (targetVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "targetVersion"); + } + UpgradableVersionsDescription versionsDescription = default(UpgradableVersionsDescription); + if (targetVersion != null) + { + versionsDescription = new UpgradableVersionsDescription(); + versionsDescription.TargetVersion = targetVersion; + } + // 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("versionsDescription", versionsDescription); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "ListUpgradableVersions", 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/clusters/{clusterName}/listUpgradableVersions").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)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(versionsDescription != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(versionsDescription, 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) + { + 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 cluster resource. /// @@ -891,7 +1098,6 @@ internal ClustersOperations(ServiceFabricManagementClient client) { parameters.Validate(); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -901,7 +1107,6 @@ 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); @@ -913,9 +1118,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1117,7 +1322,6 @@ internal ClustersOperations(ServiceFabricManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1127,7 +1331,6 @@ 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); @@ -1139,9 +1342,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ClustersOperationsExtensions.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ClustersOperationsExtensions.cs index f81ba981b945..7a9a8d15ce94 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ClustersOperationsExtensions.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ClustersOperationsExtensions.cs @@ -302,6 +302,68 @@ public static ClusterListResult List(this IClustersOperations operations) } } + /// + /// Operation to get the minimum and maximum upgradable version from the + /// current cluster version, or the required path to get to the an specific + /// target version. + /// + /// + /// If a target is not provided, it will get the minimum and maximum versions + /// available from the current cluster version. If a target is given, it will + /// provide the required path to get from the current cluster version to the + /// target version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// The target code version. + /// + public static UpgradableVersionPathResult ListUpgradableVersions(this IClustersOperations operations, string resourceGroupName, string clusterName, string targetVersion) + { + return operations.ListUpgradableVersionsAsync(resourceGroupName, clusterName, targetVersion).GetAwaiter().GetResult(); + } + + /// + /// Operation to get the minimum and maximum upgradable version from the + /// current cluster version, or the required path to get to the an specific + /// target version. + /// + /// + /// If a target is not provided, it will get the minimum and maximum versions + /// available from the current cluster version. If a target is given, it will + /// provide the required path to get from the current cluster version to the + /// target version. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// The target code version. + /// + /// + /// The cancellation token. + /// + public static async Task ListUpgradableVersionsAsync(this IClustersOperations operations, string resourceGroupName, string clusterName, string targetVersion, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListUpgradableVersionsWithHttpMessagesAsync(resourceGroupName, clusterName, targetVersion, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Creates or updates a Service Fabric cluster resource. /// diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/IClusterVersionsOperations.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/IClusterVersionsOperations.cs index 5484b90cd59c..92251cd1987a 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/IClusterVersionsOperations.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/IClusterVersionsOperations.cs @@ -44,7 +44,7 @@ public partial interface IClusterVersionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -79,7 +79,7 @@ public partial interface IClusterVersionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -107,7 +107,7 @@ public partial interface IClusterVersionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -139,7 +139,7 @@ public partial interface IClusterVersionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/IClustersOperations.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/IClustersOperations.cs index 3ac7d4e46f91..66a5db9c43c5 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/IClustersOperations.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/IClustersOperations.cs @@ -194,6 +194,42 @@ public partial interface IClustersOperations /// Task> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Operation to get the minimum and maximum upgradable version from + /// the current cluster version, or the required path to get to the an + /// specific target version. + /// + /// + /// If a target is not provided, it will get the minimum and maximum + /// versions available from the current cluster version. If a target is + /// given, it will provide the required path to get from the current + /// cluster version to the target version. + /// + /// + /// The name of the resource group. + /// + /// + /// The name of the cluster resource. + /// + /// + /// The target code version. + /// + /// + /// 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> ListUpgradableVersionsWithHttpMessagesAsync(string resourceGroupName, string clusterName, string targetVersion, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Creates or updates a Service Fabric cluster resource. /// /// diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/IManagedClusterVersionsOperations.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/IManagedClusterVersionsOperations.cs deleted file mode 100644 index 73d22099ddb8..000000000000 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/IManagedClusterVersionsOperations.cs +++ /dev/null @@ -1,59 +0,0 @@ -// -// 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 deleted file mode 100644 index adb857271d01..000000000000 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/IManagedClustersOperations.cs +++ /dev/null @@ -1,343 +0,0 @@ -// -// 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 deleted file mode 100644 index d05275923e42..000000000000 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/INodeTypesOperations.cs +++ /dev/null @@ -1,505 +0,0 @@ -// -// 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 f068f72c04d3..67a7f5899d3e 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/IServiceFabricManagementClient.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/IServiceFabricManagementClient.cs @@ -40,6 +40,13 @@ 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 "2021-06-01" for this + /// specification. + /// + string ApiVersion { get; } + /// /// The customer subscription identifier. /// @@ -99,20 +106,5 @@ 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 deleted file mode 100644 index 40fbbd86a103..000000000000 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ManagedClusterVersionsOperations.cs +++ /dev/null @@ -1,250 +0,0 @@ -// -// 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 deleted file mode 100644 index 1149fc00d213..000000000000 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ManagedClusterVersionsOperationsExtensions.cs +++ /dev/null @@ -1,81 +0,0 @@ -// -// 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 deleted file mode 100644 index be4febcb0491..000000000000 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ManagedClustersOperations.cs +++ /dev/null @@ -1,1680 +0,0 @@ -// -// 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 deleted file mode 100644 index b9e87120ac01..000000000000 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ManagedClustersOperationsExtensions.cs +++ /dev/null @@ -1,545 +0,0 @@ -// -// 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 e877808d936a..2e7a7033262f 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,15 +41,6 @@ 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 - /// overridden values from their default values specified in the - /// application manifest. - /// Describes the policy for a monitored - /// application upgrade. /// The minimum number of nodes where /// Service Fabric will reserve capacity for this application. Note /// that this does not mean that the services of this application will @@ -64,16 +55,12 @@ public ApplicationResource() /// any node. /// Remove the current /// 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), 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) + 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), SystemData systemData = default(SystemData), 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, systemData) { Identity = identity; TypeVersion = typeVersion; @@ -95,29 +82,21 @@ 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. /// [JsonProperty(PropertyName = "properties.typeVersion")] public string TypeVersion { get; set; } /// - /// Gets or sets list of application parameters with overridden values - /// from their default values specified in the application manifest. /// [JsonProperty(PropertyName = "properties.parameters")] public IDictionary Parameters { get; set; } /// - /// Gets or sets describes the policy for a monitored application - /// upgrade. /// [JsonProperty(PropertyName = "properties.upgradePolicy")] public ApplicationUpgradePolicy UpgradePolicy { get; set; } @@ -150,7 +129,6 @@ public ApplicationResource() public bool? RemoveApplicationCapacity { get; set; } /// - /// Gets or sets list of application capacity metric description. /// [JsonProperty(PropertyName = "properties.metrics")] public IList Metrics { get; set; } @@ -170,8 +148,6 @@ public ApplicationResource() public string ProvisioningState { get; private set; } /// - /// Gets or sets the application type name as defined in the - /// application manifest. /// [JsonProperty(PropertyName = "properties.typeName")] public string TypeName { get; set; } 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 f25a17c9d83d..646c4f1be6df 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 @@ -41,13 +41,6 @@ public ApplicationResourceUpdate() /// location depends on the parent resource. /// Azure resource tags. /// Azure resource etag. - /// The version of the application type as - /// defined in the application manifest. - /// List of application parameters with - /// overridden values from their default values specified in the - /// application manifest. - /// Describes the policy for a monitored - /// application upgrade. /// The minimum number of nodes where /// Service Fabric will reserve capacity for this application. Note /// that this does not mean that the services of this application will @@ -62,12 +55,10 @@ public ApplicationResourceUpdate() /// any node. /// Remove the current /// application capacity settings. - /// List of application capacity metric - /// description. /// 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) + 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), SystemData systemData = default(SystemData), 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, systemData) { TypeVersion = typeVersion; Parameters = parameters; @@ -86,22 +77,16 @@ public ApplicationResourceUpdate() partial void CustomInit(); /// - /// Gets or sets the version of the application type as defined in the - /// application manifest. /// [JsonProperty(PropertyName = "properties.typeVersion")] public string TypeVersion { get; set; } /// - /// Gets or sets list of application parameters with overridden values - /// from their default values specified in the application manifest. /// [JsonProperty(PropertyName = "properties.parameters")] public IDictionary Parameters { get; set; } /// - /// Gets or sets describes the policy for a monitored application - /// upgrade. /// [JsonProperty(PropertyName = "properties.upgradePolicy")] public ApplicationUpgradePolicy UpgradePolicy { get; set; } @@ -134,7 +119,6 @@ public ApplicationResourceUpdate() public bool? RemoveApplicationCapacity { get; set; } /// - /// Gets or sets list of application capacity metric description. /// [JsonProperty(PropertyName = "properties.metrics")] public IList Metrics { get; set; } diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ApplicationTypeResource.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ApplicationTypeResource.cs index dd3a22816f1f..a1c1963df8b0 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ApplicationTypeResource.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ApplicationTypeResource.cs @@ -43,8 +43,8 @@ public ApplicationTypeResource() /// Azure resource etag. /// The current deployment or /// provisioning state, which only appears in the response. - public ApplicationTypeResource(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 provisioningState = default(string)) - : base(id, name, type, location, tags, etag) + public ApplicationTypeResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string etag = default(string), SystemData systemData = default(SystemData), string provisioningState = default(string)) + : base(id, name, type, location, tags, etag, systemData) { ProvisioningState = provisioningState; CustomInit(); diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ApplicationTypeVersionResource.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ApplicationTypeVersionResource.cs index 3c0b8dd36747..5ad331075906 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ApplicationTypeVersionResource.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ApplicationTypeVersionResource.cs @@ -48,11 +48,8 @@ public ApplicationTypeVersionResource() /// Azure resource etag. /// The current deployment or /// provisioning state, which only appears in the response - /// List of application type - /// parameters that can be overridden when creating or updating the - /// application. - public ApplicationTypeVersionResource(string appPackageUrl, 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 provisioningState = default(string), IDictionary defaultParameterList = default(IDictionary)) - : base(id, name, type, location, tags, etag) + public ApplicationTypeVersionResource(string appPackageUrl, string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string etag = default(string), SystemData systemData = default(SystemData), string provisioningState = default(string), IDictionary defaultParameterList = default(IDictionary)) + : base(id, name, type, location, tags, etag, systemData) { ProvisioningState = provisioningState; AppPackageUrl = appPackageUrl; @@ -79,8 +76,6 @@ public ApplicationTypeVersionResource() public string AppPackageUrl { get; set; } /// - /// Gets list of application type parameters that can be overridden - /// when creating or updating the application. /// [JsonProperty(PropertyName = "properties.defaultParameterList")] public IDictionary DefaultParameterList { get; private set; } 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 index fe33e63dc415..fdb7455228f4 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ApplicationTypeVersionsCleanupPolicy.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ApplicationTypeVersionsCleanupPolicy.cs @@ -31,7 +31,7 @@ public ApplicationTypeVersionsCleanupPolicy() /// /// Number of unused versions per /// application type to keep. - public ApplicationTypeVersionsCleanupPolicy(int maxUnusedVersionsToKeep) + public ApplicationTypeVersionsCleanupPolicy(long maxUnusedVersionsToKeep) { MaxUnusedVersionsToKeep = maxUnusedVersionsToKeep; CustomInit(); @@ -47,7 +47,7 @@ public ApplicationTypeVersionsCleanupPolicy(int maxUnusedVersionsToKeep) /// keep. /// [JsonProperty(PropertyName = "maxUnusedVersionsToKeep")] - public int MaxUnusedVersionsToKeep { get; set; } + public long MaxUnusedVersionsToKeep { get; set; } /// /// Validate the object. 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 a8505cc0965b..cfbee8bc3788 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 @@ -36,26 +36,20 @@ public ApplicationUpgradePolicy() /// of availability loss issues. The timeout is reset at the start of /// each upgrade domain. Valid values are between 0 and 42949672925 /// inclusive. (unsigned 32-bit integer). - /// If true, then processes are forcefully - /// restarted during upgrade even when the code version has not changed - /// (the upgrade only changes configuration or data). - /// The policy used for - /// monitoring the application upgrade - /// Defines a health policy used - /// to evaluate the health of an application or one of its children - /// entities. - /// - /// The mode used to monitor health during a - /// rolling upgrade. The values are UnmonitoredAuto, UnmonitoredManual, - /// and Monitored. Possible values include: 'Invalid', + /// 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)) + /// Determines whether the + /// application should be recreated on update. If value=true, the rest + /// of the upgrade policy parameters are not allowed and it will result + /// in availability loss. + public ApplicationUpgradePolicy(string upgradeReplicaSetCheckTimeout = default(string), bool? forceRestart = default(bool?), ArmRollingUpgradeMonitoringPolicy rollingUpgradeMonitoringPolicy = default(ArmRollingUpgradeMonitoringPolicy), ArmApplicationHealthPolicy applicationHealthPolicy = default(ArmApplicationHealthPolicy), string upgradeMode = default(string), bool? recreateApplication = default(bool?)) { UpgradeReplicaSetCheckTimeout = upgradeReplicaSetCheckTimeout; ForceRestart = forceRestart; RollingUpgradeMonitoringPolicy = rollingUpgradeMonitoringPolicy; ApplicationHealthPolicy = applicationHealthPolicy; UpgradeMode = upgradeMode; + RecreateApplication = recreateApplication; CustomInit(); } @@ -77,36 +71,35 @@ public ApplicationUpgradePolicy() public string UpgradeReplicaSetCheckTimeout { get; set; } /// - /// Gets or sets if true, then processes are forcefully restarted - /// during upgrade even when the code version has not changed (the - /// upgrade only changes configuration or data). /// [JsonProperty(PropertyName = "forceRestart")] public bool? ForceRestart { get; set; } /// - /// Gets or sets the policy used for monitoring the application upgrade /// [JsonProperty(PropertyName = "rollingUpgradeMonitoringPolicy")] public ArmRollingUpgradeMonitoringPolicy RollingUpgradeMonitoringPolicy { get; set; } /// - /// Gets or sets defines a health policy used to evaluate the health of - /// an application or one of its children entities. - /// /// [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', + /// Gets or sets possible values include: 'Invalid', 'UnmonitoredAuto', /// 'UnmonitoredManual', 'Monitored' /// [JsonProperty(PropertyName = "upgradeMode")] public string UpgradeMode { get; set; } + /// + /// Gets or sets determines whether the application should be recreated + /// on update. If value=true, the rest of the upgrade policy parameters + /// are not allowed and it will result in availability loss. + /// + [JsonProperty(PropertyName = "recreateApplication")] + public bool? RecreateApplication { get; set; } + /// /// Validate the object. /// diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ArmRollingUpgradeMonitoringPolicy.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ArmRollingUpgradeMonitoringPolicy.cs index 2a10d07d56fb..e0419999d291 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ArmRollingUpgradeMonitoringPolicy.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ArmRollingUpgradeMonitoringPolicy.cs @@ -33,33 +33,6 @@ public ArmRollingUpgradeMonitoringPolicy() /// /// The activation Mode of the service /// package. Possible values include: 'Rollback', 'Manual' - /// The amount of time to wait - /// after completing an upgrade domain before applying health policies. - /// 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. - /// The amount of time that the - /// application or cluster must remain healthy before the upgrade - /// proceeds to the next upgrade domain. 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. - /// The amount of time to retry - /// health evaluation when the application or cluster is unhealthy - /// before FailureAction is executed. 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. - /// The amount of time the overall upgrade - /// has to complete before FailureAction is executed. 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. - /// The amount of time each upgrade - /// domain has to complete before FailureAction is executed. 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 ArmRollingUpgradeMonitoringPolicy(string failureAction = default(string), string healthCheckWaitDuration = default(string), string healthCheckStableDuration = default(string), string healthCheckRetryTimeout = default(string), string upgradeTimeout = default(string), string upgradeDomainTimeout = default(string)) { FailureAction = failureAction; @@ -84,51 +57,26 @@ public ArmRollingUpgradeMonitoringPolicy() public string FailureAction { get; set; } /// - /// Gets or sets the amount of time to wait after completing an upgrade - /// domain before applying health policies. 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 = "healthCheckWaitDuration")] public string HealthCheckWaitDuration { get; set; } /// - /// Gets or sets the amount of time that the application or cluster - /// must remain healthy before the upgrade proceeds to the next upgrade - /// domain. 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 = "healthCheckStableDuration")] public string HealthCheckStableDuration { get; set; } /// - /// Gets or sets the amount of time to retry health evaluation when the - /// application or cluster is unhealthy before FailureAction is - /// executed. 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 = "healthCheckRetryTimeout")] public string HealthCheckRetryTimeout { get; set; } /// - /// Gets or sets the amount of time the overall upgrade has to complete - /// before FailureAction is executed. 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 = "upgradeTimeout")] public string UpgradeTimeout { get; set; } /// - /// Gets or sets the amount of time each upgrade domain has to complete - /// before FailureAction is executed. 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 = "upgradeDomainTimeout")] public string UpgradeDomainTimeout { get; set; } diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/CertificateDescription.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/CertificateDescription.cs index 2836d9051c82..64077a8c6858 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/CertificateDescription.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/CertificateDescription.cs @@ -34,9 +34,8 @@ public CertificateDescription() /// certificate. /// Thumbprint of the secondary /// certificate. - /// The local certificate store location. - /// Possible values include: 'AddressBook', 'AuthRoot', - /// 'CertificateAuthority', 'Disallowed', 'My', 'Root', + /// Possible values include: 'AddressBook', + /// 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', /// 'TrustedPeople', 'TrustedPublisher' public CertificateDescription(string thumbprint, string thumbprintSecondary = default(string), string x509StoreName = default(string)) { @@ -64,9 +63,9 @@ public CertificateDescription() public string ThumbprintSecondary { get; set; } /// - /// Gets or sets the local certificate store location. Possible values - /// include: 'AddressBook', 'AuthRoot', 'CertificateAuthority', - /// 'Disallowed', 'My', 'Root', 'TrustedPeople', 'TrustedPublisher' + /// Gets or sets possible values include: 'AddressBook', 'AuthRoot', + /// 'CertificateAuthority', 'Disallowed', 'My', 'Root', + /// 'TrustedPeople', 'TrustedPublisher' /// [JsonProperty(PropertyName = "x509StoreName")] public string X509StoreName { get; set; } 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 deleted file mode 100644 index 219753afd690..000000000000 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ClientCertificate.cs +++ /dev/null @@ -1,88 +0,0 @@ -// -// 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 21874a177a0d..3839fea7a3c3 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 @@ -55,9 +55,6 @@ public Cluster() /// cluster. The certificate provided will be used for node to node /// security within the cluster, SSL certificate for cluster management /// endpoint and default admin client. - /// Describes a list of server - /// certificates referenced by common name that are used to secure the - /// cluster. /// The list of client /// certificates referenced by common name that are allowed to manage /// the cluster. @@ -74,38 +71,11 @@ public Cluster() /// A system service in the cluster connects to this endpoint. /// 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' + /// Possible values include: + /// 'WaitingForNodes', 'Deploying', 'BaselineUpgrade', + /// 'UpdatingUserConfiguration', 'UpdatingUserCertificate', + /// 'UpdatingInfrastructure', 'EnforcingClusterVersion', + /// 'UpgradeServiceUnreachable', 'AutoScale', 'Ready' /// The storage account /// information for storing Service Fabric diagnostic logs. /// Indicates if the event store @@ -115,45 +85,42 @@ public Cluster() /// The provisioning state of the /// cluster resource. Possible values include: 'Updating', 'Succeeded', /// 'Failed', 'Canceled' - /// The reliability level sets the - /// replica set size of system services. Learn about - /// [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. - /// - Bronze - Run the System services with a target replica set count - /// of 3. This should only be used for test clusters. - /// - Silver - Run the System services with a target replica set count - /// of 5. - /// - Gold - Run the System services with a target replica set count of - /// 7. - /// - Platinum - Run the System services with a target replica set - /// count of 9. - /// . Possible values include: 'None', 'Bronze', 'Silver', 'Gold', - /// 'Platinum' + /// Possible values include: 'None', + /// 'Bronze', 'Silver', 'Gold', 'Platinum' /// The server certificate used /// by reverse proxy. - /// Describes a list - /// of server certificates referenced by common name that are used to - /// secure the cluster. /// The policy to use when upgrading /// the cluster. - /// 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' + /// 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), ApplicationTypeVersionsCleanupPolicy applicationTypeVersionsCleanupPolicy = default(ApplicationTypeVersionsCleanupPolicy), string vmImage = default(string)) - : base(location, id, name, type, tags, etag) + /// Possible values include: + /// 'Parallel', 'Hierarchical' + /// Possible values include: + /// 'Parallel', 'Hierarchical' + /// Indicates if + /// infrastructure service manager is enabled. + /// Indicates when new cluster runtime + /// version upgrades will be applied after they are released. By + /// default is Wave0. Only applies when **upgradeMode** is set to + /// 'Automatic'. Possible values include: 'Wave0', 'Wave1', + /// 'Wave2' + /// Indicates the start + /// date and time to pause automatic runtime version upgrades on the + /// cluster for an specific period of time on the cluster + /// (UTC). + /// Indicates the end date + /// and time to pause automatic runtime version upgrades on the cluster + /// for an specific period of time on the cluster (UTC). + /// Boolean to pause automatic runtime + /// version upgrades to the cluster. + /// Indicates a list of notification + /// channels for cluster events. + 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), SystemData systemData = default(SystemData), 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), string sfZonalUpgradeMode = default(string), string vmssZonalUpgradeMode = default(string), bool? infrastructureServiceManager = default(bool?), string upgradeWave = default(string), System.DateTime? upgradePauseStartTimestampUtc = default(System.DateTime?), System.DateTime? upgradePauseEndTimestampUtc = default(System.DateTime?), bool? waveUpgradePaused = default(bool?), IList notifications = default(IList)) + : base(location, id, name, type, tags, etag, systemData) { AddOnFeatures = addOnFeatures; AvailableClusterVersions = availableClusterVersions; @@ -179,6 +146,14 @@ public Cluster() UpgradeMode = upgradeMode; ApplicationTypeVersionsCleanupPolicy = applicationTypeVersionsCleanupPolicy; VmImage = vmImage; + SfZonalUpgradeMode = sfZonalUpgradeMode; + VmssZonalUpgradeMode = vmssZonalUpgradeMode; + InfrastructureServiceManager = infrastructureServiceManager; + UpgradeWave = upgradeWave; + UpgradePauseStartTimestampUtc = upgradePauseStartTimestampUtc; + UpgradePauseEndTimestampUtc = upgradePauseEndTimestampUtc; + WaveUpgradePaused = waveUpgradePaused; + Notifications = notifications; CustomInit(); } @@ -216,8 +191,6 @@ public Cluster() public CertificateDescription Certificate { get; set; } /// - /// Gets or sets describes a list of server certificates referenced by - /// common name that are used to secure the cluster. /// [JsonProperty(PropertyName = "properties.certificateCommonNames")] public ServerCertificateCommonNames CertificateCommonNames { get; set; } @@ -262,34 +235,7 @@ public Cluster() 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', + /// Gets possible values include: 'WaitingForNodes', 'Deploying', /// 'BaselineUpgrade', 'UpdatingUserConfiguration', /// 'UpdatingUserCertificate', 'UpdatingInfrastructure', /// 'EnforcingClusterVersion', 'UpgradeServiceUnreachable', @@ -338,22 +284,8 @@ public Cluster() public string ProvisioningState { get; private set; } /// - /// Gets or sets the reliability level sets the replica set size of - /// system services. Learn about - /// [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. - /// - Bronze - Run the System services with a target replica set count - /// of 3. This should only be used for test clusters. - /// - Silver - Run the System services with a target replica set count - /// of 5. - /// - Gold - Run the System services with a target replica set count of - /// 7. - /// - Platinum - Run the System services with a target replica set - /// count of 9. - /// . Possible values include: 'None', 'Bronze', 'Silver', 'Gold', - /// 'Platinum' + /// Gets or sets possible values include: 'None', 'Bronze', 'Silver', + /// 'Gold', 'Platinum' /// [JsonProperty(PropertyName = "properties.reliabilityLevel")] public string ReliabilityLevel { get; set; } @@ -365,8 +297,6 @@ public Cluster() public CertificateDescription ReverseProxyCertificate { get; set; } /// - /// Gets or sets describes a list of server certificates referenced by - /// common name that are used to secure the cluster. /// [JsonProperty(PropertyName = "properties.reverseProxyCertificateCommonNames")] public ServerCertificateCommonNames ReverseProxyCertificateCommonNames { get; set; } @@ -378,16 +308,7 @@ public Cluster() public ClusterUpgradePolicy UpgradeDescription { 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' + /// Gets or sets possible values include: 'Automatic', 'Manual' /// [JsonProperty(PropertyName = "properties.upgradeMode")] public string UpgradeMode { get; set; } @@ -405,6 +326,64 @@ public Cluster() [JsonProperty(PropertyName = "properties.vmImage")] public string VmImage { get; set; } + /// + /// Gets or sets possible values include: 'Parallel', 'Hierarchical' + /// + [JsonProperty(PropertyName = "properties.sfZonalUpgradeMode")] + public string SfZonalUpgradeMode { get; set; } + + /// + /// Gets or sets possible values include: 'Parallel', 'Hierarchical' + /// + [JsonProperty(PropertyName = "properties.vmssZonalUpgradeMode")] + public string VmssZonalUpgradeMode { get; set; } + + /// + /// Gets or sets indicates if infrastructure service manager is + /// enabled. + /// + [JsonProperty(PropertyName = "properties.infrastructureServiceManager")] + public bool? InfrastructureServiceManager { get; set; } + + /// + /// Gets or sets indicates when new cluster runtime version upgrades + /// will be applied after they are released. By default is Wave0. Only + /// applies when **upgradeMode** is set to 'Automatic'. Possible values + /// include: 'Wave0', 'Wave1', 'Wave2' + /// + [JsonProperty(PropertyName = "properties.upgradeWave")] + public string UpgradeWave { get; set; } + + /// + /// Gets or sets indicates the start date and time to pause automatic + /// runtime version upgrades on the cluster for an specific period of + /// time on the cluster (UTC). + /// + [JsonProperty(PropertyName = "properties.upgradePauseStartTimestampUtc")] + public System.DateTime? UpgradePauseStartTimestampUtc { get; set; } + + /// + /// Gets or sets indicates the end date and time to pause automatic + /// runtime version upgrades on the cluster for an specific period of + /// time on the cluster (UTC). + /// + [JsonProperty(PropertyName = "properties.upgradePauseEndTimestampUtc")] + public System.DateTime? UpgradePauseEndTimestampUtc { get; set; } + + /// + /// Gets or sets boolean to pause automatic runtime version upgrades to + /// the cluster. + /// + [JsonProperty(PropertyName = "properties.waveUpgradePaused")] + public bool? WaveUpgradePaused { get; set; } + + /// + /// Gets or sets indicates a list of notification channels for cluster + /// events. + /// + [JsonProperty(PropertyName = "properties.notifications")] + public IList Notifications { get; set; } + /// /// Validate the object. /// @@ -482,6 +461,16 @@ public override void Validate() { ApplicationTypeVersionsCleanupPolicy.Validate(); } + if (Notifications != null) + { + foreach (var element4 in Notifications) + { + if (element4 != null) + { + element4.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 0a02e941e967..1600cd1a408a 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 @@ -40,9 +40,6 @@ public ClusterUpdateParameters() /// cluster. The certificate provided will be used for node to node /// security within the cluster, SSL certificate for cluster management /// endpoint and default admin client. - /// Describes a list of server - /// certificates referenced by common name that are used to secure the - /// cluster. /// The list of client /// certificates referenced by common name that are allowed to manage /// the cluster. This will overwrite the existing list. @@ -62,40 +59,37 @@ public ClusterUpdateParameters() /// list. /// The list of node types in the cluster. This /// will overwrite the existing list. - /// The reliability level sets the - /// replica set size of system services. Learn about - /// [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. - /// - Bronze - Run the System services with a target replica set count - /// of 3. This should only be used for test clusters. - /// - Silver - Run the System services with a target replica set count - /// of 5. - /// - Gold - Run the System services with a target replica set count of - /// 7. - /// - Platinum - Run the System services with a target replica set - /// count of 9. - /// . Possible values include: 'None', 'Bronze', 'Silver', 'Gold', - /// 'Platinum' + /// Possible values include: 'None', + /// 'Bronze', 'Silver', 'Gold', 'Platinum' /// The server certificate used /// by reverse proxy. /// The policy to use when upgrading /// the cluster. - /// 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' /// The policy used /// to clean up unused versions. + /// Possible values include: 'Automatic', + /// 'Manual' + /// Possible values include: + /// 'Parallel', 'Hierarchical' + /// Possible values include: + /// 'Parallel', 'Hierarchical' + /// Indicates if + /// infrastructure service manager is enabled. + /// Indicates when new cluster runtime + /// version upgrades will be applied after they are released. By + /// default is Wave0. Only applies when **upgradeMode** is set to + /// 'Automatic'. Possible values include: 'Wave0', 'Wave1', + /// 'Wave2' + /// The start timestamp to + /// pause runtime version upgrades on the cluster (UTC). + /// The end timestamp of + /// pause runtime version upgrades on the cluster (UTC). + /// Boolean to pause automatic runtime + /// version upgrades to the cluster. + /// Indicates a list of notification + /// channels for cluster events. /// 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), ApplicationTypeVersionsCleanupPolicy applicationTypeVersionsCleanupPolicy = default(ApplicationTypeVersionsCleanupPolicy), 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), ApplicationTypeVersionsCleanupPolicy applicationTypeVersionsCleanupPolicy = default(ApplicationTypeVersionsCleanupPolicy), string upgradeMode = default(string), string sfZonalUpgradeMode = default(string), string vmssZonalUpgradeMode = default(string), bool? infrastructureServiceManager = default(bool?), string upgradeWave = default(string), System.DateTime? upgradePauseStartTimestampUtc = default(System.DateTime?), System.DateTime? upgradePauseEndTimestampUtc = default(System.DateTime?), bool? waveUpgradePaused = default(bool?), IList notifications = default(IList), IDictionary tags = default(IDictionary)) { AddOnFeatures = addOnFeatures; Certificate = certificate; @@ -109,8 +103,16 @@ public ClusterUpdateParameters() ReliabilityLevel = reliabilityLevel; ReverseProxyCertificate = reverseProxyCertificate; UpgradeDescription = upgradeDescription; - UpgradeMode = upgradeMode; ApplicationTypeVersionsCleanupPolicy = applicationTypeVersionsCleanupPolicy; + UpgradeMode = upgradeMode; + SfZonalUpgradeMode = sfZonalUpgradeMode; + VmssZonalUpgradeMode = vmssZonalUpgradeMode; + InfrastructureServiceManager = infrastructureServiceManager; + UpgradeWave = upgradeWave; + UpgradePauseStartTimestampUtc = upgradePauseStartTimestampUtc; + UpgradePauseEndTimestampUtc = upgradePauseEndTimestampUtc; + WaveUpgradePaused = waveUpgradePaused; + Notifications = notifications; Tags = tags; CustomInit(); } @@ -136,8 +138,6 @@ public ClusterUpdateParameters() public CertificateDescription Certificate { get; set; } /// - /// Gets or sets describes a list of server certificates referenced by - /// common name that are used to secure the cluster. /// [JsonProperty(PropertyName = "properties.certificateCommonNames")] public ServerCertificateCommonNames CertificateCommonNames { get; set; } @@ -190,22 +190,8 @@ public ClusterUpdateParameters() public IList NodeTypes { get; set; } /// - /// Gets or sets the reliability level sets the replica set size of - /// system services. Learn about - /// [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. - /// - Bronze - Run the System services with a target replica set count - /// of 3. This should only be used for test clusters. - /// - Silver - Run the System services with a target replica set count - /// of 5. - /// - Gold - Run the System services with a target replica set count of - /// 7. - /// - Platinum - Run the System services with a target replica set - /// count of 9. - /// . Possible values include: 'None', 'Bronze', 'Silver', 'Gold', - /// 'Platinum' + /// Gets or sets possible values include: 'None', 'Bronze', 'Silver', + /// 'Gold', 'Platinum' /// [JsonProperty(PropertyName = "properties.reliabilityLevel")] public string ReliabilityLevel { get; set; } @@ -223,25 +209,72 @@ public ClusterUpdateParameters() public ClusterUpgradePolicy UpgradeDescription { 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' + /// Gets or sets the policy used to clean up unused versions. + /// + [JsonProperty(PropertyName = "properties.applicationTypeVersionsCleanupPolicy")] + public ApplicationTypeVersionsCleanupPolicy ApplicationTypeVersionsCleanupPolicy { get; set; } + + /// + /// Gets or sets possible values include: 'Automatic', 'Manual' /// [JsonProperty(PropertyName = "properties.upgradeMode")] public string UpgradeMode { get; set; } /// - /// Gets or sets the policy used to clean up unused versions. + /// Gets or sets possible values include: 'Parallel', 'Hierarchical' /// - [JsonProperty(PropertyName = "properties.applicationTypeVersionsCleanupPolicy")] - public ApplicationTypeVersionsCleanupPolicy ApplicationTypeVersionsCleanupPolicy { get; set; } + [JsonProperty(PropertyName = "properties.sfZonalUpgradeMode")] + public string SfZonalUpgradeMode { get; set; } + + /// + /// Gets or sets possible values include: 'Parallel', 'Hierarchical' + /// + [JsonProperty(PropertyName = "properties.vmssZonalUpgradeMode")] + public string VmssZonalUpgradeMode { get; set; } + + /// + /// Gets or sets indicates if infrastructure service manager is + /// enabled. + /// + [JsonProperty(PropertyName = "properties.infrastructureServiceManager")] + public bool? InfrastructureServiceManager { get; set; } + + /// + /// Gets or sets indicates when new cluster runtime version upgrades + /// will be applied after they are released. By default is Wave0. Only + /// applies when **upgradeMode** is set to 'Automatic'. Possible values + /// include: 'Wave0', 'Wave1', 'Wave2' + /// + [JsonProperty(PropertyName = "properties.upgradeWave")] + public string UpgradeWave { get; set; } + + /// + /// Gets or sets the start timestamp to pause runtime version upgrades + /// on the cluster (UTC). + /// + [JsonProperty(PropertyName = "properties.upgradePauseStartTimestampUtc")] + public System.DateTime? UpgradePauseStartTimestampUtc { get; set; } + + /// + /// Gets or sets the end timestamp of pause runtime version upgrades on + /// the cluster (UTC). + /// + [JsonProperty(PropertyName = "properties.upgradePauseEndTimestampUtc")] + public System.DateTime? UpgradePauseEndTimestampUtc { get; set; } + + /// + /// Gets or sets boolean to pause automatic runtime version upgrades to + /// the cluster. + /// + [JsonProperty(PropertyName = "properties.waveUpgradePaused")] + public bool? WaveUpgradePaused { get; set; } + + /// + /// Gets or sets indicates a list of notification channels for cluster + /// events. + /// + [JsonProperty(PropertyName = "properties.notifications")] + public IList Notifications { get; set; } /// /// Gets or sets cluster update parameters @@ -313,6 +346,16 @@ public virtual void Validate() { ApplicationTypeVersionsCleanupPolicy.Validate(); } + if (Notifications != null) + { + foreach (var element4 in Notifications) + { + if (element4 != null) + { + element4.Validate(); + } + } + } } } } diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ClusterUpgradeCadence.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ClusterUpgradeCadence.cs new file mode 100644 index 000000000000..dde00271a3c5 --- /dev/null +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ClusterUpgradeCadence.cs @@ -0,0 +1,35 @@ +// +// 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 ClusterUpgradeCadence. + /// + public static class ClusterUpgradeCadence + { + /// + /// Cluster upgrade starts immediately after a new version is rolled + /// out. Recommended for Test/Dev clusters. + /// + public const string Wave0 = "Wave0"; + /// + /// Cluster upgrade starts 7 days after a new version is rolled out. + /// Recommended for Pre-prod clusters. + /// + public const string Wave1 = "Wave1"; + /// + /// Cluster upgrade starts 14 days after a new version is rolled out. + /// Recommended for Production clusters. + /// + public const string Wave2 = "Wave2"; + } +} diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ErrorModel.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ErrorModel.cs index fb672eaf31c7..9e27beed45f9 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ErrorModel.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ErrorModel.cs @@ -29,7 +29,6 @@ public ErrorModel() /// /// Initializes a new instance of the ErrorModel class. /// - /// The error details. public ErrorModel(ErrorModelError error = default(ErrorModelError)) { Error = error; @@ -42,7 +41,6 @@ public ErrorModel() partial void CustomInit(); /// - /// Gets or sets the error details. /// [JsonProperty(PropertyName = "error")] public ErrorModelError Error { get; set; } 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 deleted file mode 100644 index 0b30373445ca..000000000000 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/LoadBalancingRule.cs +++ /dev/null @@ -1,132 +0,0 @@ -// -// 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 deleted file mode 100644 index fce7281fcb49..000000000000 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ManagedCluster.cs +++ /dev/null @@ -1,380 +0,0 @@ -// -// 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 deleted file mode 100644 index 83e88b714816..000000000000 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ManagedClusterUpdateParameters.cs +++ /dev/null @@ -1,216 +0,0 @@ -// -// 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 deleted file mode 100644 index 0af7fd691b96..000000000000 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ManagedClusterVersionDetails.cs +++ /dev/null @@ -1,75 +0,0 @@ -// -// 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 index eae2ff53e366..11ac19cc765b 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ManagedIdentity.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ManagedIdentity.cs @@ -37,14 +37,8 @@ public ManagedIdentity() /// 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}'. - /// + /// Possible values include: 'SystemAssigned', + /// 'UserAssigned', 'SystemAssigned, UserAssigned', 'None' public ManagedIdentity(string principalId = default(string), string tenantId = default(string), ManagedIdentityType? type = default(ManagedIdentityType?), IDictionary userAssignedIdentities = default(IDictionary)) { PrincipalId = principalId; @@ -74,19 +68,13 @@ public ManagedIdentity() 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' + /// Gets or sets 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/ManagedProxyResource.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ManagedProxyResource.cs deleted file mode 100644 index 054f3804a13b..000000000000 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ManagedProxyResource.cs +++ /dev/null @@ -1,79 +0,0 @@ -// -// 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/NodeType.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/NodeType.cs deleted file mode 100644 index 25135392265c..000000000000 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/NodeType.cs +++ /dev/null @@ -1,270 +0,0 @@ -// -// 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 deleted file mode 100644 index c9b42fb6ce7b..000000000000 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/NodeTypeActionParameters.cs +++ /dev/null @@ -1,75 +0,0 @@ -// -// 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 56889572bf67..6d2d5dcab8a6 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 @@ -41,33 +41,32 @@ public NodeTypeDescription() /// 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. + /// VMInstanceCount should be 1 to n, + /// where n indicates the number of VM instances corresponding to this + /// nodeType. VMInstanceCount = 0 can be done only in these scenarios: + /// NodeType is a secondary nodeType. Durability = Bronze or Durability + /// >= Bronze and InfrastructureServiceManager = true. If + /// VMInstanceCount = 0, implies the VMs for this nodeType will not be + /// used for the initial cluster size computation. /// 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 durability level of the node - /// type. Learn about - /// [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 - /// 10 minutes per UD. - /// - Gold - The infrastructure jobs can be paused for a duration of 2 - /// hours per UD. Gold durability can be enabled only on full node VM - /// skus like D15_V2, G5 etc. - /// . Possible values include: 'Bronze', 'Silver', 'Gold' + /// Possible values include: 'Bronze', + /// 'Silver', 'Gold' /// 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 endpoint used by reverse /// proxy. - public NodeTypeDescription(string name, int clientConnectionEndpointPort, int httpGatewayEndpointPort, bool isPrimary, int vmInstanceCount, IDictionary placementProperties = default(IDictionary), IDictionary capacities = default(IDictionary), string durabilityLevel = default(string), EndpointRangeDescription applicationPorts = default(EndpointRangeDescription), EndpointRangeDescription ephemeralPorts = default(EndpointRangeDescription), int? reverseProxyEndpointPort = default(int?)) + /// Indicates if the node type can only host + /// Stateless workloads. + /// Indicates if the node type + /// is enabled to support multiple zones. + public NodeTypeDescription(string name, int clientConnectionEndpointPort, int httpGatewayEndpointPort, bool isPrimary, int vmInstanceCount, IDictionary placementProperties = default(IDictionary), IDictionary capacities = default(IDictionary), string durabilityLevel = default(string), EndpointRangeDescription applicationPorts = default(EndpointRangeDescription), EndpointRangeDescription ephemeralPorts = default(EndpointRangeDescription), int? reverseProxyEndpointPort = default(int?), bool? isStateless = default(bool?), bool? multipleAvailabilityZones = default(bool?)) { Name = name; PlacementProperties = placementProperties; @@ -80,6 +79,8 @@ public NodeTypeDescription() IsPrimary = isPrimary; VmInstanceCount = vmInstanceCount; ReverseProxyEndpointPort = reverseProxyEndpointPort; + IsStateless = isStateless; + MultipleAvailabilityZones = multipleAvailabilityZones; CustomInit(); } @@ -123,16 +124,7 @@ public NodeTypeDescription() public int HttpGatewayEndpointPort { get; set; } /// - /// Gets or sets the durability level of the node type. Learn about - /// [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 - /// 10 minutes per UD. - /// - Gold - The infrastructure jobs can be paused for a duration of 2 - /// hours per UD. Gold durability can be enabled only on full node VM - /// skus like D15_V2, G5 etc. - /// . Possible values include: 'Bronze', 'Silver', 'Gold' + /// Gets or sets possible values include: 'Bronze', 'Silver', 'Gold' /// [JsonProperty(PropertyName = "durabilityLevel")] public string DurabilityLevel { get; set; } @@ -160,9 +152,13 @@ public NodeTypeDescription() 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. + /// Gets or sets vMInstanceCount should be 1 to n, where n indicates + /// the number of VM instances corresponding to this nodeType. + /// VMInstanceCount = 0 can be done only in these scenarios: NodeType + /// is a secondary nodeType. Durability = Bronze or Durability + /// &gt;= Bronze and InfrastructureServiceManager = true. If + /// VMInstanceCount = 0, implies the VMs for this nodeType will not be + /// used for the initial cluster size computation. /// [JsonProperty(PropertyName = "vmInstanceCount")] public int VmInstanceCount { get; set; } @@ -173,6 +169,20 @@ public NodeTypeDescription() [JsonProperty(PropertyName = "reverseProxyEndpointPort")] public int? ReverseProxyEndpointPort { get; set; } + /// + /// Gets or sets indicates if the node type can only host Stateless + /// workloads. + /// + [JsonProperty(PropertyName = "isStateless")] + public bool? IsStateless { get; set; } + + /// + /// Gets or sets indicates if the node type is enabled to support + /// multiple zones. + /// + [JsonProperty(PropertyName = "multipleAvailabilityZones")] + public bool? MultipleAvailabilityZones { get; set; } + /// /// Validate the object. /// @@ -197,9 +207,9 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.InclusiveMaximum, "VmInstanceCount", 2147483647); } - if (VmInstanceCount < 1) + if (VmInstanceCount < 0) { - throw new ValidationException(ValidationRules.InclusiveMinimum, "VmInstanceCount", 1); + throw new ValidationException(ValidationRules.InclusiveMinimum, "VmInstanceCount", 0); } } } 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 deleted file mode 100644 index 4d643802bf94..000000000000 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/NodeTypeUpdateParameters.cs +++ /dev/null @@ -1,180 +0,0 @@ -// -// 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/Notification.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/Notification.cs new file mode 100644 index 000000000000..368cf4039797 --- /dev/null +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/Notification.cs @@ -0,0 +1,114 @@ +// +// 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; + + /// + /// Describes the notification channel for cluster events. + /// + public partial class Notification + { + /// + /// Initializes a new instance of the Notification class. + /// + public Notification() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the Notification class. + /// + /// Indicates if the notification is + /// enabled. + /// The level of notification. Possible + /// values include: 'Critical', 'All' + /// List of targets that subscribe to + /// the notification. + public Notification(bool isEnabled, string notificationLevel, IList notificationTargets) + { + IsEnabled = isEnabled; + NotificationLevel = notificationLevel; + NotificationTargets = notificationTargets; + CustomInit(); + } + /// + /// Static constructor for Notification class. + /// + static Notification() + { + NotificationCategory = "WaveProgress"; + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets indicates if the notification is enabled. + /// + [JsonProperty(PropertyName = "isEnabled")] + public bool IsEnabled { get; set; } + + /// + /// Gets or sets the level of notification. Possible values include: + /// 'Critical', 'All' + /// + [JsonProperty(PropertyName = "notificationLevel")] + public string NotificationLevel { get; set; } + + /// + /// Gets or sets list of targets that subscribe to the notification. + /// + [JsonProperty(PropertyName = "notificationTargets")] + public IList NotificationTargets { get; set; } + + /// + /// The category of notification. + /// + [JsonProperty(PropertyName = "notificationCategory")] + public static string NotificationCategory { get; private set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (NotificationLevel == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "NotificationLevel"); + } + if (NotificationTargets == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "NotificationTargets"); + } + if (NotificationTargets != null) + { + foreach (var element in NotificationTargets) + { + if (element != null) + { + element.Validate(); + } + } + } + } + } +} diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/NotificationChannel.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/NotificationChannel.cs new file mode 100644 index 000000000000..4aa4b510e65a --- /dev/null +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/NotificationChannel.cs @@ -0,0 +1,32 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.ServiceFabric.Models +{ + + /// + /// Defines values for NotificationChannel. + /// + public static class NotificationChannel + { + /// + /// For email user receivers. In this case, the parameter receivers + /// should be a list of email addresses that will receive the + /// notifications. + /// + public const string EmailUser = "EmailUser"; + /// + /// For subscription receivers. In this case, the parameter receivers + /// should be a list of roles of the subscription for the cluster (eg. + /// Owner, AccountAdmin, etc) that will receive the notifications. + /// + public const string EmailSubscription = "EmailSubscription"; + } +} diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ProbeProtocol.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/NotificationLevel.cs similarity index 56% rename from sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ProbeProtocol.cs rename to sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/NotificationLevel.cs index e0d04814ef61..da79360c506d 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ProbeProtocol.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/NotificationLevel.cs @@ -12,12 +12,17 @@ namespace Microsoft.Azure.Management.ServiceFabric.Models { /// - /// Defines values for ProbeProtocol. + /// Defines values for NotificationLevel. /// - public static class ProbeProtocol + public static class NotificationLevel { - public const string Tcp = "tcp"; - public const string Http = "http"; - public const string Https = "https"; + /// + /// Receive only critical notifications. + /// + public const string Critical = "Critical"; + /// + /// Receive all notifications. + /// + public const string All = "All"; } } diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/NotificationTarget.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/NotificationTarget.cs new file mode 100644 index 000000000000..bc99f85af369 --- /dev/null +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/NotificationTarget.cs @@ -0,0 +1,86 @@ +// +// 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; + + /// + /// Describes the notification target properties. + /// + public partial class NotificationTarget + { + /// + /// Initializes a new instance of the NotificationTarget class. + /// + public NotificationTarget() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the NotificationTarget class. + /// + /// The notification channel + /// indicates the type of receivers subscribed to the notification, + /// either user or subscription. Possible values include: 'EmailUser', + /// 'EmailSubscription' + /// List of targets that subscribe to the + /// notification. + public NotificationTarget(string notificationChannel, IList receivers) + { + NotificationChannel = notificationChannel; + Receivers = receivers; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the notification channel indicates the type of + /// receivers subscribed to the notification, either user or + /// subscription. Possible values include: 'EmailUser', + /// 'EmailSubscription' + /// + [JsonProperty(PropertyName = "notificationChannel")] + public string NotificationChannel { get; set; } + + /// + /// Gets or sets list of targets that subscribe to the notification. + /// + [JsonProperty(PropertyName = "receivers")] + public IList Receivers { get; set; } + + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + if (NotificationChannel == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "NotificationChannel"); + } + if (Receivers == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "Receivers"); + } + } + } +} diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/OperationResult.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/OperationResult.cs index 98b15f92cdab..3ab8ce421f65 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/OperationResult.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/OperationResult.cs @@ -30,14 +30,17 @@ public OperationResult() /// Initializes a new instance of the OperationResult class. /// /// The name of the operation. + /// Indicates whether the operation is a + /// data action /// The object that represents the /// operation. /// Origin result /// The URL to use for getting the next set of /// results. - public OperationResult(string name = default(string), AvailableOperationDisplay display = default(AvailableOperationDisplay), string origin = default(string), string nextLink = default(string)) + public OperationResult(string name = default(string), bool? isDataAction = default(bool?), AvailableOperationDisplay display = default(AvailableOperationDisplay), string origin = default(string), string nextLink = default(string)) { Name = name; + IsDataAction = isDataAction; Display = display; Origin = origin; NextLink = nextLink; @@ -55,6 +58,12 @@ public OperationResult() [JsonProperty(PropertyName = "name")] public string Name { get; set; } + /// + /// Gets or sets indicates whether the operation is a data action + /// + [JsonProperty(PropertyName = "isDataAction")] + public bool? IsDataAction { get; set; } + /// /// Gets or sets the object that represents the operation. /// 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 deleted file mode 100644 index 581968ebbc84..000000000000 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/Protocol.cs +++ /dev/null @@ -1,22 +0,0 @@ -// -// 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/ProxyResource.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ProxyResource.cs index 97ca2de5b8f3..7e944ffbdcd0 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ProxyResource.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ProxyResource.cs @@ -40,7 +40,7 @@ public ProxyResource() /// location depends on the parent resource. /// Azure resource tags. /// Azure resource etag. - public ProxyResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string etag = default(string)) + public ProxyResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string etag = default(string), SystemData systemData = default(SystemData)) { Id = id; Name = name; @@ -48,6 +48,7 @@ public ProxyResource() Location = location; Tags = tags; Etag = etag; + SystemData = systemData; CustomInit(); } @@ -93,5 +94,10 @@ public ProxyResource() [JsonProperty(PropertyName = "etag")] public string Etag { get; private set; } + /// + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; set; } + } } diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/Resource.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/Resource.cs index b23fdc9f8072..1511f70b0cd5 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/Resource.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/Resource.cs @@ -39,7 +39,7 @@ public Resource() /// Azure resource type. /// Azure resource tags. /// Azure resource etag. - public Resource(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string etag = default(string)) + public Resource(string location, string id = default(string), string name = default(string), string type = default(string), IDictionary tags = default(IDictionary), string etag = default(string), SystemData systemData = default(SystemData)) { Id = id; Name = name; @@ -47,6 +47,7 @@ public Resource() Location = location; Tags = tags; Etag = etag; + SystemData = systemData; CustomInit(); } @@ -91,6 +92,11 @@ public Resource() [JsonProperty(PropertyName = "etag")] public string Etag { get; private set; } + /// + /// + [JsonProperty(PropertyName = "systemData")] + public SystemData SystemData { get; set; } + /// /// Validate the object. /// diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ServerCertificateCommonNames.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ServerCertificateCommonNames.cs index acb06a84ef5f..08f71242bff1 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ServerCertificateCommonNames.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ServerCertificateCommonNames.cs @@ -37,9 +37,8 @@ public ServerCertificateCommonNames() /// The list of server certificates /// referenced by common name that are used to secure the /// cluster. - /// The local certificate store location. - /// Possible values include: 'AddressBook', 'AuthRoot', - /// 'CertificateAuthority', 'Disallowed', 'My', 'Root', + /// Possible values include: 'AddressBook', + /// 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', /// 'TrustedPeople', 'TrustedPublisher' public ServerCertificateCommonNames(IList commonNames = default(IList), string x509StoreName = default(string)) { @@ -61,9 +60,9 @@ public ServerCertificateCommonNames() public IList CommonNames { get; set; } /// - /// Gets or sets the local certificate store location. Possible values - /// include: 'AddressBook', 'AuthRoot', 'CertificateAuthority', - /// 'Disallowed', 'My', 'Root', 'TrustedPeople', 'TrustedPublisher' + /// Gets or sets possible values include: 'AddressBook', 'AuthRoot', + /// 'CertificateAuthority', 'Disallowed', 'My', 'Root', + /// 'TrustedPeople', 'TrustedPublisher' /// [JsonProperty(PropertyName = "x509StoreName")] public string X509StoreName { get; set; } 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 c2ab3714de54..9ad7ea09b077 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 @@ -47,28 +47,19 @@ public ServiceResource() /// based on the service requirements. For example, to place a service /// on nodes where NodeType is blue specify the following: "NodeColor /// == blue)". - /// A list that describes the - /// correlation of the service with other services. - /// The service load metrics is given - /// as an array of ServiceLoadMetricDescription objects. - /// A list that describes the - /// correlation of the service with other services. - /// Specifies the move cost for the - /// service. Possible values include: 'Zero', 'Low', 'Medium', - /// 'High' + /// Possible values include: 'Zero', + /// 'Low', 'Medium', 'High' /// The current deployment or /// provisioning state, which only appears in the response /// The name of the service type - /// Describes how the service is - /// partitioned. /// 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. - 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) + 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), SystemData systemData = default(SystemData), 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, systemData) { PlacementConstraints = placementConstraints; CorrelationScheme = correlationScheme; @@ -99,29 +90,23 @@ public ServiceResource() public string PlacementConstraints { get; set; } /// - /// Gets or sets a list that describes the correlation of the service - /// with other services. /// [JsonProperty(PropertyName = "properties.correlationScheme")] public IList CorrelationScheme { get; set; } /// - /// Gets or sets the service load metrics is given as an array of - /// ServiceLoadMetricDescription objects. /// [JsonProperty(PropertyName = "properties.serviceLoadMetrics")] public IList ServiceLoadMetrics { get; set; } /// - /// Gets or sets a list that describes the correlation of the service - /// with other services. /// [JsonProperty(PropertyName = "properties.servicePlacementPolicies")] public IList ServicePlacementPolicies { get; set; } /// - /// Gets or sets specifies the move cost for the service. Possible - /// values include: 'Zero', 'Low', 'Medium', 'High' + /// Gets or sets possible values include: 'Zero', 'Low', 'Medium', + /// 'High' /// [JsonProperty(PropertyName = "properties.defaultMoveCost")] public string DefaultMoveCost { get; set; } @@ -140,7 +125,6 @@ public ServiceResource() public string ServiceTypeName { get; set; } /// - /// Gets or sets describes how the service is partitioned. /// [JsonProperty(PropertyName = "properties.partitionDescription")] public PartitionSchemeDescription PartitionDescription { 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 8bf965b85044..012cc5b725ed 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 @@ -37,20 +37,11 @@ public ServiceResourceProperties() /// based on the service requirements. For example, to place a service /// on nodes where NodeType is blue specify the following: "NodeColor /// == blue)". - /// A list that describes the - /// correlation of the service with other services. - /// The service load metrics is given - /// as an array of ServiceLoadMetricDescription objects. - /// A list that describes the - /// correlation of the service with other services. - /// Specifies the move cost for the - /// service. Possible values include: 'Zero', 'Low', 'Medium', - /// 'High' + /// Possible values include: 'Zero', + /// 'Low', 'Medium', 'High' /// The current deployment or /// provisioning state, which only appears in the response /// The name of the service type - /// Describes how the service is - /// partitioned. /// The activation Mode of /// the service package. Possible values include: 'SharedProcess', /// 'ExclusiveProcess' @@ -87,7 +78,6 @@ public ServiceResourceProperties() public string ServiceTypeName { get; set; } /// - /// Gets or sets describes how the service is partitioned. /// [JsonProperty(PropertyName = "partitionDescription")] public PartitionSchemeDescription PartitionDescription { get; set; } diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ServiceResourcePropertiesBase.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ServiceResourcePropertiesBase.cs index faa60f559e9f..72d02459c146 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ServiceResourcePropertiesBase.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ServiceResourcePropertiesBase.cs @@ -39,15 +39,8 @@ public ServiceResourcePropertiesBase() /// based on the service requirements. For example, to place a service /// on nodes where NodeType is blue specify the following: "NodeColor /// == blue)". - /// A list that describes the - /// correlation of the service with other services. - /// The service load metrics is given - /// as an array of ServiceLoadMetricDescription objects. - /// A list that describes the - /// correlation of the service with other services. - /// Specifies the move cost for the - /// service. Possible values include: 'Zero', 'Low', 'Medium', - /// 'High' + /// Possible values include: 'Zero', + /// 'Low', 'Medium', 'High' public ServiceResourcePropertiesBase(string placementConstraints = default(string), IList correlationScheme = default(IList), IList serviceLoadMetrics = default(IList), IList servicePlacementPolicies = default(IList), string defaultMoveCost = default(string)) { PlacementConstraints = placementConstraints; @@ -74,29 +67,23 @@ public ServiceResourcePropertiesBase() public string PlacementConstraints { get; set; } /// - /// Gets or sets a list that describes the correlation of the service - /// with other services. /// [JsonProperty(PropertyName = "correlationScheme")] public IList CorrelationScheme { get; set; } /// - /// Gets or sets the service load metrics is given as an array of - /// ServiceLoadMetricDescription objects. /// [JsonProperty(PropertyName = "serviceLoadMetrics")] public IList ServiceLoadMetrics { get; set; } /// - /// Gets or sets a list that describes the correlation of the service - /// with other services. /// [JsonProperty(PropertyName = "servicePlacementPolicies")] public IList ServicePlacementPolicies { get; set; } /// - /// Gets or sets specifies the move cost for the service. Possible - /// values include: 'Zero', 'Low', 'Medium', 'High' + /// Gets or sets possible values include: 'Zero', 'Low', 'Medium', + /// 'High' /// [JsonProperty(PropertyName = "defaultMoveCost")] public string DefaultMoveCost { get; set; } diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ServiceResourceUpdate.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ServiceResourceUpdate.cs index b059c5914623..7e09eb0daa11 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ServiceResourceUpdate.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ServiceResourceUpdate.cs @@ -47,17 +47,10 @@ public ServiceResourceUpdate() /// based on the service requirements. For example, to place a service /// on nodes where NodeType is blue specify the following: "NodeColor /// == blue)". - /// A list that describes the - /// correlation of the service with other services. - /// The service load metrics is given - /// as an array of ServiceLoadMetricDescription objects. - /// A list that describes the - /// correlation of the service with other services. - /// Specifies the move cost for the - /// service. Possible values include: 'Zero', 'Low', 'Medium', - /// 'High' - public ServiceResourceUpdate(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)) - : base(id, name, type, location, tags, etag) + /// Possible values include: 'Zero', + /// 'Low', 'Medium', 'High' + public ServiceResourceUpdate(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string etag = default(string), SystemData systemData = default(SystemData), string placementConstraints = default(string), IList correlationScheme = default(IList), IList serviceLoadMetrics = default(IList), IList servicePlacementPolicies = default(IList), string defaultMoveCost = default(string)) + : base(id, name, type, location, tags, etag, systemData) { PlacementConstraints = placementConstraints; CorrelationScheme = correlationScheme; @@ -83,29 +76,23 @@ public ServiceResourceUpdate() public string PlacementConstraints { get; set; } /// - /// Gets or sets a list that describes the correlation of the service - /// with other services. /// [JsonProperty(PropertyName = "properties.correlationScheme")] public IList CorrelationScheme { get; set; } /// - /// Gets or sets the service load metrics is given as an array of - /// ServiceLoadMetricDescription objects. /// [JsonProperty(PropertyName = "properties.serviceLoadMetrics")] public IList ServiceLoadMetrics { get; set; } /// - /// Gets or sets a list that describes the correlation of the service - /// with other services. /// [JsonProperty(PropertyName = "properties.servicePlacementPolicies")] public IList ServicePlacementPolicies { get; set; } /// - /// Gets or sets specifies the move cost for the service. Possible - /// values include: 'Zero', 'Low', 'Medium', 'High' + /// Gets or sets possible values include: 'Zero', 'Low', 'Medium', + /// 'High' /// [JsonProperty(PropertyName = "properties.defaultMoveCost")] public string DefaultMoveCost { get; set; } diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ServiceResourceUpdateProperties.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ServiceResourceUpdateProperties.cs index 92b4db923186..d122f042a8cc 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ServiceResourceUpdateProperties.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/ServiceResourceUpdateProperties.cs @@ -38,15 +38,8 @@ public ServiceResourceUpdateProperties() /// based on the service requirements. For example, to place a service /// on nodes where NodeType is blue specify the following: "NodeColor /// == blue)". - /// A list that describes the - /// correlation of the service with other services. - /// The service load metrics is given - /// as an array of ServiceLoadMetricDescription objects. - /// A list that describes the - /// correlation of the service with other services. - /// Specifies the move cost for the - /// service. Possible values include: 'Zero', 'Low', 'Medium', - /// 'High' + /// Possible values include: 'Zero', + /// 'Low', 'Medium', 'High' public ServiceResourceUpdateProperties(string placementConstraints = default(string), IList correlationScheme = default(IList), IList serviceLoadMetrics = default(IList), IList servicePlacementPolicies = default(IList), string defaultMoveCost = default(string)) : base(placementConstraints, correlationScheme, serviceLoadMetrics, servicePlacementPolicies, defaultMoveCost) { diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/SfZonalUpgradeMode.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/SfZonalUpgradeMode.cs new file mode 100644 index 000000000000..cd6e4cb3a024 --- /dev/null +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/SfZonalUpgradeMode.cs @@ -0,0 +1,38 @@ +// +// 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 SfZonalUpgradeMode. + /// + public static class SfZonalUpgradeMode + { + /// + /// VMs under the node type are grouped into UDs and ignore the zone + /// info in five UDs. This setting causes UDs across all zones to be + /// upgraded at the same time. This deployment mode is faster for + /// upgrades, we don't recommend it because it goes against the SDP + /// guidelines, which state that the updates should be applied to one + /// zone at a time. + /// + public const string Parallel = "Parallel"; + /// + /// If this value is omitted or set to Hierarchical, VMs are grouped to + /// reflect the zonal distribution in up to 15 UDs. Each of the three + /// zones has five UDs. This ensures that the zones are updated one at + /// a time, moving to next zone only after completing five UDs within + /// the first zone. This update process is safer for the cluster and + /// the user application. + /// + public const string Hierarchical = "Hierarchical"; + } +} 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 230ffdaf3462..0aa90b51a257 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 @@ -39,20 +39,11 @@ public StatefulServiceProperties() /// based on the service requirements. For example, to place a service /// on nodes where NodeType is blue specify the following: "NodeColor /// == blue)". - /// A list that describes the - /// correlation of the service with other services. - /// The service load metrics is given - /// as an array of ServiceLoadMetricDescription objects. - /// A list that describes the - /// correlation of the service with other services. - /// Specifies the move cost for the - /// service. Possible values include: 'Zero', 'Low', 'Medium', - /// 'High' + /// Possible values include: 'Zero', + /// 'Low', 'Medium', 'High' /// The current deployment or /// provisioning state, which only appears in the response /// The name of the service type - /// Describes how the service is - /// partitioned. /// The activation Mode of /// the service package. Possible values include: 'SharedProcess', /// 'ExclusiveProcess' diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/StatefulServiceUpdateProperties.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/StatefulServiceUpdateProperties.cs index 3b6163de3160..f5f653f8e80e 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/StatefulServiceUpdateProperties.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/StatefulServiceUpdateProperties.cs @@ -41,15 +41,8 @@ public StatefulServiceUpdateProperties() /// based on the service requirements. For example, to place a service /// on nodes where NodeType is blue specify the following: "NodeColor /// == blue)". - /// A list that describes the - /// correlation of the service with other services. - /// The service load metrics is given - /// as an array of ServiceLoadMetricDescription objects. - /// A list that describes the - /// correlation of the service with other services. - /// Specifies the move cost for the - /// service. Possible values include: 'Zero', 'Low', 'Medium', - /// 'High' + /// Possible values include: 'Zero', + /// 'Low', 'Medium', 'High' /// The target replica set size as a /// number. /// The minimum replica set size as a 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 5c69d7913c6a..7dafd1a6f943 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 @@ -39,20 +39,11 @@ public StatelessServiceProperties() /// based on the service requirements. For example, to place a service /// on nodes where NodeType is blue specify the following: "NodeColor /// == blue)". - /// A list that describes the - /// correlation of the service with other services. - /// The service load metrics is given - /// as an array of ServiceLoadMetricDescription objects. - /// A list that describes the - /// correlation of the service with other services. - /// Specifies the move cost for the - /// service. Possible values include: 'Zero', 'Low', 'Medium', - /// 'High' + /// Possible values include: 'Zero', + /// 'Low', 'Medium', 'High' /// The current deployment or /// provisioning state, which only appears in the response /// The name of the service type - /// Describes how the service is - /// partitioned. /// The activation Mode of /// the service package. Possible values include: 'SharedProcess', /// 'ExclusiveProcess' 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 d0562f1baebd..6a778b382415 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 @@ -41,15 +41,8 @@ public StatelessServiceUpdateProperties() /// based on the service requirements. For example, to place a service /// on nodes where NodeType is blue specify the following: "NodeColor /// == blue)". - /// A list that describes the - /// correlation of the service with other services. - /// The service load metrics is given - /// as an array of ServiceLoadMetricDescription objects. - /// A list that describes the - /// correlation of the service with other services. - /// Specifies the move cost for the - /// service. Possible values include: 'Zero', 'Low', 'Medium', - /// 'High' + /// Possible values include: 'Zero', + /// 'Low', 'Medium', 'High' /// The instance count. /// Delay duration for /// RequestDrain feature to ensures that the endpoint advertised by the diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/SystemData.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/SystemData.cs new file mode 100644 index 000000000000..fd7260fe2dbe --- /dev/null +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/SystemData.cs @@ -0,0 +1,97 @@ +// +// 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; + + /// + /// Metadata pertaining to creation and last modification of the resource. + /// + public partial class SystemData + { + /// + /// Initializes a new instance of the SystemData class. + /// + public SystemData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SystemData class. + /// + /// The identity that created the + /// resource. + /// The type of identity that created the + /// resource. + /// The timestamp of resource creation + /// (UTC). + /// The identity that last modified the + /// resource. + /// The type of identity that last + /// modified the resource. + /// The timestamp of resource last + /// modification (UTC). + public SystemData(string createdBy = default(string), string createdByType = default(string), System.DateTime? createdAt = default(System.DateTime?), string lastModifiedBy = default(string), string lastModifiedByType = default(string), System.DateTime? lastModifiedAt = default(System.DateTime?)) + { + CreatedBy = createdBy; + CreatedByType = createdByType; + CreatedAt = createdAt; + LastModifiedBy = lastModifiedBy; + LastModifiedByType = lastModifiedByType; + LastModifiedAt = lastModifiedAt; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the identity that created the resource. + /// + [JsonProperty(PropertyName = "createdBy")] + public string CreatedBy { get; set; } + + /// + /// Gets or sets the type of identity that created the resource. + /// + [JsonProperty(PropertyName = "createdByType")] + public string CreatedByType { get; set; } + + /// + /// Gets or sets the timestamp of resource creation (UTC). + /// + [JsonProperty(PropertyName = "createdAt")] + public System.DateTime? CreatedAt { get; set; } + + /// + /// Gets or sets the identity that last modified the resource. + /// + [JsonProperty(PropertyName = "lastModifiedBy")] + public string LastModifiedBy { get; set; } + + /// + /// Gets or sets the type of identity that last modified the resource. + /// + [JsonProperty(PropertyName = "lastModifiedByType")] + public string LastModifiedByType { get; set; } + + /// + /// Gets or sets the timestamp of resource last modification (UTC). + /// + [JsonProperty(PropertyName = "lastModifiedAt")] + public System.DateTime? LastModifiedAt { get; set; } + + } +} diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/SubResource.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/UpgradableVersionPathResult.cs similarity index 54% rename from sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/SubResource.cs rename to sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/UpgradableVersionPathResult.cs index 80278c6283e6..a031c733a940 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/SubResource.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/UpgradableVersionPathResult.cs @@ -10,31 +10,34 @@ 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; /// - /// Azure resource identifier. + /// The list of intermediate cluster code versions for an upgrade or + /// downgrade. Or minimum and maximum upgradable version if no target was + /// given /// - public partial class SubResource : IResource + public partial class UpgradableVersionPathResult { /// - /// Initializes a new instance of the SubResource class. + /// Initializes a new instance of the UpgradableVersionPathResult + /// class. /// - public SubResource() + public UpgradableVersionPathResult() { CustomInit(); } /// - /// Initializes a new instance of the SubResource class. + /// Initializes a new instance of the UpgradableVersionPathResult + /// class. /// - /// Azure resource identifier. - public SubResource(string id = default(string)) + public UpgradableVersionPathResult(IList supportedPath = default(IList)) { - Id = id; + SupportedPath = supportedPath; CustomInit(); } @@ -44,10 +47,9 @@ public SubResource() partial void CustomInit(); /// - /// Gets or sets azure resource identifier. /// - [JsonProperty(PropertyName = "id")] - public string Id { get; set; } + [JsonProperty(PropertyName = "supportedPath")] + public IList SupportedPath { 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/UpgradableVersionsDescription.cs similarity index 59% rename from sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/Sku.cs rename to sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/UpgradableVersionsDescription.cs index 04cc20c4e280..054c398980c2 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/Sku.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/UpgradableVersionsDescription.cs @@ -14,28 +14,25 @@ namespace Microsoft.Azure.Management.ServiceFabric.Models using Newtonsoft.Json; using System.Linq; - /// - /// Sku definition - /// - public partial class Sku + public partial class UpgradableVersionsDescription { /// - /// Initializes a new instance of the Sku class. + /// Initializes a new instance of the UpgradableVersionsDescription + /// class. /// - public Sku() + public UpgradableVersionsDescription() { CustomInit(); } /// - /// Initializes a new instance of the Sku class. + /// Initializes a new instance of the UpgradableVersionsDescription + /// 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) + /// The target code version. + public UpgradableVersionsDescription(string targetVersion) { - Name = name; + TargetVersion = targetVersion; CustomInit(); } @@ -45,12 +42,10 @@ public Sku(string name) 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' + /// Gets or sets the target code version. /// - [JsonProperty(PropertyName = "name")] - public string Name { get; set; } + [JsonProperty(PropertyName = "targetVersion")] + public string TargetVersion { get; set; } /// /// Validate the object. @@ -60,9 +55,9 @@ public Sku(string name) /// public virtual void Validate() { - if (Name == null) + if (TargetVersion == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "Name"); + throw new ValidationException(ValidationRules.CannotBeNull, "TargetVersion"); } } } diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/UpgradeMode.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/UpgradeMode.cs new file mode 100644 index 000000000000..4956b54934e6 --- /dev/null +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/UpgradeMode.cs @@ -0,0 +1,32 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.ServiceFabric.Models +{ + + /// + /// Defines values for UpgradeMode. + /// + public static class UpgradeMode + { + /// + /// The cluster will be automatically upgraded to the latest Service + /// Fabric runtime version, **upgradeWave** will determine when the + /// upgrade starts after the new version becomes available. + /// + public const string Automatic = "Automatic"; + /// + /// 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. + /// + public const string Manual = "Manual"; + } +} 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 deleted file mode 100644 index 34ca919e65f6..000000000000 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/VMSSExtension.cs +++ /dev/null @@ -1,177 +0,0 @@ -// -// 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 deleted file mode 100644 index 96da69c220f4..000000000000 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/VaultCertificate.cs +++ /dev/null @@ -1,110 +0,0 @@ -// -// 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 deleted file mode 100644 index 42351c4d4eea..000000000000 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/VaultSecretGroup.cs +++ /dev/null @@ -1,94 +0,0 @@ -// -// 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/Models/VmssZonalUpgradeMode.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/VmssZonalUpgradeMode.cs new file mode 100644 index 000000000000..8e3c2add6162 --- /dev/null +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/Models/VmssZonalUpgradeMode.cs @@ -0,0 +1,32 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.ServiceFabric.Models +{ + + /// + /// Defines values for VmssZonalUpgradeMode. + /// + public static class VmssZonalUpgradeMode + { + /// + /// Updates will happen in all Availability Zones at once for the + /// virtual machine scale sets. + /// + public const string Parallel = "Parallel"; + /// + /// VMs are grouped to reflect the zonal distribution in up to 15 UDs. + /// Each of the three zones has five UDs. This ensures that the zones + /// are updated one at a time, moving to next zone only after + /// completing five UDs within the first zone. + /// + public const string Hierarchical = "Hierarchical"; + } +} diff --git a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/NodeTypesOperations.cs b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/NodeTypesOperations.cs deleted file mode 100644 index 06fa233439b6..000000000000 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/NodeTypesOperations.cs +++ /dev/null @@ -1,2069 +0,0 @@ -// -// 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 deleted file mode 100644 index 23ad256f683d..000000000000 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/NodeTypesOperationsExtensions.cs +++ /dev/null @@ -1,835 +0,0 @@ -// -// 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 b746b3bd8f04..13c6be074070 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,30 +19,15 @@ public static IEnumerable> ApiInfo_ServiceFabricMa { return new Tuple[] { - 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"), + new Tuple("ServiceFabric", "ApplicationTypeVersions", "2021-06-01"), + new Tuple("ServiceFabric", "ApplicationTypes", "2021-06-01"), + new Tuple("ServiceFabric", "Applications", "2021-06-01"), + new Tuple("ServiceFabric", "ClusterVersions", "2021-06-01"), + new Tuple("ServiceFabric", "Clusters", "2021-06-01"), + new Tuple("ServiceFabric", "Operations", "2021-06-01"), + new Tuple("ServiceFabric", "Services", "2021-06-01"), }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "v2"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4413"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/servicefabric/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=E:\\code\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "4873ee82eef44772dec2b6c26d9b5a094c393b21"; - 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 18f36768399c..2c0dff12bb65 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ServiceFabricManagementClient.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ServiceFabricManagementClient.cs @@ -46,6 +46,12 @@ 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 "2021-06-01" for this specification. + /// + public string ApiVersion { get; private set; } + /// /// The customer subscription identifier. /// @@ -104,21 +110,6 @@ 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. /// @@ -367,10 +358,8 @@ 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 = "2021-06-01"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; 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 7397bab3a264..c3d8f2571a41 100644 --- a/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ServicesOperations.cs +++ b/sdk/servicefabric/Microsoft.Azure.Management.ServiceFabric/src/Generated/ServicesOperations.cs @@ -113,7 +113,6 @@ internal ServicesOperations(ServiceFabricManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "serviceName"); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -125,7 +124,6 @@ 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); } @@ -138,9 +136,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -420,7 +418,6 @@ internal ServicesOperations(ServiceFabricManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "applicationName"); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -431,7 +428,6 @@ 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); } @@ -443,9 +439,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -636,7 +632,6 @@ internal ServicesOperations(ServiceFabricManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -648,7 +643,6 @@ 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); @@ -662,9 +656,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -861,7 +855,6 @@ internal ServicesOperations(ServiceFabricManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -873,7 +866,6 @@ 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); @@ -887,9 +879,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1076,7 +1068,6 @@ internal ServicesOperations(ServiceFabricManagementClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "serviceName"); } - string apiVersion = "2020-03-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1088,7 +1079,6 @@ 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); } @@ -1101,9 +1091,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 (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) {