Skip to content

Commit 9db0a3e

Browse files
authored
[AKS] Supported the value 'AzureLinux' for parameter 'OsSKU' (#21917)
* [AKS] bumpd SDK API version to 2023-04-01 * [AKS] support OSSKU Value AzureLinux * [AKS] add breaking change for parameter 'DockerBridgeCidr' * update changelog & help md * update the warning message of breaking change on parameter 'DockerBridgeCidr'
1 parent 3703fbb commit 9db0a3e

File tree

56 files changed

+17961
-25077
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+17961
-25077
lines changed

src/Aks/Aks.Sdk/Generated/ContainerServiceClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ private void Initialize()
364364
ResolvePrivateLinkServiceId = new ResolvePrivateLinkServiceIdOperations(this);
365365
Snapshots = new SnapshotsOperations(this);
366366
BaseUri = new System.Uri("https://management.azure.com");
367-
ApiVersion = "2023-02-01";
367+
ApiVersion = "2023-04-01";
368368
AcceptLanguage = "en-US";
369369
LongRunningOperationRetryTimeout = 30;
370370
GenerateClientRequestId = true;

src/Aks/Aks.Sdk/Generated/IManagedClustersOperations.cs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,34 @@ public partial interface IManagedClustersOperations
4949
/// </exception>
5050
Task<AzureOperationResponse<OSOptionProfile>> GetOSOptionsWithHttpMessagesAsync(string location, string resourceType = default(string), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
5151
/// <summary>
52+
/// Gets a list of supported Kubernetes versions in the specified
53+
/// subscription.
54+
/// </summary>
55+
/// <remarks>
56+
/// Contains extra metadata on the version, including supported patch
57+
/// versions, capabilities, available upgrades, and details on preview
58+
/// status of the version
59+
/// </remarks>
60+
/// <param name='location'>
61+
/// The name of Azure region.
62+
/// </param>
63+
/// <param name='customHeaders'>
64+
/// The headers that will be added to request.
65+
/// </param>
66+
/// <param name='cancellationToken'>
67+
/// The cancellation token.
68+
/// </param>
69+
/// <exception cref="Microsoft.Rest.Azure.CloudException">
70+
/// Thrown when the operation returned an invalid status code
71+
/// </exception>
72+
/// <exception cref="Microsoft.Rest.SerializationException">
73+
/// Thrown when unable to deserialize the response
74+
/// </exception>
75+
/// <exception cref="Microsoft.Rest.ValidationException">
76+
/// Thrown when a required parameter is null
77+
/// </exception>
78+
Task<AzureOperationResponse<KubernetesVersionListResult>> ListKubernetesVersionsWithHttpMessagesAsync(string location, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
79+
/// <summary>
5280
/// Gets a list of managed clusters in the specified subscription.
5381
/// </summary>
5482
/// <param name='customHeaders'>

src/Aks/Aks.Sdk/Generated/ManagedClustersOperations.cs

Lines changed: 213 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,219 @@ internal ManagedClustersOperations(ContainerServiceClient client)
266266
return _result;
267267
}
268268

269+
/// <summary>
270+
/// Gets a list of supported Kubernetes versions in the specified subscription.
271+
/// </summary>
272+
/// <remarks>
273+
/// Contains extra metadata on the version, including supported patch versions,
274+
/// capabilities, available upgrades, and details on preview status of the
275+
/// version
276+
/// </remarks>
277+
/// <param name='location'>
278+
/// The name of Azure region.
279+
/// </param>
280+
/// <param name='customHeaders'>
281+
/// Headers that will be added to request.
282+
/// </param>
283+
/// <param name='cancellationToken'>
284+
/// The cancellation token.
285+
/// </param>
286+
/// <exception cref="CloudException">
287+
/// Thrown when the operation returned an invalid status code
288+
/// </exception>
289+
/// <exception cref="SerializationException">
290+
/// Thrown when unable to deserialize the response
291+
/// </exception>
292+
/// <exception cref="ValidationException">
293+
/// Thrown when a required parameter is null
294+
/// </exception>
295+
/// <exception cref="System.ArgumentNullException">
296+
/// Thrown when a required parameter is null
297+
/// </exception>
298+
/// <return>
299+
/// A response object containing the response body and response headers.
300+
/// </return>
301+
public async Task<AzureOperationResponse<KubernetesVersionListResult>> ListKubernetesVersionsWithHttpMessagesAsync(string location, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
302+
{
303+
if (Client.ApiVersion == null)
304+
{
305+
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
306+
}
307+
if (Client.ApiVersion != null)
308+
{
309+
if (Client.ApiVersion.Length < 1)
310+
{
311+
throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
312+
}
313+
}
314+
if (Client.SubscriptionId == null)
315+
{
316+
throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
317+
}
318+
if (Client.SubscriptionId != null)
319+
{
320+
if (Client.SubscriptionId.Length < 1)
321+
{
322+
throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
323+
}
324+
}
325+
if (location == null)
326+
{
327+
throw new ValidationException(ValidationRules.CannotBeNull, "location");
328+
}
329+
if (location != null)
330+
{
331+
if (location.Length < 1)
332+
{
333+
throw new ValidationException(ValidationRules.MinLength, "location", 1);
334+
}
335+
}
336+
// Tracing
337+
bool _shouldTrace = ServiceClientTracing.IsEnabled;
338+
string _invocationId = null;
339+
if (_shouldTrace)
340+
{
341+
_invocationId = ServiceClientTracing.NextInvocationId.ToString();
342+
Dictionary<string, object> tracingParameters = new Dictionary<string, object>();
343+
tracingParameters.Add("location", location);
344+
tracingParameters.Add("cancellationToken", cancellationToken);
345+
ServiceClientTracing.Enter(_invocationId, this, "ListKubernetesVersions", tracingParameters);
346+
}
347+
// Construct URL
348+
var _baseUrl = Client.BaseUri.AbsoluteUri;
349+
var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/kubernetesVersions").ToString();
350+
_url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
351+
_url = _url.Replace("{location}", System.Uri.EscapeDataString(location));
352+
List<string> _queryParameters = new List<string>();
353+
if (Client.ApiVersion != null)
354+
{
355+
_queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
356+
}
357+
if (_queryParameters.Count > 0)
358+
{
359+
_url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
360+
}
361+
// Create HTTP transport objects
362+
var _httpRequest = new HttpRequestMessage();
363+
HttpResponseMessage _httpResponse = null;
364+
_httpRequest.Method = new HttpMethod("GET");
365+
_httpRequest.RequestUri = new System.Uri(_url);
366+
// Set Headers
367+
if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
368+
{
369+
_httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
370+
}
371+
if (Client.AcceptLanguage != null)
372+
{
373+
if (_httpRequest.Headers.Contains("accept-language"))
374+
{
375+
_httpRequest.Headers.Remove("accept-language");
376+
}
377+
_httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
378+
}
379+
380+
381+
if (customHeaders != null)
382+
{
383+
foreach(var _header in customHeaders)
384+
{
385+
if (_httpRequest.Headers.Contains(_header.Key))
386+
{
387+
_httpRequest.Headers.Remove(_header.Key);
388+
}
389+
_httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
390+
}
391+
}
392+
393+
// Serialize Request
394+
string _requestContent = null;
395+
// Set Credentials
396+
if (Client.Credentials != null)
397+
{
398+
cancellationToken.ThrowIfCancellationRequested();
399+
await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
400+
}
401+
// Send Request
402+
if (_shouldTrace)
403+
{
404+
ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
405+
}
406+
cancellationToken.ThrowIfCancellationRequested();
407+
_httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
408+
if (_shouldTrace)
409+
{
410+
ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
411+
}
412+
HttpStatusCode _statusCode = _httpResponse.StatusCode;
413+
cancellationToken.ThrowIfCancellationRequested();
414+
string _responseContent = null;
415+
if ((int)_statusCode != 200)
416+
{
417+
var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
418+
try
419+
{
420+
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
421+
CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject<CloudError>(_responseContent, Client.DeserializationSettings);
422+
if (_errorBody != null)
423+
{
424+
ex = new CloudException(_errorBody.Message);
425+
ex.Body = _errorBody;
426+
}
427+
}
428+
catch (JsonException)
429+
{
430+
// Ignore the exception
431+
}
432+
ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
433+
ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
434+
if (_httpResponse.Headers.Contains("x-ms-request-id"))
435+
{
436+
ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
437+
}
438+
if (_shouldTrace)
439+
{
440+
ServiceClientTracing.Error(_invocationId, ex);
441+
}
442+
_httpRequest.Dispose();
443+
if (_httpResponse != null)
444+
{
445+
_httpResponse.Dispose();
446+
}
447+
throw ex;
448+
}
449+
// Create Result
450+
var _result = new AzureOperationResponse<KubernetesVersionListResult>();
451+
_result.Request = _httpRequest;
452+
_result.Response = _httpResponse;
453+
if (_httpResponse.Headers.Contains("x-ms-request-id"))
454+
{
455+
_result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
456+
}
457+
// Deserialize Response
458+
if ((int)_statusCode == 200)
459+
{
460+
_responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
461+
try
462+
{
463+
_result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject<KubernetesVersionListResult>(_responseContent, Client.DeserializationSettings);
464+
}
465+
catch (JsonException ex)
466+
{
467+
_httpRequest.Dispose();
468+
if (_httpResponse != null)
469+
{
470+
_httpResponse.Dispose();
471+
}
472+
throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
473+
}
474+
}
475+
if (_shouldTrace)
476+
{
477+
ServiceClientTracing.Exit(_invocationId, _result);
478+
}
479+
return _result;
480+
}
481+
269482
/// <summary>
270483
/// Gets a list of managed clusters in the specified subscription.
271484
/// </summary>

src/Aks/Aks.Sdk/Generated/ManagedClustersOperationsExtensions.cs

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,50 @@ public static partial class ManagedClustersOperationsExtensions
6363
}
6464
}
6565

66+
/// <summary>
67+
/// Gets a list of supported Kubernetes versions in the specified subscription.
68+
/// </summary>
69+
/// <remarks>
70+
/// Contains extra metadata on the version, including supported patch versions,
71+
/// capabilities, available upgrades, and details on preview status of the
72+
/// version
73+
/// </remarks>
74+
/// <param name='operations'>
75+
/// The operations group for this extension method.
76+
/// </param>
77+
/// <param name='location'>
78+
/// The name of Azure region.
79+
/// </param>
80+
public static KubernetesVersionListResult ListKubernetesVersions(this IManagedClustersOperations operations, string location)
81+
{
82+
return operations.ListKubernetesVersionsAsync(location).GetAwaiter().GetResult();
83+
}
84+
85+
/// <summary>
86+
/// Gets a list of supported Kubernetes versions in the specified subscription.
87+
/// </summary>
88+
/// <remarks>
89+
/// Contains extra metadata on the version, including supported patch versions,
90+
/// capabilities, available upgrades, and details on preview status of the
91+
/// version
92+
/// </remarks>
93+
/// <param name='operations'>
94+
/// The operations group for this extension method.
95+
/// </param>
96+
/// <param name='location'>
97+
/// The name of Azure region.
98+
/// </param>
99+
/// <param name='cancellationToken'>
100+
/// The cancellation token.
101+
/// </param>
102+
public static async Task<KubernetesVersionListResult> ListKubernetesVersionsAsync(this IManagedClustersOperations operations, string location, CancellationToken cancellationToken = default(CancellationToken))
103+
{
104+
using (var _result = await operations.ListKubernetesVersionsWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false))
105+
{
106+
return _result.Body;
107+
}
108+
}
109+
66110
/// <summary>
67111
/// Gets a list of managed clusters in the specified subscription.
68112
/// </summary>

src/Aks/Aks.Sdk/Generated/Models/AgentPool.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public AgentPool()
5959
/// <param name="osType">Possible values include: 'Linux',
6060
/// 'Windows'</param>
6161
/// <param name="osSKU">Possible values include: 'Ubuntu',
62-
/// 'CBLMariner', 'Windows2019', 'Windows2022'</param>
62+
/// 'AzureLinux', 'CBLMariner', 'Windows2019', 'Windows2022'</param>
6363
/// <param name="maxCount">The maximum number of nodes for
6464
/// auto-scaling</param>
6565
/// <param name="minCount">The minimum number of nodes for
@@ -258,8 +258,8 @@ public AgentPool()
258258
public string OsType { get; set; }
259259

260260
/// <summary>
261-
/// Gets or sets possible values include: 'Ubuntu', 'CBLMariner',
262-
/// 'Windows2019', 'Windows2022'
261+
/// Gets or sets possible values include: 'Ubuntu', 'AzureLinux',
262+
/// 'CBLMariner', 'Windows2019', 'Windows2022'
263263
/// </summary>
264264
[JsonProperty(PropertyName = "properties.osSKU")]
265265
public string OsSKU { get; set; }

0 commit comments

Comments
 (0)