diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotData.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotData.cs
deleted file mode 100644
index 1bbf5325758a..000000000000
--- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotData.cs
+++ /dev/null
@@ -1,123 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Collections.Generic;
-using Azure.Core;
-using Azure.ResourceManager.ContainerService.Models;
-using Azure.ResourceManager.Models;
-
-namespace Azure.ResourceManager.ContainerService
-{
- ///
- /// A class representing the AgentPoolSnapshot data model.
- /// A node pool snapshot resource.
- ///
- public partial class AgentPoolSnapshotData : TrackedResourceData
- {
- ///
- /// Keeps track of any properties unknown to the library.
- ///
- /// To assign an object to the value of this property use .
- ///
- ///
- /// To assign an already formatted json string to this property use .
- ///
- ///
- /// Examples:
- ///
- /// -
- /// BinaryData.FromObjectAsJson("foo")
- /// Creates a payload of "foo".
- ///
- /// -
- /// BinaryData.FromString("\"foo\"")
- /// Creates a payload of "foo".
- ///
- /// -
- /// BinaryData.FromObjectAsJson(new { key = "value" })
- /// Creates a payload of { "key": "value" }.
- ///
- /// -
- /// BinaryData.FromString("{\"key\": \"value\"}")
- /// Creates a payload of { "key": "value" }.
- ///
- ///
- ///
- ///
- private IDictionary _serializedAdditionalRawData;
-
- /// Initializes a new instance of .
- /// The location.
- public AgentPoolSnapshotData(AzureLocation location) : base(location)
- {
- }
-
- /// Initializes a new instance of .
- /// The id.
- /// The name.
- /// The resourceType.
- /// The systemData.
- /// The tags.
- /// The location.
- /// CreationData to be used to specify the source agent pool resource ID to create this snapshot.
- /// The type of a snapshot. The default is NodePool.
- /// The version of Kubernetes.
- /// The version of node image.
- /// The operating system type. The default is Linux.
- /// Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType is Windows.
- /// The size of the VM.
- /// Whether to use a FIPS-enabled OS.
- /// Keeps track of any properties unknown to the library.
- internal AgentPoolSnapshotData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ContainerServiceCreationData creationData, SnapshotType? snapshotType, string kubernetesVersion, string nodeImageVersion, ContainerServiceOSType? osType, ContainerServiceOSSku? osSku, string vmSize, bool? enableFips, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location)
- {
- CreationData = creationData;
- SnapshotType = snapshotType;
- KubernetesVersion = kubernetesVersion;
- NodeImageVersion = nodeImageVersion;
- OSType = osType;
- OSSku = osSku;
- VmSize = vmSize;
- EnableFips = enableFips;
- _serializedAdditionalRawData = serializedAdditionalRawData;
- }
-
- /// Initializes a new instance of for deserialization.
- internal AgentPoolSnapshotData()
- {
- }
-
- /// CreationData to be used to specify the source agent pool resource ID to create this snapshot.
- internal ContainerServiceCreationData CreationData { get; set; }
- /// This is the ARM ID of the source object to be used to create the target object.
- public ResourceIdentifier CreationDataSourceResourceId
- {
- get => CreationData is null ? default : CreationData.SourceResourceId;
- set
- {
- if (CreationData is null)
- CreationData = new ContainerServiceCreationData();
- CreationData.SourceResourceId = value;
- }
- }
-
- /// The type of a snapshot. The default is NodePool.
- public SnapshotType? SnapshotType { get; set; }
- /// The version of Kubernetes.
- public string KubernetesVersion { get; }
- /// The version of node image.
- public string NodeImageVersion { get; }
- /// The operating system type. The default is Linux.
- public ContainerServiceOSType? OSType { get; }
- /// Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType is Windows.
- public ContainerServiceOSSku? OSSku { get; }
- /// The size of the VM.
- public string VmSize { get; }
- /// Whether to use a FIPS-enabled OS.
- public bool? EnableFips { get; }
- }
-}
diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotResource.cs
deleted file mode 100644
index a106360d89a2..000000000000
--- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolSnapshotResource.cs
+++ /dev/null
@@ -1,701 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Collections.Generic;
-using System.Globalization;
-using System.Threading;
-using System.Threading.Tasks;
-using Azure;
-using Azure.Core;
-using Azure.Core.Pipeline;
-using Azure.ResourceManager;
-using Azure.ResourceManager.ContainerService.Models;
-using Azure.ResourceManager.Resources;
-
-namespace Azure.ResourceManager.ContainerService
-{
- ///
- /// A Class representing an AgentPoolSnapshot along with the instance operations that can be performed on it.
- /// If you have a you can construct an
- /// from an instance of using the GetAgentPoolSnapshotResource method.
- /// Otherwise you can get one from its parent resource using the GetAgentPoolSnapshot method.
- ///
- public partial class AgentPoolSnapshotResource : ArmResource
- {
- /// Generate the resource identifier of a instance.
- /// The subscriptionId.
- /// The resourceGroupName.
- /// The resourceName.
- public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string resourceName)
- {
- var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}";
- return new ResourceIdentifier(resourceId);
- }
-
- private readonly ClientDiagnostics _agentPoolSnapshotSnapshotsClientDiagnostics;
- private readonly SnapshotsRestOperations _agentPoolSnapshotSnapshotsRestClient;
- private readonly AgentPoolSnapshotData _data;
-
- /// Gets the resource type for the operations.
- public static readonly ResourceType ResourceType = "Microsoft.ContainerService/snapshots";
-
- /// Initializes a new instance of the class for mocking.
- protected AgentPoolSnapshotResource()
- {
- }
-
- /// Initializes a new instance of the class.
- /// The client parameters to use in these operations.
- /// The resource that is the target of operations.
- internal AgentPoolSnapshotResource(ArmClient client, AgentPoolSnapshotData data) : this(client, data.Id)
- {
- HasData = true;
- _data = data;
- }
-
- /// Initializes a new instance of the class.
- /// The client parameters to use in these operations.
- /// The identifier of the resource that is the target of operations.
- internal AgentPoolSnapshotResource(ArmClient client, ResourceIdentifier id) : base(client, id)
- {
- _agentPoolSnapshotSnapshotsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ResourceType.Namespace, Diagnostics);
- TryGetApiVersion(ResourceType, out string agentPoolSnapshotSnapshotsApiVersion);
- _agentPoolSnapshotSnapshotsRestClient = new SnapshotsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, agentPoolSnapshotSnapshotsApiVersion);
-#if DEBUG
- ValidateResourceId(Id);
-#endif
- }
-
- /// Gets whether or not the current instance has data.
- public virtual bool HasData { get; }
-
- /// Gets the data representing this Feature.
- /// Throws if there is no data loaded in the current instance.
- public virtual AgentPoolSnapshotData Data
- {
- get
- {
- if (!HasData)
- throw new InvalidOperationException("The current instance does not have data, you must call Get first.");
- return _data;
- }
- }
-
- internal static void ValidateResourceId(ResourceIdentifier id)
- {
- if (id.ResourceType != ResourceType)
- throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id));
- }
-
- ///
- /// Gets a snapshot.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}
- ///
- /// -
- /// Operation Id
- /// Snapshots_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The cancellation token to use.
- public virtual async Task> GetAsync(CancellationToken cancellationToken = default)
- {
- using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotResource.Get");
- scope.Start();
- try
- {
- var response = await _agentPoolSnapshotSnapshotsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false);
- if (response.Value == null)
- throw new RequestFailedException(response.GetRawResponse());
- return Response.FromValue(new AgentPoolSnapshotResource(Client, response.Value), response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Gets a snapshot.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}
- ///
- /// -
- /// Operation Id
- /// Snapshots_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The cancellation token to use.
- public virtual Response Get(CancellationToken cancellationToken = default)
- {
- using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotResource.Get");
- scope.Start();
- try
- {
- var response = _agentPoolSnapshotSnapshotsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken);
- if (response.Value == null)
- throw new RequestFailedException(response.GetRawResponse());
- return Response.FromValue(new AgentPoolSnapshotResource(Client, response.Value), response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Deletes a snapshot.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}
- ///
- /// -
- /// Operation Id
- /// Snapshots_Delete
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
- /// The cancellation token to use.
- public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default)
- {
- using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotResource.Delete");
- scope.Start();
- try
- {
- var response = await _agentPoolSnapshotSnapshotsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false);
- var operation = new ContainerServiceArmOperation(response);
- if (waitUntil == WaitUntil.Completed)
- await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false);
- return operation;
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Deletes a snapshot.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}
- ///
- /// -
- /// Operation Id
- /// Snapshots_Delete
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
- /// The cancellation token to use.
- public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default)
- {
- using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotResource.Delete");
- scope.Start();
- try
- {
- var response = _agentPoolSnapshotSnapshotsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken);
- var operation = new ContainerServiceArmOperation(response);
- if (waitUntil == WaitUntil.Completed)
- operation.WaitForCompletionResponse(cancellationToken);
- return operation;
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Updates tags on a snapshot.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}
- ///
- /// -
- /// Operation Id
- /// Snapshots_UpdateTags
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// Parameters supplied to the Update snapshot Tags operation.
- /// The cancellation token to use.
- /// is null.
- public virtual async Task> UpdateAsync(ContainerServiceTagsObject containerServiceTagsObject, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNull(containerServiceTagsObject, nameof(containerServiceTagsObject));
-
- using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotResource.Update");
- scope.Start();
- try
- {
- var response = await _agentPoolSnapshotSnapshotsRestClient.UpdateTagsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, containerServiceTagsObject, cancellationToken).ConfigureAwait(false);
- return Response.FromValue(new AgentPoolSnapshotResource(Client, response.Value), response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Updates tags on a snapshot.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}
- ///
- /// -
- /// Operation Id
- /// Snapshots_UpdateTags
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// Parameters supplied to the Update snapshot Tags operation.
- /// The cancellation token to use.
- /// is null.
- public virtual Response Update(ContainerServiceTagsObject containerServiceTagsObject, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNull(containerServiceTagsObject, nameof(containerServiceTagsObject));
-
- using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotResource.Update");
- scope.Start();
- try
- {
- var response = _agentPoolSnapshotSnapshotsRestClient.UpdateTags(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, containerServiceTagsObject, cancellationToken);
- return Response.FromValue(new AgentPoolSnapshotResource(Client, response.Value), response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Add a tag to the current resource.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}
- ///
- /// -
- /// Operation Id
- /// Snapshots_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The key for the tag.
- /// The value for the tag.
- /// The cancellation token to use.
- /// or is null.
- public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNull(key, nameof(key));
- Argument.AssertNotNull(value, nameof(value));
-
- using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotResource.AddTag");
- scope.Start();
- try
- {
- if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false))
- {
- var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false);
- originalTags.Value.Data.TagValues[key] = value;
- await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false);
- var originalResponse = await _agentPoolSnapshotSnapshotsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false);
- return Response.FromValue(new AgentPoolSnapshotResource(Client, originalResponse.Value), originalResponse.GetRawResponse());
- }
- else
- {
- var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data;
- var patch = new ContainerServiceTagsObject();
- foreach (var tag in current.Tags)
- {
- patch.Tags.Add(tag);
- }
- patch.Tags[key] = value;
- var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false);
- return result;
- }
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Add a tag to the current resource.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}
- ///
- /// -
- /// Operation Id
- /// Snapshots_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The key for the tag.
- /// The value for the tag.
- /// The cancellation token to use.
- /// or is null.
- public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNull(key, nameof(key));
- Argument.AssertNotNull(value, nameof(value));
-
- using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotResource.AddTag");
- scope.Start();
- try
- {
- if (CanUseTagResource(cancellationToken: cancellationToken))
- {
- var originalTags = GetTagResource().Get(cancellationToken);
- originalTags.Value.Data.TagValues[key] = value;
- GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken);
- var originalResponse = _agentPoolSnapshotSnapshotsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken);
- return Response.FromValue(new AgentPoolSnapshotResource(Client, originalResponse.Value), originalResponse.GetRawResponse());
- }
- else
- {
- var current = Get(cancellationToken: cancellationToken).Value.Data;
- var patch = new ContainerServiceTagsObject();
- foreach (var tag in current.Tags)
- {
- patch.Tags.Add(tag);
- }
- patch.Tags[key] = value;
- var result = Update(patch, cancellationToken: cancellationToken);
- return result;
- }
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Replace the tags on the resource with the given set.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}
- ///
- /// -
- /// Operation Id
- /// Snapshots_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The set of tags to use as replacement.
- /// The cancellation token to use.
- /// is null.
- public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNull(tags, nameof(tags));
-
- using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotResource.SetTags");
- scope.Start();
- try
- {
- if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false))
- {
- await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false);
- var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false);
- originalTags.Value.Data.TagValues.ReplaceWith(tags);
- await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false);
- var originalResponse = await _agentPoolSnapshotSnapshotsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false);
- return Response.FromValue(new AgentPoolSnapshotResource(Client, originalResponse.Value), originalResponse.GetRawResponse());
- }
- else
- {
- var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data;
- var patch = new ContainerServiceTagsObject();
- patch.Tags.ReplaceWith(tags);
- var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false);
- return result;
- }
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Replace the tags on the resource with the given set.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}
- ///
- /// -
- /// Operation Id
- /// Snapshots_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The set of tags to use as replacement.
- /// The cancellation token to use.
- /// is null.
- public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNull(tags, nameof(tags));
-
- using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotResource.SetTags");
- scope.Start();
- try
- {
- if (CanUseTagResource(cancellationToken: cancellationToken))
- {
- GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken);
- var originalTags = GetTagResource().Get(cancellationToken);
- originalTags.Value.Data.TagValues.ReplaceWith(tags);
- GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken);
- var originalResponse = _agentPoolSnapshotSnapshotsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken);
- return Response.FromValue(new AgentPoolSnapshotResource(Client, originalResponse.Value), originalResponse.GetRawResponse());
- }
- else
- {
- var current = Get(cancellationToken: cancellationToken).Value.Data;
- var patch = new ContainerServiceTagsObject();
- patch.Tags.ReplaceWith(tags);
- var result = Update(patch, cancellationToken: cancellationToken);
- return result;
- }
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Removes a tag by key from the resource.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}
- ///
- /// -
- /// Operation Id
- /// Snapshots_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The key for the tag.
- /// The cancellation token to use.
- /// is null.
- public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNull(key, nameof(key));
-
- using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotResource.RemoveTag");
- scope.Start();
- try
- {
- if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false))
- {
- var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false);
- originalTags.Value.Data.TagValues.Remove(key);
- await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false);
- var originalResponse = await _agentPoolSnapshotSnapshotsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false);
- return Response.FromValue(new AgentPoolSnapshotResource(Client, originalResponse.Value), originalResponse.GetRawResponse());
- }
- else
- {
- var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data;
- var patch = new ContainerServiceTagsObject();
- foreach (var tag in current.Tags)
- {
- patch.Tags.Add(tag);
- }
- patch.Tags.Remove(key);
- var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false);
- return result;
- }
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Removes a tag by key from the resource.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/snapshots/{resourceName}
- ///
- /// -
- /// Operation Id
- /// Snapshots_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The key for the tag.
- /// The cancellation token to use.
- /// is null.
- public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNull(key, nameof(key));
-
- using var scope = _agentPoolSnapshotSnapshotsClientDiagnostics.CreateScope("AgentPoolSnapshotResource.RemoveTag");
- scope.Start();
- try
- {
- if (CanUseTagResource(cancellationToken: cancellationToken))
- {
- var originalTags = GetTagResource().Get(cancellationToken);
- originalTags.Value.Data.TagValues.Remove(key);
- GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken);
- var originalResponse = _agentPoolSnapshotSnapshotsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken);
- return Response.FromValue(new AgentPoolSnapshotResource(Client, originalResponse.Value), originalResponse.GetRawResponse());
- }
- else
- {
- var current = Get(cancellationToken: cancellationToken).Value.Data;
- var patch = new ContainerServiceTagsObject();
- foreach (var tag in current.Tags)
- {
- patch.Tags.Add(tag);
- }
- patch.Tags.Remove(key);
- var result = Update(patch, cancellationToken: cancellationToken);
- return result;
- }
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
- }
-}
diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolUpgradeProfileData.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolUpgradeProfileData.cs
deleted file mode 100644
index 1269f3b9a22f..000000000000
--- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolUpgradeProfileData.cs
+++ /dev/null
@@ -1,100 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Collections.Generic;
-using Azure.Core;
-using Azure.ResourceManager.ContainerService.Models;
-using Azure.ResourceManager.Models;
-
-namespace Azure.ResourceManager.ContainerService
-{
- ///
- /// A class representing the AgentPoolUpgradeProfile data model.
- /// The list of available upgrades for an agent pool.
- ///
- public partial class AgentPoolUpgradeProfileData : ResourceData
- {
- ///
- /// Keeps track of any properties unknown to the library.
- ///
- /// To assign an object to the value of this property use .
- ///
- ///
- /// To assign an already formatted json string to this property use .
- ///
- ///
- /// Examples:
- ///
- /// -
- /// BinaryData.FromObjectAsJson("foo")
- /// Creates a payload of "foo".
- ///
- /// -
- /// BinaryData.FromString("\"foo\"")
- /// Creates a payload of "foo".
- ///
- /// -
- /// BinaryData.FromObjectAsJson(new { key = "value" })
- /// Creates a payload of { "key": "value" }.
- ///
- /// -
- /// BinaryData.FromString("{\"key\": \"value\"}")
- /// Creates a payload of { "key": "value" }.
- ///
- ///
- ///
- ///
- private IDictionary _serializedAdditionalRawData;
-
- /// Initializes a new instance of .
- /// The Kubernetes version (major.minor.patch).
- /// The operating system type. The default is Linux.
- /// is null.
- internal AgentPoolUpgradeProfileData(string kubernetesVersion, ContainerServiceOSType osType)
- {
- Argument.AssertNotNull(kubernetesVersion, nameof(kubernetesVersion));
-
- KubernetesVersion = kubernetesVersion;
- OSType = osType;
- Upgrades = new ChangeTrackingList();
- }
-
- /// Initializes a new instance of .
- /// The id.
- /// The name.
- /// The resourceType.
- /// The systemData.
- /// The Kubernetes version (major.minor.patch).
- /// The operating system type. The default is Linux.
- /// List of orchestrator types and versions available for upgrade.
- /// The latest AKS supported node image version.
- /// Keeps track of any properties unknown to the library.
- internal AgentPoolUpgradeProfileData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string kubernetesVersion, ContainerServiceOSType osType, IReadOnlyList upgrades, string latestNodeImageVersion, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData)
- {
- KubernetesVersion = kubernetesVersion;
- OSType = osType;
- Upgrades = upgrades;
- LatestNodeImageVersion = latestNodeImageVersion;
- _serializedAdditionalRawData = serializedAdditionalRawData;
- }
-
- /// Initializes a new instance of for deserialization.
- internal AgentPoolUpgradeProfileData()
- {
- }
-
- /// The Kubernetes version (major.minor.patch).
- public string KubernetesVersion { get; }
- /// The operating system type. The default is Linux.
- public ContainerServiceOSType OSType { get; }
- /// List of orchestrator types and versions available for upgrade.
- public IReadOnlyList Upgrades { get; }
- /// The latest AKS supported node image version.
- public string LatestNodeImageVersion { get; }
- }
-}
diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolUpgradeProfileResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolUpgradeProfileResource.cs
deleted file mode 100644
index 55c0ef154ea0..000000000000
--- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/AgentPoolUpgradeProfileResource.cs
+++ /dev/null
@@ -1,173 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Globalization;
-using System.Threading;
-using System.Threading.Tasks;
-using Azure;
-using Azure.Core;
-using Azure.Core.Pipeline;
-using Azure.ResourceManager;
-
-namespace Azure.ResourceManager.ContainerService
-{
- ///
- /// A Class representing an AgentPoolUpgradeProfile along with the instance operations that can be performed on it.
- /// If you have a you can construct an
- /// from an instance of using the GetAgentPoolUpgradeProfileResource method.
- /// Otherwise you can get one from its parent resource using the GetAgentPoolUpgradeProfile method.
- ///
- public partial class AgentPoolUpgradeProfileResource : ArmResource
- {
- /// Generate the resource identifier of a instance.
- /// The subscriptionId.
- /// The resourceGroupName.
- /// The resourceName.
- /// The agentPoolName.
- public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName)
- {
- var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default";
- return new ResourceIdentifier(resourceId);
- }
-
- private readonly ClientDiagnostics _agentPoolUpgradeProfileAgentPoolsClientDiagnostics;
- private readonly AgentPoolsRestOperations _agentPoolUpgradeProfileAgentPoolsRestClient;
- private readonly AgentPoolUpgradeProfileData _data;
-
- /// Gets the resource type for the operations.
- public static readonly ResourceType ResourceType = "Microsoft.ContainerService/managedClusters/agentPools/upgradeProfiles";
-
- /// Initializes a new instance of the class for mocking.
- protected AgentPoolUpgradeProfileResource()
- {
- }
-
- /// Initializes a new instance of the class.
- /// The client parameters to use in these operations.
- /// The resource that is the target of operations.
- internal AgentPoolUpgradeProfileResource(ArmClient client, AgentPoolUpgradeProfileData data) : this(client, data.Id)
- {
- HasData = true;
- _data = data;
- }
-
- /// Initializes a new instance of the class.
- /// The client parameters to use in these operations.
- /// The identifier of the resource that is the target of operations.
- internal AgentPoolUpgradeProfileResource(ArmClient client, ResourceIdentifier id) : base(client, id)
- {
- _agentPoolUpgradeProfileAgentPoolsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ResourceType.Namespace, Diagnostics);
- TryGetApiVersion(ResourceType, out string agentPoolUpgradeProfileAgentPoolsApiVersion);
- _agentPoolUpgradeProfileAgentPoolsRestClient = new AgentPoolsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, agentPoolUpgradeProfileAgentPoolsApiVersion);
-#if DEBUG
- ValidateResourceId(Id);
-#endif
- }
-
- /// Gets whether or not the current instance has data.
- public virtual bool HasData { get; }
-
- /// Gets the data representing this Feature.
- /// Throws if there is no data loaded in the current instance.
- public virtual AgentPoolUpgradeProfileData Data
- {
- get
- {
- if (!HasData)
- throw new InvalidOperationException("The current instance does not have data, you must call Get first.");
- return _data;
- }
- }
-
- internal static void ValidateResourceId(ResourceIdentifier id)
- {
- if (id.ResourceType != ResourceType)
- throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id));
- }
-
- ///
- /// Gets the upgrade profile for an agent pool.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default
- ///
- /// -
- /// Operation Id
- /// AgentPools_GetUpgradeProfile
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The cancellation token to use.
- public virtual async Task> GetAsync(CancellationToken cancellationToken = default)
- {
- using var scope = _agentPoolUpgradeProfileAgentPoolsClientDiagnostics.CreateScope("AgentPoolUpgradeProfileResource.Get");
- scope.Start();
- try
- {
- var response = await _agentPoolUpgradeProfileAgentPoolsRestClient.GetUpgradeProfileAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken).ConfigureAwait(false);
- if (response.Value == null)
- throw new RequestFailedException(response.GetRawResponse());
- return Response.FromValue(new AgentPoolUpgradeProfileResource(Client, response.Value), response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Gets the upgrade profile for an agent pool.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default
- ///
- /// -
- /// Operation Id
- /// AgentPools_GetUpgradeProfile
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The cancellation token to use.
- public virtual Response Get(CancellationToken cancellationToken = default)
- {
- using var scope = _agentPoolUpgradeProfileAgentPoolsClientDiagnostics.CreateScope("AgentPoolUpgradeProfileResource.Get");
- scope.Start();
- try
- {
- var response = _agentPoolUpgradeProfileAgentPoolsRestClient.GetUpgradeProfile(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, cancellationToken);
- if (response.Value == null)
- throw new RequestFailedException(response.GetRawResponse());
- return Response.FromValue(new AgentPoolUpgradeProfileResource(Client, response.Value), response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
- }
-}
diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ArmContainerServiceModelFactory.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ArmContainerServiceModelFactory.cs
index 881b4813db6d..eae9b756b211 100644
--- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ArmContainerServiceModelFactory.cs
+++ b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ArmContainerServiceModelFactory.cs
@@ -8,658 +8,210 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using System.Net;
using Azure;
using Azure.Core;
using Azure.ResourceManager.ContainerService;
using Azure.ResourceManager.Models;
-using Azure.ResourceManager.Resources.Models;
namespace Azure.ResourceManager.ContainerService.Models
{
/// Model factory for models.
public static partial class ArmContainerServiceModelFactory
{
- /// Initializes a new instance of .
- /// The id.
- /// The name.
- /// The resourceType.
- /// The systemData.
- /// The list of OS options.
- /// A new instance for mocking.
- public static OSOptionProfileData OSOptionProfileData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IEnumerable osOptionPropertyList = null)
- {
- osOptionPropertyList ??= new List();
-
- return new OSOptionProfileData(id, name, resourceType, systemData, osOptionPropertyList?.ToList(), serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The OS type.
- /// Whether the image is FIPS-enabled.
- /// A new instance for mocking.
- public static ContainerServiceOSOptionProperty ContainerServiceOSOptionProperty(string osType = null, bool enableFipsImage = default)
- {
- return new ContainerServiceOSOptionProperty(osType, enableFipsImage, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// Array of AKS supported Kubernetes versions.
- /// A new instance for mocking.
- public static KubernetesVersionListResult KubernetesVersionListResult(IEnumerable values = null)
- {
- values ??= new List();
-
- return new KubernetesVersionListResult(values?.ToList(), serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// major.minor version of Kubernetes release.
- /// Capabilities on this Kubernetes version.
- /// Whether this version is in preview mode.
- /// Patch versions of Kubernetes release.
- /// A new instance for mocking.
- public static KubernetesVersion KubernetesVersion(string version = null, IEnumerable capabilitiesSupportPlan = null, bool? isPreview = null, IReadOnlyDictionary patchVersions = null)
- {
- capabilitiesSupportPlan ??= new List();
- patchVersions ??= new Dictionary();
-
- return new KubernetesVersion(version, capabilitiesSupportPlan != null ? new KubernetesVersionCapabilities(capabilitiesSupportPlan?.ToList(), serializedAdditionalRawData: null) : null, isPreview, patchVersions, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// Possible upgrade path for given patch version.
- /// A new instance for mocking.
- public static KubernetesPatchVersion KubernetesPatchVersion(IEnumerable upgrades = null)
- {
- upgrades ??= new List();
-
- return new KubernetesPatchVersion(upgrades?.ToList(), serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
+ /// Initializes a new instance of .
/// The id.
/// The name.
/// The resourceType.
/// The systemData.
/// The tags.
/// The location.
- /// The managed cluster SKU.
- /// The extended location of the Virtual Machine.
- /// The identity of the managed cluster, if configured.
- /// The current provisioning state.
- /// The Power State of the cluster.
- /// The max number of agent pools for the managed cluster.
- /// Both patch version <major.minor.patch> (e.g. 1.20.13) and <major.minor> (e.g. 1.20) are supported. When <major.minor> is specified, the latest supported GA patch version is chosen automatically. Updating the cluster with the same <major.minor> once it has been created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. When you upgrade a supported AKS cluster, Kubernetes minor versions cannot be skipped. All upgrades must be performed sequentially by major version number. For example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, however 1.14.x -> 1.16.x is not allowed. See [upgrading an AKS cluster](https://docs.microsoft.com/azure/aks/upgrade-cluster) for more details.
- /// If kubernetesVersion was a fully specified version <major.minor.patch>, this field will be exactly equal to it. If kubernetesVersion was <major.minor>, this field will contain the full <major.minor.patch> version being used.
- /// This cannot be updated once the Managed Cluster has been created.
- /// This cannot be updated once the Managed Cluster has been created.
- /// The FQDN of the master pool.
- /// The FQDN of private cluster.
- /// The Azure Portal requires certain Cross-Origin Resource Sharing (CORS) headers to be sent in some responses, which Kubernetes APIServer doesn't handle by default. This special FQDN supports CORS, allowing the Azure Portal to function properly.
- /// The agent pool properties.
- /// The profile for Linux VMs in the Managed Cluster.
- /// The profile for Windows VMs in the Managed Cluster.
- /// Information about a service principal identity for the cluster to use for manipulating Azure APIs.
- /// The profile of managed cluster add-on.
- /// See [use AAD pod identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity) for more details on AAD pod identity integration.
- /// The OIDC issuer profile of the Managed Cluster.
- /// The name of the resource group containing agent pool nodes.
- /// Whether to enable Kubernetes Role-Based Access Control.
- /// The support plan for the Managed Cluster. If unspecified, the default is 'KubernetesOfficial'.
- /// (DEPRECATED) Whether to enable Kubernetes pod security policy (preview). PodSecurityPolicy was deprecated in Kubernetes v1.21, and removed from Kubernetes in v1.25. Learn more at https://aka.ms/k8s/psp and https://aka.ms/aks/psp.
- /// The network configuration profile.
- /// The Azure Active Directory configuration.
- /// The auto upgrade configuration.
- /// Settings for upgrading a cluster.
- /// Parameters to be applied to the cluster-autoscaler when enabled.
- /// The access profile for managed cluster API server.
- /// This is of the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'.
- /// Identities associated with the cluster.
- /// Private link resources associated with the cluster.
- /// If set to true, getting static credentials will be disabled for this cluster. This must only be used on Managed Clusters that are AAD enabled. For more details see [disable local accounts](https://docs.microsoft.com/azure/aks/managed-aad#disable-local-accounts-preview).
- /// Configurations for provisioning the cluster with HTTP proxy servers.
- /// Security profile for the managed cluster.
- /// Storage profile for the managed cluster.
- /// Allow or deny public network access for AKS.
- /// Workload Auto-scaler profile for the managed cluster.
- /// Azure Monitor addon profiles for monitoring the managed cluster.
- /// Service mesh profile for a managed cluster.
- /// The resourceUID uniquely identifies ManagedClusters that reuse ARM ResourceIds (i.e: create, delete, create sequence).
- /// A new instance for mocking.
- public static ContainerServiceManagedClusterData ContainerServiceManagedClusterData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedClusterSku sku = null, ExtendedLocation extendedLocation = null, ManagedClusterIdentity clusterIdentity = null, string provisioningState = null, ContainerServiceStateCode? powerStateCode = null, int? maxAgentPools = null, string kubernetesVersion = null, string currentKubernetesVersion = null, string dnsPrefix = null, string fqdnSubdomain = null, string fqdn = null, string privateFqdn = null, string azurePortalFqdn = null, IEnumerable agentPoolProfiles = null, ContainerServiceLinuxProfile linuxProfile = null, ManagedClusterWindowsProfile windowsProfile = null, ManagedClusterServicePrincipalProfile servicePrincipalProfile = null, IDictionary addonProfiles = null, ManagedClusterPodIdentityProfile podIdentityProfile = null, ManagedClusterOidcIssuerProfile oidcIssuerProfile = null, string nodeResourceGroup = null, bool? enableRbac = null, KubernetesSupportPlan? supportPlan = null, bool? enablePodSecurityPolicy = null, ContainerServiceNetworkProfile networkProfile = null, ManagedClusterAadProfile aadProfile = null, ManagedClusterAutoUpgradeProfile autoUpgradeProfile = null, UpgradeOverrideSettings upgradeOverrideSettings = null, ManagedClusterAutoScalerProfile autoScalerProfile = null, ManagedClusterApiServerAccessProfile apiServerAccessProfile = null, ResourceIdentifier diskEncryptionSetId = null, IDictionary identityProfile = null, IEnumerable privateLinkResources = null, bool? disableLocalAccounts = null, ManagedClusterHttpProxyConfig httpProxyConfig = null, ManagedClusterSecurityProfile securityProfile = null, ManagedClusterStorageProfile storageProfile = null, ContainerServicePublicNetworkAccess? publicNetworkAccess = null, ManagedClusterWorkloadAutoScalerProfile workloadAutoScalerProfile = null, ManagedClusterMonitorProfileMetrics azureMonitorMetrics = null, ServiceMeshProfile serviceMeshProfile = null, ResourceIdentifier resourceId = null)
- {
- tags ??= new Dictionary();
- agentPoolProfiles ??= new List();
- addonProfiles ??= new Dictionary();
- identityProfile ??= new Dictionary();
- privateLinkResources ??= new List();
-
- return new ContainerServiceManagedClusterData(id, name, resourceType, systemData, tags, location, sku, extendedLocation, clusterIdentity, provisioningState, powerStateCode != null ? new ContainerServicePowerState(powerStateCode, serializedAdditionalRawData: null) : null, maxAgentPools, kubernetesVersion, currentKubernetesVersion, dnsPrefix, fqdnSubdomain, fqdn, privateFqdn, azurePortalFqdn, agentPoolProfiles?.ToList(), linuxProfile, windowsProfile, servicePrincipalProfile, addonProfiles, podIdentityProfile, oidcIssuerProfile, nodeResourceGroup, enableRbac, supportPlan, enablePodSecurityPolicy, networkProfile, aadProfile, autoUpgradeProfile, upgradeOverrideSettings != null ? new ClusterUpgradeSettings(upgradeOverrideSettings, serializedAdditionalRawData: null) : null, autoScalerProfile, apiServerAccessProfile, diskEncryptionSetId, identityProfile, privateLinkResources?.ToList(), disableLocalAccounts, httpProxyConfig, securityProfile, storageProfile, publicNetworkAccess, workloadAutoScalerProfile, azureMonitorMetrics != null ? new ManagedClusterAzureMonitorProfile(azureMonitorMetrics, serializedAdditionalRawData: null) : null, serviceMeshProfile, resourceId, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1.
- /// VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions.
- /// OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified.
- /// The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os).
- /// Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage.
- /// Determines the type of workload a node can run.
- /// If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}.
- /// If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}.
- /// The maximum number of pods that can run on a node.
- /// The operating system type. The default is Linux.
- /// Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType is Windows.
- /// The maximum number of nodes for auto-scaling.
- /// The minimum number of nodes for auto-scaling.
- /// Whether to enable auto-scaler.
- /// This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete.
- /// The type of Agent Pool.
- /// A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools.
- /// Both patch version <major.minor.patch> (e.g. 1.20.13) and <major.minor> (e.g. 1.20) are supported. When <major.minor> is specified, the latest supported GA patch version is chosen automatically. Updating the cluster with the same <major.minor> once it has been created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool).
- /// If orchestratorVersion is a fully specified version <major.minor.patch>, this field will be exactly equal to it. If orchestratorVersion is <major.minor>, this field will contain the full <major.minor.patch> version being used.
- /// The version of node image.
- /// Settings for upgrading the agentpool.
- /// The current deployment or provisioning state.
- /// When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded.
- /// The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'.
- /// Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see [assigning a public IP per node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). The default is false.
- /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}.
- /// The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'.
- /// This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'.
- /// Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see [spot VMs pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing).
- /// The tags to be persisted on the agent pool virtual machine scale set.
- /// The node labels to be persisted across all nodes in agent pool.
- /// The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule.
- /// The ID for Proximity Placement Group.
- /// The Kubelet configuration on the agent pool nodes.
- /// The OS configuration of Linux agent nodes.
- /// This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption.
- /// Whether to enable UltraSSD.
- /// See [Add a FIPS-enabled node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) for more details.
- /// GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU.
- /// CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot.
- /// AKS will associate the specified agent pool with the Capacity Reservation Group.
- /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts).
- /// Network-related settings of an agent pool.
- /// Windows agent pool names must be 6 characters or less.
- /// A new instance for mocking.
- public static ManagedClusterAgentPoolProfile ManagedClusterAgentPoolProfile(int? count = null, string vmSize = null, int? osDiskSizeInGB = null, ContainerServiceOSDiskType? osDiskType = null, KubeletDiskType? kubeletDiskType = null, WorkloadRuntime? workloadRuntime = null, ResourceIdentifier vnetSubnetId = null, ResourceIdentifier podSubnetId = null, int? maxPods = null, ContainerServiceOSType? osType = null, ContainerServiceOSSku? osSku = null, int? maxCount = null, int? minCount = null, bool? enableAutoScaling = null, ScaleDownMode? scaleDownMode = null, AgentPoolType? agentPoolType = null, AgentPoolMode? mode = null, string orchestratorVersion = null, string currentOrchestratorVersion = null, string nodeImageVersion = null, AgentPoolUpgradeSettings upgradeSettings = null, string provisioningState = null, ContainerServiceStateCode? powerStateCode = null, IEnumerable availabilityZones = null, bool? enableNodePublicIP = null, ResourceIdentifier nodePublicIPPrefixId = null, ScaleSetPriority? scaleSetPriority = null, ScaleSetEvictionPolicy? scaleSetEvictionPolicy = null, float? spotMaxPrice = null, IDictionary tags = null, IDictionary nodeLabels = null, IEnumerable nodeTaints = null, ResourceIdentifier proximityPlacementGroupId = null, KubeletConfig kubeletConfig = null, LinuxOSConfig linuxOSConfig = null, bool? enableEncryptionAtHost = null, bool? enableUltraSsd = null, bool? enableFips = null, GpuInstanceProfile? gpuInstanceProfile = null, ResourceIdentifier creationDataSourceResourceId = null, ResourceIdentifier capacityReservationGroupId = null, ResourceIdentifier hostGroupId = null, AgentPoolNetworkProfile networkProfile = null, string name = null)
- {
- availabilityZones ??= new List();
- tags ??= new Dictionary();
- nodeLabels ??= new Dictionary();
- nodeTaints ??= new List();
-
- return new ManagedClusterAgentPoolProfile(count, vmSize, osDiskSizeInGB, osDiskType, kubeletDiskType, workloadRuntime, vnetSubnetId, podSubnetId, maxPods, osType, osSku, maxCount, minCount, enableAutoScaling, scaleDownMode, agentPoolType, mode, orchestratorVersion, currentOrchestratorVersion, nodeImageVersion, upgradeSettings, provisioningState, powerStateCode != null ? new ContainerServicePowerState(powerStateCode, serializedAdditionalRawData: null) : null, availabilityZones?.ToList(), enableNodePublicIP, nodePublicIPPrefixId, scaleSetPriority, scaleSetEvictionPolicy, spotMaxPrice, tags, nodeLabels, nodeTaints?.ToList(), proximityPlacementGroupId, kubeletConfig, linuxOSConfig, enableEncryptionAtHost, enableUltraSsd, enableFips, gpuInstanceProfile, creationDataSourceResourceId != null ? new ContainerServiceCreationData(creationDataSourceResourceId, serializedAdditionalRawData: null) : null, capacityReservationGroupId, hostGroupId, networkProfile, serializedAdditionalRawData: null, name);
- }
-
- /// Initializes a new instance of .
- /// Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1.
- /// VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions.
- /// OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified.
- /// The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os).
- /// Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage.
- /// Determines the type of workload a node can run.
- /// If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}.
- /// If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}.
- /// The maximum number of pods that can run on a node.
- /// The operating system type. The default is Linux.
- /// Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType is Windows.
- /// The maximum number of nodes for auto-scaling.
- /// The minimum number of nodes for auto-scaling.
- /// Whether to enable auto-scaler.
- /// This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete.
- /// The type of Agent Pool.
- /// A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools.
- /// Both patch version <major.minor.patch> (e.g. 1.20.13) and <major.minor> (e.g. 1.20) are supported. When <major.minor> is specified, the latest supported GA patch version is chosen automatically. Updating the cluster with the same <major.minor> once it has been created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool).
- /// If orchestratorVersion is a fully specified version <major.minor.patch>, this field will be exactly equal to it. If orchestratorVersion is <major.minor>, this field will contain the full <major.minor.patch> version being used.
- /// The version of node image.
- /// Settings for upgrading the agentpool.
- /// The current deployment or provisioning state.
- /// When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded.
- /// The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'.
- /// Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see [assigning a public IP per node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). The default is false.
- /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}.
- /// The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'.
- /// This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'.
- /// Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see [spot VMs pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing).
- /// The tags to be persisted on the agent pool virtual machine scale set.
- /// The node labels to be persisted across all nodes in agent pool.
- /// The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule.
- /// The ID for Proximity Placement Group.
- /// The Kubelet configuration on the agent pool nodes.
- /// The OS configuration of Linux agent nodes.
- /// This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption.
- /// Whether to enable UltraSSD.
- /// See [Add a FIPS-enabled node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) for more details.
- /// GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU.
- /// CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot.
- /// AKS will associate the specified agent pool with the Capacity Reservation Group.
- /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts).
- /// Network-related settings of an agent pool.
- /// A new instance for mocking.
- public static ManagedClusterAgentPoolProfileProperties ManagedClusterAgentPoolProfileProperties(int? count = null, string vmSize = null, int? osDiskSizeInGB = null, ContainerServiceOSDiskType? osDiskType = null, KubeletDiskType? kubeletDiskType = null, WorkloadRuntime? workloadRuntime = null, ResourceIdentifier vnetSubnetId = null, ResourceIdentifier podSubnetId = null, int? maxPods = null, ContainerServiceOSType? osType = null, ContainerServiceOSSku? osSku = null, int? maxCount = null, int? minCount = null, bool? enableAutoScaling = null, ScaleDownMode? scaleDownMode = null, AgentPoolType? agentPoolType = null, AgentPoolMode? mode = null, string orchestratorVersion = null, string currentOrchestratorVersion = null, string nodeImageVersion = null, AgentPoolUpgradeSettings upgradeSettings = null, string provisioningState = null, ContainerServiceStateCode? powerStateCode = null, IEnumerable availabilityZones = null, bool? enableNodePublicIP = null, ResourceIdentifier nodePublicIPPrefixId = null, ScaleSetPriority? scaleSetPriority = null, ScaleSetEvictionPolicy? scaleSetEvictionPolicy = null, float? spotMaxPrice = null, IDictionary tags = null, IDictionary nodeLabels = null, IEnumerable nodeTaints = null, ResourceIdentifier proximityPlacementGroupId = null, KubeletConfig kubeletConfig = null, LinuxOSConfig linuxOSConfig = null, bool? enableEncryptionAtHost = null, bool? enableUltraSsd = null, bool? enableFips = null, GpuInstanceProfile? gpuInstanceProfile = null, ResourceIdentifier creationDataSourceResourceId = null, ResourceIdentifier capacityReservationGroupId = null, ResourceIdentifier hostGroupId = null, AgentPoolNetworkProfile networkProfile = null)
+ /// If eTag is provided in the response body, it may also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.
+ /// Managed identity.
+ /// The status of the last operation.
+ /// The FleetHubProfile configures the Fleet's hub.
+ /// A new instance for mocking.
+ public static FleetData FleetData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ETag? eTag = null, ResourceManager.Models.ManagedServiceIdentity identity = null, FleetProvisioningState? provisioningState = null, FleetHubProfile hubProfile = null)
{
- availabilityZones ??= new List();
tags ??= new Dictionary();
- nodeLabels ??= new Dictionary();
- nodeTaints ??= new List();
-
- return new ManagedClusterAgentPoolProfileProperties(count, vmSize, osDiskSizeInGB, osDiskType, kubeletDiskType, workloadRuntime, vnetSubnetId, podSubnetId, maxPods, osType, osSku, maxCount, minCount, enableAutoScaling, scaleDownMode, agentPoolType, mode, orchestratorVersion, currentOrchestratorVersion, nodeImageVersion, upgradeSettings, provisioningState, powerStateCode != null ? new ContainerServicePowerState(powerStateCode, serializedAdditionalRawData: null) : null, availabilityZones?.ToList(), enableNodePublicIP, nodePublicIPPrefixId, scaleSetPriority, scaleSetEvictionPolicy, spotMaxPrice, tags, nodeLabels, nodeTaints?.ToList(), proximityPlacementGroupId, kubeletConfig, linuxOSConfig, enableEncryptionAtHost, enableUltraSsd, enableFips, gpuInstanceProfile, creationDataSourceResourceId != null ? new ContainerServiceCreationData(creationDataSourceResourceId, serializedAdditionalRawData: null) : null, capacityReservationGroupId, hostGroupId, networkProfile, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// Whether the add-on is enabled or not.
- /// Key-value pairs for configuring an add-on.
- /// Information of user assigned identity used by this add-on.
- /// A new instance for mocking.
- public static ManagedClusterAddonProfile ManagedClusterAddonProfile(bool isEnabled = default, IDictionary config = null, ManagedClusterAddonProfileIdentity identity = null)
- {
- config ??= new Dictionary();
-
- return new ManagedClusterAddonProfile(isEnabled, config, identity, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The name of the pod identity.
- /// The namespace of the pod identity.
- /// The binding selector to use for the AzureIdentityBinding resource.
- /// The user assigned identity details.
- /// The current provisioning state of the pod identity.
- ///
- /// A new instance for mocking.
- public static ManagedClusterPodIdentity ManagedClusterPodIdentity(string name = null, string @namespace = null, string bindingSelector = null, ContainerServiceUserAssignedIdentity identity = null, ManagedClusterPodIdentityProvisioningState? provisioningState = null, ResponseError errorDetail = null)
- {
- return new ManagedClusterPodIdentity(name, @namespace, bindingSelector, identity, provisioningState, errorDetail != null ? new ManagedClusterPodIdentityProvisioningInfo(new ManagedClusterPodIdentityProvisioningError(errorDetail, serializedAdditionalRawData: null), serializedAdditionalRawData: null) : null, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The OIDC issuer url of the Managed Cluster.
- /// Whether the OIDC issuer is enabled.
- /// A new instance for mocking.
- public static ManagedClusterOidcIssuerProfile ManagedClusterOidcIssuerProfile(string issuerUriInfo = null, bool? isEnabled = null)
- {
- return new ManagedClusterOidcIssuerProfile(issuerUriInfo, isEnabled, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The ID of the private link resource.
- /// The name of the private link resource.
- /// The resource type.
- /// The group ID of the resource.
- /// The RequiredMembers of the resource.
- /// The private link service ID of the resource, this field is exposed only to NRP internally.
- /// A new instance for mocking.
- public static ContainerServicePrivateLinkResourceData ContainerServicePrivateLinkResourceData(ResourceIdentifier id = null, string name = null, ResourceType? resourceType = null, string groupId = null, IEnumerable requiredMembers = null, ResourceIdentifier privateLinkServiceId = null)
- {
- requiredMembers ??= new List();
-
- return new ContainerServicePrivateLinkResourceData(id, name, resourceType, groupId, requiredMembers?.ToList(), privateLinkServiceId, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The id.
- /// The name.
- /// The resourceType.
- /// The systemData.
- /// The list of available upgrade versions for the control plane.
- /// The list of available upgrade versions for agent pools.
- /// A new instance for mocking.
- public static ManagedClusterUpgradeProfileData ManagedClusterUpgradeProfileData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ManagedClusterPoolUpgradeProfile controlPlaneProfile = null, IEnumerable agentPoolProfiles = null)
- {
- agentPoolProfiles ??= new List();
-
- return new ManagedClusterUpgradeProfileData(id, name, resourceType, systemData, controlPlaneProfile, agentPoolProfiles?.ToList(), serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The Kubernetes version (major.minor.patch).
- /// The Agent Pool name.
- /// The operating system type. The default is Linux.
- /// List of orchestrator types and versions available for upgrade.
- /// A new instance for mocking.
- public static ManagedClusterPoolUpgradeProfile ManagedClusterPoolUpgradeProfile(string kubernetesVersion = null, string name = null, ContainerServiceOSType osType = default, IEnumerable upgrades = null)
- {
- upgrades ??= new List();
-
- return new ManagedClusterPoolUpgradeProfile(kubernetesVersion, name, osType, upgrades?.ToList(), serializedAdditionalRawData: null);
- }
- /// Initializes a new instance of .
- /// The Kubernetes version (major.minor.patch).
- /// Whether the Kubernetes version is currently in preview.
- /// A new instance for mocking.
- public static ManagedClusterPoolUpgradeProfileUpgradesItem ManagedClusterPoolUpgradeProfileUpgradesItem(string kubernetesVersion = null, bool? isPreview = null)
- {
- return new ManagedClusterPoolUpgradeProfileUpgradesItem(kubernetesVersion, isPreview, serializedAdditionalRawData: null);
+ return new FleetData(id, name, resourceType, systemData, tags, location, eTag, identity, provisioningState, hubProfile, serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
- /// The id.
- /// The name.
- /// The resourceType.
- /// The systemData.
- /// The tags.
- /// The location.
- /// Base64-encoded Kubernetes configuration file.
- /// A new instance for mocking.
- public static ManagedClusterAccessProfile ManagedClusterAccessProfile(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, byte[] kubeConfig = null)
+ /// Initializes a new instance of .
+ /// DNS prefix used to create the FQDN for the Fleet hub.
+ /// The access profile for the Fleet hub API server.
+ /// The agent profile for the Fleet hub.
+ /// The FQDN of the Fleet hub.
+ /// The Kubernetes version of the Fleet hub.
+ /// The Azure Portal FQDN of the Fleet hub.
+ /// A new instance for mocking.
+ public static FleetHubProfile FleetHubProfile(string dnsPrefix = null, ApiServerAccessProfile apiServerAccessProfile = null, AgentProfile agentProfile = null, string fqdn = null, string kubernetesVersion = null, string portalFqdn = null)
{
- tags ??= new Dictionary();
-
- return new ManagedClusterAccessProfile(id, name, resourceType, systemData, tags, location, kubeConfig, serializedAdditionalRawData: null);
+ return new FleetHubProfile(dnsPrefix, apiServerAccessProfile, agentProfile, fqdn, kubernetesVersion, portalFqdn, serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
- /// Base64-encoded Kubernetes configuration file.
- /// A new instance for mocking.
- public static ManagedClusterCredentials ManagedClusterCredentials(IEnumerable kubeconfigs = null)
+ /// Initializes a new instance of .
+ /// Array of base64-encoded Kubernetes configuration files.
+ /// A new instance for mocking.
+ public static FleetCredentialResults FleetCredentialResults(IEnumerable kubeconfigs = null)
{
- kubeconfigs ??= new List();
+ kubeconfigs ??= new List();
- return new ManagedClusterCredentials(kubeconfigs?.ToList(), serializedAdditionalRawData: null);
+ return new FleetCredentialResults(kubeconfigs?.ToList(), serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
+ /// Initializes a new instance of .
/// The name of the credential.
/// Base64-encoded Kubernetes configuration file.
- /// A new instance for mocking.
- public static ManagedClusterCredential ManagedClusterCredential(string name = null, byte[] value = null)
- {
- return new ManagedClusterCredential(name, value, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The id.
- /// The name.
- /// The resourceType.
- /// The systemData.
- /// If two array entries specify the same day of the week, the applied configuration is the union of times in both entries.
- /// Time slots on which upgrade is not allowed.
- /// Maintenance window for the maintenance configuration.
- /// A new instance for mocking.
- public static ContainerServiceMaintenanceConfigurationData ContainerServiceMaintenanceConfigurationData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IEnumerable timesInWeek = null, IEnumerable notAllowedTimes = null, ContainerServiceMaintenanceWindow maintenanceWindow = null)
- {
- timesInWeek ??= new List();
- notAllowedTimes ??= new List();
-
- return new ContainerServiceMaintenanceConfigurationData(id, name, resourceType, systemData, timesInWeek?.ToList(), notAllowedTimes?.ToList(), maintenanceWindow, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The id.
- /// The name.
- /// The resourceType.
- /// The systemData.
- /// Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1.
- /// VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions.
- /// OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified.
- /// The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os).
- /// Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage.
- /// Determines the type of workload a node can run.
- /// If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}.
- /// If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}.
- /// The maximum number of pods that can run on a node.
- /// The operating system type. The default is Linux.
- /// Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType is Windows.
- /// The maximum number of nodes for auto-scaling.
- /// The minimum number of nodes for auto-scaling.
- /// Whether to enable auto-scaler.
- /// This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete.
- /// The type of Agent Pool.
- /// A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools.
- /// Both patch version <major.minor.patch> (e.g. 1.20.13) and <major.minor> (e.g. 1.20) are supported. When <major.minor> is specified, the latest supported GA patch version is chosen automatically. Updating the cluster with the same <major.minor> once it has been created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool).
- /// If orchestratorVersion is a fully specified version <major.minor.patch>, this field will be exactly equal to it. If orchestratorVersion is <major.minor>, this field will contain the full <major.minor.patch> version being used.
- /// The version of node image.
- /// Settings for upgrading the agentpool.
- /// The current deployment or provisioning state.
- /// When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded.
- /// The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'.
- /// Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see [assigning a public IP per node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). The default is false.
- /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}.
- /// The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'.
- /// This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'.
- /// Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see [spot VMs pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing).
- /// The tags to be persisted on the agent pool virtual machine scale set.
- /// The node labels to be persisted across all nodes in agent pool.
- /// The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule.
- /// The ID for Proximity Placement Group.
- /// The Kubelet configuration on the agent pool nodes.
- /// The OS configuration of Linux agent nodes.
- /// This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption.
- /// Whether to enable UltraSSD.
- /// See [Add a FIPS-enabled node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) for more details.
- /// GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU.
- /// CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot.
- /// AKS will associate the specified agent pool with the Capacity Reservation Group.
- /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts).
- /// Network-related settings of an agent pool.
- /// A new instance for mocking.
- public static ContainerServiceAgentPoolData ContainerServiceAgentPoolData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, int? count = null, string vmSize = null, int? osDiskSizeInGB = null, ContainerServiceOSDiskType? osDiskType = null, KubeletDiskType? kubeletDiskType = null, WorkloadRuntime? workloadRuntime = null, ResourceIdentifier vnetSubnetId = null, ResourceIdentifier podSubnetId = null, int? maxPods = null, ContainerServiceOSType? osType = null, ContainerServiceOSSku? osSku = null, int? maxCount = null, int? minCount = null, bool? enableAutoScaling = null, ScaleDownMode? scaleDownMode = null, AgentPoolType? typePropertiesType = null, AgentPoolMode? mode = null, string orchestratorVersion = null, string currentOrchestratorVersion = null, string nodeImageVersion = null, AgentPoolUpgradeSettings upgradeSettings = null, string provisioningState = null, ContainerServiceStateCode? powerStateCode = null, IEnumerable availabilityZones = null, bool? enableNodePublicIP = null, ResourceIdentifier nodePublicIPPrefixId = null, ScaleSetPriority? scaleSetPriority = null, ScaleSetEvictionPolicy? scaleSetEvictionPolicy = null, float? spotMaxPrice = null, IDictionary tags = null, IDictionary nodeLabels = null, IEnumerable nodeTaints = null, ResourceIdentifier proximityPlacementGroupId = null, KubeletConfig kubeletConfig = null, LinuxOSConfig linuxOSConfig = null, bool? enableEncryptionAtHost = null, bool? enableUltraSsd = null, bool? enableFips = null, GpuInstanceProfile? gpuInstanceProfile = null, ResourceIdentifier creationDataSourceResourceId = null, ResourceIdentifier capacityReservationGroupId = null, ResourceIdentifier hostGroupId = null, AgentPoolNetworkProfile networkProfile = null)
+ /// A new instance for mocking.
+ public static FleetCredentialResult FleetCredentialResult(string name = null, byte[] value = null)
{
- availabilityZones ??= new List();
- tags ??= new Dictionary();
- nodeLabels ??= new Dictionary();
- nodeTaints ??= new List();
-
- return new ContainerServiceAgentPoolData(id, name, resourceType, systemData, count, vmSize, osDiskSizeInGB, osDiskType, kubeletDiskType, workloadRuntime, vnetSubnetId, podSubnetId, maxPods, osType, osSku, maxCount, minCount, enableAutoScaling, scaleDownMode, typePropertiesType, mode, orchestratorVersion, currentOrchestratorVersion, nodeImageVersion, upgradeSettings, provisioningState, powerStateCode != null ? new ContainerServicePowerState(powerStateCode, serializedAdditionalRawData: null) : null, availabilityZones?.ToList(), enableNodePublicIP, nodePublicIPPrefixId, scaleSetPriority, scaleSetEvictionPolicy, spotMaxPrice, tags, nodeLabels, nodeTaints?.ToList(), proximityPlacementGroupId, kubeletConfig, linuxOSConfig, enableEncryptionAtHost, enableUltraSsd, enableFips, gpuInstanceProfile, creationDataSourceResourceId != null ? new ContainerServiceCreationData(creationDataSourceResourceId, serializedAdditionalRawData: null) : null, capacityReservationGroupId, hostGroupId, networkProfile, serializedAdditionalRawData: null);
+ return new FleetCredentialResult(name, value, serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
+ /// Initializes a new instance of .
/// The id.
/// The name.
/// The resourceType.
/// The systemData.
- /// The Kubernetes version (major.minor.patch).
- /// The operating system type. The default is Linux.
- /// List of orchestrator types and versions available for upgrade.
- /// The latest AKS supported node image version.
- /// A new instance for mocking.
- public static AgentPoolUpgradeProfileData AgentPoolUpgradeProfileData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string kubernetesVersion = null, ContainerServiceOSType osType = default, IEnumerable upgrades = null, string latestNodeImageVersion = null)
- {
- upgrades ??= new List();
-
- return new AgentPoolUpgradeProfileData(id, name, resourceType, systemData, kubernetesVersion, osType, upgrades?.ToList(), latestNodeImageVersion, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The Kubernetes version (major.minor.patch).
- /// Whether the Kubernetes version is currently in preview.
- /// A new instance for mocking.
- public static AgentPoolUpgradeProfilePropertiesUpgradesItem AgentPoolUpgradeProfilePropertiesUpgradesItem(string kubernetesVersion = null, bool? isPreview = null)
+ /// If eTag is provided in the response body, it may also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.
+ /// The ARM resource id of the cluster that joins the Fleet. Must be a valid Azure resource id. e.g.: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{clusterName}'.
+ /// The group this member belongs to for multi-cluster update management.
+ /// The status of the last operation.
+ /// A new instance for mocking.
+ public static FleetMemberData FleetMemberData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ETag? eTag = null, ResourceIdentifier clusterResourceId = null, string group = null, FleetMemberProvisioningState? provisioningState = null)
{
- return new AgentPoolUpgradeProfilePropertiesUpgradesItem(kubernetesVersion, isPreview, serializedAdditionalRawData: null);
+ return new FleetMemberData(id, name, resourceType, systemData, eTag, clusterResourceId, group, provisioningState, serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
+ /// Initializes a new instance of .
/// The id.
/// The name.
/// The resourceType.
/// The systemData.
- /// List of versions available for agent pool.
- /// A new instance for mocking.
- public static AgentPoolAvailableVersions AgentPoolAvailableVersions(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IEnumerable agentPoolVersions = null)
+ /// If eTag is provided in the response body, it may also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.
+ /// The provisioning state of the UpdateRun resource.
+ ///
+ /// The resource id of the FleetUpdateStrategy resource to reference.
+ ///
+ /// When creating a new run, there are three ways to define a strategy for the run:
+ /// 1. Define a new strategy in place: Set the "strategy" field.
+ /// 2. Use an existing strategy: Set the "updateStrategyId" field. (since 2023-08-15-preview)
+ /// 3. Use the default strategy to update all the members one by one: Leave both "updateStrategyId" and "strategy" unset. (since 2023-08-15-preview)
+ ///
+ /// Setting both "updateStrategyId" and "strategy" is invalid.
+ ///
+ /// UpdateRuns created by "updateStrategyId" snapshot the referenced UpdateStrategy at the time of creation and store it in the "strategy" field.
+ /// Subsequent changes to the referenced FleetUpdateStrategy resource do not propagate.
+ /// UpdateRunStrategy changes can be made directly on the "strategy" field before launching the UpdateRun.
+ ///
+ ///
+ /// The strategy defines the order in which the clusters will be updated.
+ /// If not set, all members will be updated sequentially. The UpdateRun status will show a single UpdateStage and a single UpdateGroup targeting all members.
+ /// The strategy of the UpdateRun can be modified until the run is started.
+ ///
+ /// The update to be applied to all clusters in the UpdateRun. The managedClusterUpdate can be modified until the run is started.
+ /// The status of the UpdateRun.
+ /// A new instance for mocking.
+ public static UpdateRunData UpdateRunData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ETag? eTag = null, UpdateRunProvisioningState? provisioningState = null, ResourceIdentifier updateStrategyId = null, IEnumerable strategyStages = null, ManagedClusterUpdate managedClusterUpdate = null, UpdateRunStatus status = null)
{
- agentPoolVersions ??= new List();
-
- return new AgentPoolAvailableVersions(id, name, resourceType, systemData, agentPoolVersions?.ToList(), serializedAdditionalRawData: null);
- }
+ strategyStages ??= new List();
- /// Initializes a new instance of .
- /// Whether this version is the default agent pool version.
- /// The Kubernetes version (major.minor.patch).
- /// Whether Kubernetes version is currently in preview.
- /// A new instance for mocking.
- public static AgentPoolAvailableVersion AgentPoolAvailableVersion(bool? isDefault = null, string kubernetesVersion = null, bool? isPreview = null)
- {
- return new AgentPoolAvailableVersion(isDefault, kubernetesVersion, isPreview, serializedAdditionalRawData: null);
+ return new UpdateRunData(id, name, resourceType, systemData, eTag, provisioningState, updateStrategyId, strategyStages != null ? new UpdateRunStrategy(strategyStages?.ToList(), serializedAdditionalRawData: null) : null, managedClusterUpdate, status, serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
- /// The id.
- /// The name.
- /// The resourceType.
- /// The systemData.
- /// The current provisioning state.
- /// The resource of private endpoint.
- /// A collection of information about the state of the connection between service consumer and provider.
- /// A new instance for mocking.
- public static ContainerServicePrivateEndpointConnectionData ContainerServicePrivateEndpointConnectionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ContainerServicePrivateEndpointConnectionProvisioningState? provisioningState = null, ResourceIdentifier privateEndpointId = null, ContainerServicePrivateLinkServiceConnectionState connectionState = null)
+ /// Initializes a new instance of .
+ /// The status of the UpdateRun.
+ /// The stages composing an update run. Stages are run sequentially withing an UpdateRun.
+ /// The node image upgrade specs for the update run. It is only set in update run when `NodeImageSelection.type` is `Consistent`.
+ /// A new instance for mocking.
+ public static UpdateRunStatus UpdateRunStatus(UpdateStatus status = null, IEnumerable stages = null, IEnumerable selectedNodeImageVersions = null)
{
- return new ContainerServicePrivateEndpointConnectionData(id, name, resourceType, systemData, provisioningState, privateEndpointId != null ? ResourceManagerModelFactory.WritableSubResource(privateEndpointId) : null, connectionState, serializedAdditionalRawData: null);
- }
+ stages ??= new List();
+ selectedNodeImageVersions ??= new List();
- /// Initializes a new instance of .
- /// The command to run.
- /// A base64 encoded zip file containing the files required by the command.
- /// AuthToken issued for AKS AAD Server App.
- /// A new instance for mocking.
- public static ManagedClusterRunCommandContent ManagedClusterRunCommandContent(string command = null, string context = null, string clusterToken = null)
- {
- return new ManagedClusterRunCommandContent(command, context, clusterToken, serializedAdditionalRawData: null);
+ return new UpdateRunStatus(status, stages?.ToList(), selectedNodeImageVersions != null ? new NodeImageSelectionStatus(selectedNodeImageVersions?.ToList(), serializedAdditionalRawData: null) : null, serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
- /// The command id.
- /// provisioning State.
- /// The exit code of the command.
- /// The time when the command started.
- /// The time when the command finished.
- /// The command output.
- /// An explanation of why provisioningState is set to failed (if so).
- /// A new instance for mocking.
- public static ManagedClusterRunCommandResult ManagedClusterRunCommandResult(string id = null, string provisioningState = null, int? exitCode = null, DateTimeOffset? startedOn = null, DateTimeOffset? finishedOn = null, string logs = null, string reason = null)
+ /// Initializes a new instance of .
+ /// The time the operation or group was started.
+ /// The time the operation or group was completed.
+ /// The State of the operation or group.
+ /// The error details when a failure is encountered.
+ /// A new instance for mocking.
+ public static UpdateStatus UpdateStatus(DateTimeOffset? startOn = null, DateTimeOffset? completedOn = null, UpdateState? state = null, ResponseError error = null)
{
- return new ManagedClusterRunCommandResult(id, provisioningState, exitCode, startedOn, finishedOn, logs, reason, serializedAdditionalRawData: null);
+ return new UpdateStatus(startOn, completedOn, state, error, serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
- /// The category of endpoints accessed by the AKS agent node, e.g. azure-resource-management, apiserver, etc.
- /// The endpoints that AKS agent nodes connect to.
- /// A new instance for mocking.
- public static ContainerServiceOutboundEnvironmentEndpoint ContainerServiceOutboundEnvironmentEndpoint(string category = null, IEnumerable endpoints = null)
+ /// Initializes a new instance of .
+ /// The status of the UpdateStage.
+ /// The name of the UpdateStage.
+ /// The list of groups to be updated as part of this UpdateStage.
+ /// The status of the wait period configured on the UpdateStage.
+ /// A new instance for mocking.
+ public static UpdateStageStatus UpdateStageStatus(UpdateStatus status = null, string name = null, IEnumerable groups = null, WaitStatus afterStageWaitStatus = null)
{
- endpoints ??= new List();
+ groups ??= new List();
- return new ContainerServiceOutboundEnvironmentEndpoint(category, endpoints?.ToList(), serializedAdditionalRawData: null);
+ return new UpdateStageStatus(status, name, groups?.ToList(), afterStageWaitStatus, serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
- /// The domain name of the dependency.
- /// The Ports and Protocols used when connecting to domainName.
- /// A new instance for mocking.
- public static ContainerServiceEndpointDependency ContainerServiceEndpointDependency(string domainName = null, IEnumerable endpointDetails = null)
+ /// Initializes a new instance of .
+ /// The status of the UpdateGroup.
+ /// The name of the UpdateGroup.
+ /// The list of member this UpdateGroup updates.
+ /// A new instance for mocking.
+ public static UpdateGroupStatus UpdateGroupStatus(UpdateStatus status = null, string name = null, IEnumerable members = null)
{
- endpointDetails ??= new List();
+ members ??= new List();
- return new ContainerServiceEndpointDependency(domainName, endpointDetails?.ToList(), serializedAdditionalRawData: null);
+ return new UpdateGroupStatus(status, name, members?.ToList(), serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
- /// An IP Address that Domain Name currently resolves to.
- /// The port an endpoint is connected to.
- /// The protocol used for connection.
- /// Description of the detail.
- /// A new instance for mocking.
- public static ContainerServiceEndpointDetail ContainerServiceEndpointDetail(IPAddress ipAddress = null, int? port = null, string protocol = null, string description = null)
- {
- return new ContainerServiceEndpointDetail(ipAddress, port, protocol, description, serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// The id.
- /// The name.
- /// The resourceType.
- /// The systemData.
- /// The tags.
- /// The location.
- /// CreationData to be used to specify the source agent pool resource ID to create this snapshot.
- /// The type of a snapshot. The default is NodePool.
- /// The version of Kubernetes.
- /// The version of node image.
- /// The operating system type. The default is Linux.
- /// Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType is Windows.
- /// The size of the VM.
- /// Whether to use a FIPS-enabled OS.
- /// A new instance for mocking.
- public static AgentPoolSnapshotData AgentPoolSnapshotData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ResourceIdentifier creationDataSourceResourceId = null, SnapshotType? snapshotType = null, string kubernetesVersion = null, string nodeImageVersion = null, ContainerServiceOSType? osType = null, ContainerServiceOSSku? osSku = null, string vmSize = null, bool? enableFips = null)
+ /// Initializes a new instance of .
+ /// The status of the MemberUpdate operation.
+ /// The name of the FleetMember.
+ /// The Azure resource id of the target Kubernetes cluster.
+ /// The operation resource id of the latest attempt to perform the operation.
+ /// The status message after processing the member update operation.
+ /// A new instance for mocking.
+ public static MemberUpdateStatus MemberUpdateStatus(UpdateStatus status = null, string name = null, ResourceIdentifier clusterResourceId = null, string operationId = null, string message = null)
{
- tags ??= new Dictionary();
-
- return new AgentPoolSnapshotData(id, name, resourceType, systemData, tags, location, creationDataSourceResourceId != null ? new ContainerServiceCreationData(creationDataSourceResourceId, serializedAdditionalRawData: null) : null, snapshotType, kubernetesVersion, nodeImageVersion, osType, osSku, vmSize, enableFips, serializedAdditionalRawData: null);
+ return new MemberUpdateStatus(status, name, clusterResourceId, operationId, message, serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
- /// The id.
- /// The name.
- /// The resourceType.
- /// The systemData.
- /// Mesh revision profile properties for a mesh.
- /// A new instance for mocking.
- public static MeshRevisionProfileData MeshRevisionProfileData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IEnumerable meshRevisions = null)
+ /// Initializes a new instance of .
+ /// The status of the wait duration.
+ /// The wait duration configured in seconds.
+ /// A new instance for mocking.
+ public static WaitStatus WaitStatus(UpdateStatus status = null, int? waitDurationInSeconds = null)
{
- meshRevisions ??= new List();
-
- return new MeshRevisionProfileData(id, name, resourceType, systemData, meshRevisions != null ? new MeshRevisionProfileProperties(meshRevisions?.ToList(), serializedAdditionalRawData: null) : null, serializedAdditionalRawData: null);
+ return new WaitStatus(status, waitDurationInSeconds, serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
- /// The id.
- /// The name.
- /// The resourceType.
- /// The systemData.
- /// Mesh upgrade profile properties for a major.minor release.
- /// A new instance for mocking.
- public static MeshUpgradeProfileData MeshUpgradeProfileData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, MeshUpgradeProfileProperties properties = null)
+ /// Initializes a new instance of .
+ /// The image version to upgrade the nodes to (e.g., 'AKSUbuntu-1804gen2containerd-2022.12.13').
+ /// A new instance for mocking.
+ public static NodeImageVersion NodeImageVersion(string version = null)
{
- return new MeshUpgradeProfileData(id, name, resourceType, systemData, properties, serializedAdditionalRawData: null);
+ return new NodeImageVersion(version, serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
+ /// Initializes a new instance of .
/// The id.
/// The name.
/// The resourceType.
/// The systemData.
- /// The current provisioning state of trusted access role binding.
- /// The ARM resource ID of source resource that trusted access is configured for.
- /// A list of roles to bind, each item is a resource type qualified role name. For example: 'Microsoft.MachineLearningServices/workspaces/reader'.
- /// A new instance for mocking.
- public static ContainerServiceTrustedAccessRoleBindingData ContainerServiceTrustedAccessRoleBindingData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ContainerServiceTrustedAccessRoleBindingProvisioningState? provisioningState = null, ResourceIdentifier sourceResourceId = null, IEnumerable roles = null)
- {
- roles ??= new List();
-
- return new ContainerServiceTrustedAccessRoleBindingData(id, name, resourceType, systemData, provisioningState, sourceResourceId, roles?.ToList(), serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// Resource type of Azure resource.
- /// Name of role, name is unique under a source resource type.
- /// List of rules for the role. This maps to 'rules' property of [Kubernetes Cluster Role](https://kubernetes.io/docs/reference/kubernetes-api/authorization-resources/cluster-role-v1/#ClusterRole).
- /// A new instance for mocking.
- public static ContainerServiceTrustedAccessRole ContainerServiceTrustedAccessRole(string sourceResourceType = null, string name = null, IEnumerable rules = null)
- {
- rules ??= new List();
-
- return new ContainerServiceTrustedAccessRole(sourceResourceType, name, rules?.ToList(), serializedAdditionalRawData: null);
- }
-
- /// Initializes a new instance of .
- /// List of allowed verbs.
- /// List of allowed apiGroups.
- /// List of allowed resources.
- /// List of allowed names.
- /// List of allowed nonResourceURLs.
- /// A new instance for mocking.
- public static ContainerServiceTrustedAccessRoleRule ContainerServiceTrustedAccessRoleRule(IEnumerable verbs = null, IEnumerable apiGroups = null, IEnumerable resources = null, IEnumerable resourceNames = null, IEnumerable nonResourceUrls = null)
+ /// If eTag is provided in the response body, it may also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.
+ /// The provisioning state of the UpdateStrategy resource.
+ /// Defines the update sequence of the clusters.
+ /// A new instance for mocking.
+ public static FleetUpdateStrategyData FleetUpdateStrategyData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ETag? eTag = null, FleetUpdateStrategyProvisioningState? provisioningState = null, IEnumerable strategyStages = null)
{
- verbs ??= new List();
- apiGroups ??= new List();
- resources ??= new List();
- resourceNames ??= new List();
- nonResourceUrls ??= new List();
+ strategyStages ??= new List();
- return new ContainerServiceTrustedAccessRoleRule(verbs?.ToList(), apiGroups?.ToList(), resources?.ToList(), resourceNames?.ToList(), nonResourceUrls?.ToList(), serializedAdditionalRawData: null);
+ return new FleetUpdateStrategyData(id, name, resourceType, systemData, eTag, provisioningState, strategyStages != null ? new UpdateRunStrategy(strategyStages?.ToList(), serializedAdditionalRawData: null) : null, serializedAdditionalRawData: null);
}
}
}
diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolCollection.cs
deleted file mode 100644
index 3a3f3f978ced..000000000000
--- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolCollection.cs
+++ /dev/null
@@ -1,495 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Globalization;
-using System.Threading;
-using System.Threading.Tasks;
-using Autorest.CSharp.Core;
-using Azure;
-using Azure.Core;
-using Azure.Core.Pipeline;
-using Azure.ResourceManager;
-
-namespace Azure.ResourceManager.ContainerService
-{
- ///
- /// A class representing a collection of and their operations.
- /// Each in the collection will belong to the same instance of .
- /// To get a instance call the GetContainerServiceAgentPools method from an instance of .
- ///
- public partial class ContainerServiceAgentPoolCollection : ArmCollection, IEnumerable, IAsyncEnumerable
- {
- private readonly ClientDiagnostics _containerServiceAgentPoolAgentPoolsClientDiagnostics;
- private readonly AgentPoolsRestOperations _containerServiceAgentPoolAgentPoolsRestClient;
-
- /// Initializes a new instance of the class for mocking.
- protected ContainerServiceAgentPoolCollection()
- {
- }
-
- /// Initializes a new instance of the class.
- /// The client parameters to use in these operations.
- /// The identifier of the parent resource that is the target of operations.
- internal ContainerServiceAgentPoolCollection(ArmClient client, ResourceIdentifier id) : base(client, id)
- {
- _containerServiceAgentPoolAgentPoolsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ContainerServiceAgentPoolResource.ResourceType.Namespace, Diagnostics);
- TryGetApiVersion(ContainerServiceAgentPoolResource.ResourceType, out string containerServiceAgentPoolAgentPoolsApiVersion);
- _containerServiceAgentPoolAgentPoolsRestClient = new AgentPoolsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerServiceAgentPoolAgentPoolsApiVersion);
-#if DEBUG
- ValidateResourceId(Id);
-#endif
- }
-
- internal static void ValidateResourceId(ResourceIdentifier id)
- {
- if (id.ResourceType != ContainerServiceManagedClusterResource.ResourceType)
- throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ContainerServiceManagedClusterResource.ResourceType), nameof(id));
- }
-
- ///
- /// Creates or updates an agent pool in the specified managed cluster.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}
- ///
- /// -
- /// Operation Id
- /// AgentPools_CreateOrUpdate
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
- /// The name of the agent pool.
- /// The agent pool to create or update.
- /// The cancellation token to use.
- /// is an empty string, and was expected to be non-empty.
- /// or is null.
- public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string agentPoolName, ContainerServiceAgentPoolData data, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName));
- Argument.AssertNotNull(data, nameof(data));
-
- using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolCollection.CreateOrUpdate");
- scope.Start();
- try
- {
- var response = await _containerServiceAgentPoolAgentPoolsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, data, cancellationToken).ConfigureAwait(false);
- var operation = new ContainerServiceArmOperation(new ContainerServiceAgentPoolOperationSource(Client), _containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, data).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2017-08-31");
- if (waitUntil == WaitUntil.Completed)
- await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
- return operation;
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Creates or updates an agent pool in the specified managed cluster.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}
- ///
- /// -
- /// Operation Id
- /// AgentPools_CreateOrUpdate
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
- /// The name of the agent pool.
- /// The agent pool to create or update.
- /// The cancellation token to use.
- /// is an empty string, and was expected to be non-empty.
- /// or is null.
- public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string agentPoolName, ContainerServiceAgentPoolData data, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName));
- Argument.AssertNotNull(data, nameof(data));
-
- using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolCollection.CreateOrUpdate");
- scope.Start();
- try
- {
- var response = _containerServiceAgentPoolAgentPoolsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, data, cancellationToken);
- var operation = new ContainerServiceArmOperation(new ContainerServiceAgentPoolOperationSource(Client), _containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, data).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2017-08-31");
- if (waitUntil == WaitUntil.Completed)
- operation.WaitForCompletion(cancellationToken);
- return operation;
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Gets the specified managed cluster agent pool.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}
- ///
- /// -
- /// Operation Id
- /// AgentPools_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The name of the agent pool.
- /// The cancellation token to use.
- /// is an empty string, and was expected to be non-empty.
- /// is null.
- public virtual async Task> GetAsync(string agentPoolName, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName));
-
- using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolCollection.Get");
- scope.Start();
- try
- {
- var response = await _containerServiceAgentPoolAgentPoolsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, cancellationToken).ConfigureAwait(false);
- if (response.Value == null)
- throw new RequestFailedException(response.GetRawResponse());
- return Response.FromValue(new ContainerServiceAgentPoolResource(Client, response.Value), response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Gets the specified managed cluster agent pool.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}
- ///
- /// -
- /// Operation Id
- /// AgentPools_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The name of the agent pool.
- /// The cancellation token to use.
- /// is an empty string, and was expected to be non-empty.
- /// is null.
- public virtual Response Get(string agentPoolName, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName));
-
- using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolCollection.Get");
- scope.Start();
- try
- {
- var response = _containerServiceAgentPoolAgentPoolsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, cancellationToken);
- if (response.Value == null)
- throw new RequestFailedException(response.GetRawResponse());
- return Response.FromValue(new ContainerServiceAgentPoolResource(Client, response.Value), response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Gets a list of agent pools in the specified managed cluster.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools
- ///
- /// -
- /// Operation Id
- /// AgentPools_List
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The cancellation token to use.
- /// An async collection of that may take multiple service requests to iterate over.
- public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default)
- {
- HttpMessage FirstPageRequest(int? pageSizeHint) => _containerServiceAgentPoolAgentPoolsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name);
- HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerServiceAgentPoolAgentPoolsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name);
- return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerServiceAgentPoolResource(Client, ContainerServiceAgentPoolData.DeserializeContainerServiceAgentPoolData(e)), _containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, "ContainerServiceAgentPoolCollection.GetAll", "value", "nextLink", cancellationToken);
- }
-
- ///
- /// Gets a list of agent pools in the specified managed cluster.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools
- ///
- /// -
- /// Operation Id
- /// AgentPools_List
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The cancellation token to use.
- /// A collection of that may take multiple service requests to iterate over.
- public virtual Pageable GetAll(CancellationToken cancellationToken = default)
- {
- HttpMessage FirstPageRequest(int? pageSizeHint) => _containerServiceAgentPoolAgentPoolsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name);
- HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerServiceAgentPoolAgentPoolsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name);
- return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerServiceAgentPoolResource(Client, ContainerServiceAgentPoolData.DeserializeContainerServiceAgentPoolData(e)), _containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, "ContainerServiceAgentPoolCollection.GetAll", "value", "nextLink", cancellationToken);
- }
-
- ///
- /// Checks to see if the resource exists in azure.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}
- ///
- /// -
- /// Operation Id
- /// AgentPools_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The name of the agent pool.
- /// The cancellation token to use.
- /// is an empty string, and was expected to be non-empty.
- /// is null.
- public virtual async Task> ExistsAsync(string agentPoolName, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName));
-
- using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolCollection.Exists");
- scope.Start();
- try
- {
- var response = await _containerServiceAgentPoolAgentPoolsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, cancellationToken: cancellationToken).ConfigureAwait(false);
- return Response.FromValue(response.Value != null, response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Checks to see if the resource exists in azure.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}
- ///
- /// -
- /// Operation Id
- /// AgentPools_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The name of the agent pool.
- /// The cancellation token to use.
- /// is an empty string, and was expected to be non-empty.
- /// is null.
- public virtual Response Exists(string agentPoolName, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName));
-
- using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolCollection.Exists");
- scope.Start();
- try
- {
- var response = _containerServiceAgentPoolAgentPoolsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, cancellationToken: cancellationToken);
- return Response.FromValue(response.Value != null, response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Tries to get details for this resource from the service.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}
- ///
- /// -
- /// Operation Id
- /// AgentPools_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The name of the agent pool.
- /// The cancellation token to use.
- /// is an empty string, and was expected to be non-empty.
- /// is null.
- public virtual async Task> GetIfExistsAsync(string agentPoolName, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName));
-
- using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolCollection.GetIfExists");
- scope.Start();
- try
- {
- var response = await _containerServiceAgentPoolAgentPoolsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, cancellationToken: cancellationToken).ConfigureAwait(false);
- if (response.Value == null)
- return new NoValueResponse(response.GetRawResponse());
- return Response.FromValue(new ContainerServiceAgentPoolResource(Client, response.Value), response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Tries to get details for this resource from the service.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}
- ///
- /// -
- /// Operation Id
- /// AgentPools_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The name of the agent pool.
- /// The cancellation token to use.
- /// is an empty string, and was expected to be non-empty.
- /// is null.
- public virtual NullableResponse GetIfExists(string agentPoolName, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNullOrEmpty(agentPoolName, nameof(agentPoolName));
-
- using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolCollection.GetIfExists");
- scope.Start();
- try
- {
- var response = _containerServiceAgentPoolAgentPoolsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, agentPoolName, cancellationToken: cancellationToken);
- if (response.Value == null)
- return new NoValueResponse(response.GetRawResponse());
- return Response.FromValue(new ContainerServiceAgentPoolResource(Client, response.Value), response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- return GetAll().GetEnumerator();
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- return GetAll().GetEnumerator();
- }
-
- IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken)
- {
- return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken);
- }
- }
-}
diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolData.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolData.cs
deleted file mode 100644
index 0cba3bcad288..000000000000
--- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolData.cs
+++ /dev/null
@@ -1,271 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Collections.Generic;
-using Azure.Core;
-using Azure.ResourceManager.ContainerService.Models;
-using Azure.ResourceManager.Models;
-
-namespace Azure.ResourceManager.ContainerService
-{
- ///
- /// A class representing the ContainerServiceAgentPool data model.
- /// Agent Pool.
- ///
- public partial class ContainerServiceAgentPoolData : ResourceData
- {
- ///
- /// Keeps track of any properties unknown to the library.
- ///
- /// To assign an object to the value of this property use .
- ///
- ///
- /// To assign an already formatted json string to this property use .
- ///
- ///
- /// Examples:
- ///
- /// -
- /// BinaryData.FromObjectAsJson("foo")
- /// Creates a payload of "foo".
- ///
- /// -
- /// BinaryData.FromString("\"foo\"")
- /// Creates a payload of "foo".
- ///
- /// -
- /// BinaryData.FromObjectAsJson(new { key = "value" })
- /// Creates a payload of { "key": "value" }.
- ///
- /// -
- /// BinaryData.FromString("{\"key\": \"value\"}")
- /// Creates a payload of { "key": "value" }.
- ///
- ///
- ///
- ///
- private IDictionary _serializedAdditionalRawData;
-
- /// Initializes a new instance of .
- public ContainerServiceAgentPoolData()
- {
- AvailabilityZones = new ChangeTrackingList();
- Tags = new ChangeTrackingDictionary();
- NodeLabels = new ChangeTrackingDictionary();
- NodeTaints = new ChangeTrackingList();
- }
-
- /// Initializes a new instance of .
- /// The id.
- /// The name.
- /// The resourceType.
- /// The systemData.
- /// Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1.
- /// VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions.
- /// OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified.
- /// The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os).
- /// Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage.
- /// Determines the type of workload a node can run.
- /// If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}.
- /// If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}.
- /// The maximum number of pods that can run on a node.
- /// The operating system type. The default is Linux.
- /// Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType is Windows.
- /// The maximum number of nodes for auto-scaling.
- /// The minimum number of nodes for auto-scaling.
- /// Whether to enable auto-scaler.
- /// This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete.
- /// The type of Agent Pool.
- /// A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools.
- /// Both patch version <major.minor.patch> (e.g. 1.20.13) and <major.minor> (e.g. 1.20) are supported. When <major.minor> is specified, the latest supported GA patch version is chosen automatically. Updating the cluster with the same <major.minor> once it has been created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool).
- /// If orchestratorVersion is a fully specified version <major.minor.patch>, this field will be exactly equal to it. If orchestratorVersion is <major.minor>, this field will contain the full <major.minor.patch> version being used.
- /// The version of node image.
- /// Settings for upgrading the agentpool.
- /// The current deployment or provisioning state.
- /// When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded.
- /// The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'.
- /// Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see [assigning a public IP per node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). The default is false.
- /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}.
- /// The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'.
- /// This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'.
- /// Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see [spot VMs pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing).
- /// The tags to be persisted on the agent pool virtual machine scale set.
- /// The node labels to be persisted across all nodes in agent pool.
- /// The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule.
- /// The ID for Proximity Placement Group.
- /// The Kubelet configuration on the agent pool nodes.
- /// The OS configuration of Linux agent nodes.
- /// This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption.
- /// Whether to enable UltraSSD.
- /// See [Add a FIPS-enabled node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) for more details.
- /// GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU.
- /// CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot.
- /// AKS will associate the specified agent pool with the Capacity Reservation Group.
- /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts).
- /// Network-related settings of an agent pool.
- /// Keeps track of any properties unknown to the library.
- internal ContainerServiceAgentPoolData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, int? count, string vmSize, int? osDiskSizeInGB, ContainerServiceOSDiskType? osDiskType, KubeletDiskType? kubeletDiskType, WorkloadRuntime? workloadRuntime, ResourceIdentifier vnetSubnetId, ResourceIdentifier podSubnetId, int? maxPods, ContainerServiceOSType? osType, ContainerServiceOSSku? osSku, int? maxCount, int? minCount, bool? enableAutoScaling, ScaleDownMode? scaleDownMode, AgentPoolType? typePropertiesType, AgentPoolMode? mode, string orchestratorVersion, string currentOrchestratorVersion, string nodeImageVersion, AgentPoolUpgradeSettings upgradeSettings, string provisioningState, ContainerServicePowerState powerState, IList availabilityZones, bool? enableNodePublicIP, ResourceIdentifier nodePublicIPPrefixId, ScaleSetPriority? scaleSetPriority, ScaleSetEvictionPolicy? scaleSetEvictionPolicy, float? spotMaxPrice, IDictionary tags, IDictionary nodeLabels, IList nodeTaints, ResourceIdentifier proximityPlacementGroupId, KubeletConfig kubeletConfig, LinuxOSConfig linuxOSConfig, bool? enableEncryptionAtHost, bool? enableUltraSsd, bool? enableFips, GpuInstanceProfile? gpuInstanceProfile, ContainerServiceCreationData creationData, ResourceIdentifier capacityReservationGroupId, ResourceIdentifier hostGroupId, AgentPoolNetworkProfile networkProfile, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData)
- {
- Count = count;
- VmSize = vmSize;
- OSDiskSizeInGB = osDiskSizeInGB;
- OSDiskType = osDiskType;
- KubeletDiskType = kubeletDiskType;
- WorkloadRuntime = workloadRuntime;
- VnetSubnetId = vnetSubnetId;
- PodSubnetId = podSubnetId;
- MaxPods = maxPods;
- OSType = osType;
- OSSku = osSku;
- MaxCount = maxCount;
- MinCount = minCount;
- EnableAutoScaling = enableAutoScaling;
- ScaleDownMode = scaleDownMode;
- TypePropertiesType = typePropertiesType;
- Mode = mode;
- OrchestratorVersion = orchestratorVersion;
- CurrentOrchestratorVersion = currentOrchestratorVersion;
- NodeImageVersion = nodeImageVersion;
- UpgradeSettings = upgradeSettings;
- ProvisioningState = provisioningState;
- PowerState = powerState;
- AvailabilityZones = availabilityZones;
- EnableNodePublicIP = enableNodePublicIP;
- NodePublicIPPrefixId = nodePublicIPPrefixId;
- ScaleSetPriority = scaleSetPriority;
- ScaleSetEvictionPolicy = scaleSetEvictionPolicy;
- SpotMaxPrice = spotMaxPrice;
- Tags = tags;
- NodeLabels = nodeLabels;
- NodeTaints = nodeTaints;
- ProximityPlacementGroupId = proximityPlacementGroupId;
- KubeletConfig = kubeletConfig;
- LinuxOSConfig = linuxOSConfig;
- EnableEncryptionAtHost = enableEncryptionAtHost;
- EnableUltraSsd = enableUltraSsd;
- EnableFips = enableFips;
- GpuInstanceProfile = gpuInstanceProfile;
- CreationData = creationData;
- CapacityReservationGroupId = capacityReservationGroupId;
- HostGroupId = hostGroupId;
- NetworkProfile = networkProfile;
- _serializedAdditionalRawData = serializedAdditionalRawData;
- }
-
- /// Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 1000 (inclusive) for user pools and in the range of 1 to 1000 (inclusive) for system pools. The default value is 1.
- public int? Count { get; set; }
- /// VM size availability varies by region. If a node contains insufficient compute resources (memory, cpu, etc) pods might fail to run correctly. For more details on restricted VM sizes, see: https://docs.microsoft.com/azure/aks/quotas-skus-regions.
- public string VmSize { get; set; }
- /// OS Disk Size in GB to be used to specify the disk size for every machine in the master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified.
- public int? OSDiskSizeInGB { get; set; }
- /// The default is 'Ephemeral' if the VM supports it and has a cache disk larger than the requested OSDiskSizeGB. Otherwise, defaults to 'Managed'. May not be changed after creation. For more information see [Ephemeral OS](https://docs.microsoft.com/azure/aks/cluster-configuration#ephemeral-os).
- public ContainerServiceOSDiskType? OSDiskType { get; set; }
- /// Determines the placement of emptyDir volumes, container runtime data root, and Kubelet ephemeral storage.
- public KubeletDiskType? KubeletDiskType { get; set; }
- /// Determines the type of workload a node can run.
- public WorkloadRuntime? WorkloadRuntime { get; set; }
- /// If this is not specified, a VNET and subnet will be generated and used. If no podSubnetID is specified, this applies to nodes and pods, otherwise it applies to just nodes. This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}.
- public ResourceIdentifier VnetSubnetId { get; set; }
- /// If omitted, pod IPs are statically assigned on the node subnet (see vnetSubnetID for more details). This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}.
- public ResourceIdentifier PodSubnetId { get; set; }
- /// The maximum number of pods that can run on a node.
- public int? MaxPods { get; set; }
- /// The operating system type. The default is Linux.
- public ContainerServiceOSType? OSType { get; set; }
- /// Specifies the OS SKU used by the agent pool. The default is Ubuntu if OSType is Linux. The default is Windows2019 when Kubernetes <= 1.24 or Windows2022 when Kubernetes >= 1.25 if OSType is Windows.
- public ContainerServiceOSSku? OSSku { get; set; }
- /// The maximum number of nodes for auto-scaling.
- public int? MaxCount { get; set; }
- /// The minimum number of nodes for auto-scaling.
- public int? MinCount { get; set; }
- /// Whether to enable auto-scaler.
- public bool? EnableAutoScaling { get; set; }
- /// This also effects the cluster autoscaler behavior. If not specified, it defaults to Delete.
- public ScaleDownMode? ScaleDownMode { get; set; }
- /// The type of Agent Pool.
- public AgentPoolType? TypePropertiesType { get; set; }
- /// A cluster must have at least one 'System' Agent Pool at all times. For additional information on agent pool restrictions and best practices, see: https://docs.microsoft.com/azure/aks/use-system-pools.
- public AgentPoolMode? Mode { get; set; }
- /// Both patch version <major.minor.patch> (e.g. 1.20.13) and <major.minor> (e.g. 1.20) are supported. When <major.minor> is specified, the latest supported GA patch version is chosen automatically. Updating the cluster with the same <major.minor> once it has been created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. As a best practice, you should upgrade all node pools in an AKS cluster to the same Kubernetes version. The node pool version must have the same major version as the control plane. The node pool minor version must be within two minor versions of the control plane version. The node pool version cannot be greater than the control plane version. For more information see [upgrading a node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#upgrade-a-node-pool).
- public string OrchestratorVersion { get; set; }
- /// If orchestratorVersion is a fully specified version <major.minor.patch>, this field will be exactly equal to it. If orchestratorVersion is <major.minor>, this field will contain the full <major.minor.patch> version being used.
- public string CurrentOrchestratorVersion { get; }
- /// The version of node image.
- public string NodeImageVersion { get; }
- /// Settings for upgrading the agentpool.
- public AgentPoolUpgradeSettings UpgradeSettings { get; set; }
- /// The current deployment or provisioning state.
- public string ProvisioningState { get; }
- /// When an Agent Pool is first created it is initially Running. The Agent Pool can be stopped by setting this field to Stopped. A stopped Agent Pool stops all of its VMs and does not accrue billing charges. An Agent Pool can only be stopped if it is Running and provisioning state is Succeeded.
- internal ContainerServicePowerState PowerState { get; set; }
- /// Tells whether the cluster is Running or Stopped.
- public ContainerServiceStateCode? PowerStateCode
- {
- get => PowerState is null ? default : PowerState.Code;
- set
- {
- if (PowerState is null)
- PowerState = new ContainerServicePowerState();
- PowerState.Code = value;
- }
- }
-
- /// The list of Availability zones to use for nodes. This can only be specified if the AgentPoolType property is 'VirtualMachineScaleSets'.
- public IList AvailabilityZones { get; }
- /// Some scenarios may require nodes in a node pool to receive their own dedicated public IP addresses. A common scenario is for gaming workloads, where a console needs to make a direct connection to a cloud virtual machine to minimize hops. For more information see [assigning a public IP per node](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#assign-a-public-ip-per-node-for-your-node-pools). The default is false.
- public bool? EnableNodePublicIP { get; set; }
- /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPPrefixes/{publicIPPrefixName}.
- public ResourceIdentifier NodePublicIPPrefixId { get; set; }
- /// The Virtual Machine Scale Set priority. If not specified, the default is 'Regular'.
- public ScaleSetPriority? ScaleSetPriority { get; set; }
- /// This cannot be specified unless the scaleSetPriority is 'Spot'. If not specified, the default is 'Delete'.
- public ScaleSetEvictionPolicy? ScaleSetEvictionPolicy { get; set; }
- /// Possible values are any decimal value greater than zero or -1 which indicates the willingness to pay any on-demand price. For more details on spot pricing, see [spot VMs pricing](https://docs.microsoft.com/azure/virtual-machines/spot-vms#pricing).
- public float? SpotMaxPrice { get; set; }
- /// The tags to be persisted on the agent pool virtual machine scale set.
- public IDictionary Tags { get; }
- /// The node labels to be persisted across all nodes in agent pool.
- public IDictionary NodeLabels { get; }
- /// The taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule.
- public IList NodeTaints { get; }
- /// The ID for Proximity Placement Group.
- public ResourceIdentifier ProximityPlacementGroupId { get; set; }
- /// The Kubelet configuration on the agent pool nodes.
- public KubeletConfig KubeletConfig { get; set; }
- /// The OS configuration of Linux agent nodes.
- public LinuxOSConfig LinuxOSConfig { get; set; }
- /// This is only supported on certain VM sizes and in certain Azure regions. For more information, see: https://docs.microsoft.com/azure/aks/enable-host-encryption.
- public bool? EnableEncryptionAtHost { get; set; }
- /// Whether to enable UltraSSD.
- public bool? EnableUltraSsd { get; set; }
- /// See [Add a FIPS-enabled node pool](https://docs.microsoft.com/azure/aks/use-multiple-node-pools#add-a-fips-enabled-node-pool-preview) for more details.
- public bool? EnableFips { get; set; }
- /// GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU.
- public GpuInstanceProfile? GpuInstanceProfile { get; set; }
- /// CreationData to be used to specify the source Snapshot ID if the node pool will be created/upgraded using a snapshot.
- internal ContainerServiceCreationData CreationData { get; set; }
- /// This is the ARM ID of the source object to be used to create the target object.
- public ResourceIdentifier CreationDataSourceResourceId
- {
- get => CreationData is null ? default : CreationData.SourceResourceId;
- set
- {
- if (CreationData is null)
- CreationData = new ContainerServiceCreationData();
- CreationData.SourceResourceId = value;
- }
- }
-
- /// AKS will associate the specified agent pool with the Capacity Reservation Group.
- public ResourceIdentifier CapacityReservationGroupId { get; set; }
- /// This is of the form: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}. For more information see [Azure dedicated hosts](https://docs.microsoft.com/azure/virtual-machines/dedicated-hosts).
- public ResourceIdentifier HostGroupId { get; set; }
- /// Network-related settings of an agent pool.
- public AgentPoolNetworkProfile NetworkProfile { get; set; }
- }
-}
diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolResource.cs
deleted file mode 100644
index 1b013a3a476b..000000000000
--- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceAgentPoolResource.cs
+++ /dev/null
@@ -1,777 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Collections.Generic;
-using System.Globalization;
-using System.Threading;
-using System.Threading.Tasks;
-using Azure;
-using Azure.Core;
-using Azure.Core.Pipeline;
-using Azure.ResourceManager;
-
-namespace Azure.ResourceManager.ContainerService
-{
- ///
- /// A Class representing a ContainerServiceAgentPool along with the instance operations that can be performed on it.
- /// If you have a you can construct a
- /// from an instance of using the GetContainerServiceAgentPoolResource method.
- /// Otherwise you can get one from its parent resource using the GetContainerServiceAgentPool method.
- ///
- public partial class ContainerServiceAgentPoolResource : ArmResource
- {
- /// Generate the resource identifier of a instance.
- /// The subscriptionId.
- /// The resourceGroupName.
- /// The resourceName.
- /// The agentPoolName.
- public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string resourceName, string agentPoolName)
- {
- var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}";
- return new ResourceIdentifier(resourceId);
- }
-
- private readonly ClientDiagnostics _containerServiceAgentPoolAgentPoolsClientDiagnostics;
- private readonly AgentPoolsRestOperations _containerServiceAgentPoolAgentPoolsRestClient;
- private readonly ContainerServiceAgentPoolData _data;
-
- /// Gets the resource type for the operations.
- public static readonly ResourceType ResourceType = "Microsoft.ContainerService/managedClusters/agentPools";
-
- /// Initializes a new instance of the class for mocking.
- protected ContainerServiceAgentPoolResource()
- {
- }
-
- /// Initializes a new instance of the class.
- /// The client parameters to use in these operations.
- /// The resource that is the target of operations.
- internal ContainerServiceAgentPoolResource(ArmClient client, ContainerServiceAgentPoolData data) : this(client, data.Id)
- {
- HasData = true;
- _data = data;
- }
-
- /// Initializes a new instance of the class.
- /// The client parameters to use in these operations.
- /// The identifier of the resource that is the target of operations.
- internal ContainerServiceAgentPoolResource(ArmClient client, ResourceIdentifier id) : base(client, id)
- {
- _containerServiceAgentPoolAgentPoolsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ResourceType.Namespace, Diagnostics);
- TryGetApiVersion(ResourceType, out string containerServiceAgentPoolAgentPoolsApiVersion);
- _containerServiceAgentPoolAgentPoolsRestClient = new AgentPoolsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerServiceAgentPoolAgentPoolsApiVersion);
-#if DEBUG
- ValidateResourceId(Id);
-#endif
- }
-
- /// Gets whether or not the current instance has data.
- public virtual bool HasData { get; }
-
- /// Gets the data representing this Feature.
- /// Throws if there is no data loaded in the current instance.
- public virtual ContainerServiceAgentPoolData Data
- {
- get
- {
- if (!HasData)
- throw new InvalidOperationException("The current instance does not have data, you must call Get first.");
- return _data;
- }
- }
-
- internal static void ValidateResourceId(ResourceIdentifier id)
- {
- if (id.ResourceType != ResourceType)
- throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id));
- }
-
- /// Gets an object representing a AgentPoolUpgradeProfileResource along with the instance operations that can be performed on it in the ContainerServiceAgentPool.
- /// Returns a object.
- public virtual AgentPoolUpgradeProfileResource GetAgentPoolUpgradeProfile()
- {
- return new AgentPoolUpgradeProfileResource(Client, Id.AppendChildResource("upgradeProfiles", "default"));
- }
-
- ///
- /// Gets the specified managed cluster agent pool.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}
- ///
- /// -
- /// Operation Id
- /// AgentPools_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The cancellation token to use.
- public virtual async Task> GetAsync(CancellationToken cancellationToken = default)
- {
- using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.Get");
- scope.Start();
- try
- {
- var response = await _containerServiceAgentPoolAgentPoolsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false);
- if (response.Value == null)
- throw new RequestFailedException(response.GetRawResponse());
- return Response.FromValue(new ContainerServiceAgentPoolResource(Client, response.Value), response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Gets the specified managed cluster agent pool.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}
- ///
- /// -
- /// Operation Id
- /// AgentPools_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The cancellation token to use.
- public virtual Response Get(CancellationToken cancellationToken = default)
- {
- using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.Get");
- scope.Start();
- try
- {
- var response = _containerServiceAgentPoolAgentPoolsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken);
- if (response.Value == null)
- throw new RequestFailedException(response.GetRawResponse());
- return Response.FromValue(new ContainerServiceAgentPoolResource(Client, response.Value), response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Creates or updates an agent pool in the specified managed cluster.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}
- ///
- /// -
- /// Operation Id
- /// AgentPools_CreateOrUpdate
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
- /// The agent pool to create or update.
- /// The cancellation token to use.
- /// is null.
- public virtual async Task> UpdateAsync(WaitUntil waitUntil, ContainerServiceAgentPoolData data, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNull(data, nameof(data));
-
- using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.Update");
- scope.Start();
- try
- {
- var response = await _containerServiceAgentPoolAgentPoolsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false);
- var operation = new ContainerServiceArmOperation(new ContainerServiceAgentPoolOperationSource(Client), _containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2017-08-31");
- if (waitUntil == WaitUntil.Completed)
- await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
- return operation;
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Creates or updates an agent pool in the specified managed cluster.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}
- ///
- /// -
- /// Operation Id
- /// AgentPools_CreateOrUpdate
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
- /// The agent pool to create or update.
- /// The cancellation token to use.
- /// is null.
- public virtual ArmOperation Update(WaitUntil waitUntil, ContainerServiceAgentPoolData data, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNull(data, nameof(data));
-
- using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.Update");
- scope.Start();
- try
- {
- var response = _containerServiceAgentPoolAgentPoolsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken);
- var operation = new ContainerServiceArmOperation(new ContainerServiceAgentPoolOperationSource(Client), _containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2017-08-31");
- if (waitUntil == WaitUntil.Completed)
- operation.WaitForCompletion(cancellationToken);
- return operation;
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Aborts the currently running operation on the agent pool. The Agent Pool will be moved to a Canceling state and eventually to a Canceled state when cancellation finishes. If the operation completes before cancellation can take place, a 409 error code is returned.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclusters/{resourceName}/agentPools/{agentPoolName}/abort
- ///
- /// -
- /// Operation Id
- /// AgentPools_AbortLatestOperation
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
- /// The cancellation token to use.
- public virtual async Task AbortLatestOperationAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default)
- {
- using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.AbortLatestOperation");
- scope.Start();
- try
- {
- var response = await _containerServiceAgentPoolAgentPoolsRestClient.AbortLatestOperationAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false);
- var operation = new ContainerServiceArmOperation(_containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateAbortLatestOperationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location);
- if (waitUntil == WaitUntil.Completed)
- await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false);
- return operation;
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Aborts the currently running operation on the agent pool. The Agent Pool will be moved to a Canceling state and eventually to a Canceled state when cancellation finishes. If the operation completes before cancellation can take place, a 409 error code is returned.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclusters/{resourceName}/agentPools/{agentPoolName}/abort
- ///
- /// -
- /// Operation Id
- /// AgentPools_AbortLatestOperation
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
- /// The cancellation token to use.
- public virtual ArmOperation AbortLatestOperation(WaitUntil waitUntil, CancellationToken cancellationToken = default)
- {
- using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.AbortLatestOperation");
- scope.Start();
- try
- {
- var response = _containerServiceAgentPoolAgentPoolsRestClient.AbortLatestOperation(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken);
- var operation = new ContainerServiceArmOperation(_containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateAbortLatestOperationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location);
- if (waitUntil == WaitUntil.Completed)
- operation.WaitForCompletionResponse(cancellationToken);
- return operation;
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. AKS provides one new image per week with the latest updates. For more details on node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion
- ///
- /// -
- /// Operation Id
- /// AgentPools_UpgradeNodeImageVersion
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
- /// The cancellation token to use.
- public virtual async Task UpgradeNodeImageVersionAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default)
- {
- using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.UpgradeNodeImageVersion");
- scope.Start();
- try
- {
- var response = await _containerServiceAgentPoolAgentPoolsRestClient.UpgradeNodeImageVersionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false);
- var operation = new ContainerServiceArmOperation(_containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateUpgradeNodeImageVersionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2017-08-31");
- if (waitUntil == WaitUntil.Completed)
- await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false);
- return operation;
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Upgrading the node image version of an agent pool applies the newest OS and runtime updates to the nodes. AKS provides one new image per week with the latest updates. For more details on node image versions, see: https://docs.microsoft.com/azure/aks/node-image-upgrade
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion
- ///
- /// -
- /// Operation Id
- /// AgentPools_UpgradeNodeImageVersion
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
- /// The cancellation token to use.
- public virtual ArmOperation UpgradeNodeImageVersion(WaitUntil waitUntil, CancellationToken cancellationToken = default)
- {
- using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.UpgradeNodeImageVersion");
- scope.Start();
- try
- {
- var response = _containerServiceAgentPoolAgentPoolsRestClient.UpgradeNodeImageVersion(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken);
- var operation = new ContainerServiceArmOperation(_containerServiceAgentPoolAgentPoolsClientDiagnostics, Pipeline, _containerServiceAgentPoolAgentPoolsRestClient.CreateUpgradeNodeImageVersionRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2017-08-31");
- if (waitUntil == WaitUntil.Completed)
- operation.WaitForCompletionResponse(cancellationToken);
- return operation;
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Add a tag to the current resource.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}
- ///
- /// -
- /// Operation Id
- /// AgentPools_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The key for the tag.
- /// The value for the tag.
- /// The cancellation token to use.
- /// or is null.
- public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNull(key, nameof(key));
- Argument.AssertNotNull(value, nameof(value));
-
- using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.AddTag");
- scope.Start();
- try
- {
- if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false))
- {
- var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false);
- originalTags.Value.Data.TagValues[key] = value;
- await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false);
- var originalResponse = await _containerServiceAgentPoolAgentPoolsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false);
- return Response.FromValue(new ContainerServiceAgentPoolResource(Client, originalResponse.Value), originalResponse.GetRawResponse());
- }
- else
- {
- var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data;
- current.Tags[key] = value;
- var result = await UpdateAsync(WaitUntil.Completed, current, cancellationToken: cancellationToken).ConfigureAwait(false);
- return Response.FromValue(result.Value, result.GetRawResponse());
- }
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Add a tag to the current resource.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}
- ///
- /// -
- /// Operation Id
- /// AgentPools_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The key for the tag.
- /// The value for the tag.
- /// The cancellation token to use.
- /// or is null.
- public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNull(key, nameof(key));
- Argument.AssertNotNull(value, nameof(value));
-
- using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.AddTag");
- scope.Start();
- try
- {
- if (CanUseTagResource(cancellationToken: cancellationToken))
- {
- var originalTags = GetTagResource().Get(cancellationToken);
- originalTags.Value.Data.TagValues[key] = value;
- GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken);
- var originalResponse = _containerServiceAgentPoolAgentPoolsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken);
- return Response.FromValue(new ContainerServiceAgentPoolResource(Client, originalResponse.Value), originalResponse.GetRawResponse());
- }
- else
- {
- var current = Get(cancellationToken: cancellationToken).Value.Data;
- current.Tags[key] = value;
- var result = Update(WaitUntil.Completed, current, cancellationToken: cancellationToken);
- return Response.FromValue(result.Value, result.GetRawResponse());
- }
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Replace the tags on the resource with the given set.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}
- ///
- /// -
- /// Operation Id
- /// AgentPools_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The set of tags to use as replacement.
- /// The cancellation token to use.
- /// is null.
- public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNull(tags, nameof(tags));
-
- using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.SetTags");
- scope.Start();
- try
- {
- if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false))
- {
- await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false);
- var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false);
- originalTags.Value.Data.TagValues.ReplaceWith(tags);
- await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false);
- var originalResponse = await _containerServiceAgentPoolAgentPoolsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false);
- return Response.FromValue(new ContainerServiceAgentPoolResource(Client, originalResponse.Value), originalResponse.GetRawResponse());
- }
- else
- {
- var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data;
- current.Tags.ReplaceWith(tags);
- var result = await UpdateAsync(WaitUntil.Completed, current, cancellationToken: cancellationToken).ConfigureAwait(false);
- return Response.FromValue(result.Value, result.GetRawResponse());
- }
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Replace the tags on the resource with the given set.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}
- ///
- /// -
- /// Operation Id
- /// AgentPools_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The set of tags to use as replacement.
- /// The cancellation token to use.
- /// is null.
- public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNull(tags, nameof(tags));
-
- using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.SetTags");
- scope.Start();
- try
- {
- if (CanUseTagResource(cancellationToken: cancellationToken))
- {
- GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken);
- var originalTags = GetTagResource().Get(cancellationToken);
- originalTags.Value.Data.TagValues.ReplaceWith(tags);
- GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken);
- var originalResponse = _containerServiceAgentPoolAgentPoolsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken);
- return Response.FromValue(new ContainerServiceAgentPoolResource(Client, originalResponse.Value), originalResponse.GetRawResponse());
- }
- else
- {
- var current = Get(cancellationToken: cancellationToken).Value.Data;
- current.Tags.ReplaceWith(tags);
- var result = Update(WaitUntil.Completed, current, cancellationToken: cancellationToken);
- return Response.FromValue(result.Value, result.GetRawResponse());
- }
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Removes a tag by key from the resource.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}
- ///
- /// -
- /// Operation Id
- /// AgentPools_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The key for the tag.
- /// The cancellation token to use.
- /// is null.
- public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNull(key, nameof(key));
-
- using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.RemoveTag");
- scope.Start();
- try
- {
- if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false))
- {
- var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false);
- originalTags.Value.Data.TagValues.Remove(key);
- await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false);
- var originalResponse = await _containerServiceAgentPoolAgentPoolsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false);
- return Response.FromValue(new ContainerServiceAgentPoolResource(Client, originalResponse.Value), originalResponse.GetRawResponse());
- }
- else
- {
- var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data;
- current.Tags.Remove(key);
- var result = await UpdateAsync(WaitUntil.Completed, current, cancellationToken: cancellationToken).ConfigureAwait(false);
- return Response.FromValue(result.Value, result.GetRawResponse());
- }
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Removes a tag by key from the resource.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}
- ///
- /// -
- /// Operation Id
- /// AgentPools_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The key for the tag.
- /// The cancellation token to use.
- /// is null.
- public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNull(key, nameof(key));
-
- using var scope = _containerServiceAgentPoolAgentPoolsClientDiagnostics.CreateScope("ContainerServiceAgentPoolResource.RemoveTag");
- scope.Start();
- try
- {
- if (CanUseTagResource(cancellationToken: cancellationToken))
- {
- var originalTags = GetTagResource().Get(cancellationToken);
- originalTags.Value.Data.TagValues.Remove(key);
- GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken);
- var originalResponse = _containerServiceAgentPoolAgentPoolsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken);
- return Response.FromValue(new ContainerServiceAgentPoolResource(Client, originalResponse.Value), originalResponse.GetRawResponse());
- }
- else
- {
- var current = Get(cancellationToken: cancellationToken).Value.Data;
- current.Tags.Remove(key);
- var result = Update(WaitUntil.Completed, current, cancellationToken: cancellationToken);
- return Response.FromValue(result.Value, result.GetRawResponse());
- }
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
- }
-}
diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationCollection.cs
deleted file mode 100644
index 1a4e94d94ece..000000000000
--- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationCollection.cs
+++ /dev/null
@@ -1,495 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Globalization;
-using System.Threading;
-using System.Threading.Tasks;
-using Autorest.CSharp.Core;
-using Azure;
-using Azure.Core;
-using Azure.Core.Pipeline;
-using Azure.ResourceManager;
-
-namespace Azure.ResourceManager.ContainerService
-{
- ///
- /// A class representing a collection of and their operations.
- /// Each in the collection will belong to the same instance of .
- /// To get a instance call the GetContainerServiceMaintenanceConfigurations method from an instance of .
- ///
- public partial class ContainerServiceMaintenanceConfigurationCollection : ArmCollection, IEnumerable, IAsyncEnumerable
- {
- private readonly ClientDiagnostics _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics;
- private readonly MaintenanceConfigurationsRestOperations _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient;
-
- /// Initializes a new instance of the class for mocking.
- protected ContainerServiceMaintenanceConfigurationCollection()
- {
- }
-
- /// Initializes a new instance of the class.
- /// The client parameters to use in these operations.
- /// The identifier of the parent resource that is the target of operations.
- internal ContainerServiceMaintenanceConfigurationCollection(ArmClient client, ResourceIdentifier id) : base(client, id)
- {
- _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ContainerServiceMaintenanceConfigurationResource.ResourceType.Namespace, Diagnostics);
- TryGetApiVersion(ContainerServiceMaintenanceConfigurationResource.ResourceType, out string containerServiceMaintenanceConfigurationMaintenanceConfigurationsApiVersion);
- _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient = new MaintenanceConfigurationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerServiceMaintenanceConfigurationMaintenanceConfigurationsApiVersion);
-#if DEBUG
- ValidateResourceId(Id);
-#endif
- }
-
- internal static void ValidateResourceId(ResourceIdentifier id)
- {
- if (id.ResourceType != ContainerServiceManagedClusterResource.ResourceType)
- throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ContainerServiceManagedClusterResource.ResourceType), nameof(id));
- }
-
- ///
- /// Creates or updates a maintenance configuration in the specified managed cluster.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}
- ///
- /// -
- /// Operation Id
- /// MaintenanceConfigurations_CreateOrUpdate
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
- /// The name of the maintenance configuration.
- /// The maintenance configuration to create or update.
- /// The cancellation token to use.
- /// is an empty string, and was expected to be non-empty.
- /// or is null.
- public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string configName, ContainerServiceMaintenanceConfigurationData data, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNullOrEmpty(configName, nameof(configName));
- Argument.AssertNotNull(data, nameof(data));
-
- using var scope = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics.CreateScope("ContainerServiceMaintenanceConfigurationCollection.CreateOrUpdate");
- scope.Start();
- try
- {
- var response = await _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configName, data, cancellationToken).ConfigureAwait(false);
- var operation = new ContainerServiceArmOperation(Response.FromValue(new ContainerServiceMaintenanceConfigurationResource(Client, response), response.GetRawResponse()));
- if (waitUntil == WaitUntil.Completed)
- await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
- return operation;
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Creates or updates a maintenance configuration in the specified managed cluster.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}
- ///
- /// -
- /// Operation Id
- /// MaintenanceConfigurations_CreateOrUpdate
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
- /// The name of the maintenance configuration.
- /// The maintenance configuration to create or update.
- /// The cancellation token to use.
- /// is an empty string, and was expected to be non-empty.
- /// or is null.
- public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string configName, ContainerServiceMaintenanceConfigurationData data, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNullOrEmpty(configName, nameof(configName));
- Argument.AssertNotNull(data, nameof(data));
-
- using var scope = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics.CreateScope("ContainerServiceMaintenanceConfigurationCollection.CreateOrUpdate");
- scope.Start();
- try
- {
- var response = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configName, data, cancellationToken);
- var operation = new ContainerServiceArmOperation(Response.FromValue(new ContainerServiceMaintenanceConfigurationResource(Client, response), response.GetRawResponse()));
- if (waitUntil == WaitUntil.Completed)
- operation.WaitForCompletion(cancellationToken);
- return operation;
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Gets the specified maintenance configuration of a managed cluster.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}
- ///
- /// -
- /// Operation Id
- /// MaintenanceConfigurations_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The name of the maintenance configuration.
- /// The cancellation token to use.
- /// is an empty string, and was expected to be non-empty.
- /// is null.
- public virtual async Task> GetAsync(string configName, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNullOrEmpty(configName, nameof(configName));
-
- using var scope = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics.CreateScope("ContainerServiceMaintenanceConfigurationCollection.Get");
- scope.Start();
- try
- {
- var response = await _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configName, cancellationToken).ConfigureAwait(false);
- if (response.Value == null)
- throw new RequestFailedException(response.GetRawResponse());
- return Response.FromValue(new ContainerServiceMaintenanceConfigurationResource(Client, response.Value), response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Gets the specified maintenance configuration of a managed cluster.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}
- ///
- /// -
- /// Operation Id
- /// MaintenanceConfigurations_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The name of the maintenance configuration.
- /// The cancellation token to use.
- /// is an empty string, and was expected to be non-empty.
- /// is null.
- public virtual Response Get(string configName, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNullOrEmpty(configName, nameof(configName));
-
- using var scope = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics.CreateScope("ContainerServiceMaintenanceConfigurationCollection.Get");
- scope.Start();
- try
- {
- var response = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configName, cancellationToken);
- if (response.Value == null)
- throw new RequestFailedException(response.GetRawResponse());
- return Response.FromValue(new ContainerServiceMaintenanceConfigurationResource(Client, response.Value), response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Gets a list of maintenance configurations in the specified managed cluster.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations
- ///
- /// -
- /// Operation Id
- /// MaintenanceConfigurations_ListByManagedCluster
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The cancellation token to use.
- /// An async collection of that may take multiple service requests to iterate over.
- public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default)
- {
- HttpMessage FirstPageRequest(int? pageSizeHint) => _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.CreateListByManagedClusterRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name);
- HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.CreateListByManagedClusterNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name);
- return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerServiceMaintenanceConfigurationResource(Client, ContainerServiceMaintenanceConfigurationData.DeserializeContainerServiceMaintenanceConfigurationData(e)), _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics, Pipeline, "ContainerServiceMaintenanceConfigurationCollection.GetAll", "value", "nextLink", cancellationToken);
- }
-
- ///
- /// Gets a list of maintenance configurations in the specified managed cluster.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations
- ///
- /// -
- /// Operation Id
- /// MaintenanceConfigurations_ListByManagedCluster
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The cancellation token to use.
- /// A collection of that may take multiple service requests to iterate over.
- public virtual Pageable GetAll(CancellationToken cancellationToken = default)
- {
- HttpMessage FirstPageRequest(int? pageSizeHint) => _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.CreateListByManagedClusterRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name);
- HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.CreateListByManagedClusterNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name);
- return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerServiceMaintenanceConfigurationResource(Client, ContainerServiceMaintenanceConfigurationData.DeserializeContainerServiceMaintenanceConfigurationData(e)), _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics, Pipeline, "ContainerServiceMaintenanceConfigurationCollection.GetAll", "value", "nextLink", cancellationToken);
- }
-
- ///
- /// Checks to see if the resource exists in azure.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}
- ///
- /// -
- /// Operation Id
- /// MaintenanceConfigurations_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The name of the maintenance configuration.
- /// The cancellation token to use.
- /// is an empty string, and was expected to be non-empty.
- /// is null.
- public virtual async Task> ExistsAsync(string configName, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNullOrEmpty(configName, nameof(configName));
-
- using var scope = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics.CreateScope("ContainerServiceMaintenanceConfigurationCollection.Exists");
- scope.Start();
- try
- {
- var response = await _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configName, cancellationToken: cancellationToken).ConfigureAwait(false);
- return Response.FromValue(response.Value != null, response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Checks to see if the resource exists in azure.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}
- ///
- /// -
- /// Operation Id
- /// MaintenanceConfigurations_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The name of the maintenance configuration.
- /// The cancellation token to use.
- /// is an empty string, and was expected to be non-empty.
- /// is null.
- public virtual Response Exists(string configName, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNullOrEmpty(configName, nameof(configName));
-
- using var scope = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics.CreateScope("ContainerServiceMaintenanceConfigurationCollection.Exists");
- scope.Start();
- try
- {
- var response = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configName, cancellationToken: cancellationToken);
- return Response.FromValue(response.Value != null, response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Tries to get details for this resource from the service.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}
- ///
- /// -
- /// Operation Id
- /// MaintenanceConfigurations_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The name of the maintenance configuration.
- /// The cancellation token to use.
- /// is an empty string, and was expected to be non-empty.
- /// is null.
- public virtual async Task> GetIfExistsAsync(string configName, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNullOrEmpty(configName, nameof(configName));
-
- using var scope = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics.CreateScope("ContainerServiceMaintenanceConfigurationCollection.GetIfExists");
- scope.Start();
- try
- {
- var response = await _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configName, cancellationToken: cancellationToken).ConfigureAwait(false);
- if (response.Value == null)
- return new NoValueResponse(response.GetRawResponse());
- return Response.FromValue(new ContainerServiceMaintenanceConfigurationResource(Client, response.Value), response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Tries to get details for this resource from the service.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}
- ///
- /// -
- /// Operation Id
- /// MaintenanceConfigurations_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The name of the maintenance configuration.
- /// The cancellation token to use.
- /// is an empty string, and was expected to be non-empty.
- /// is null.
- public virtual NullableResponse GetIfExists(string configName, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNullOrEmpty(configName, nameof(configName));
-
- using var scope = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsClientDiagnostics.CreateScope("ContainerServiceMaintenanceConfigurationCollection.GetIfExists");
- scope.Start();
- try
- {
- var response = _containerServiceMaintenanceConfigurationMaintenanceConfigurationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, configName, cancellationToken: cancellationToken);
- if (response.Value == null)
- return new NoValueResponse(response.GetRawResponse());
- return Response.FromValue(new ContainerServiceMaintenanceConfigurationResource(Client, response.Value), response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- return GetAll().GetEnumerator();
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- return GetAll().GetEnumerator();
- }
-
- IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken)
- {
- return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken);
- }
- }
-}
diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationData.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationData.cs
deleted file mode 100644
index 6f75ba50accb..000000000000
--- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceMaintenanceConfigurationData.cs
+++ /dev/null
@@ -1,85 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Collections.Generic;
-using Azure.Core;
-using Azure.ResourceManager.ContainerService.Models;
-using Azure.ResourceManager.Models;
-
-namespace Azure.ResourceManager.ContainerService
-{
- ///
- /// A class representing the ContainerServiceMaintenanceConfiguration data model.
- /// See [planned maintenance](https://docs.microsoft.com/azure/aks/planned-maintenance) for more information about planned maintenance.
- ///
- public partial class ContainerServiceMaintenanceConfigurationData : ResourceData
- {
- ///
- /// Keeps track of any properties unknown to the library.
- ///
- /// To assign an object to the value of this property use .
- ///
- ///
- /// To assign an already formatted json string to this property use .
- ///
- ///
- /// Examples:
- ///
- /// -
- /// BinaryData.FromObjectAsJson("foo")
- /// Creates a payload of "foo".
- ///
- /// -
- /// BinaryData.FromString("\"foo\"")
- /// Creates a payload of "foo".
- ///
- /// -
- /// BinaryData.FromObjectAsJson(new { key = "value" })
- /// Creates a payload of { "key": "value" }.
- ///
- /// -
- /// BinaryData.FromString("{\"key\": \"value\"}")
- /// Creates a payload of { "key": "value" }.
- ///
- ///
- ///
- ///
- private IDictionary _serializedAdditionalRawData;
-
- /// Initializes a new instance of .
- public ContainerServiceMaintenanceConfigurationData()
- {
- TimesInWeek = new ChangeTrackingList();
- NotAllowedTimes = new ChangeTrackingList();
- }
-
- /// Initializes a new instance of .
- /// The id.
- /// The name.
- /// The resourceType.
- /// The systemData.
- /// If two array entries specify the same day of the week, the applied configuration is the union of times in both entries.
- /// Time slots on which upgrade is not allowed.
- /// Maintenance window for the maintenance configuration.
- /// Keeps track of any properties unknown to the library.
- internal ContainerServiceMaintenanceConfigurationData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IList timesInWeek, IList notAllowedTimes, ContainerServiceMaintenanceWindow maintenanceWindow, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData)
- {
- TimesInWeek = timesInWeek;
- NotAllowedTimes = notAllowedTimes;
- MaintenanceWindow = maintenanceWindow;
- _serializedAdditionalRawData = serializedAdditionalRawData;
- }
-
- /// If two array entries specify the same day of the week, the applied configuration is the union of times in both entries.
- public IList TimesInWeek { get; }
- /// Time slots on which upgrade is not allowed.
- public IList NotAllowedTimes { get; }
- /// Maintenance window for the maintenance configuration.
- public ContainerServiceMaintenanceWindow MaintenanceWindow { get; set; }
- }
-}
diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterCollection.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterCollection.cs
deleted file mode 100644
index e16c9b6d8786..000000000000
--- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterCollection.cs
+++ /dev/null
@@ -1,496 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Globalization;
-using System.Threading;
-using System.Threading.Tasks;
-using Autorest.CSharp.Core;
-using Azure;
-using Azure.Core;
-using Azure.Core.Pipeline;
-using Azure.ResourceManager;
-using Azure.ResourceManager.Resources;
-
-namespace Azure.ResourceManager.ContainerService
-{
- ///
- /// A class representing a collection of and their operations.
- /// Each in the collection will belong to the same instance of .
- /// To get a instance call the GetContainerServiceManagedClusters method from an instance of .
- ///
- public partial class ContainerServiceManagedClusterCollection : ArmCollection, IEnumerable, IAsyncEnumerable
- {
- private readonly ClientDiagnostics _containerServiceManagedClusterManagedClustersClientDiagnostics;
- private readonly ManagedClustersRestOperations _containerServiceManagedClusterManagedClustersRestClient;
-
- /// Initializes a new instance of the class for mocking.
- protected ContainerServiceManagedClusterCollection()
- {
- }
-
- /// Initializes a new instance of the class.
- /// The client parameters to use in these operations.
- /// The identifier of the parent resource that is the target of operations.
- internal ContainerServiceManagedClusterCollection(ArmClient client, ResourceIdentifier id) : base(client, id)
- {
- _containerServiceManagedClusterManagedClustersClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ContainerServiceManagedClusterResource.ResourceType.Namespace, Diagnostics);
- TryGetApiVersion(ContainerServiceManagedClusterResource.ResourceType, out string containerServiceManagedClusterManagedClustersApiVersion);
- _containerServiceManagedClusterManagedClustersRestClient = new ManagedClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerServiceManagedClusterManagedClustersApiVersion);
-#if DEBUG
- ValidateResourceId(Id);
-#endif
- }
-
- internal static void ValidateResourceId(ResourceIdentifier id)
- {
- if (id.ResourceType != ResourceGroupResource.ResourceType)
- throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id));
- }
-
- ///
- /// Creates or updates a managed cluster.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}
- ///
- /// -
- /// Operation Id
- /// ManagedClusters_CreateOrUpdate
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
- /// The name of the managed cluster resource.
- /// The managed cluster to create or update.
- /// The cancellation token to use.
- /// is an empty string, and was expected to be non-empty.
- /// or is null.
- public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string resourceName, ContainerServiceManagedClusterData data, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName));
- Argument.AssertNotNull(data, nameof(data));
-
- using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterCollection.CreateOrUpdate");
- scope.Start();
- try
- {
- var response = await _containerServiceManagedClusterManagedClustersRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, resourceName, data, cancellationToken).ConfigureAwait(false);
- var operation = new ContainerServiceArmOperation(new ContainerServiceManagedClusterOperationSource(Client), _containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, resourceName, data).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2017-08-31");
- if (waitUntil == WaitUntil.Completed)
- await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
- return operation;
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Creates or updates a managed cluster.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}
- ///
- /// -
- /// Operation Id
- /// ManagedClusters_CreateOrUpdate
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
- /// The name of the managed cluster resource.
- /// The managed cluster to create or update.
- /// The cancellation token to use.
- /// is an empty string, and was expected to be non-empty.
- /// or is null.
- public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string resourceName, ContainerServiceManagedClusterData data, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName));
- Argument.AssertNotNull(data, nameof(data));
-
- using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterCollection.CreateOrUpdate");
- scope.Start();
- try
- {
- var response = _containerServiceManagedClusterManagedClustersRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, resourceName, data, cancellationToken);
- var operation = new ContainerServiceArmOperation(new ContainerServiceManagedClusterOperationSource(Client), _containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, resourceName, data).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2017-08-31");
- if (waitUntil == WaitUntil.Completed)
- operation.WaitForCompletion(cancellationToken);
- return operation;
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Gets a managed cluster.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}
- ///
- /// -
- /// Operation Id
- /// ManagedClusters_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The name of the managed cluster resource.
- /// The cancellation token to use.
- /// is an empty string, and was expected to be non-empty.
- /// is null.
- public virtual async Task> GetAsync(string resourceName, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName));
-
- using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterCollection.Get");
- scope.Start();
- try
- {
- var response = await _containerServiceManagedClusterManagedClustersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, resourceName, cancellationToken).ConfigureAwait(false);
- if (response.Value == null)
- throw new RequestFailedException(response.GetRawResponse());
- return Response.FromValue(new ContainerServiceManagedClusterResource(Client, response.Value), response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Gets a managed cluster.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}
- ///
- /// -
- /// Operation Id
- /// ManagedClusters_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The name of the managed cluster resource.
- /// The cancellation token to use.
- /// is an empty string, and was expected to be non-empty.
- /// is null.
- public virtual Response Get(string resourceName, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName));
-
- using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterCollection.Get");
- scope.Start();
- try
- {
- var response = _containerServiceManagedClusterManagedClustersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, resourceName, cancellationToken);
- if (response.Value == null)
- throw new RequestFailedException(response.GetRawResponse());
- return Response.FromValue(new ContainerServiceManagedClusterResource(Client, response.Value), response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Lists managed clusters in the specified subscription and resource group.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters
- ///
- /// -
- /// Operation Id
- /// ManagedClusters_ListByResourceGroup
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The cancellation token to use.
- /// An async collection of that may take multiple service requests to iterate over.
- public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default)
- {
- HttpMessage FirstPageRequest(int? pageSizeHint) => _containerServiceManagedClusterManagedClustersRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName);
- HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerServiceManagedClusterManagedClustersRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName);
- return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ContainerServiceManagedClusterResource(Client, ContainerServiceManagedClusterData.DeserializeContainerServiceManagedClusterData(e)), _containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, "ContainerServiceManagedClusterCollection.GetAll", "value", "nextLink", cancellationToken);
- }
-
- ///
- /// Lists managed clusters in the specified subscription and resource group.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters
- ///
- /// -
- /// Operation Id
- /// ManagedClusters_ListByResourceGroup
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The cancellation token to use.
- /// A collection of that may take multiple service requests to iterate over.
- public virtual Pageable GetAll(CancellationToken cancellationToken = default)
- {
- HttpMessage FirstPageRequest(int? pageSizeHint) => _containerServiceManagedClusterManagedClustersRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName);
- HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _containerServiceManagedClusterManagedClustersRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName);
- return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ContainerServiceManagedClusterResource(Client, ContainerServiceManagedClusterData.DeserializeContainerServiceManagedClusterData(e)), _containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, "ContainerServiceManagedClusterCollection.GetAll", "value", "nextLink", cancellationToken);
- }
-
- ///
- /// Checks to see if the resource exists in azure.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}
- ///
- /// -
- /// Operation Id
- /// ManagedClusters_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The name of the managed cluster resource.
- /// The cancellation token to use.
- /// is an empty string, and was expected to be non-empty.
- /// is null.
- public virtual async Task> ExistsAsync(string resourceName, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName));
-
- using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterCollection.Exists");
- scope.Start();
- try
- {
- var response = await _containerServiceManagedClusterManagedClustersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, resourceName, cancellationToken: cancellationToken).ConfigureAwait(false);
- return Response.FromValue(response.Value != null, response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Checks to see if the resource exists in azure.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}
- ///
- /// -
- /// Operation Id
- /// ManagedClusters_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The name of the managed cluster resource.
- /// The cancellation token to use.
- /// is an empty string, and was expected to be non-empty.
- /// is null.
- public virtual Response Exists(string resourceName, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName));
-
- using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterCollection.Exists");
- scope.Start();
- try
- {
- var response = _containerServiceManagedClusterManagedClustersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, resourceName, cancellationToken: cancellationToken);
- return Response.FromValue(response.Value != null, response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Tries to get details for this resource from the service.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}
- ///
- /// -
- /// Operation Id
- /// ManagedClusters_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The name of the managed cluster resource.
- /// The cancellation token to use.
- /// is an empty string, and was expected to be non-empty.
- /// is null.
- public virtual async Task> GetIfExistsAsync(string resourceName, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName));
-
- using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterCollection.GetIfExists");
- scope.Start();
- try
- {
- var response = await _containerServiceManagedClusterManagedClustersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, resourceName, cancellationToken: cancellationToken).ConfigureAwait(false);
- if (response.Value == null)
- return new NoValueResponse(response.GetRawResponse());
- return Response.FromValue(new ContainerServiceManagedClusterResource(Client, response.Value), response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Tries to get details for this resource from the service.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}
- ///
- /// -
- /// Operation Id
- /// ManagedClusters_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The name of the managed cluster resource.
- /// The cancellation token to use.
- /// is an empty string, and was expected to be non-empty.
- /// is null.
- public virtual NullableResponse GetIfExists(string resourceName, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNullOrEmpty(resourceName, nameof(resourceName));
-
- using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterCollection.GetIfExists");
- scope.Start();
- try
- {
- var response = _containerServiceManagedClusterManagedClustersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, resourceName, cancellationToken: cancellationToken);
- if (response.Value == null)
- return new NoValueResponse(response.GetRawResponse());
- return Response.FromValue(new ContainerServiceManagedClusterResource(Client, response.Value), response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- return GetAll().GetEnumerator();
- }
-
- IEnumerator IEnumerable.GetEnumerator()
- {
- return GetAll().GetEnumerator();
- }
-
- IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken)
- {
- return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken);
- }
- }
-}
diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterData.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterData.cs
deleted file mode 100644
index 2d5de45be238..000000000000
--- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterData.cs
+++ /dev/null
@@ -1,282 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Collections.Generic;
-using Azure.Core;
-using Azure.ResourceManager.ContainerService.Models;
-using Azure.ResourceManager.Models;
-using Azure.ResourceManager.Resources.Models;
-
-namespace Azure.ResourceManager.ContainerService
-{
- ///
- /// A class representing the ContainerServiceManagedCluster data model.
- /// Managed cluster.
- ///
- public partial class ContainerServiceManagedClusterData : TrackedResourceData
- {
- ///
- /// Keeps track of any properties unknown to the library.
- ///
- /// To assign an object to the value of this property use .
- ///
- ///
- /// To assign an already formatted json string to this property use .
- ///
- ///
- /// Examples:
- ///
- /// -
- /// BinaryData.FromObjectAsJson("foo")
- /// Creates a payload of "foo".
- ///
- /// -
- /// BinaryData.FromString("\"foo\"")
- /// Creates a payload of "foo".
- ///
- /// -
- /// BinaryData.FromObjectAsJson(new { key = "value" })
- /// Creates a payload of { "key": "value" }.
- ///
- /// -
- /// BinaryData.FromString("{\"key\": \"value\"}")
- /// Creates a payload of { "key": "value" }.
- ///
- ///
- ///
- ///
- private IDictionary _serializedAdditionalRawData;
-
- /// Initializes a new instance of .
- /// The location.
- public ContainerServiceManagedClusterData(AzureLocation location) : base(location)
- {
- AgentPoolProfiles = new ChangeTrackingList();
- AddonProfiles = new ChangeTrackingDictionary();
- IdentityProfile = new ChangeTrackingDictionary();
- PrivateLinkResources = new ChangeTrackingList();
- }
-
- /// Initializes a new instance of .
- /// The id.
- /// The name.
- /// The resourceType.
- /// The systemData.
- /// The tags.
- /// The location.
- /// The managed cluster SKU.
- /// The extended location of the Virtual Machine.
- /// The identity of the managed cluster, if configured.
- /// The current provisioning state.
- /// The Power State of the cluster.
- /// The max number of agent pools for the managed cluster.
- /// Both patch version <major.minor.patch> (e.g. 1.20.13) and <major.minor> (e.g. 1.20) are supported. When <major.minor> is specified, the latest supported GA patch version is chosen automatically. Updating the cluster with the same <major.minor> once it has been created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. When you upgrade a supported AKS cluster, Kubernetes minor versions cannot be skipped. All upgrades must be performed sequentially by major version number. For example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, however 1.14.x -> 1.16.x is not allowed. See [upgrading an AKS cluster](https://docs.microsoft.com/azure/aks/upgrade-cluster) for more details.
- /// If kubernetesVersion was a fully specified version <major.minor.patch>, this field will be exactly equal to it. If kubernetesVersion was <major.minor>, this field will contain the full <major.minor.patch> version being used.
- /// This cannot be updated once the Managed Cluster has been created.
- /// This cannot be updated once the Managed Cluster has been created.
- /// The FQDN of the master pool.
- /// The FQDN of private cluster.
- /// The Azure Portal requires certain Cross-Origin Resource Sharing (CORS) headers to be sent in some responses, which Kubernetes APIServer doesn't handle by default. This special FQDN supports CORS, allowing the Azure Portal to function properly.
- /// The agent pool properties.
- /// The profile for Linux VMs in the Managed Cluster.
- /// The profile for Windows VMs in the Managed Cluster.
- /// Information about a service principal identity for the cluster to use for manipulating Azure APIs.
- /// The profile of managed cluster add-on.
- /// See [use AAD pod identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity) for more details on AAD pod identity integration.
- /// The OIDC issuer profile of the Managed Cluster.
- /// The name of the resource group containing agent pool nodes.
- /// Whether to enable Kubernetes Role-Based Access Control.
- /// The support plan for the Managed Cluster. If unspecified, the default is 'KubernetesOfficial'.
- /// (DEPRECATED) Whether to enable Kubernetes pod security policy (preview). PodSecurityPolicy was deprecated in Kubernetes v1.21, and removed from Kubernetes in v1.25. Learn more at https://aka.ms/k8s/psp and https://aka.ms/aks/psp.
- /// The network configuration profile.
- /// The Azure Active Directory configuration.
- /// The auto upgrade configuration.
- /// Settings for upgrading a cluster.
- /// Parameters to be applied to the cluster-autoscaler when enabled.
- /// The access profile for managed cluster API server.
- /// This is of the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'.
- /// Identities associated with the cluster.
- /// Private link resources associated with the cluster.
- /// If set to true, getting static credentials will be disabled for this cluster. This must only be used on Managed Clusters that are AAD enabled. For more details see [disable local accounts](https://docs.microsoft.com/azure/aks/managed-aad#disable-local-accounts-preview).
- /// Configurations for provisioning the cluster with HTTP proxy servers.
- /// Security profile for the managed cluster.
- /// Storage profile for the managed cluster.
- /// Allow or deny public network access for AKS.
- /// Workload Auto-scaler profile for the managed cluster.
- /// Azure Monitor addon profiles for monitoring the managed cluster.
- /// Service mesh profile for a managed cluster.
- /// The resourceUID uniquely identifies ManagedClusters that reuse ARM ResourceIds (i.e: create, delete, create sequence).
- /// Keeps track of any properties unknown to the library.
- internal ContainerServiceManagedClusterData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ManagedClusterSku sku, ExtendedLocation extendedLocation, ManagedClusterIdentity clusterIdentity, string provisioningState, ContainerServicePowerState powerState, int? maxAgentPools, string kubernetesVersion, string currentKubernetesVersion, string dnsPrefix, string fqdnSubdomain, string fqdn, string privateFqdn, string azurePortalFqdn, IList agentPoolProfiles, ContainerServiceLinuxProfile linuxProfile, ManagedClusterWindowsProfile windowsProfile, ManagedClusterServicePrincipalProfile servicePrincipalProfile, IDictionary addonProfiles, ManagedClusterPodIdentityProfile podIdentityProfile, ManagedClusterOidcIssuerProfile oidcIssuerProfile, string nodeResourceGroup, bool? enableRbac, KubernetesSupportPlan? supportPlan, bool? enablePodSecurityPolicy, ContainerServiceNetworkProfile networkProfile, ManagedClusterAadProfile aadProfile, ManagedClusterAutoUpgradeProfile autoUpgradeProfile, ClusterUpgradeSettings upgradeSettings, ManagedClusterAutoScalerProfile autoScalerProfile, ManagedClusterApiServerAccessProfile apiServerAccessProfile, ResourceIdentifier diskEncryptionSetId, IDictionary identityProfile, IList privateLinkResources, bool? disableLocalAccounts, ManagedClusterHttpProxyConfig httpProxyConfig, ManagedClusterSecurityProfile securityProfile, ManagedClusterStorageProfile storageProfile, ContainerServicePublicNetworkAccess? publicNetworkAccess, ManagedClusterWorkloadAutoScalerProfile workloadAutoScalerProfile, ManagedClusterAzureMonitorProfile azureMonitorProfile, ServiceMeshProfile serviceMeshProfile, ResourceIdentifier resourceId, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location)
- {
- Sku = sku;
- ExtendedLocation = extendedLocation;
- ClusterIdentity = clusterIdentity;
- ProvisioningState = provisioningState;
- PowerState = powerState;
- MaxAgentPools = maxAgentPools;
- KubernetesVersion = kubernetesVersion;
- CurrentKubernetesVersion = currentKubernetesVersion;
- DnsPrefix = dnsPrefix;
- FqdnSubdomain = fqdnSubdomain;
- Fqdn = fqdn;
- PrivateFqdn = privateFqdn;
- AzurePortalFqdn = azurePortalFqdn;
- AgentPoolProfiles = agentPoolProfiles;
- LinuxProfile = linuxProfile;
- WindowsProfile = windowsProfile;
- ServicePrincipalProfile = servicePrincipalProfile;
- AddonProfiles = addonProfiles;
- PodIdentityProfile = podIdentityProfile;
- OidcIssuerProfile = oidcIssuerProfile;
- NodeResourceGroup = nodeResourceGroup;
- EnableRbac = enableRbac;
- SupportPlan = supportPlan;
- EnablePodSecurityPolicy = enablePodSecurityPolicy;
- NetworkProfile = networkProfile;
- AadProfile = aadProfile;
- AutoUpgradeProfile = autoUpgradeProfile;
- UpgradeSettings = upgradeSettings;
- AutoScalerProfile = autoScalerProfile;
- ApiServerAccessProfile = apiServerAccessProfile;
- DiskEncryptionSetId = diskEncryptionSetId;
- IdentityProfile = identityProfile;
- PrivateLinkResources = privateLinkResources;
- DisableLocalAccounts = disableLocalAccounts;
- HttpProxyConfig = httpProxyConfig;
- SecurityProfile = securityProfile;
- StorageProfile = storageProfile;
- PublicNetworkAccess = publicNetworkAccess;
- WorkloadAutoScalerProfile = workloadAutoScalerProfile;
- AzureMonitorProfile = azureMonitorProfile;
- ServiceMeshProfile = serviceMeshProfile;
- ResourceId = resourceId;
- _serializedAdditionalRawData = serializedAdditionalRawData;
- }
-
- /// Initializes a new instance of for deserialization.
- internal ContainerServiceManagedClusterData()
- {
- }
-
- /// The managed cluster SKU.
- public ManagedClusterSku Sku { get; set; }
- /// The extended location of the Virtual Machine.
- public ExtendedLocation ExtendedLocation { get; set; }
- /// The identity of the managed cluster, if configured.
- public ManagedClusterIdentity ClusterIdentity { get; set; }
- /// The current provisioning state.
- public string ProvisioningState { get; }
- /// The Power State of the cluster.
- internal ContainerServicePowerState PowerState { get; }
- /// Tells whether the cluster is Running or Stopped.
- public ContainerServiceStateCode? PowerStateCode
- {
- get => PowerState?.Code;
- }
-
- /// The max number of agent pools for the managed cluster.
- public int? MaxAgentPools { get; }
- /// Both patch version <major.minor.patch> (e.g. 1.20.13) and <major.minor> (e.g. 1.20) are supported. When <major.minor> is specified, the latest supported GA patch version is chosen automatically. Updating the cluster with the same <major.minor> once it has been created (e.g. 1.14.x -> 1.14) will not trigger an upgrade, even if a newer patch version is available. When you upgrade a supported AKS cluster, Kubernetes minor versions cannot be skipped. All upgrades must be performed sequentially by major version number. For example, upgrades between 1.14.x -> 1.15.x or 1.15.x -> 1.16.x are allowed, however 1.14.x -> 1.16.x is not allowed. See [upgrading an AKS cluster](https://docs.microsoft.com/azure/aks/upgrade-cluster) for more details.
- public string KubernetesVersion { get; set; }
- /// If kubernetesVersion was a fully specified version <major.minor.patch>, this field will be exactly equal to it. If kubernetesVersion was <major.minor>, this field will contain the full <major.minor.patch> version being used.
- public string CurrentKubernetesVersion { get; }
- /// This cannot be updated once the Managed Cluster has been created.
- public string DnsPrefix { get; set; }
- /// This cannot be updated once the Managed Cluster has been created.
- public string FqdnSubdomain { get; set; }
- /// The FQDN of the master pool.
- public string Fqdn { get; }
- /// The FQDN of private cluster.
- public string PrivateFqdn { get; }
- /// The Azure Portal requires certain Cross-Origin Resource Sharing (CORS) headers to be sent in some responses, which Kubernetes APIServer doesn't handle by default. This special FQDN supports CORS, allowing the Azure Portal to function properly.
- public string AzurePortalFqdn { get; }
- /// The agent pool properties.
- public IList AgentPoolProfiles { get; }
- /// The profile for Linux VMs in the Managed Cluster.
- public ContainerServiceLinuxProfile LinuxProfile { get; set; }
- /// The profile for Windows VMs in the Managed Cluster.
- public ManagedClusterWindowsProfile WindowsProfile { get; set; }
- /// Information about a service principal identity for the cluster to use for manipulating Azure APIs.
- public ManagedClusterServicePrincipalProfile ServicePrincipalProfile { get; set; }
- /// The profile of managed cluster add-on.
- public IDictionary AddonProfiles { get; }
- /// See [use AAD pod identity](https://docs.microsoft.com/azure/aks/use-azure-ad-pod-identity) for more details on AAD pod identity integration.
- public ManagedClusterPodIdentityProfile PodIdentityProfile { get; set; }
- /// The OIDC issuer profile of the Managed Cluster.
- public ManagedClusterOidcIssuerProfile OidcIssuerProfile { get; set; }
- /// The name of the resource group containing agent pool nodes.
- public string NodeResourceGroup { get; set; }
- /// Whether to enable Kubernetes Role-Based Access Control.
- public bool? EnableRbac { get; set; }
- /// The support plan for the Managed Cluster. If unspecified, the default is 'KubernetesOfficial'.
- public KubernetesSupportPlan? SupportPlan { get; set; }
- /// (DEPRECATED) Whether to enable Kubernetes pod security policy (preview). PodSecurityPolicy was deprecated in Kubernetes v1.21, and removed from Kubernetes in v1.25. Learn more at https://aka.ms/k8s/psp and https://aka.ms/aks/psp.
- public bool? EnablePodSecurityPolicy { get; set; }
- /// The network configuration profile.
- public ContainerServiceNetworkProfile NetworkProfile { get; set; }
- /// The Azure Active Directory configuration.
- public ManagedClusterAadProfile AadProfile { get; set; }
- /// The auto upgrade configuration.
- public ManagedClusterAutoUpgradeProfile AutoUpgradeProfile { get; set; }
- /// Settings for upgrading a cluster.
- internal ClusterUpgradeSettings UpgradeSettings { get; set; }
- /// Settings for overrides.
- public UpgradeOverrideSettings UpgradeOverrideSettings
- {
- get => UpgradeSettings is null ? default : UpgradeSettings.OverrideSettings;
- set
- {
- if (UpgradeSettings is null)
- UpgradeSettings = new ClusterUpgradeSettings();
- UpgradeSettings.OverrideSettings = value;
- }
- }
-
- /// Parameters to be applied to the cluster-autoscaler when enabled.
- public ManagedClusterAutoScalerProfile AutoScalerProfile { get; set; }
- /// The access profile for managed cluster API server.
- public ManagedClusterApiServerAccessProfile ApiServerAccessProfile { get; set; }
- /// This is of the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/diskEncryptionSets/{encryptionSetName}'.
- public ResourceIdentifier DiskEncryptionSetId { get; set; }
- /// Identities associated with the cluster.
- public IDictionary IdentityProfile { get; }
- /// Private link resources associated with the cluster.
- public IList PrivateLinkResources { get; }
- /// If set to true, getting static credentials will be disabled for this cluster. This must only be used on Managed Clusters that are AAD enabled. For more details see [disable local accounts](https://docs.microsoft.com/azure/aks/managed-aad#disable-local-accounts-preview).
- public bool? DisableLocalAccounts { get; set; }
- /// Configurations for provisioning the cluster with HTTP proxy servers.
- public ManagedClusterHttpProxyConfig HttpProxyConfig { get; set; }
- /// Security profile for the managed cluster.
- public ManagedClusterSecurityProfile SecurityProfile { get; set; }
- /// Storage profile for the managed cluster.
- public ManagedClusterStorageProfile StorageProfile { get; set; }
- /// Allow or deny public network access for AKS.
- public ContainerServicePublicNetworkAccess? PublicNetworkAccess { get; set; }
- /// Workload Auto-scaler profile for the managed cluster.
- public ManagedClusterWorkloadAutoScalerProfile WorkloadAutoScalerProfile { get; set; }
- /// Azure Monitor addon profiles for monitoring the managed cluster.
- internal ManagedClusterAzureMonitorProfile AzureMonitorProfile { get; set; }
- /// Metrics profile for the Azure Monitor managed service for Prometheus addon. Collect out-of-the-box Kubernetes infrastructure metrics to send to an Azure Monitor Workspace and configure additional scraping for custom targets. See aka.ms/AzureManagedPrometheus for an overview.
- public ManagedClusterMonitorProfileMetrics AzureMonitorMetrics
- {
- get => AzureMonitorProfile is null ? default : AzureMonitorProfile.Metrics;
- set
- {
- if (AzureMonitorProfile is null)
- AzureMonitorProfile = new ManagedClusterAzureMonitorProfile();
- AzureMonitorProfile.Metrics = value;
- }
- }
-
- /// Service mesh profile for a managed cluster.
- public ServiceMeshProfile ServiceMeshProfile { get; set; }
- /// The resourceUID uniquely identifies ManagedClusters that reuse ARM ResourceIds (i.e: create, delete, create sequence).
- public ResourceIdentifier ResourceId { get; }
- }
-}
diff --git a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterResource.cs b/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterResource.cs
deleted file mode 100644
index 8418f1b4477b..000000000000
--- a/sdk/containerservice/Azure.ResourceManager.ContainerService/src/Generated/ContainerServiceManagedClusterResource.cs
+++ /dev/null
@@ -1,2332 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Collections.Generic;
-using System.Globalization;
-using System.Threading;
-using System.Threading.Tasks;
-using Autorest.CSharp.Core;
-using Azure;
-using Azure.Core;
-using Azure.Core.Pipeline;
-using Azure.ResourceManager;
-using Azure.ResourceManager.ContainerService.Models;
-using Azure.ResourceManager.Resources;
-
-namespace Azure.ResourceManager.ContainerService
-{
- ///
- /// A Class representing a ContainerServiceManagedCluster along with the instance operations that can be performed on it.
- /// If you have a you can construct a
- /// from an instance of using the GetContainerServiceManagedClusterResource method.
- /// Otherwise you can get one from its parent resource using the GetContainerServiceManagedCluster method.
- ///
- public partial class ContainerServiceManagedClusterResource : ArmResource
- {
- /// Generate the resource identifier of a instance.
- /// The subscriptionId.
- /// The resourceGroupName.
- /// The resourceName.
- public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string resourceName)
- {
- var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}";
- return new ResourceIdentifier(resourceId);
- }
-
- private readonly ClientDiagnostics _containerServiceManagedClusterManagedClustersClientDiagnostics;
- private readonly ManagedClustersRestOperations _containerServiceManagedClusterManagedClustersRestClient;
- private readonly ClientDiagnostics _agentPoolsClientDiagnostics;
- private readonly AgentPoolsRestOperations _agentPoolsRestClient;
- private readonly ClientDiagnostics _privateLinkResourcesClientDiagnostics;
- private readonly PrivateLinkResourcesRestOperations _privateLinkResourcesRestClient;
- private readonly ClientDiagnostics _resolvePrivateLinkServiceIdClientDiagnostics;
- private readonly ResolvePrivateLinkServiceIdRestOperations _resolvePrivateLinkServiceIdRestClient;
- private readonly ContainerServiceManagedClusterData _data;
-
- /// Gets the resource type for the operations.
- public static readonly ResourceType ResourceType = "Microsoft.ContainerService/managedClusters";
-
- /// Initializes a new instance of the class for mocking.
- protected ContainerServiceManagedClusterResource()
- {
- }
-
- /// Initializes a new instance of the class.
- /// The client parameters to use in these operations.
- /// The resource that is the target of operations.
- internal ContainerServiceManagedClusterResource(ArmClient client, ContainerServiceManagedClusterData data) : this(client, data.Id)
- {
- HasData = true;
- _data = data;
- }
-
- /// Initializes a new instance of the class.
- /// The client parameters to use in these operations.
- /// The identifier of the resource that is the target of operations.
- internal ContainerServiceManagedClusterResource(ArmClient client, ResourceIdentifier id) : base(client, id)
- {
- _containerServiceManagedClusterManagedClustersClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ResourceType.Namespace, Diagnostics);
- TryGetApiVersion(ResourceType, out string containerServiceManagedClusterManagedClustersApiVersion);
- _containerServiceManagedClusterManagedClustersRestClient = new ManagedClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, containerServiceManagedClusterManagedClustersApiVersion);
- _agentPoolsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ProviderConstants.DefaultProviderNamespace, Diagnostics);
- _agentPoolsRestClient = new AgentPoolsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint);
- _privateLinkResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ProviderConstants.DefaultProviderNamespace, Diagnostics);
- _privateLinkResourcesRestClient = new PrivateLinkResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint);
- _resolvePrivateLinkServiceIdClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerService", ProviderConstants.DefaultProviderNamespace, Diagnostics);
- _resolvePrivateLinkServiceIdRestClient = new ResolvePrivateLinkServiceIdRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint);
-#if DEBUG
- ValidateResourceId(Id);
-#endif
- }
-
- /// Gets whether or not the current instance has data.
- public virtual bool HasData { get; }
-
- /// Gets the data representing this Feature.
- /// Throws if there is no data loaded in the current instance.
- public virtual ContainerServiceManagedClusterData Data
- {
- get
- {
- if (!HasData)
- throw new InvalidOperationException("The current instance does not have data, you must call Get first.");
- return _data;
- }
- }
-
- internal static void ValidateResourceId(ResourceIdentifier id)
- {
- if (id.ResourceType != ResourceType)
- throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id));
- }
-
- /// Gets an object representing a ManagedClusterUpgradeProfileResource along with the instance operations that can be performed on it in the ContainerServiceManagedCluster.
- /// Returns a object.
- public virtual ManagedClusterUpgradeProfileResource GetManagedClusterUpgradeProfile()
- {
- return new ManagedClusterUpgradeProfileResource(Client, Id.AppendChildResource("upgradeProfiles", "default"));
- }
-
- /// Gets a collection of MeshUpgradeProfileResources in the ContainerServiceManagedCluster.
- /// An object representing collection of MeshUpgradeProfileResources and their operations over a MeshUpgradeProfileResource.
- public virtual MeshUpgradeProfileCollection GetMeshUpgradeProfiles()
- {
- return GetCachedClient(client => new MeshUpgradeProfileCollection(client, Id));
- }
-
- ///
- /// Gets available upgrades for a service mesh in a cluster.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshUpgradeProfiles/{mode}
- ///
- /// -
- /// Operation Id
- /// ManagedClusters_GetMeshUpgradeProfile
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The mode of the mesh.
- /// The cancellation token to use.
- /// is null.
- /// is an empty string, and was expected to be non-empty.
- [ForwardsClientCalls]
- public virtual async Task> GetMeshUpgradeProfileAsync(string mode, CancellationToken cancellationToken = default)
- {
- return await GetMeshUpgradeProfiles().GetAsync(mode, cancellationToken).ConfigureAwait(false);
- }
-
- ///
- /// Gets available upgrades for a service mesh in a cluster.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/meshUpgradeProfiles/{mode}
- ///
- /// -
- /// Operation Id
- /// ManagedClusters_GetMeshUpgradeProfile
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The mode of the mesh.
- /// The cancellation token to use.
- /// is null.
- /// is an empty string, and was expected to be non-empty.
- [ForwardsClientCalls]
- public virtual Response GetMeshUpgradeProfile(string mode, CancellationToken cancellationToken = default)
- {
- return GetMeshUpgradeProfiles().Get(mode, cancellationToken);
- }
-
- /// Gets a collection of ContainerServiceMaintenanceConfigurationResources in the ContainerServiceManagedCluster.
- /// An object representing collection of ContainerServiceMaintenanceConfigurationResources and their operations over a ContainerServiceMaintenanceConfigurationResource.
- public virtual ContainerServiceMaintenanceConfigurationCollection GetContainerServiceMaintenanceConfigurations()
- {
- return GetCachedClient(client => new ContainerServiceMaintenanceConfigurationCollection(client, Id));
- }
-
- ///
- /// Gets the specified maintenance configuration of a managed cluster.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}
- ///
- /// -
- /// Operation Id
- /// MaintenanceConfigurations_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The name of the maintenance configuration.
- /// The cancellation token to use.
- /// is null.
- /// is an empty string, and was expected to be non-empty.
- [ForwardsClientCalls]
- public virtual async Task> GetContainerServiceMaintenanceConfigurationAsync(string configName, CancellationToken cancellationToken = default)
- {
- return await GetContainerServiceMaintenanceConfigurations().GetAsync(configName, cancellationToken).ConfigureAwait(false);
- }
-
- ///
- /// Gets the specified maintenance configuration of a managed cluster.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/maintenanceConfigurations/{configName}
- ///
- /// -
- /// Operation Id
- /// MaintenanceConfigurations_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The name of the maintenance configuration.
- /// The cancellation token to use.
- /// is null.
- /// is an empty string, and was expected to be non-empty.
- [ForwardsClientCalls]
- public virtual Response GetContainerServiceMaintenanceConfiguration(string configName, CancellationToken cancellationToken = default)
- {
- return GetContainerServiceMaintenanceConfigurations().Get(configName, cancellationToken);
- }
-
- /// Gets a collection of ContainerServiceAgentPoolResources in the ContainerServiceManagedCluster.
- /// An object representing collection of ContainerServiceAgentPoolResources and their operations over a ContainerServiceAgentPoolResource.
- public virtual ContainerServiceAgentPoolCollection GetContainerServiceAgentPools()
- {
- return GetCachedClient(client => new ContainerServiceAgentPoolCollection(client, Id));
- }
-
- ///
- /// Gets the specified managed cluster agent pool.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}
- ///
- /// -
- /// Operation Id
- /// AgentPools_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The name of the agent pool.
- /// The cancellation token to use.
- /// is null.
- /// is an empty string, and was expected to be non-empty.
- [ForwardsClientCalls]
- public virtual async Task> GetContainerServiceAgentPoolAsync(string agentPoolName, CancellationToken cancellationToken = default)
- {
- return await GetContainerServiceAgentPools().GetAsync(agentPoolName, cancellationToken).ConfigureAwait(false);
- }
-
- ///
- /// Gets the specified managed cluster agent pool.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}
- ///
- /// -
- /// Operation Id
- /// AgentPools_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The name of the agent pool.
- /// The cancellation token to use.
- /// is null.
- /// is an empty string, and was expected to be non-empty.
- [ForwardsClientCalls]
- public virtual Response GetContainerServiceAgentPool(string agentPoolName, CancellationToken cancellationToken = default)
- {
- return GetContainerServiceAgentPools().Get(agentPoolName, cancellationToken);
- }
-
- /// Gets a collection of ContainerServicePrivateEndpointConnectionResources in the ContainerServiceManagedCluster.
- /// An object representing collection of ContainerServicePrivateEndpointConnectionResources and their operations over a ContainerServicePrivateEndpointConnectionResource.
- public virtual ContainerServicePrivateEndpointConnectionCollection GetContainerServicePrivateEndpointConnections()
- {
- return GetCachedClient(client => new ContainerServicePrivateEndpointConnectionCollection(client, Id));
- }
-
- ///
- /// To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}
- ///
- /// -
- /// Operation Id
- /// PrivateEndpointConnections_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The name of the private endpoint connection.
- /// The cancellation token to use.
- /// is null.
- /// is an empty string, and was expected to be non-empty.
- [ForwardsClientCalls]
- public virtual async Task> GetContainerServicePrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default)
- {
- return await GetContainerServicePrivateEndpointConnections().GetAsync(privateEndpointConnectionName, cancellationToken).ConfigureAwait(false);
- }
-
- ///
- /// To learn more about private clusters, see: https://docs.microsoft.com/azure/aks/private-clusters
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}
- ///
- /// -
- /// Operation Id
- /// PrivateEndpointConnections_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The name of the private endpoint connection.
- /// The cancellation token to use.
- /// is null.
- /// is an empty string, and was expected to be non-empty.
- [ForwardsClientCalls]
- public virtual Response GetContainerServicePrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default)
- {
- return GetContainerServicePrivateEndpointConnections().Get(privateEndpointConnectionName, cancellationToken);
- }
-
- /// Gets a collection of ContainerServiceTrustedAccessRoleBindingResources in the ContainerServiceManagedCluster.
- /// An object representing collection of ContainerServiceTrustedAccessRoleBindingResources and their operations over a ContainerServiceTrustedAccessRoleBindingResource.
- public virtual ContainerServiceTrustedAccessRoleBindingCollection GetContainerServiceTrustedAccessRoleBindings()
- {
- return GetCachedClient(client => new ContainerServiceTrustedAccessRoleBindingCollection(client, Id));
- }
-
- ///
- /// Get a trusted access role binding.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}
- ///
- /// -
- /// Operation Id
- /// TrustedAccessRoleBindings_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The name of trusted access role binding.
- /// The cancellation token to use.
- /// is null.
- /// is an empty string, and was expected to be non-empty.
- [ForwardsClientCalls]
- public virtual async Task> GetContainerServiceTrustedAccessRoleBindingAsync(string trustedAccessRoleBindingName, CancellationToken cancellationToken = default)
- {
- return await GetContainerServiceTrustedAccessRoleBindings().GetAsync(trustedAccessRoleBindingName, cancellationToken).ConfigureAwait(false);
- }
-
- ///
- /// Get a trusted access role binding.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/trustedAccessRoleBindings/{trustedAccessRoleBindingName}
- ///
- /// -
- /// Operation Id
- /// TrustedAccessRoleBindings_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The name of trusted access role binding.
- /// The cancellation token to use.
- /// is null.
- /// is an empty string, and was expected to be non-empty.
- [ForwardsClientCalls]
- public virtual Response GetContainerServiceTrustedAccessRoleBinding(string trustedAccessRoleBindingName, CancellationToken cancellationToken = default)
- {
- return GetContainerServiceTrustedAccessRoleBindings().Get(trustedAccessRoleBindingName, cancellationToken);
- }
-
- ///
- /// Gets a managed cluster.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}
- ///
- /// -
- /// Operation Id
- /// ManagedClusters_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The cancellation token to use.
- public virtual async Task> GetAsync(CancellationToken cancellationToken = default)
- {
- using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.Get");
- scope.Start();
- try
- {
- var response = await _containerServiceManagedClusterManagedClustersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false);
- if (response.Value == null)
- throw new RequestFailedException(response.GetRawResponse());
- return Response.FromValue(new ContainerServiceManagedClusterResource(Client, response.Value), response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Gets a managed cluster.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}
- ///
- /// -
- /// Operation Id
- /// ManagedClusters_Get
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// The cancellation token to use.
- public virtual Response Get(CancellationToken cancellationToken = default)
- {
- using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.Get");
- scope.Start();
- try
- {
- var response = _containerServiceManagedClusterManagedClustersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken);
- if (response.Value == null)
- throw new RequestFailedException(response.GetRawResponse());
- return Response.FromValue(new ContainerServiceManagedClusterResource(Client, response.Value), response.GetRawResponse());
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Updates tags on a managed cluster.
- ///
- /// -
- /// Request Path
- /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}
- ///
- /// -
- /// Operation Id
- /// ManagedClusters_UpdateTags
- ///
- /// -
- /// Default Api Version
- /// 2023-10-01
- ///
- /// -
- /// Resource
- ///
- ///
- ///
- ///
- /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples.
- /// Parameters supplied to the Update Managed Cluster Tags operation.
- /// The cancellation token to use.
- /// is null.
- public virtual async Task> UpdateAsync(WaitUntil waitUntil, ContainerServiceTagsObject containerServiceTagsObject, CancellationToken cancellationToken = default)
- {
- Argument.AssertNotNull(containerServiceTagsObject, nameof(containerServiceTagsObject));
-
- using var scope = _containerServiceManagedClusterManagedClustersClientDiagnostics.CreateScope("ContainerServiceManagedClusterResource.Update");
- scope.Start();
- try
- {
- var response = await _containerServiceManagedClusterManagedClustersRestClient.UpdateTagsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, containerServiceTagsObject, cancellationToken).ConfigureAwait(false);
- var operation = new ContainerServiceArmOperation(new ContainerServiceManagedClusterOperationSource(Client), _containerServiceManagedClusterManagedClustersClientDiagnostics, Pipeline, _containerServiceManagedClusterManagedClustersRestClient.CreateUpdateTagsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, containerServiceTagsObject).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2017-08-31");
- if (waitUntil == WaitUntil.Completed)
- await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
- return operation;
- }
- catch (Exception e)
- {
- scope.Failed(e);
- throw;
- }
- }
-
- ///
- /// Updates tags on a managed cluster.
- ///
- /// -
- ///