diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/CHANGELOG.md b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/CHANGELOG.md index aa83382bdbdf..423bcbba5f03 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/CHANGELOG.md +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/CHANGELOG.md @@ -1,5 +1,17 @@ # Release History +## 1.2.0-beta.1 (Unreleased) + +### Features Added + +- Add AutoUpgrade and AutoUpgradeProfile support + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.1.0-beta.1 (Unreleased) ### Features Added diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/api/Azure.ResourceManager.ContainerServiceFleet.netstandard2.0.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/api/Azure.ResourceManager.ContainerServiceFleet.netstandard2.0.cs index e80578ed5889..301a6ada4997 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/api/Azure.ResourceManager.ContainerServiceFleet.netstandard2.0.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/api/Azure.ResourceManager.ContainerServiceFleet.netstandard2.0.cs @@ -1,5 +1,56 @@ namespace Azure.ResourceManager.ContainerServiceFleet { + public partial class AutoUpgradeProfileCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected AutoUpgradeProfileCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string autoUpgradeProfileName, Azure.ResourceManager.ContainerServiceFleet.AutoUpgradeProfileData data, string ifMatch = null, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string autoUpgradeProfileName, Azure.ResourceManager.ContainerServiceFleet.AutoUpgradeProfileData data, string ifMatch = null, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string autoUpgradeProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string autoUpgradeProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string autoUpgradeProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string autoUpgradeProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string autoUpgradeProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string autoUpgradeProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class AutoUpgradeProfileData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AutoUpgradeProfileData() { } + public Azure.ResourceManager.ContainerServiceFleet.Models.UpgradeChannel? Channel { get { throw null; } set { } } + public bool? Disabled { get { throw null; } set { } } + public Azure.ETag? ETag { get { throw null; } } + public Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeProfileProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeNodeImageSelectionType? SelectionType { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier UpdateStrategyId { get { throw null; } set { } } + Azure.ResourceManager.ContainerServiceFleet.AutoUpgradeProfileData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.AutoUpgradeProfileData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AutoUpgradeProfileResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected AutoUpgradeProfileResource() { } + public virtual Azure.ResourceManager.ContainerServiceFleet.AutoUpgradeProfileData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string autoUpgradeProfileName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.ContainerServiceFleet.AutoUpgradeProfileData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.AutoUpgradeProfileData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerServiceFleet.AutoUpgradeProfileData data, string ifMatch = null, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerServiceFleet.AutoUpgradeProfileData data, string ifMatch = null, string ifNoneMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public partial class ContainerServiceFleetCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected ContainerServiceFleetCollection() { } @@ -21,6 +72,7 @@ public partial class ContainerServiceFleetData : Azure.ResourceManager.Models.Tr { public ContainerServiceFleetData(Azure.Core.AzureLocation location) { } public Azure.ETag? ETag { get { throw null; } } + public Azure.ResourceManager.ContainerServiceFleet.Models.FleetHubProfile HubProfile { get { throw null; } set { } } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.ContainerServiceFleet.Models.FleetProvisioningState? ProvisioningState { get { throw null; } } Azure.ResourceManager.ContainerServiceFleet.ContainerServiceFleetData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -31,6 +83,7 @@ public ContainerServiceFleetData(Azure.Core.AzureLocation location) { } } public static partial class ContainerServiceFleetExtensions { + public static Azure.ResourceManager.ContainerServiceFleet.AutoUpgradeProfileResource GetAutoUpgradeProfileResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.Response GetContainerServiceFleet(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetContainerServiceFleetAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.ContainerServiceFleet.ContainerServiceFleetMemberResource GetContainerServiceFleetMemberResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } @@ -103,6 +156,9 @@ protected ContainerServiceFleetResource() { } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetAutoUpgradeProfile(string autoUpgradeProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAutoUpgradeProfileAsync(string autoUpgradeProfileName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ContainerServiceFleet.AutoUpgradeProfileCollection GetAutoUpgradeProfiles() { throw null; } public virtual Azure.Response GetContainerServiceFleetMember(string fleetMemberName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetContainerServiceFleetMemberAsync(string fleetMemberName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.ContainerServiceFleet.ContainerServiceFleetMemberCollection GetContainerServiceFleetMembers() { throw null; } @@ -169,6 +225,8 @@ protected ContainerServiceFleetUpdateRunResource() { } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Skip(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerServiceFleet.Models.SkipProperties body, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SkipAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.ContainerServiceFleet.Models.SkipProperties body, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.ArmOperation Start(Azure.WaitUntil waitUntil, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> StartAsync(Azure.WaitUntil waitUntil, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.ArmOperation Stop(Azure.WaitUntil waitUntil, string ifMatch = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -235,6 +293,7 @@ namespace Azure.ResourceManager.ContainerServiceFleet.Mocking public partial class MockableContainerServiceFleetArmClient : Azure.ResourceManager.ArmResource { protected MockableContainerServiceFleetArmClient() { } + public virtual Azure.ResourceManager.ContainerServiceFleet.AutoUpgradeProfileResource GetAutoUpgradeProfileResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.ContainerServiceFleet.ContainerServiceFleetMemberResource GetContainerServiceFleetMemberResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.ContainerServiceFleet.ContainerServiceFleetResource GetContainerServiceFleetResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.ContainerServiceFleet.ContainerServiceFleetUpdateRunResource GetContainerServiceFleetUpdateRunResource(Azure.Core.ResourceIdentifier id) { throw null; } @@ -258,7 +317,10 @@ namespace Azure.ResourceManager.ContainerServiceFleet.Models { public static partial class ArmContainerServiceFleetModelFactory { - public static Azure.ResourceManager.ContainerServiceFleet.ContainerServiceFleetData ContainerServiceFleetData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ETag? eTag = default(Azure.ETag?), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.ContainerServiceFleet.Models.FleetProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerServiceFleet.Models.FleetProvisioningState?)) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.AutoUpgradeProfileData AutoUpgradeProfileData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ETag? eTag = default(Azure.ETag?), Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeProfileProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeProfileProvisioningState?), Azure.Core.ResourceIdentifier updateStrategyId = null, Azure.ResourceManager.ContainerServiceFleet.Models.UpgradeChannel? channel = default(Azure.ResourceManager.ContainerServiceFleet.Models.UpgradeChannel?), Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeNodeImageSelectionType? selectionType = default(Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeNodeImageSelectionType?), bool? disabled = default(bool?)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.ContainerServiceFleet.ContainerServiceFleetData ContainerServiceFleetData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, System.Collections.Generic.IDictionary tags, Azure.Core.AzureLocation location, Azure.ETag? eTag, Azure.ResourceManager.Models.ManagedServiceIdentity identity, Azure.ResourceManager.ContainerServiceFleet.Models.FleetProvisioningState? provisioningState) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.ContainerServiceFleetData ContainerServiceFleetData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ETag? eTag = default(Azure.ETag?), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.ContainerServiceFleet.Models.FleetProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerServiceFleet.Models.FleetProvisioningState?), Azure.ResourceManager.ContainerServiceFleet.Models.FleetHubProfile hubProfile = null) { throw null; } public static Azure.ResourceManager.ContainerServiceFleet.ContainerServiceFleetMemberData ContainerServiceFleetMemberData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ETag? eTag = default(Azure.ETag?), Azure.Core.ResourceIdentifier clusterResourceId = null, string group = null, Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerServiceFleet.Models.FleetMemberProvisioningState?)) { throw null; } public static Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetUpdateGroupStatus ContainerServiceFleetUpdateGroupStatus(Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetUpdateStatus status = null, string name = null, System.Collections.Generic.IEnumerable members = null) { throw null; } public static Azure.ResourceManager.ContainerServiceFleet.ContainerServiceFleetUpdateRunData ContainerServiceFleetUpdateRunData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ETag? eTag = default(Azure.ETag?), Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetUpdateRunProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetUpdateRunProvisioningState?), Azure.Core.ResourceIdentifier updateStrategyId = null, System.Collections.Generic.IEnumerable strategyStages = null, Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetManagedClusterUpdate managedClusterUpdate = null, Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetUpdateRunStatus status = null) { throw null; } @@ -268,13 +330,76 @@ public static partial class ArmContainerServiceFleetModelFactory public static Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetWaitStatus ContainerServiceFleetWaitStatus(Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetUpdateStatus status = null, int? waitDurationInSeconds = default(int?)) { throw null; } public static Azure.ResourceManager.ContainerServiceFleet.Models.FleetCredentialResult FleetCredentialResult(string name = null, byte[] value = null) { throw null; } public static Azure.ResourceManager.ContainerServiceFleet.Models.FleetCredentialResults FleetCredentialResults(System.Collections.Generic.IEnumerable kubeconfigs = null) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.FleetHubProfile FleetHubProfile(string dnsPrefix = null, Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetAPIServerAccessProfile apiServerAccessProfile = null, Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetAgentProfile agentProfile = null, string fqdn = null, string kubernetesVersion = null, string portalFqdn = null) { throw null; } public static Azure.ResourceManager.ContainerServiceFleet.FleetUpdateStrategyData FleetUpdateStrategyData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ETag? eTag = default(Azure.ETag?), Azure.ResourceManager.ContainerServiceFleet.Models.FleetUpdateStrategyProvisioningState? provisioningState = default(Azure.ResourceManager.ContainerServiceFleet.Models.FleetUpdateStrategyProvisioningState?), System.Collections.Generic.IEnumerable strategyStages = null) { throw null; } public static Azure.ResourceManager.ContainerServiceFleet.Models.MemberUpdateStatus MemberUpdateStatus(Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetUpdateStatus status = null, string name = null, Azure.Core.ResourceIdentifier clusterResourceId = null, string operationId = null, string message = null) { throw null; } public static Azure.ResourceManager.ContainerServiceFleet.Models.NodeImageVersion NodeImageVersion(string version = null) { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AutoUpgradeNodeImageSelectionType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AutoUpgradeNodeImageSelectionType(string value) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeNodeImageSelectionType Consistent { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeNodeImageSelectionType Latest { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeNodeImageSelectionType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeNodeImageSelectionType left, Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeNodeImageSelectionType right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeNodeImageSelectionType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeNodeImageSelectionType left, Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeNodeImageSelectionType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AutoUpgradeProfileProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AutoUpgradeProfileProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeProfileProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeProfileProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeProfileProvisioningState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeProfileProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeProfileProvisioningState left, Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeProfileProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeProfileProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeProfileProvisioningState left, Azure.ResourceManager.ContainerServiceFleet.Models.AutoUpgradeProfileProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ContainerServiceFleetAgentProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerServiceFleetAgentProfile() { } + public Azure.Core.ResourceIdentifier SubnetId { get { throw null; } set { } } + public string VmSize { get { throw null; } set { } } + Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetAgentProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetAgentProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ContainerServiceFleetAPIServerAccessProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ContainerServiceFleetAPIServerAccessProfile() { } + public bool? EnablePrivateCluster { get { throw null; } set { } } + public bool? EnableVnetIntegration { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier SubnetId { get { throw null; } set { } } + Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetAPIServerAccessProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetAPIServerAccessProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ContainerServiceFleetManagedClusterUpdate : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ContainerServiceFleetManagedClusterUpdate(Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetManagedClusterUpgradeSpec upgrade) { } + public Azure.ResourceManager.ContainerServiceFleet.Models.NodeImageSelection NodeImageSelection { get { throw null; } set { } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public Azure.ResourceManager.ContainerServiceFleet.Models.NodeImageSelectionType? SelectionType { get { throw null; } set { } } public Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetManagedClusterUpgradeSpec Upgrade { get { throw null; } set { } } Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetManagedClusterUpdate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -300,6 +425,7 @@ public ContainerServiceFleetManagedClusterUpgradeSpec(Azure.ResourceManager.Cont private readonly object _dummy; private readonly int _dummyPrimitive; public ContainerServiceFleetManagedClusterUpgradeType(string value) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetManagedClusterUpgradeType ControlPlaneOnly { get { throw null; } } public static Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetManagedClusterUpgradeType Full { get { throw null; } } public static Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetManagedClusterUpgradeType NodeImageOnly { get { throw null; } } public bool Equals(Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetManagedClusterUpgradeType other) { throw null; } @@ -479,6 +605,21 @@ internal FleetCredentialResults() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class FleetHubProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetHubProfile() { } + public Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetAgentProfile AgentProfile { get { throw null; } set { } } + public Azure.ResourceManager.ContainerServiceFleet.Models.ContainerServiceFleetAPIServerAccessProfile ApiServerAccessProfile { get { throw null; } set { } } + public string DnsPrefix { get { throw null; } set { } } + public string Fqdn { get { throw null; } } + public string KubernetesVersion { get { throw null; } } + public string PortalFqdn { get { throw null; } } + Azure.ResourceManager.ContainerServiceFleet.Models.FleetHubProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.FleetHubProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct FleetMemberProvisioningState : System.IEquatable { @@ -556,6 +697,17 @@ internal MemberUpdateStatus() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class NodeImageSelection : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NodeImageSelection(Azure.ResourceManager.ContainerServiceFleet.Models.NodeImageSelectionType selectionType) { } + public System.Collections.Generic.IList CustomNodeImageVersions { get { throw null; } } + public Azure.ResourceManager.ContainerServiceFleet.Models.NodeImageSelectionType SelectionType { get { throw null; } set { } } + Azure.ResourceManager.ContainerServiceFleet.Models.NodeImageSelection System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.NodeImageSelection System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct NodeImageSelectionType : System.IEquatable { @@ -563,6 +715,7 @@ internal MemberUpdateStatus() { } private readonly int _dummyPrimitive; public NodeImageSelectionType(string value) { throw null; } public static Azure.ResourceManager.ContainerServiceFleet.Models.NodeImageSelectionType Consistent { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.NodeImageSelectionType Custom { get { throw null; } } public static Azure.ResourceManager.ContainerServiceFleet.Models.NodeImageSelectionType Latest { get { throw null; } } public bool Equals(Azure.ResourceManager.ContainerServiceFleet.Models.NodeImageSelectionType other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -576,7 +729,7 @@ internal MemberUpdateStatus() { } } public partial class NodeImageVersion : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal NodeImageVersion() { } + public NodeImageVersion() { } public string Version { get { throw null; } } Azure.ResourceManager.ContainerServiceFleet.Models.NodeImageVersion System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -584,4 +737,64 @@ internal NodeImageVersion() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class SkipProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SkipProperties(System.Collections.Generic.IEnumerable targets) { } + public System.Collections.Generic.IList Targets { get { throw null; } } + Azure.ResourceManager.ContainerServiceFleet.Models.SkipProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.SkipProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class SkipTarget : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public SkipTarget(Azure.ResourceManager.ContainerServiceFleet.Models.TargetType targetType, string name) { } + public string Name { get { throw null; } } + public Azure.ResourceManager.ContainerServiceFleet.Models.TargetType TargetType { get { throw null; } } + Azure.ResourceManager.ContainerServiceFleet.Models.SkipTarget System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ContainerServiceFleet.Models.SkipTarget System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct TargetType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public TargetType(string value) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.TargetType AfterStageWait { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.TargetType Group { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.TargetType Member { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.TargetType Stage { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerServiceFleet.Models.TargetType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerServiceFleet.Models.TargetType left, Azure.ResourceManager.ContainerServiceFleet.Models.TargetType right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerServiceFleet.Models.TargetType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerServiceFleet.Models.TargetType left, Azure.ResourceManager.ContainerServiceFleet.Models.TargetType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct UpgradeChannel : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public UpgradeChannel(string value) { throw null; } + public static Azure.ResourceManager.ContainerServiceFleet.Models.UpgradeChannel NodeImage { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.UpgradeChannel Rapid { get { throw null; } } + public static Azure.ResourceManager.ContainerServiceFleet.Models.UpgradeChannel Stable { get { throw null; } } + public bool Equals(Azure.ResourceManager.ContainerServiceFleet.Models.UpgradeChannel other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.ContainerServiceFleet.Models.UpgradeChannel left, Azure.ResourceManager.ContainerServiceFleet.Models.UpgradeChannel right) { throw null; } + public static implicit operator Azure.ResourceManager.ContainerServiceFleet.Models.UpgradeChannel (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ContainerServiceFleet.Models.UpgradeChannel left, Azure.ResourceManager.ContainerServiceFleet.Models.UpgradeChannel right) { throw null; } + public override string ToString() { throw null; } + } } diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/assets.json b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/assets.json index dd935d390aa3..eff6f619143d 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/assets.json +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/fleet/Azure.ResourceManager.ContainerServiceFleet", - "Tag": "net/fleet/Azure.ResourceManager.ContainerServiceFleet_d1cc30d3cd" + "Tag": "net/fleet/Azure.ResourceManager.ContainerServiceFleet_f0519a638f" } diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_AutoUpgradeProfileCollection.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_AutoUpgradeProfileCollection.cs new file mode 100644 index 000000000000..6778e8edb60b --- /dev/null +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_AutoUpgradeProfileCollection.cs @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.ContainerServiceFleet.Models; + +namespace Azure.ResourceManager.ContainerServiceFleet.Samples +{ + public partial class Sample_AutoUpgradeProfileCollection + { + // Lists the AutoUpgradeProfile resources by fleet. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_ListsTheAutoUpgradeProfileResourcesByFleet() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-05-02-preview/examples/AutoUpgradeProfiles_ListByFleet.json + // this example is just showing the usage of "AutoUpgradeProfiles_ListByFleet" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerServiceFleetResource created on azure + // for more information of creating ContainerServiceFleetResource, please refer to the document of ContainerServiceFleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier containerServiceFleetResourceId = ContainerServiceFleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + ContainerServiceFleetResource containerServiceFleet = client.GetContainerServiceFleetResource(containerServiceFleetResourceId); + + // get the collection of this AutoUpgradeProfileResource + AutoUpgradeProfileCollection collection = containerServiceFleet.GetAutoUpgradeProfiles(); + + // invoke the operation and iterate over the result + await foreach (AutoUpgradeProfileResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AutoUpgradeProfileData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + + // Gets an AutoUpgradeProfile resource. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetsAnAutoUpgradeProfileResource() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-05-02-preview/examples/AutoUpgradeProfiles_Get.json + // this example is just showing the usage of "AutoUpgradeProfiles_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerServiceFleetResource created on azure + // for more information of creating ContainerServiceFleetResource, please refer to the document of ContainerServiceFleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier containerServiceFleetResourceId = ContainerServiceFleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + ContainerServiceFleetResource containerServiceFleet = client.GetContainerServiceFleetResource(containerServiceFleetResourceId); + + // get the collection of this AutoUpgradeProfileResource + AutoUpgradeProfileCollection collection = containerServiceFleet.GetAutoUpgradeProfiles(); + + // invoke the operation + string autoUpgradeProfileName = "autoupgradeprofile1"; + AutoUpgradeProfileResource result = await collection.GetAsync(autoUpgradeProfileName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AutoUpgradeProfileData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Gets an AutoUpgradeProfile resource. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GetsAnAutoUpgradeProfileResource() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-05-02-preview/examples/AutoUpgradeProfiles_Get.json + // this example is just showing the usage of "AutoUpgradeProfiles_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerServiceFleetResource created on azure + // for more information of creating ContainerServiceFleetResource, please refer to the document of ContainerServiceFleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier containerServiceFleetResourceId = ContainerServiceFleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + ContainerServiceFleetResource containerServiceFleet = client.GetContainerServiceFleetResource(containerServiceFleetResourceId); + + // get the collection of this AutoUpgradeProfileResource + AutoUpgradeProfileCollection collection = containerServiceFleet.GetAutoUpgradeProfiles(); + + // invoke the operation + string autoUpgradeProfileName = "autoupgradeprofile1"; + bool result = await collection.ExistsAsync(autoUpgradeProfileName); + + Console.WriteLine($"Succeeded: {result}"); + } + + // Gets an AutoUpgradeProfile resource. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GetsAnAutoUpgradeProfileResource() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-05-02-preview/examples/AutoUpgradeProfiles_Get.json + // this example is just showing the usage of "AutoUpgradeProfiles_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerServiceFleetResource created on azure + // for more information of creating ContainerServiceFleetResource, please refer to the document of ContainerServiceFleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier containerServiceFleetResourceId = ContainerServiceFleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + ContainerServiceFleetResource containerServiceFleet = client.GetContainerServiceFleetResource(containerServiceFleetResourceId); + + // get the collection of this AutoUpgradeProfileResource + AutoUpgradeProfileCollection collection = containerServiceFleet.GetAutoUpgradeProfiles(); + + // invoke the operation + string autoUpgradeProfileName = "autoupgradeprofile1"; + NullableResponse response = await collection.GetIfExistsAsync(autoUpgradeProfileName); + AutoUpgradeProfileResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AutoUpgradeProfileData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // Create an AutoUpgradeProfile. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateAnAutoUpgradeProfile() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-05-02-preview/examples/AutoUpgradeProfiles_CreateOrUpdate.json + // this example is just showing the usage of "AutoUpgradeProfiles_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerServiceFleetResource created on azure + // for more information of creating ContainerServiceFleetResource, please refer to the document of ContainerServiceFleetResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + ResourceIdentifier containerServiceFleetResourceId = ContainerServiceFleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + ContainerServiceFleetResource containerServiceFleet = client.GetContainerServiceFleetResource(containerServiceFleetResourceId); + + // get the collection of this AutoUpgradeProfileResource + AutoUpgradeProfileCollection collection = containerServiceFleet.GetAutoUpgradeProfiles(); + + // invoke the operation + string autoUpgradeProfileName = "autoupgradeprofile1"; + AutoUpgradeProfileData data = new AutoUpgradeProfileData() + { + Channel = UpgradeChannel.Stable, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, autoUpgradeProfileName, data); + AutoUpgradeProfileResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AutoUpgradeProfileData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_AutoUpgradeProfileResource.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_AutoUpgradeProfileResource.cs new file mode 100644 index 000000000000..f389b62c32b2 --- /dev/null +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_AutoUpgradeProfileResource.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.ContainerServiceFleet.Models; + +namespace Azure.ResourceManager.ContainerServiceFleet.Samples +{ + public partial class Sample_AutoUpgradeProfileResource + { + // Gets an AutoUpgradeProfile resource. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetsAnAutoUpgradeProfileResource() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-05-02-preview/examples/AutoUpgradeProfiles_Get.json + // this example is just showing the usage of "AutoUpgradeProfiles_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AutoUpgradeProfileResource created on azure + // for more information of creating AutoUpgradeProfileResource, please refer to the document of AutoUpgradeProfileResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + string autoUpgradeProfileName = "autoupgradeprofile1"; + ResourceIdentifier autoUpgradeProfileResourceId = AutoUpgradeProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, autoUpgradeProfileName); + AutoUpgradeProfileResource autoUpgradeProfile = client.GetAutoUpgradeProfileResource(autoUpgradeProfileResourceId); + + // invoke the operation + AutoUpgradeProfileResource result = await autoUpgradeProfile.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AutoUpgradeProfileData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Create an AutoUpgradeProfile. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_CreateAnAutoUpgradeProfile() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-05-02-preview/examples/AutoUpgradeProfiles_CreateOrUpdate.json + // this example is just showing the usage of "AutoUpgradeProfiles_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AutoUpgradeProfileResource created on azure + // for more information of creating AutoUpgradeProfileResource, please refer to the document of AutoUpgradeProfileResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + string autoUpgradeProfileName = "autoupgradeprofile1"; + ResourceIdentifier autoUpgradeProfileResourceId = AutoUpgradeProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, autoUpgradeProfileName); + AutoUpgradeProfileResource autoUpgradeProfile = client.GetAutoUpgradeProfileResource(autoUpgradeProfileResourceId); + + // invoke the operation + AutoUpgradeProfileData data = new AutoUpgradeProfileData() + { + Channel = UpgradeChannel.Stable, + }; + ArmOperation lro = await autoUpgradeProfile.UpdateAsync(WaitUntil.Completed, data); + AutoUpgradeProfileResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + AutoUpgradeProfileData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Delete an AutoUpgradeProfile resource. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_DeleteAnAutoUpgradeProfileResource() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-05-02-preview/examples/AutoUpgradeProfiles_Delete.json + // this example is just showing the usage of "AutoUpgradeProfiles_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AutoUpgradeProfileResource created on azure + // for more information of creating AutoUpgradeProfileResource, please refer to the document of AutoUpgradeProfileResource + string subscriptionId = "subid1"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + string autoUpgradeProfileName = "autoupgradeprofile1"; + ResourceIdentifier autoUpgradeProfileResourceId = AutoUpgradeProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, autoUpgradeProfileName); + AutoUpgradeProfileResource autoUpgradeProfile = client.GetAutoUpgradeProfileResource(autoUpgradeProfileResourceId); + + // invoke the operation + await autoUpgradeProfile.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + } +} diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_ContainerServiceFleetCollection.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_ContainerServiceFleetCollection.cs index 47dbcf3f0265..da6d1136d291 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_ContainerServiceFleetCollection.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_ContainerServiceFleetCollection.cs @@ -9,6 +9,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Identity; +using Azure.ResourceManager.ContainerServiceFleet.Models; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.ContainerServiceFleet.Samples @@ -20,7 +21,7 @@ public partial class Sample_ContainerServiceFleetCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListsTheFleetResourcesInAResourceGroup() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/Fleets_ListByResourceGroup.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-05-02-preview/examples/Fleets_ListByResourceGroup.json // this example is just showing the usage of "Fleets_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -56,7 +57,7 @@ public async Task GetAll_ListsTheFleetResourcesInAResourceGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetsAFleetResource() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/Fleets_Get.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-05-02-preview/examples/Fleets_Get.json // this example is just showing the usage of "Fleets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -90,7 +91,7 @@ public async Task Get_GetsAFleetResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetsAFleetResource() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/Fleets_Get.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-05-02-preview/examples/Fleets_Get.json // this example is just showing the usage of "Fleets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -120,7 +121,7 @@ public async Task Exists_GetsAFleetResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetsAFleetResource() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/Fleets_Get.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-05-02-preview/examples/Fleets_Get.json // this example is just showing the usage of "Fleets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -162,7 +163,7 @@ public async Task GetIfExists_GetsAFleetResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreatesAFleetResourceWithALongRunningOperation() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/Fleets_CreateOrUpdate.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-05-02-preview/examples/Fleets_CreateOrUpdate.json // this example is just showing the usage of "Fleets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -184,6 +185,14 @@ public async Task CreateOrUpdate_CreatesAFleetResourceWithALongRunningOperation( string fleetName = "fleet1"; ContainerServiceFleetData data = new ContainerServiceFleetData(new AzureLocation("East US")) { + HubProfile = new FleetHubProfile() + { + DnsPrefix = "dnsprefix1", + AgentProfile = new ContainerServiceFleetAgentProfile() + { + VmSize = "Standard_DS1", + }, + }, Tags = { ["archv2"] = "", diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_ContainerServiceFleetMemberCollection.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_ContainerServiceFleetMemberCollection.cs index 9d2dccbd7370..e3b55ac6806d 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_ContainerServiceFleetMemberCollection.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_ContainerServiceFleetMemberCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_ContainerServiceFleetMemberCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListsTheMembersOfAFleet() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/FleetMembers_ListByFleet.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-05-02-preview/examples/FleetMembers_ListByFleet.json // this example is just showing the usage of "FleetMembers_ListByFleet" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -56,7 +56,7 @@ public async Task GetAll_ListsTheMembersOfAFleet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetsAFleetMemberResource() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/FleetMembers_Get.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-05-02-preview/examples/FleetMembers_Get.json // this example is just showing the usage of "FleetMembers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -91,7 +91,7 @@ public async Task Get_GetsAFleetMemberResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetsAFleetMemberResource() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/FleetMembers_Get.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-05-02-preview/examples/FleetMembers_Get.json // this example is just showing the usage of "FleetMembers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -122,7 +122,7 @@ public async Task Exists_GetsAFleetMemberResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetsAFleetMemberResource() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/FleetMembers_Get.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-05-02-preview/examples/FleetMembers_Get.json // this example is just showing the usage of "FleetMembers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -165,7 +165,7 @@ public async Task GetIfExists_GetsAFleetMemberResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreatesAFleetMemberResourceWithALongRunningOperation() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/FleetMembers_Create.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-05-02-preview/examples/FleetMembers_Create.json // this example is just showing the usage of "FleetMembers_Create" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_ContainerServiceFleetMemberResource.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_ContainerServiceFleetMemberResource.cs index d0ffdd1e175b..044df0cc0abb 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_ContainerServiceFleetMemberResource.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_ContainerServiceFleetMemberResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerServiceFleetMemberResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetsAFleetMemberResource() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/FleetMembers_Get.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-05-02-preview/examples/FleetMembers_Get.json // this example is just showing the usage of "FleetMembers_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_GetsAFleetMemberResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdatesAFleetMemberResourceSynchronously() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/FleetMembers_Update.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-05-02-preview/examples/FleetMembers_Update.json // this example is just showing the usage of "FleetMembers_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -89,7 +89,7 @@ public async Task Update_UpdatesAFleetMemberResourceSynchronously() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeletesAFleetMemberResourceAsynchronouslyWithALongRunningOperation() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/FleetMembers_Delete.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-05-02-preview/examples/FleetMembers_Delete.json // this example is just showing the usage of "FleetMembers_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_ContainerServiceFleetResource.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_ContainerServiceFleetResource.cs index 3817bc55392e..46c179410db4 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_ContainerServiceFleetResource.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_ContainerServiceFleetResource.cs @@ -21,7 +21,7 @@ public partial class Sample_ContainerServiceFleetResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetContainerServiceFleets_ListsTheFleetResourcesInASubscription() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/Fleets_ListBySub.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-05-02-preview/examples/Fleets_ListBySub.json // this example is just showing the usage of "Fleets_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task GetContainerServiceFleets_ListsTheFleetResourcesInASubscriptio [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetsAFleetResource() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/Fleets_Get.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-05-02-preview/examples/Fleets_Get.json // this example is just showing the usage of "Fleets_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -84,7 +84,7 @@ public async Task Get_GetsAFleetResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateAFleet() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/Fleets_PatchTags.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-05-02-preview/examples/Fleets_PatchTags.json // this example is just showing the usage of "Fleets_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -125,7 +125,7 @@ public async Task Update_UpdateAFleet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeletesAFleetResourceAsynchronouslyWithALongRunningOperation() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/Fleets_Delete.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-05-02-preview/examples/Fleets_Delete.json // this example is just showing the usage of "Fleets_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -152,7 +152,7 @@ public async Task Delete_DeletesAFleetResourceAsynchronouslyWithALongRunningOper [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetCredentials_ListsTheUserCredentialsOfAFleet() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/Fleets_ListCredentialsResult.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-05-02-preview/examples/Fleets_ListCredentialsResult.json // this example is just showing the usage of "Fleets_ListCredentials" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_ContainerServiceFleetUpdateRunCollection.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_ContainerServiceFleetUpdateRunCollection.cs index 7392dcdbe620..d699768d78b4 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_ContainerServiceFleetUpdateRunCollection.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_ContainerServiceFleetUpdateRunCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerServiceFleetUpdateRunCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListsTheUpdateRunResourcesByFleet() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/UpdateRuns_ListByFleet.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-05-02-preview/examples/UpdateRuns_ListByFleet.json // this example is just showing the usage of "UpdateRuns_ListByFleet" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +57,7 @@ public async Task GetAll_ListsTheUpdateRunResourcesByFleet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetsAnUpdateRunResource() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/UpdateRuns_Get.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-05-02-preview/examples/UpdateRuns_Get.json // this example is just showing the usage of "UpdateRuns_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +92,7 @@ public async Task Get_GetsAnUpdateRunResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetsAnUpdateRunResource() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/UpdateRuns_Get.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-05-02-preview/examples/UpdateRuns_Get.json // this example is just showing the usage of "UpdateRuns_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +123,7 @@ public async Task Exists_GetsAnUpdateRunResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetsAnUpdateRunResource() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/UpdateRuns_Get.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-05-02-preview/examples/UpdateRuns_Get.json // this example is just showing the usage of "UpdateRuns_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +166,7 @@ public async Task GetIfExists_GetsAnUpdateRunResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAnUpdateRun() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/UpdateRuns_CreateOrUpdate.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-05-02-preview/examples/UpdateRuns_CreateOrUpdate.json // this example is just showing the usage of "UpdateRuns_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -206,7 +206,7 @@ public async Task CreateOrUpdate_CreateAnUpdateRun() KubernetesVersion = "1.26.1", }) { - SelectionType = NodeImageSelectionType.Latest, + NodeImageSelection = new NodeImageSelection(NodeImageSelectionType.Latest), }, }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, updateRunName, data); diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_ContainerServiceFleetUpdateRunResource.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_ContainerServiceFleetUpdateRunResource.cs index 54a3321de84b..42bd2c237ed8 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_ContainerServiceFleetUpdateRunResource.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_ContainerServiceFleetUpdateRunResource.cs @@ -20,7 +20,7 @@ public partial class Sample_ContainerServiceFleetUpdateRunResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetsAnUpdateRunResource() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/UpdateRuns_Get.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-05-02-preview/examples/UpdateRuns_Get.json // this example is just showing the usage of "UpdateRuns_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_GetsAnUpdateRunResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateAnUpdateRun() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/UpdateRuns_CreateOrUpdate.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-05-02-preview/examples/UpdateRuns_CreateOrUpdate.json // this example is just showing the usage of "UpdateRuns_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -89,7 +89,7 @@ public async Task Update_CreateAnUpdateRun() KubernetesVersion = "1.26.1", }) { - SelectionType = NodeImageSelectionType.Latest, + NodeImageSelection = new NodeImageSelection(NodeImageSelectionType.Latest), }, }; ArmOperation lro = await containerServiceFleetUpdateRun.UpdateAsync(WaitUntil.Completed, data); @@ -107,7 +107,7 @@ public async Task Update_CreateAnUpdateRun() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteAnUpdateRunResource() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/UpdateRuns_Delete.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-05-02-preview/examples/UpdateRuns_Delete.json // this example is just showing the usage of "UpdateRuns_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -130,12 +130,49 @@ public async Task Delete_DeleteAnUpdateRunResource() Console.WriteLine($"Succeeded"); } + // Skips one or more member/group/stage/afterStageWait(s) of an UpdateRun. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Skip_SkipsOneOrMoreMemberGroupStageAfterStageWaitSOfAnUpdateRun() + { + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-05-02-preview/examples/UpdateRuns_Skip.json + // this example is just showing the usage of "UpdateRuns_Skip" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ContainerServiceFleetUpdateRunResource created on azure + // for more information of creating ContainerServiceFleetUpdateRunResource, please refer to the document of ContainerServiceFleetUpdateRunResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "rg1"; + string fleetName = "fleet1"; + string updateRunName = "run1"; + ResourceIdentifier containerServiceFleetUpdateRunResourceId = ContainerServiceFleetUpdateRunResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, updateRunName); + ContainerServiceFleetUpdateRunResource containerServiceFleetUpdateRun = client.GetContainerServiceFleetUpdateRunResource(containerServiceFleetUpdateRunResourceId); + + // invoke the operation + SkipProperties body = new SkipProperties(new SkipTarget[] + { +new SkipTarget(TargetType.Member,"member-one"),new SkipTarget(TargetType.AfterStageWait,"stage1") + }); + ArmOperation lro = await containerServiceFleetUpdateRun.SkipAsync(WaitUntil.Completed, body); + ContainerServiceFleetUpdateRunResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ContainerServiceFleetUpdateRunData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + // Starts an UpdateRun. [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Start_StartsAnUpdateRun() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/UpdateRuns_Start.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-05-02-preview/examples/UpdateRuns_Start.json // this example is just showing the usage of "UpdateRuns_Start" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -168,7 +205,7 @@ public async Task Start_StartsAnUpdateRun() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Stop_StopsAnUpdateRun() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/UpdateRuns_Stop.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-05-02-preview/examples/UpdateRuns_Stop.json // this example is just showing the usage of "UpdateRuns_Stop" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_FleetUpdateStrategyCollection.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_FleetUpdateStrategyCollection.cs index 1391422b6af5..5a6c7f18f027 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_FleetUpdateStrategyCollection.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_FleetUpdateStrategyCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_FleetUpdateStrategyCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListTheFleetUpdateStrategyResourcesByFleet() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/UpdateStrategies_ListByFleet.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-05-02-preview/examples/UpdateStrategies_ListByFleet.json // this example is just showing the usage of "FleetUpdateStrategies_ListByFleet" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +57,7 @@ public async Task GetAll_ListTheFleetUpdateStrategyResourcesByFleet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAFleetUpdateStrategyResource() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/UpdateStrategies_Get.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-05-02-preview/examples/UpdateStrategies_Get.json // this example is just showing the usage of "FleetUpdateStrategies_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +92,7 @@ public async Task Get_GetAFleetUpdateStrategyResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetAFleetUpdateStrategyResource() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/UpdateStrategies_Get.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-05-02-preview/examples/UpdateStrategies_Get.json // this example is just showing the usage of "FleetUpdateStrategies_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +123,7 @@ public async Task Exists_GetAFleetUpdateStrategyResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetAFleetUpdateStrategyResource() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/UpdateStrategies_Get.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-05-02-preview/examples/UpdateStrategies_Get.json // this example is just showing the usage of "FleetUpdateStrategies_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -166,7 +166,7 @@ public async Task GetIfExists_GetAFleetUpdateStrategyResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateAFleetUpdateStrategy() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/UpdateStrategies_CreateOrUpdate.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-05-02-preview/examples/UpdateStrategies_CreateOrUpdate.json // this example is just showing the usage of "FleetUpdateStrategies_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_FleetUpdateStrategyResource.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_FleetUpdateStrategyResource.cs index 9303f3adb271..112ed43b8333 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_FleetUpdateStrategyResource.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/samples/Generated/Samples/Sample_FleetUpdateStrategyResource.cs @@ -20,7 +20,7 @@ public partial class Sample_FleetUpdateStrategyResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetAFleetUpdateStrategyResource() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/UpdateStrategies_Get.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-05-02-preview/examples/UpdateStrategies_Get.json // this example is just showing the usage of "FleetUpdateStrategies_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_GetAFleetUpdateStrategyResource() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateAFleetUpdateStrategy() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/UpdateStrategies_CreateOrUpdate.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-05-02-preview/examples/UpdateStrategies_CreateOrUpdate.json // this example is just showing the usage of "FleetUpdateStrategies_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -99,7 +99,7 @@ public async Task Update_CreateAFleetUpdateStrategy() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteAFleetUpdateStrategyResource() { - // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/stable/2023-10-15/examples/UpdateStrategies_Delete.json + // Generated from example definition: specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/preview/2024-05-02-preview/examples/UpdateStrategies_Delete.json // this example is just showing the usage of "FleetUpdateStrategies_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Customized/ContainerServiceFleetManagedClusterUpdate.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Customized/ContainerServiceFleetManagedClusterUpdate.cs new file mode 100644 index 000000000000..ad3aaaccc87d --- /dev/null +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Customized/ContainerServiceFleetManagedClusterUpdate.cs @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable disable + +using System; +using System.Collections.Generic; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + public partial class ContainerServiceFleetManagedClusterUpdate + { + /// The node image upgrade type. + [EditorBrowsable(EditorBrowsableState.Never)] + public NodeImageSelectionType? SelectionType + { + get => NodeImageSelection is null ? default(NodeImageSelectionType?) : NodeImageSelection.SelectionType; + set + { + NodeImageSelection = value.HasValue ? new NodeImageSelection(value.Value) : null; + } + } + } +} diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ArmContainerServiceFleetModelFactory.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ArmContainerServiceFleetModelFactory.cs index 32f57a392309..f37479cd9b4f 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ArmContainerServiceFleetModelFactory.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ArmContainerServiceFleetModelFactory.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using Azure.Core; using Azure.ResourceManager.Models; @@ -26,8 +27,9 @@ public static partial class ArmContainerServiceFleetModelFactory /// 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 ContainerServiceFleetData ContainerServiceFleetData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ETag? eTag = null, ManagedServiceIdentity identity = null, FleetProvisioningState? provisioningState = null) + public static ContainerServiceFleetData ContainerServiceFleetData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ETag? eTag = null, ManagedServiceIdentity identity = null, FleetProvisioningState? provisioningState = null, FleetHubProfile hubProfile = null) { tags ??= new Dictionary(); @@ -41,6 +43,60 @@ public static ContainerServiceFleetData ContainerServiceFleetData(ResourceIdenti eTag, identity, provisioningState, + hubProfile, + serializedAdditionalRawData: 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, ContainerServiceFleetAPIServerAccessProfile apiServerAccessProfile = null, ContainerServiceFleetAgentProfile agentProfile = null, string fqdn = null, string kubernetesVersion = null, string portalFqdn = null) + { + return new FleetHubProfile( + dnsPrefix, + apiServerAccessProfile, + agentProfile, + fqdn, + kubernetesVersion, + portalFqdn, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// 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 AutoUpgradeProfile resource. + /// The resource id of the UpdateStrategy resource to reference. If not specified, the auto upgrade will run on all clusters which are members of the fleet. + /// Configures how auto-upgrade will be run. + /// The node image upgrade to be applied to the target clusters in auto upgrade. + /// + /// If set to False: the auto upgrade has effect - target managed clusters will be upgraded on schedule. + /// If set to True: the auto upgrade has no effect - no upgrade will be run on the target managed clusters. + /// This is a boolean and not an enum because enabled/disabled are all available states of the auto upgrade profile. + /// By default, this is set to False. + /// + /// A new instance for mocking. + public static AutoUpgradeProfileData AutoUpgradeProfileData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ETag? eTag = null, AutoUpgradeProfileProvisioningState? provisioningState = null, ResourceIdentifier updateStrategyId = null, UpgradeChannel? channel = null, AutoUpgradeNodeImageSelectionType? selectionType = null, bool? disabled = null) + { + return new AutoUpgradeProfileData( + id, + name, + resourceType, + systemData, + eTag, + provisioningState, + updateStrategyId, + channel, + selectionType.HasValue ? new AutoUpgradeNodeImageSelection(selectionType.Value, serializedAdditionalRawData: null) : null, + disabled, serializedAdditionalRawData: null); } @@ -134,6 +190,14 @@ public static ContainerServiceFleetUpdateRunData ContainerServiceFleetUpdateRunD serializedAdditionalRawData: 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 NodeImageVersion(version, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The status of the UpdateRun. /// The stages composing an update run. Stages are run sequentially withing an UpdateRun. @@ -210,14 +274,6 @@ public static ContainerServiceFleetWaitStatus ContainerServiceFleetWaitStatus(Co return new ContainerServiceFleetWaitStatus(status, waitDurationInSeconds, serializedAdditionalRawData: 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 NodeImageVersion(version, serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The id. /// The name. @@ -241,5 +297,22 @@ public static FleetUpdateStrategyData FleetUpdateStrategyData(ResourceIdentifier strategyStages != null ? new ContainerServiceFleetUpdateRunStrategy(strategyStages?.ToList(), serializedAdditionalRawData: null) : null, serializedAdditionalRawData: null); } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// 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. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static ContainerServiceFleetData ContainerServiceFleetData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ETag? eTag, ManagedServiceIdentity identity, FleetProvisioningState? provisioningState) + { + return ContainerServiceFleetData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, eTag: eTag, identity: identity, provisioningState: provisioningState, hubProfile: default); + } } } diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/AutoUpgradeProfileCollection.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/AutoUpgradeProfileCollection.cs new file mode 100644 index 000000000000..7cb39a39a567 --- /dev/null +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/AutoUpgradeProfileCollection.cs @@ -0,0 +1,497 @@ +// 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.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetAutoUpgradeProfiles method from an instance of . + /// + public partial class AutoUpgradeProfileCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _autoUpgradeProfileClientDiagnostics; + private readonly AutoUpgradeProfilesRestOperations _autoUpgradeProfileRestClient; + + /// Initializes a new instance of the class for mocking. + protected AutoUpgradeProfileCollection() + { + } + + /// 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 AutoUpgradeProfileCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _autoUpgradeProfileClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerServiceFleet", AutoUpgradeProfileResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(AutoUpgradeProfileResource.ResourceType, out string autoUpgradeProfileApiVersion); + _autoUpgradeProfileRestClient = new AutoUpgradeProfilesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, autoUpgradeProfileApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ContainerServiceFleetResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ContainerServiceFleetResource.ResourceType), nameof(id)); + } + + /// + /// Create a AutoUpgradeProfile + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/autoUpgradeProfiles/{autoUpgradeProfileName} + /// + /// + /// Operation Id + /// AutoUpgradeProfiles_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-05-02-preview + /// + /// + /// 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 AutoUpgradeProfile resource. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// 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 autoUpgradeProfileName, AutoUpgradeProfileData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(autoUpgradeProfileName, nameof(autoUpgradeProfileName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _autoUpgradeProfileClientDiagnostics.CreateScope("AutoUpgradeProfileCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _autoUpgradeProfileRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, autoUpgradeProfileName, data, ifMatch, ifNoneMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceFleetArmOperation(new AutoUpgradeProfileOperationSource(Client), _autoUpgradeProfileClientDiagnostics, Pipeline, _autoUpgradeProfileRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, autoUpgradeProfileName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a AutoUpgradeProfile + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/autoUpgradeProfiles/{autoUpgradeProfileName} + /// + /// + /// Operation Id + /// AutoUpgradeProfiles_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-05-02-preview + /// + /// + /// 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 AutoUpgradeProfile resource. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// 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 autoUpgradeProfileName, AutoUpgradeProfileData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(autoUpgradeProfileName, nameof(autoUpgradeProfileName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _autoUpgradeProfileClientDiagnostics.CreateScope("AutoUpgradeProfileCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _autoUpgradeProfileRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, autoUpgradeProfileName, data, ifMatch, ifNoneMatch, cancellationToken); + var operation = new ContainerServiceFleetArmOperation(new AutoUpgradeProfileOperationSource(Client), _autoUpgradeProfileClientDiagnostics, Pipeline, _autoUpgradeProfileRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, autoUpgradeProfileName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a AutoUpgradeProfile + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/autoUpgradeProfiles/{autoUpgradeProfileName} + /// + /// + /// Operation Id + /// AutoUpgradeProfiles_Get + /// + /// + /// Default Api Version + /// 2024-05-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the AutoUpgradeProfile 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 autoUpgradeProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(autoUpgradeProfileName, nameof(autoUpgradeProfileName)); + + using var scope = _autoUpgradeProfileClientDiagnostics.CreateScope("AutoUpgradeProfileCollection.Get"); + scope.Start(); + try + { + var response = await _autoUpgradeProfileRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, autoUpgradeProfileName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AutoUpgradeProfileResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a AutoUpgradeProfile + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/autoUpgradeProfiles/{autoUpgradeProfileName} + /// + /// + /// Operation Id + /// AutoUpgradeProfiles_Get + /// + /// + /// Default Api Version + /// 2024-05-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the AutoUpgradeProfile resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string autoUpgradeProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(autoUpgradeProfileName, nameof(autoUpgradeProfileName)); + + using var scope = _autoUpgradeProfileClientDiagnostics.CreateScope("AutoUpgradeProfileCollection.Get"); + scope.Start(); + try + { + var response = _autoUpgradeProfileRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, autoUpgradeProfileName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AutoUpgradeProfileResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List AutoUpgradeProfile resources by Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/autoUpgradeProfiles + /// + /// + /// Operation Id + /// AutoUpgradeProfiles_ListByFleet + /// + /// + /// Default Api Version + /// 2024-05-02-preview + /// + /// + /// 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) => _autoUpgradeProfileRestClient.CreateListByFleetRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _autoUpgradeProfileRestClient.CreateListByFleetNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AutoUpgradeProfileResource(Client, AutoUpgradeProfileData.DeserializeAutoUpgradeProfileData(e)), _autoUpgradeProfileClientDiagnostics, Pipeline, "AutoUpgradeProfileCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List AutoUpgradeProfile resources by Fleet + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/autoUpgradeProfiles + /// + /// + /// Operation Id + /// AutoUpgradeProfiles_ListByFleet + /// + /// + /// Default Api Version + /// 2024-05-02-preview + /// + /// + /// 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) => _autoUpgradeProfileRestClient.CreateListByFleetRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _autoUpgradeProfileRestClient.CreateListByFleetNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AutoUpgradeProfileResource(Client, AutoUpgradeProfileData.DeserializeAutoUpgradeProfileData(e)), _autoUpgradeProfileClientDiagnostics, Pipeline, "AutoUpgradeProfileCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/autoUpgradeProfiles/{autoUpgradeProfileName} + /// + /// + /// Operation Id + /// AutoUpgradeProfiles_Get + /// + /// + /// Default Api Version + /// 2024-05-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the AutoUpgradeProfile 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 autoUpgradeProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(autoUpgradeProfileName, nameof(autoUpgradeProfileName)); + + using var scope = _autoUpgradeProfileClientDiagnostics.CreateScope("AutoUpgradeProfileCollection.Exists"); + scope.Start(); + try + { + var response = await _autoUpgradeProfileRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, autoUpgradeProfileName, 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/fleets/{fleetName}/autoUpgradeProfiles/{autoUpgradeProfileName} + /// + /// + /// Operation Id + /// AutoUpgradeProfiles_Get + /// + /// + /// Default Api Version + /// 2024-05-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the AutoUpgradeProfile resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string autoUpgradeProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(autoUpgradeProfileName, nameof(autoUpgradeProfileName)); + + using var scope = _autoUpgradeProfileClientDiagnostics.CreateScope("AutoUpgradeProfileCollection.Exists"); + scope.Start(); + try + { + var response = _autoUpgradeProfileRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, autoUpgradeProfileName, 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/fleets/{fleetName}/autoUpgradeProfiles/{autoUpgradeProfileName} + /// + /// + /// Operation Id + /// AutoUpgradeProfiles_Get + /// + /// + /// Default Api Version + /// 2024-05-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the AutoUpgradeProfile 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 autoUpgradeProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(autoUpgradeProfileName, nameof(autoUpgradeProfileName)); + + using var scope = _autoUpgradeProfileClientDiagnostics.CreateScope("AutoUpgradeProfileCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _autoUpgradeProfileRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, autoUpgradeProfileName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AutoUpgradeProfileResource(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/fleets/{fleetName}/autoUpgradeProfiles/{autoUpgradeProfileName} + /// + /// + /// Operation Id + /// AutoUpgradeProfiles_Get + /// + /// + /// Default Api Version + /// 2024-05-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the AutoUpgradeProfile resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string autoUpgradeProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(autoUpgradeProfileName, nameof(autoUpgradeProfileName)); + + using var scope = _autoUpgradeProfileClientDiagnostics.CreateScope("AutoUpgradeProfileCollection.GetIfExists"); + scope.Start(); + try + { + var response = _autoUpgradeProfileRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, autoUpgradeProfileName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new AutoUpgradeProfileResource(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/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/AutoUpgradeProfileData.Serialization.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/AutoUpgradeProfileData.Serialization.cs new file mode 100644 index 000000000000..f6a643dbd6e6 --- /dev/null +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/AutoUpgradeProfileData.Serialization.cs @@ -0,0 +1,277 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.ContainerServiceFleet.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + public partial class AutoUpgradeProfileData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AutoUpgradeProfileData)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(ETag)) + { + writer.WritePropertyName("eTag"u8); + writer.WriteStringValue(ETag.Value.ToString()); + } + if (options.Format != "W") + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W") + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W") + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ResourceType); + } + if (options.Format != "W" && Optional.IsDefined(SystemData)) + { + writer.WritePropertyName("systemData"u8); + JsonSerializer.Serialize(writer, SystemData); + } + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(UpdateStrategyId)) + { + writer.WritePropertyName("updateStrategyId"u8); + writer.WriteStringValue(UpdateStrategyId); + } + if (Optional.IsDefined(Channel)) + { + writer.WritePropertyName("channel"u8); + writer.WriteStringValue(Channel.Value.ToString()); + } + if (Optional.IsDefined(NodeImageSelection)) + { + writer.WritePropertyName("nodeImageSelection"u8); + writer.WriteObjectValue(NodeImageSelection, options); + } + if (Optional.IsDefined(Disabled)) + { + writer.WritePropertyName("disabled"u8); + writer.WriteBooleanValue(Disabled.Value); + } + writer.WriteEndObject(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + AutoUpgradeProfileData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AutoUpgradeProfileData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAutoUpgradeProfileData(document.RootElement, options); + } + + internal static AutoUpgradeProfileData DeserializeAutoUpgradeProfileData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ETag? eTag = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + AutoUpgradeProfileProvisioningState? provisioningState = default; + ResourceIdentifier updateStrategyId = default; + UpgradeChannel? channel = default; + AutoUpgradeNodeImageSelection nodeImageSelection = default; + bool? disabled = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("eTag"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + eTag = new ETag(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new AutoUpgradeProfileProvisioningState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("updateStrategyId"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + updateStrategyId = new ResourceIdentifier(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("channel"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + channel = new UpgradeChannel(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("nodeImageSelection"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nodeImageSelection = AutoUpgradeNodeImageSelection.DeserializeAutoUpgradeNodeImageSelection(property0.Value, options); + continue; + } + if (property0.NameEquals("disabled"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + disabled = property0.Value.GetBoolean(); + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AutoUpgradeProfileData( + id, + name, + type, + systemData, + eTag, + provisioningState, + updateStrategyId, + channel, + nodeImageSelection, + disabled, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AutoUpgradeProfileData)} does not support writing '{options.Format}' format."); + } + } + + AutoUpgradeProfileData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAutoUpgradeProfileData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AutoUpgradeProfileData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/AutoUpgradeProfileData.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/AutoUpgradeProfileData.cs new file mode 100644 index 000000000000..dd6cb137735e --- /dev/null +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/AutoUpgradeProfileData.cs @@ -0,0 +1,115 @@ +// 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.ContainerServiceFleet.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + /// + /// A class representing the AutoUpgradeProfile data model. + /// The AutoUpgradeProfile resource. + /// + public partial class AutoUpgradeProfileData : 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 AutoUpgradeProfileData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// 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 AutoUpgradeProfile resource. + /// The resource id of the UpdateStrategy resource to reference. If not specified, the auto upgrade will run on all clusters which are members of the fleet. + /// Configures how auto-upgrade will be run. + /// The node image upgrade to be applied to the target clusters in auto upgrade. + /// + /// If set to False: the auto upgrade has effect - target managed clusters will be upgraded on schedule. + /// If set to True: the auto upgrade has no effect - no upgrade will be run on the target managed clusters. + /// This is a boolean and not an enum because enabled/disabled are all available states of the auto upgrade profile. + /// By default, this is set to False. + /// + /// Keeps track of any properties unknown to the library. + internal AutoUpgradeProfileData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ETag? eTag, AutoUpgradeProfileProvisioningState? provisioningState, ResourceIdentifier updateStrategyId, UpgradeChannel? channel, AutoUpgradeNodeImageSelection nodeImageSelection, bool? disabled, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + ETag = eTag; + ProvisioningState = provisioningState; + UpdateStrategyId = updateStrategyId; + Channel = channel; + NodeImageSelection = nodeImageSelection; + Disabled = disabled; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// 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. + public ETag? ETag { get; } + /// The provisioning state of the AutoUpgradeProfile resource. + public AutoUpgradeProfileProvisioningState? ProvisioningState { get; } + /// The resource id of the UpdateStrategy resource to reference. If not specified, the auto upgrade will run on all clusters which are members of the fleet. + public ResourceIdentifier UpdateStrategyId { get; set; } + /// Configures how auto-upgrade will be run. + public UpgradeChannel? Channel { get; set; } + /// The node image upgrade to be applied to the target clusters in auto upgrade. + internal AutoUpgradeNodeImageSelection NodeImageSelection { get; set; } + /// The node image upgrade type. + public AutoUpgradeNodeImageSelectionType? SelectionType + { + get => NodeImageSelection is null ? default(AutoUpgradeNodeImageSelectionType?) : NodeImageSelection.SelectionType; + set + { + NodeImageSelection = value.HasValue ? new AutoUpgradeNodeImageSelection(value.Value) : null; + } + } + + /// + /// If set to False: the auto upgrade has effect - target managed clusters will be upgraded on schedule. + /// If set to True: the auto upgrade has no effect - no upgrade will be run on the target managed clusters. + /// This is a boolean and not an enum because enabled/disabled are all available states of the auto upgrade profile. + /// By default, this is set to False. + /// + public bool? Disabled { get; set; } + } +} diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/AutoUpgradeProfileResource.Serialization.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/AutoUpgradeProfileResource.Serialization.cs new file mode 100644 index 000000000000..9df7a8401d6f --- /dev/null +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/AutoUpgradeProfileResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + public partial class AutoUpgradeProfileResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + AutoUpgradeProfileData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + AutoUpgradeProfileData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/AutoUpgradeProfileResource.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/AutoUpgradeProfileResource.cs new file mode 100644 index 000000000000..c5deec2cc26f --- /dev/null +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/AutoUpgradeProfileResource.cs @@ -0,0 +1,353 @@ +// 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.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + /// + /// A Class representing an AutoUpgradeProfile 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 GetAutoUpgradeProfileResource method. + /// Otherwise you can get one from its parent resource using the GetAutoUpgradeProfile method. + /// + public partial class AutoUpgradeProfileResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The fleetName. + /// The autoUpgradeProfileName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string autoUpgradeProfileName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/autoUpgradeProfiles/{autoUpgradeProfileName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _autoUpgradeProfileClientDiagnostics; + private readonly AutoUpgradeProfilesRestOperations _autoUpgradeProfileRestClient; + private readonly AutoUpgradeProfileData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.ContainerService/fleets/autoUpgradeProfiles"; + + /// Initializes a new instance of the class for mocking. + protected AutoUpgradeProfileResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal AutoUpgradeProfileResource(ArmClient client, AutoUpgradeProfileData 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 AutoUpgradeProfileResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _autoUpgradeProfileClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ContainerServiceFleet", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string autoUpgradeProfileApiVersion); + _autoUpgradeProfileRestClient = new AutoUpgradeProfilesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, autoUpgradeProfileApiVersion); +#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 AutoUpgradeProfileData 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)); + } + + /// + /// Get a AutoUpgradeProfile + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/autoUpgradeProfiles/{autoUpgradeProfileName} + /// + /// + /// Operation Id + /// AutoUpgradeProfiles_Get + /// + /// + /// Default Api Version + /// 2024-05-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _autoUpgradeProfileClientDiagnostics.CreateScope("AutoUpgradeProfileResource.Get"); + scope.Start(); + try + { + var response = await _autoUpgradeProfileRestClient.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 AutoUpgradeProfileResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a AutoUpgradeProfile + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/autoUpgradeProfiles/{autoUpgradeProfileName} + /// + /// + /// Operation Id + /// AutoUpgradeProfiles_Get + /// + /// + /// Default Api Version + /// 2024-05-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _autoUpgradeProfileClientDiagnostics.CreateScope("AutoUpgradeProfileResource.Get"); + scope.Start(); + try + { + var response = _autoUpgradeProfileRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new AutoUpgradeProfileResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a AutoUpgradeProfile + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/autoUpgradeProfiles/{autoUpgradeProfileName} + /// + /// + /// Operation Id + /// AutoUpgradeProfiles_Delete + /// + /// + /// Default Api Version + /// 2024-05-02-preview + /// + /// + /// 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 request should only proceed if an entity matches this string. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, string ifMatch = null, CancellationToken cancellationToken = default) + { + using var scope = _autoUpgradeProfileClientDiagnostics.CreateScope("AutoUpgradeProfileResource.Delete"); + scope.Start(); + try + { + var response = await _autoUpgradeProfileRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceFleetArmOperation(_autoUpgradeProfileClientDiagnostics, Pipeline, _autoUpgradeProfileRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a AutoUpgradeProfile + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/autoUpgradeProfiles/{autoUpgradeProfileName} + /// + /// + /// Operation Id + /// AutoUpgradeProfiles_Delete + /// + /// + /// Default Api Version + /// 2024-05-02-preview + /// + /// + /// 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 request should only proceed if an entity matches this string. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, string ifMatch = null, CancellationToken cancellationToken = default) + { + using var scope = _autoUpgradeProfileClientDiagnostics.CreateScope("AutoUpgradeProfileResource.Delete"); + scope.Start(); + try + { + var response = _autoUpgradeProfileRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch, cancellationToken); + var operation = new ContainerServiceFleetArmOperation(_autoUpgradeProfileClientDiagnostics, Pipeline, _autoUpgradeProfileRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a AutoUpgradeProfile + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/autoUpgradeProfiles/{autoUpgradeProfileName} + /// + /// + /// Operation Id + /// AutoUpgradeProfiles_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-05-02-preview + /// + /// + /// 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. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, AutoUpgradeProfileData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _autoUpgradeProfileClientDiagnostics.CreateScope("AutoUpgradeProfileResource.Update"); + scope.Start(); + try + { + var response = await _autoUpgradeProfileRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceFleetArmOperation(new AutoUpgradeProfileOperationSource(Client), _autoUpgradeProfileClientDiagnostics, Pipeline, _autoUpgradeProfileRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a AutoUpgradeProfile + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/autoUpgradeProfiles/{autoUpgradeProfileName} + /// + /// + /// Operation Id + /// AutoUpgradeProfiles_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-05-02-preview + /// + /// + /// 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. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, AutoUpgradeProfileData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _autoUpgradeProfileClientDiagnostics.CreateScope("AutoUpgradeProfileResource.Update"); + scope.Start(); + try + { + var response = _autoUpgradeProfileRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch, cancellationToken); + var operation = new ContainerServiceFleetArmOperation(new AutoUpgradeProfileOperationSource(Client), _autoUpgradeProfileClientDiagnostics, Pipeline, _autoUpgradeProfileRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetCollection.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetCollection.cs index 1c90020d7bf3..45c7429dcb9e 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetCollection.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -91,7 +91,7 @@ public virtual async Task> CreateOrU try { var response = await _containerServiceFleetFleetsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, fleetName, data, ifMatch, ifNoneMatch, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceFleetArmOperation(new ContainerServiceFleetOperationSource(Client), _containerServiceFleetFleetsClientDiagnostics, Pipeline, _containerServiceFleetFleetsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, fleetName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation, apiVersionOverrideValue: "2016-03-30"); + var operation = new ContainerServiceFleetArmOperation(new ContainerServiceFleetOperationSource(Client), _containerServiceFleetFleetsClientDiagnostics, Pipeline, _containerServiceFleetFleetsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, fleetName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -116,7 +116,7 @@ public virtual async Task> CreateOrU /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -142,7 +142,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUn try { var response = _containerServiceFleetFleetsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, fleetName, data, ifMatch, ifNoneMatch, cancellationToken); - var operation = new ContainerServiceFleetArmOperation(new ContainerServiceFleetOperationSource(Client), _containerServiceFleetFleetsClientDiagnostics, Pipeline, _containerServiceFleetFleetsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, fleetName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation, apiVersionOverrideValue: "2016-03-30"); + var operation = new ContainerServiceFleetArmOperation(new ContainerServiceFleetOperationSource(Client), _containerServiceFleetFleetsClientDiagnostics, Pipeline, _containerServiceFleetFleetsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, fleetName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -167,7 +167,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUn /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -212,7 +212,7 @@ public virtual async Task> GetAsync(stri /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -257,7 +257,7 @@ public virtual Response Get(string fleetName, Can /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -287,7 +287,7 @@ public virtual AsyncPageable GetAllAsync(Cancella /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -317,7 +317,7 @@ public virtual Pageable GetAll(CancellationToken /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -360,7 +360,7 @@ public virtual async Task> ExistsAsync(string fleetName, Cancella /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -403,7 +403,7 @@ public virtual Response Exists(string fleetName, CancellationToken cancell /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -448,7 +448,7 @@ public virtual async Task> GetIf /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetData.Serialization.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetData.Serialization.cs index e77d973b76c4..fb718ef7e963 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetData.Serialization.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetData.Serialization.cs @@ -78,6 +78,11 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea writer.WritePropertyName("provisioningState"u8); writer.WriteStringValue(ProvisioningState.Value.ToString()); } + if (Optional.IsDefined(HubProfile)) + { + writer.WritePropertyName("hubProfile"u8); + writer.WriteObjectValue(HubProfile, options); + } writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -126,6 +131,7 @@ internal static ContainerServiceFleetData DeserializeContainerServiceFleetData(J ResourceType type = default; SystemData systemData = default; FleetProvisioningState? provisioningState = default; + FleetHubProfile hubProfile = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -209,6 +215,15 @@ internal static ContainerServiceFleetData DeserializeContainerServiceFleetData(J provisioningState = new FleetProvisioningState(property0.Value.GetString()); continue; } + if (property0.NameEquals("hubProfile"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + hubProfile = FleetHubProfile.DeserializeFleetHubProfile(property0.Value, options); + continue; + } } continue; } @@ -228,6 +243,7 @@ internal static ContainerServiceFleetData DeserializeContainerServiceFleetData(J eTag, identity, provisioningState, + hubProfile, serializedAdditionalRawData); } diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetData.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetData.cs index 9bb52ac45394..f0f517e6dfcc 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetData.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetData.cs @@ -67,12 +67,14 @@ public ContainerServiceFleetData(AzureLocation location) : base(location) /// 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. /// Keeps track of any properties unknown to the library. - internal ContainerServiceFleetData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ETag? eTag, ManagedServiceIdentity identity, FleetProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal ContainerServiceFleetData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ETag? eTag, ManagedServiceIdentity identity, FleetProvisioningState? provisioningState, FleetHubProfile hubProfile, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { ETag = eTag; Identity = identity; ProvisioningState = provisioningState; + HubProfile = hubProfile; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -87,5 +89,7 @@ internal ContainerServiceFleetData() public ManagedServiceIdentity Identity { get; set; } /// The status of the last operation. public FleetProvisioningState? ProvisioningState { get; } + /// The FleetHubProfile configures the Fleet's hub. + public FleetHubProfile HubProfile { get; set; } } } diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetMemberCollection.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetMemberCollection.cs index cc491e0f95ab..b7aea330dc85 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetMemberCollection.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetMemberCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -90,7 +90,7 @@ public virtual async Task> Cre try { var response = await _containerServiceFleetMemberFleetMembersRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetMemberName, data, ifMatch, ifNoneMatch, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceFleetArmOperation(new ContainerServiceFleetMemberOperationSource(Client), _containerServiceFleetMemberFleetMembersClientDiagnostics, Pipeline, _containerServiceFleetMemberFleetMembersRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetMemberName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation, apiVersionOverrideValue: "2016-03-30"); + var operation = new ContainerServiceFleetArmOperation(new ContainerServiceFleetMemberOperationSource(Client), _containerServiceFleetMemberFleetMembersClientDiagnostics, Pipeline, _containerServiceFleetMemberFleetMembersRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetMemberName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -115,7 +115,7 @@ public virtual async Task> Cre /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -141,7 +141,7 @@ public virtual ArmOperation CreateOrUpdate( try { var response = _containerServiceFleetMemberFleetMembersRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetMemberName, data, ifMatch, ifNoneMatch, cancellationToken); - var operation = new ContainerServiceFleetArmOperation(new ContainerServiceFleetMemberOperationSource(Client), _containerServiceFleetMemberFleetMembersClientDiagnostics, Pipeline, _containerServiceFleetMemberFleetMembersRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetMemberName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation, apiVersionOverrideValue: "2016-03-30"); + var operation = new ContainerServiceFleetArmOperation(new ContainerServiceFleetMemberOperationSource(Client), _containerServiceFleetMemberFleetMembersClientDiagnostics, Pipeline, _containerServiceFleetMemberFleetMembersRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetMemberName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -166,7 +166,7 @@ public virtual ArmOperation CreateOrUpdate( /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -211,7 +211,7 @@ public virtual async Task> GetAsyn /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -256,7 +256,7 @@ public virtual Response Get(string fleetMem /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -286,7 +286,7 @@ public virtual AsyncPageable GetAllAsync(Ca /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -316,7 +316,7 @@ public virtual Pageable GetAll(Cancellation /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -359,7 +359,7 @@ public virtual async Task> ExistsAsync(string fleetMemberName, Ca /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -402,7 +402,7 @@ public virtual Response Exists(string fleetMemberName, CancellationToken c /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -447,7 +447,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetMemberResource.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetMemberResource.cs index ad605737e361..e0683ad16deb 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetMemberResource.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetMemberResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsyn /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationTok /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -200,7 +200,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, string try { var response = await _containerServiceFleetMemberFleetMembersRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceFleetArmOperation(_containerServiceFleetMemberFleetMembersClientDiagnostics, Pipeline, _containerServiceFleetMemberFleetMembersRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2016-03-30"); + var operation = new ContainerServiceFleetArmOperation(_containerServiceFleetMemberFleetMembersClientDiagnostics, Pipeline, _containerServiceFleetMemberFleetMembersRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, string /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -243,7 +243,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, string ifMatch = null, C try { var response = _containerServiceFleetMemberFleetMembersRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch, cancellationToken); - var operation = new ContainerServiceFleetArmOperation(_containerServiceFleetMemberFleetMembersClientDiagnostics, Pipeline, _containerServiceFleetMemberFleetMembersRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2016-03-30"); + var operation = new ContainerServiceFleetArmOperation(_containerServiceFleetMemberFleetMembersClientDiagnostics, Pipeline, _containerServiceFleetMemberFleetMembersRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -268,7 +268,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, string ifMatch = null, C /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -290,7 +290,7 @@ public virtual async Task> Upd try { var response = await _containerServiceFleetMemberFleetMembersRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, ifMatch, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceFleetArmOperation(new ContainerServiceFleetMemberOperationSource(Client), _containerServiceFleetMemberFleetMembersClientDiagnostics, Pipeline, _containerServiceFleetMemberFleetMembersRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, ifMatch).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2016-03-30"); + var operation = new ContainerServiceFleetArmOperation(new ContainerServiceFleetMemberOperationSource(Client), _containerServiceFleetMemberFleetMembersClientDiagnostics, Pipeline, _containerServiceFleetMemberFleetMembersRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, ifMatch).Request, response, OperationFinalStateVia.OriginalUri); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -315,7 +315,7 @@ public virtual async Task> Upd /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -337,7 +337,7 @@ public virtual ArmOperation Update(WaitUnti try { var response = _containerServiceFleetMemberFleetMembersRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, ifMatch, cancellationToken); - var operation = new ContainerServiceFleetArmOperation(new ContainerServiceFleetMemberOperationSource(Client), _containerServiceFleetMemberFleetMembersClientDiagnostics, Pipeline, _containerServiceFleetMemberFleetMembersRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, ifMatch).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2016-03-30"); + var operation = new ContainerServiceFleetArmOperation(new ContainerServiceFleetMemberOperationSource(Client), _containerServiceFleetMemberFleetMembersClientDiagnostics, Pipeline, _containerServiceFleetMemberFleetMembersRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, ifMatch).Request, response, OperationFinalStateVia.OriginalUri); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetResource.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetResource.cs index aee0906c7577..99c0fb94def0 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetResource.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetResource.cs @@ -90,6 +90,75 @@ internal static void ValidateResourceId(ResourceIdentifier id) throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); } + /// Gets a collection of AutoUpgradeProfileResources in the ContainerServiceFleet. + /// An object representing collection of AutoUpgradeProfileResources and their operations over a AutoUpgradeProfileResource. + public virtual AutoUpgradeProfileCollection GetAutoUpgradeProfiles() + { + return GetCachedClient(client => new AutoUpgradeProfileCollection(client, Id)); + } + + /// + /// Get a AutoUpgradeProfile + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/autoUpgradeProfiles/{autoUpgradeProfileName} + /// + /// + /// Operation Id + /// AutoUpgradeProfiles_Get + /// + /// + /// Default Api Version + /// 2024-05-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the AutoUpgradeProfile resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetAutoUpgradeProfileAsync(string autoUpgradeProfileName, CancellationToken cancellationToken = default) + { + return await GetAutoUpgradeProfiles().GetAsync(autoUpgradeProfileName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a AutoUpgradeProfile + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/autoUpgradeProfiles/{autoUpgradeProfileName} + /// + /// + /// Operation Id + /// AutoUpgradeProfiles_Get + /// + /// + /// Default Api Version + /// 2024-05-02-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the AutoUpgradeProfile resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetAutoUpgradeProfile(string autoUpgradeProfileName, CancellationToken cancellationToken = default) + { + return GetAutoUpgradeProfiles().Get(autoUpgradeProfileName, cancellationToken); + } + /// Gets a collection of ContainerServiceFleetMemberResources in the ContainerServiceFleet. /// An object representing collection of ContainerServiceFleetMemberResources and their operations over a ContainerServiceFleetMemberResource. public virtual ContainerServiceFleetMemberCollection GetContainerServiceFleetMembers() @@ -110,7 +179,7 @@ public virtual ContainerServiceFleetMemberCollection GetContainerServiceFleetMem /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -141,7 +210,7 @@ public virtual async Task> GetCont /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -179,7 +248,7 @@ public virtual ContainerServiceFleetUpdateRunCollection GetContainerServiceFleet /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -210,7 +279,7 @@ public virtual async Task> GetC /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -248,7 +317,7 @@ public virtual FleetUpdateStrategyCollection GetFleetUpdateStrategies() /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -279,7 +348,7 @@ public virtual async Task> GetFleetUpdateS /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -310,7 +379,7 @@ public virtual Response GetFleetUpdateStrategy(stri /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -350,7 +419,7 @@ public virtual async Task> GetAsync(Canc /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -390,7 +459,7 @@ public virtual Response Get(CancellationToken can /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -408,7 +477,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, string try { var response = await _containerServiceFleetFleetsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, ifMatch, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceFleetArmOperation(_containerServiceFleetFleetsClientDiagnostics, Pipeline, _containerServiceFleetFleetsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2016-03-30"); + var operation = new ContainerServiceFleetArmOperation(_containerServiceFleetFleetsClientDiagnostics, Pipeline, _containerServiceFleetFleetsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -433,7 +502,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, string /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -451,7 +520,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, string ifMatch = null, C try { var response = _containerServiceFleetFleetsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, ifMatch, cancellationToken); - var operation = new ContainerServiceFleetArmOperation(_containerServiceFleetFleetsClientDiagnostics, Pipeline, _containerServiceFleetFleetsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2016-03-30"); + var operation = new ContainerServiceFleetArmOperation(_containerServiceFleetFleetsClientDiagnostics, Pipeline, _containerServiceFleetFleetsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -476,7 +545,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, string ifMatch = null, C /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -498,7 +567,7 @@ public virtual async Task> UpdateAsy try { var response = await _containerServiceFleetFleetsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, ifMatch, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceFleetArmOperation(new ContainerServiceFleetOperationSource(Client), _containerServiceFleetFleetsClientDiagnostics, Pipeline, _containerServiceFleetFleetsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, ifMatch).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2016-03-30"); + var operation = new ContainerServiceFleetArmOperation(new ContainerServiceFleetOperationSource(Client), _containerServiceFleetFleetsClientDiagnostics, Pipeline, _containerServiceFleetFleetsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, ifMatch).Request, response, OperationFinalStateVia.OriginalUri); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -523,7 +592,7 @@ public virtual async Task> UpdateAsy /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -545,7 +614,7 @@ public virtual ArmOperation Update(WaitUntil wait try { var response = _containerServiceFleetFleetsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, ifMatch, cancellationToken); - var operation = new ContainerServiceFleetArmOperation(new ContainerServiceFleetOperationSource(Client), _containerServiceFleetFleetsClientDiagnostics, Pipeline, _containerServiceFleetFleetsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, ifMatch).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2016-03-30"); + var operation = new ContainerServiceFleetArmOperation(new ContainerServiceFleetOperationSource(Client), _containerServiceFleetFleetsClientDiagnostics, Pipeline, _containerServiceFleetFleetsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, ifMatch).Request, response, OperationFinalStateVia.OriginalUri); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -570,7 +639,7 @@ public virtual ArmOperation Update(WaitUntil wait /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -608,7 +677,7 @@ public virtual async Task> GetCredentialsAsync( /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -646,7 +715,7 @@ public virtual Response GetCredentials(CancellationToken /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -708,7 +777,7 @@ public virtual async Task> AddTagAsync(s /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -770,7 +839,7 @@ public virtual Response AddTag(string key, string /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -827,7 +896,7 @@ public virtual async Task> SetTagsAsync( /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -884,7 +953,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -944,7 +1013,7 @@ public virtual async Task> RemoveTagAsyn /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetUpdateRunCollection.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetUpdateRunCollection.cs index b9ea5fa9a816..7a27bc475f7f 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetUpdateRunCollection.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetUpdateRunCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -90,7 +90,7 @@ public virtual async Task> try { var response = await _containerServiceFleetUpdateRunUpdateRunsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateRunName, data, ifMatch, ifNoneMatch, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceFleetArmOperation(new ContainerServiceFleetUpdateRunOperationSource(Client), _containerServiceFleetUpdateRunUpdateRunsClientDiagnostics, Pipeline, _containerServiceFleetUpdateRunUpdateRunsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateRunName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation, apiVersionOverrideValue: "2016-03-30"); + var operation = new ContainerServiceFleetArmOperation(new ContainerServiceFleetUpdateRunOperationSource(Client), _containerServiceFleetUpdateRunUpdateRunsClientDiagnostics, Pipeline, _containerServiceFleetUpdateRunUpdateRunsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateRunName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -115,7 +115,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -141,7 +141,7 @@ public virtual ArmOperation CreateOrUpda try { var response = _containerServiceFleetUpdateRunUpdateRunsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateRunName, data, ifMatch, ifNoneMatch, cancellationToken); - var operation = new ContainerServiceFleetArmOperation(new ContainerServiceFleetUpdateRunOperationSource(Client), _containerServiceFleetUpdateRunUpdateRunsClientDiagnostics, Pipeline, _containerServiceFleetUpdateRunUpdateRunsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateRunName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation, apiVersionOverrideValue: "2016-03-30"); + var operation = new ContainerServiceFleetArmOperation(new ContainerServiceFleetUpdateRunOperationSource(Client), _containerServiceFleetUpdateRunUpdateRunsClientDiagnostics, Pipeline, _containerServiceFleetUpdateRunUpdateRunsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateRunName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -166,7 +166,7 @@ public virtual ArmOperation CreateOrUpda /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -211,7 +211,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -256,7 +256,7 @@ public virtual Response Get(string updat /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -286,7 +286,7 @@ public virtual AsyncPageable GetAllAsync /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -316,7 +316,7 @@ public virtual Pageable GetAll(Cancellat /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -359,7 +359,7 @@ public virtual async Task> ExistsAsync(string updateRunName, Canc /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -402,7 +402,7 @@ public virtual Response Exists(string updateRunName, CancellationToken can /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -447,7 +447,7 @@ public virtual async Task /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetUpdateRunResource.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetUpdateRunResource.cs index 55d15c849262..33bf088be5ef 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetUpdateRunResource.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/ContainerServiceFleetUpdateRunResource.cs @@ -11,6 +11,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager.ContainerServiceFleet.Models; namespace Azure.ResourceManager.ContainerServiceFleet { @@ -101,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -141,7 +142,7 @@ public virtual async Task> GetA /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -181,7 +182,7 @@ public virtual Response Get(Cancellation /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -199,7 +200,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, string try { var response = await _containerServiceFleetUpdateRunUpdateRunsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceFleetArmOperation(_containerServiceFleetUpdateRunUpdateRunsClientDiagnostics, Pipeline, _containerServiceFleetUpdateRunUpdateRunsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2016-03-30"); + var operation = new ContainerServiceFleetArmOperation(_containerServiceFleetUpdateRunUpdateRunsClientDiagnostics, Pipeline, _containerServiceFleetUpdateRunUpdateRunsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -224,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, string /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -242,7 +243,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, string ifMatch = null, C try { var response = _containerServiceFleetUpdateRunUpdateRunsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch, cancellationToken); - var operation = new ContainerServiceFleetArmOperation(_containerServiceFleetUpdateRunUpdateRunsClientDiagnostics, Pipeline, _containerServiceFleetUpdateRunUpdateRunsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location, apiVersionOverrideValue: "2016-03-30"); + var operation = new ContainerServiceFleetArmOperation(_containerServiceFleetUpdateRunUpdateRunsClientDiagnostics, Pipeline, _containerServiceFleetUpdateRunUpdateRunsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -267,7 +268,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, string ifMatch = null, C /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -290,7 +291,7 @@ public virtual async Task> try { var response = await _containerServiceFleetUpdateRunUpdateRunsRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceFleetArmOperation(new ContainerServiceFleetUpdateRunOperationSource(Client), _containerServiceFleetUpdateRunUpdateRunsClientDiagnostics, Pipeline, _containerServiceFleetUpdateRunUpdateRunsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation, apiVersionOverrideValue: "2016-03-30"); + var operation = new ContainerServiceFleetArmOperation(new ContainerServiceFleetUpdateRunOperationSource(Client), _containerServiceFleetUpdateRunUpdateRunsClientDiagnostics, Pipeline, _containerServiceFleetUpdateRunUpdateRunsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -315,7 +316,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -338,7 +339,101 @@ public virtual ArmOperation Update(WaitU try { var response = _containerServiceFleetUpdateRunUpdateRunsRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch, cancellationToken); - var operation = new ContainerServiceFleetArmOperation(new ContainerServiceFleetUpdateRunOperationSource(Client), _containerServiceFleetUpdateRunUpdateRunsClientDiagnostics, Pipeline, _containerServiceFleetUpdateRunUpdateRunsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation, apiVersionOverrideValue: "2016-03-30"); + var operation = new ContainerServiceFleetArmOperation(new ContainerServiceFleetUpdateRunOperationSource(Client), _containerServiceFleetUpdateRunUpdateRunsClientDiagnostics, Pipeline, _containerServiceFleetUpdateRunUpdateRunsRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Skips one or a combination of member/group/stage/afterStageWait(s) of an update run. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns/{updateRunName}/skip + /// + /// + /// Operation Id + /// UpdateRuns_Skip + /// + /// + /// Default Api Version + /// 2024-05-02-preview + /// + /// + /// 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 content of the action request. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + /// is null. + public virtual async Task> SkipAsync(WaitUntil waitUntil, SkipProperties body, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _containerServiceFleetUpdateRunUpdateRunsClientDiagnostics.CreateScope("ContainerServiceFleetUpdateRunResource.Skip"); + scope.Start(); + try + { + var response = await _containerServiceFleetUpdateRunUpdateRunsRestClient.SkipAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body, ifMatch, cancellationToken).ConfigureAwait(false); + var operation = new ContainerServiceFleetArmOperation(new ContainerServiceFleetUpdateRunOperationSource(Client), _containerServiceFleetUpdateRunUpdateRunsClientDiagnostics, Pipeline, _containerServiceFleetUpdateRunUpdateRunsRestClient.CreateSkipRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body, ifMatch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Skips one or a combination of member/group/stage/afterStageWait(s) of an update run. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/fleets/{fleetName}/updateRuns/{updateRunName}/skip + /// + /// + /// Operation Id + /// UpdateRuns_Skip + /// + /// + /// Default Api Version + /// 2024-05-02-preview + /// + /// + /// 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 content of the action request. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Skip(WaitUntil waitUntil, SkipProperties body, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _containerServiceFleetUpdateRunUpdateRunsClientDiagnostics.CreateScope("ContainerServiceFleetUpdateRunResource.Skip"); + scope.Start(); + try + { + var response = _containerServiceFleetUpdateRunUpdateRunsRestClient.Skip(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body, ifMatch, cancellationToken); + var operation = new ContainerServiceFleetArmOperation(new ContainerServiceFleetUpdateRunOperationSource(Client), _containerServiceFleetUpdateRunUpdateRunsClientDiagnostics, Pipeline, _containerServiceFleetUpdateRunUpdateRunsRestClient.CreateSkipRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body, ifMatch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -363,7 +458,7 @@ public virtual ArmOperation Update(WaitU /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -406,7 +501,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -449,7 +544,7 @@ public virtual ArmOperation Start(WaitUn /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -492,7 +587,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/ContainerServiceFleetExtensions.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/ContainerServiceFleetExtensions.cs index d9a0ffd01eef..24943cf4b275 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/ContainerServiceFleetExtensions.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/ContainerServiceFleetExtensions.cs @@ -51,6 +51,25 @@ public static ContainerServiceFleetResource GetContainerServiceFleetResource(thi return GetMockableContainerServiceFleetArmClient(client).GetContainerServiceFleetResource(id); } + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static AutoUpgradeProfileResource GetAutoUpgradeProfileResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableContainerServiceFleetArmClient(client).GetAutoUpgradeProfileResource(id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -138,7 +157,7 @@ public static ContainerServiceFleetCollection GetContainerServiceFleets(this Res /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -176,7 +195,7 @@ public static async Task> GetContainerSe /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -214,7 +233,7 @@ public static Response GetContainerServiceFleet(t /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -250,7 +269,7 @@ public static AsyncPageable GetContainerServiceFl /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/MockableContainerServiceFleetArmClient.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/MockableContainerServiceFleetArmClient.cs index 1086484e53e7..5c5c50847abc 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/MockableContainerServiceFleetArmClient.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/MockableContainerServiceFleetArmClient.cs @@ -46,6 +46,18 @@ public virtual ContainerServiceFleetResource GetContainerServiceFleetResource(Re return new ContainerServiceFleetResource(Client, id); } + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual AutoUpgradeProfileResource GetAutoUpgradeProfileResource(ResourceIdentifier id) + { + AutoUpgradeProfileResource.ValidateResourceId(id); + return new AutoUpgradeProfileResource(Client, id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/MockableContainerServiceFleetResourceGroupResource.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/MockableContainerServiceFleetResourceGroupResource.cs index b6ed73a891cb..d9814eb3b8ce 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/MockableContainerServiceFleetResourceGroupResource.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/MockableContainerServiceFleetResourceGroupResource.cs @@ -53,7 +53,7 @@ public virtual ContainerServiceFleetCollection GetContainerServiceFleets() /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -84,7 +84,7 @@ public virtual async Task> GetContainerS /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/MockableContainerServiceFleetSubscriptionResource.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/MockableContainerServiceFleetSubscriptionResource.cs index 0f67a4240bde..07c4f8c9ad37 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/MockableContainerServiceFleetSubscriptionResource.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Extensions/MockableContainerServiceFleetSubscriptionResource.cs @@ -52,7 +52,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -82,7 +82,7 @@ public virtual AsyncPageable GetContainerServiceF /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetUpdateStrategyCollection.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetUpdateStrategyCollection.cs index 2a83c649eb5c..2f843c53b7a6 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetUpdateStrategyCollection.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetUpdateStrategyCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -90,7 +90,7 @@ public virtual async Task> CreateOrUpd try { var response = await _fleetUpdateStrategyRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateStrategyName, data, ifMatch, ifNoneMatch, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceFleetArmOperation(new FleetUpdateStrategyOperationSource(Client), _fleetUpdateStrategyClientDiagnostics, Pipeline, _fleetUpdateStrategyRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateStrategyName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation, apiVersionOverrideValue: "2016-03-30"); + var operation = new ContainerServiceFleetArmOperation(new FleetUpdateStrategyOperationSource(Client), _fleetUpdateStrategyClientDiagnostics, Pipeline, _fleetUpdateStrategyRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateStrategyName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -115,7 +115,7 @@ public virtual async Task> CreateOrUpd /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -141,7 +141,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUnti try { var response = _fleetUpdateStrategyRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateStrategyName, data, ifMatch, ifNoneMatch, cancellationToken); - var operation = new ContainerServiceFleetArmOperation(new FleetUpdateStrategyOperationSource(Client), _fleetUpdateStrategyClientDiagnostics, Pipeline, _fleetUpdateStrategyRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateStrategyName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation, apiVersionOverrideValue: "2016-03-30"); + var operation = new ContainerServiceFleetArmOperation(new FleetUpdateStrategyOperationSource(Client), _fleetUpdateStrategyClientDiagnostics, Pipeline, _fleetUpdateStrategyRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, updateStrategyName, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -166,7 +166,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUnti /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -211,7 +211,7 @@ public virtual async Task> GetAsync(string /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -256,7 +256,7 @@ public virtual Response Get(string updateStrategyNa /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -286,7 +286,7 @@ public virtual AsyncPageable GetAllAsync(Cancellati /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -316,7 +316,7 @@ public virtual Pageable GetAll(CancellationToken ca /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -359,7 +359,7 @@ public virtual async Task> ExistsAsync(string updateStrategyName, /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -402,7 +402,7 @@ public virtual Response Exists(string updateStrategyName, CancellationToke /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -447,7 +447,7 @@ public virtual async Task> GetIfEx /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetUpdateStrategyResource.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetUpdateStrategyResource.cs index 129ce7354cd5..21c4315ecf1d 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetUpdateStrategyResource.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/FleetUpdateStrategyResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsync(Cancel /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(CancellationToken cance /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -199,7 +199,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, string try { var response = await _fleetUpdateStrategyRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceFleetArmOperation(_fleetUpdateStrategyClientDiagnostics, Pipeline, _fleetUpdateStrategyRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation, apiVersionOverrideValue: "2016-03-30"); + var operation = new ContainerServiceFleetArmOperation(_fleetUpdateStrategyClientDiagnostics, Pipeline, _fleetUpdateStrategyRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, string /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -242,7 +242,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, string ifMatch = null, C try { var response = _fleetUpdateStrategyRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch, cancellationToken); - var operation = new ContainerServiceFleetArmOperation(_fleetUpdateStrategyClientDiagnostics, Pipeline, _fleetUpdateStrategyRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation, apiVersionOverrideValue: "2016-03-30"); + var operation = new ContainerServiceFleetArmOperation(_fleetUpdateStrategyClientDiagnostics, Pipeline, _fleetUpdateStrategyRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, ifMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -267,7 +267,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, string ifMatch = null, C /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -290,7 +290,7 @@ public virtual async Task> UpdateAsync try { var response = await _fleetUpdateStrategyRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch, cancellationToken).ConfigureAwait(false); - var operation = new ContainerServiceFleetArmOperation(new FleetUpdateStrategyOperationSource(Client), _fleetUpdateStrategyClientDiagnostics, Pipeline, _fleetUpdateStrategyRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation, apiVersionOverrideValue: "2016-03-30"); + var operation = new ContainerServiceFleetArmOperation(new FleetUpdateStrategyOperationSource(Client), _fleetUpdateStrategyClientDiagnostics, Pipeline, _fleetUpdateStrategyRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -315,7 +315,7 @@ public virtual async Task> UpdateAsync /// /// /// Default Api Version - /// 2023-10-15 + /// 2024-05-02-preview /// /// /// Resource @@ -338,7 +338,7 @@ public virtual ArmOperation Update(WaitUntil waitUn try { var response = _fleetUpdateStrategyRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch, cancellationToken); - var operation = new ContainerServiceFleetArmOperation(new FleetUpdateStrategyOperationSource(Client), _fleetUpdateStrategyClientDiagnostics, Pipeline, _fleetUpdateStrategyRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation, apiVersionOverrideValue: "2016-03-30"); + var operation = new ContainerServiceFleetArmOperation(new FleetUpdateStrategyOperationSource(Client), _fleetUpdateStrategyClientDiagnostics, Pipeline, _fleetUpdateStrategyRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, ifMatch, ifNoneMatch).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/LongRunningOperation/AutoUpgradeProfileOperationSource.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/LongRunningOperation/AutoUpgradeProfileOperationSource.cs new file mode 100644 index 000000000000..dd07739754de --- /dev/null +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/LongRunningOperation/AutoUpgradeProfileOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + internal class AutoUpgradeProfileOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal AutoUpgradeProfileOperationSource(ArmClient client) + { + _client = client; + } + + AutoUpgradeProfileResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = AutoUpgradeProfileData.DeserializeAutoUpgradeProfileData(document.RootElement); + return new AutoUpgradeProfileResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = AutoUpgradeProfileData.DeserializeAutoUpgradeProfileData(document.RootElement); + return new AutoUpgradeProfileResource(_client, data); + } + } +} diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeNodeImageSelection.Serialization.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeNodeImageSelection.Serialization.cs new file mode 100644 index 000000000000..bed2d49f2d6b --- /dev/null +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeNodeImageSelection.Serialization.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + internal partial class AutoUpgradeNodeImageSelection : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AutoUpgradeNodeImageSelection)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("type"u8); + writer.WriteStringValue(SelectionType.ToString()); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + AutoUpgradeNodeImageSelection IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AutoUpgradeNodeImageSelection)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAutoUpgradeNodeImageSelection(document.RootElement, options); + } + + internal static AutoUpgradeNodeImageSelection DeserializeAutoUpgradeNodeImageSelection(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AutoUpgradeNodeImageSelectionType type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = new AutoUpgradeNodeImageSelectionType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AutoUpgradeNodeImageSelection(type, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AutoUpgradeNodeImageSelection)} does not support writing '{options.Format}' format."); + } + } + + AutoUpgradeNodeImageSelection IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAutoUpgradeNodeImageSelection(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AutoUpgradeNodeImageSelection)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeNodeImageSelection.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeNodeImageSelection.cs new file mode 100644 index 000000000000..e6f06b116162 --- /dev/null +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeNodeImageSelection.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// The node image upgrade to be applied to the target clusters in auto upgrade. + internal partial class AutoUpgradeNodeImageSelection + { + /// + /// 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 node image upgrade type. + public AutoUpgradeNodeImageSelection(AutoUpgradeNodeImageSelectionType selectionType) + { + SelectionType = selectionType; + } + + /// Initializes a new instance of . + /// The node image upgrade type. + /// Keeps track of any properties unknown to the library. + internal AutoUpgradeNodeImageSelection(AutoUpgradeNodeImageSelectionType selectionType, IDictionary serializedAdditionalRawData) + { + SelectionType = selectionType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AutoUpgradeNodeImageSelection() + { + } + + /// The node image upgrade type. + public AutoUpgradeNodeImageSelectionType SelectionType { get; set; } + } +} diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeNodeImageSelectionType.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeNodeImageSelectionType.cs new file mode 100644 index 000000000000..8e0faa9dbe54 --- /dev/null +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeNodeImageSelectionType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// The node image upgrade type. + public readonly partial struct AutoUpgradeNodeImageSelectionType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AutoUpgradeNodeImageSelectionType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string LatestValue = "Latest"; + private const string ConsistentValue = "Consistent"; + + /// Use the latest image version when upgrading nodes. Clusters may use different image versions (e.g., 'AKSUbuntu-1804gen2containerd-2021.10.12' and 'AKSUbuntu-1804gen2containerd-2021.10.19') because, for example, the latest available version is different in different regions. + public static AutoUpgradeNodeImageSelectionType Latest { get; } = new AutoUpgradeNodeImageSelectionType(LatestValue); + /// The image versions to upgrade nodes to are selected as described below: for each node pool in managed clusters affected by the update run, the system selects the latest image version such that it is available across all other node pools (in all other clusters) of the same image type. As a result, all node pools of the same image type will be upgraded to the same image version. For example, if the latest image version for image type 'AKSUbuntu-1804gen2containerd' is 'AKSUbuntu-1804gen2containerd-2021.10.12' for a node pool in cluster A in region X, and is 'AKSUbuntu-1804gen2containerd-2021.10.17' for a node pool in cluster B in region Y, the system will upgrade both node pools to image version 'AKSUbuntu-1804gen2containerd-2021.10.12'. + public static AutoUpgradeNodeImageSelectionType Consistent { get; } = new AutoUpgradeNodeImageSelectionType(ConsistentValue); + /// Determines if two values are the same. + public static bool operator ==(AutoUpgradeNodeImageSelectionType left, AutoUpgradeNodeImageSelectionType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AutoUpgradeNodeImageSelectionType left, AutoUpgradeNodeImageSelectionType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AutoUpgradeNodeImageSelectionType(string value) => new AutoUpgradeNodeImageSelectionType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AutoUpgradeNodeImageSelectionType other && Equals(other); + /// + public bool Equals(AutoUpgradeNodeImageSelectionType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeProfileListResult.Serialization.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeProfileListResult.Serialization.cs new file mode 100644 index 000000000000..6947ea1d5096 --- /dev/null +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeProfileListResult.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + internal partial class AutoUpgradeProfileListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AutoUpgradeProfileListResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + AutoUpgradeProfileListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AutoUpgradeProfileListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAutoUpgradeProfileListResult(document.RootElement, options); + } + + internal static AutoUpgradeProfileListResult DeserializeAutoUpgradeProfileListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AutoUpgradeProfileData.DeserializeAutoUpgradeProfileData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AutoUpgradeProfileListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AutoUpgradeProfileListResult)} does not support writing '{options.Format}' format."); + } + } + + AutoUpgradeProfileListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeAutoUpgradeProfileListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AutoUpgradeProfileListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeProfileListResult.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeProfileListResult.cs new file mode 100644 index 000000000000..fafd94282b79 --- /dev/null +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeProfileListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// The response of a AutoUpgradeProfile list operation. + internal partial class AutoUpgradeProfileListResult + { + /// + /// 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 AutoUpgradeProfile items on this page. + /// is null. + internal AutoUpgradeProfileListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The AutoUpgradeProfile items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal AutoUpgradeProfileListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AutoUpgradeProfileListResult() + { + } + + /// The AutoUpgradeProfile items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeProfileProvisioningState.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeProfileProvisioningState.cs new file mode 100644 index 000000000000..2cb2c37c36cc --- /dev/null +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/AutoUpgradeProfileProvisioningState.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// The provisioning state of the AutoUpgradeProfile resource. + public readonly partial struct AutoUpgradeProfileProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AutoUpgradeProfileProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + + /// Resource has been created. + public static AutoUpgradeProfileProvisioningState Succeeded { get; } = new AutoUpgradeProfileProvisioningState(SucceededValue); + /// Resource creation failed. + public static AutoUpgradeProfileProvisioningState Failed { get; } = new AutoUpgradeProfileProvisioningState(FailedValue); + /// Resource creation was canceled. + public static AutoUpgradeProfileProvisioningState Canceled { get; } = new AutoUpgradeProfileProvisioningState(CanceledValue); + /// Determines if two values are the same. + public static bool operator ==(AutoUpgradeProfileProvisioningState left, AutoUpgradeProfileProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AutoUpgradeProfileProvisioningState left, AutoUpgradeProfileProvisioningState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AutoUpgradeProfileProvisioningState(string value) => new AutoUpgradeProfileProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AutoUpgradeProfileProvisioningState other && Equals(other); + /// + public bool Equals(AutoUpgradeProfileProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ContainerServiceFleetAPIServerAccessProfile.Serialization.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ContainerServiceFleetAPIServerAccessProfile.Serialization.cs new file mode 100644 index 000000000000..8ad942187201 --- /dev/null +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ContainerServiceFleetAPIServerAccessProfile.Serialization.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + public partial class ContainerServiceFleetAPIServerAccessProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerServiceFleetAPIServerAccessProfile)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(EnablePrivateCluster)) + { + writer.WritePropertyName("enablePrivateCluster"u8); + writer.WriteBooleanValue(EnablePrivateCluster.Value); + } + if (Optional.IsDefined(EnableVnetIntegration)) + { + writer.WritePropertyName("enableVnetIntegration"u8); + writer.WriteBooleanValue(EnableVnetIntegration.Value); + } + if (Optional.IsDefined(SubnetId)) + { + writer.WritePropertyName("subnetId"u8); + writer.WriteStringValue(SubnetId); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ContainerServiceFleetAPIServerAccessProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerServiceFleetAPIServerAccessProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerServiceFleetAPIServerAccessProfile(document.RootElement, options); + } + + internal static ContainerServiceFleetAPIServerAccessProfile DeserializeContainerServiceFleetAPIServerAccessProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? enablePrivateCluster = default; + bool? enableVnetIntegration = default; + ResourceIdentifier subnetId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("enablePrivateCluster"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enablePrivateCluster = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("enableVnetIntegration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableVnetIntegration = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("subnetId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + subnetId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContainerServiceFleetAPIServerAccessProfile(enablePrivateCluster, enableVnetIntegration, subnetId, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ContainerServiceFleetAPIServerAccessProfile)} does not support writing '{options.Format}' format."); + } + } + + ContainerServiceFleetAPIServerAccessProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeContainerServiceFleetAPIServerAccessProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContainerServiceFleetAPIServerAccessProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ContainerServiceFleetAPIServerAccessProfile.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ContainerServiceFleetAPIServerAccessProfile.cs new file mode 100644 index 000000000000..fdee28fe4cb0 --- /dev/null +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ContainerServiceFleetAPIServerAccessProfile.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// Access profile for the Fleet hub API server. + public partial class ContainerServiceFleetAPIServerAccessProfile + { + /// + /// 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 ContainerServiceFleetAPIServerAccessProfile() + { + } + + /// Initializes a new instance of . + /// Whether to create the Fleet hub as a private cluster or not. + /// Whether to enable apiserver vnet integration for the Fleet hub or not. + /// The subnet to be used when apiserver vnet integration is enabled. It is required when creating a new Fleet with BYO vnet. + /// Keeps track of any properties unknown to the library. + internal ContainerServiceFleetAPIServerAccessProfile(bool? enablePrivateCluster, bool? enableVnetIntegration, ResourceIdentifier subnetId, IDictionary serializedAdditionalRawData) + { + EnablePrivateCluster = enablePrivateCluster; + EnableVnetIntegration = enableVnetIntegration; + SubnetId = subnetId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Whether to create the Fleet hub as a private cluster or not. + public bool? EnablePrivateCluster { get; set; } + /// Whether to enable apiserver vnet integration for the Fleet hub or not. + public bool? EnableVnetIntegration { get; set; } + /// The subnet to be used when apiserver vnet integration is enabled. It is required when creating a new Fleet with BYO vnet. + public ResourceIdentifier SubnetId { get; set; } + } +} diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ContainerServiceFleetAgentProfile.Serialization.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ContainerServiceFleetAgentProfile.Serialization.cs new file mode 100644 index 000000000000..798840fc275e --- /dev/null +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ContainerServiceFleetAgentProfile.Serialization.cs @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + public partial class ContainerServiceFleetAgentProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerServiceFleetAgentProfile)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(SubnetId)) + { + writer.WritePropertyName("subnetId"u8); + writer.WriteStringValue(SubnetId); + } + if (Optional.IsDefined(VmSize)) + { + writer.WritePropertyName("vmSize"u8); + writer.WriteStringValue(VmSize); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + ContainerServiceFleetAgentProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ContainerServiceFleetAgentProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeContainerServiceFleetAgentProfile(document.RootElement, options); + } + + internal static ContainerServiceFleetAgentProfile DeserializeContainerServiceFleetAgentProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier subnetId = default; + string vmSize = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("subnetId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + subnetId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("vmSize"u8)) + { + vmSize = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ContainerServiceFleetAgentProfile(subnetId, vmSize, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ContainerServiceFleetAgentProfile)} does not support writing '{options.Format}' format."); + } + } + + ContainerServiceFleetAgentProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeContainerServiceFleetAgentProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ContainerServiceFleetAgentProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ContainerServiceFleetAgentProfile.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ContainerServiceFleetAgentProfile.cs new file mode 100644 index 000000000000..3337c87f860e --- /dev/null +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ContainerServiceFleetAgentProfile.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// Agent profile for the Fleet hub. + public partial class ContainerServiceFleetAgentProfile + { + /// + /// 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 ContainerServiceFleetAgentProfile() + { + } + + /// Initializes a new instance of . + /// The ID of the subnet which the Fleet hub node will join on startup. If this is not specified, a vnet and subnet will be generated and used. + /// The virtual machine size of the Fleet hub. + /// Keeps track of any properties unknown to the library. + internal ContainerServiceFleetAgentProfile(ResourceIdentifier subnetId, string vmSize, IDictionary serializedAdditionalRawData) + { + SubnetId = subnetId; + VmSize = vmSize; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The ID of the subnet which the Fleet hub node will join on startup. If this is not specified, a vnet and subnet will be generated and used. + public ResourceIdentifier SubnetId { get; set; } + /// The virtual machine size of the Fleet hub. + public string VmSize { get; set; } + } +} diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ContainerServiceFleetManagedClusterUpdate.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ContainerServiceFleetManagedClusterUpdate.cs index b335953fbd57..0f7aa7c2b264 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ContainerServiceFleetManagedClusterUpdate.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ContainerServiceFleetManagedClusterUpdate.cs @@ -74,15 +74,6 @@ internal ContainerServiceFleetManagedClusterUpdate() /// The upgrade to apply to the ManagedClusters. public ContainerServiceFleetManagedClusterUpgradeSpec Upgrade { get; set; } /// The node image upgrade to be applied to the target nodes in update run. - internal NodeImageSelection NodeImageSelection { get; set; } - /// The node image upgrade type. - public NodeImageSelectionType? SelectionType - { - get => NodeImageSelection is null ? default(NodeImageSelectionType?) : NodeImageSelection.SelectionType; - set - { - NodeImageSelection = value.HasValue ? new NodeImageSelection(value.Value) : null; - } - } + public NodeImageSelection NodeImageSelection { get; set; } } } diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ContainerServiceFleetManagedClusterUpgradeSpec.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ContainerServiceFleetManagedClusterUpgradeSpec.cs index 6e1f4fb7b2d9..033bdaefe58a 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ContainerServiceFleetManagedClusterUpgradeSpec.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ContainerServiceFleetManagedClusterUpgradeSpec.cs @@ -46,22 +46,14 @@ public partial class ContainerServiceFleetManagedClusterUpgradeSpec private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// - /// The upgrade type. - /// Full requires the KubernetesVersion property to be set. - /// NodeImageOnly requires the KubernetesVersion property not to be set. - /// + /// ManagedClusterUpgradeType is the type of upgrade to be applied. public ContainerServiceFleetManagedClusterUpgradeSpec(ContainerServiceFleetManagedClusterUpgradeType upgradeType) { UpgradeType = upgradeType; } /// Initializes a new instance of . - /// - /// The upgrade type. - /// Full requires the KubernetesVersion property to be set. - /// NodeImageOnly requires the KubernetesVersion property not to be set. - /// + /// ManagedClusterUpgradeType is the type of upgrade to be applied. /// The Kubernetes version to upgrade the member clusters to. /// Keeps track of any properties unknown to the library. internal ContainerServiceFleetManagedClusterUpgradeSpec(ContainerServiceFleetManagedClusterUpgradeType upgradeType, string kubernetesVersion, IDictionary serializedAdditionalRawData) @@ -76,11 +68,7 @@ internal ContainerServiceFleetManagedClusterUpgradeSpec() { } - /// - /// The upgrade type. - /// Full requires the KubernetesVersion property to be set. - /// NodeImageOnly requires the KubernetesVersion property not to be set. - /// + /// ManagedClusterUpgradeType is the type of upgrade to be applied. public ContainerServiceFleetManagedClusterUpgradeType UpgradeType { get; set; } /// The Kubernetes version to upgrade the member clusters to. public string KubernetesVersion { get; set; } diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ContainerServiceFleetManagedClusterUpgradeType.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ContainerServiceFleetManagedClusterUpgradeType.cs index 51bb65dcbbf6..dd53bee46272 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ContainerServiceFleetManagedClusterUpgradeType.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/ContainerServiceFleetManagedClusterUpgradeType.cs @@ -24,11 +24,14 @@ public ContainerServiceFleetManagedClusterUpgradeType(string value) private const string FullValue = "Full"; private const string NodeImageOnlyValue = "NodeImageOnly"; + private const string ControlPlaneOnlyValue = "ControlPlaneOnly"; - /// Full upgrades the control plane and all agent pools of the target ManagedClusters. + /// Full upgrades the control plane and all agent pools of the target ManagedClusters. Requires the ManagedClusterUpgradeSpec.KubernetesVersion property to be set. public static ContainerServiceFleetManagedClusterUpgradeType Full { get; } = new ContainerServiceFleetManagedClusterUpgradeType(FullValue); - /// NodeImageOnly upgrades only the node images of the target ManagedClusters. + /// NodeImageOnly upgrades only the node images of the target ManagedClusters. Requires the ManagedClusterUpgradeSpec.KubernetesVersion property to NOT be set. public static ContainerServiceFleetManagedClusterUpgradeType NodeImageOnly { get; } = new ContainerServiceFleetManagedClusterUpgradeType(NodeImageOnlyValue); + /// ControlPlaneOnly upgrades only targets the KubernetesVersion of the ManagedClusters and will not be applied to the AgentPool. Requires the ManagedClusterUpgradeSpec.KubernetesVersion property to be set. + public static ContainerServiceFleetManagedClusterUpgradeType ControlPlaneOnly { get; } = new ContainerServiceFleetManagedClusterUpgradeType(ControlPlaneOnlyValue); /// Determines if two values are the same. public static bool operator ==(ContainerServiceFleetManagedClusterUpgradeType left, ContainerServiceFleetManagedClusterUpgradeType right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetHubProfile.Serialization.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetHubProfile.Serialization.cs new file mode 100644 index 000000000000..083f6fc2b2da --- /dev/null +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetHubProfile.Serialization.cs @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + public partial class FleetHubProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetHubProfile)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(DnsPrefix)) + { + writer.WritePropertyName("dnsPrefix"u8); + writer.WriteStringValue(DnsPrefix); + } + if (Optional.IsDefined(ApiServerAccessProfile)) + { + writer.WritePropertyName("apiServerAccessProfile"u8); + writer.WriteObjectValue(ApiServerAccessProfile, options); + } + if (Optional.IsDefined(AgentProfile)) + { + writer.WritePropertyName("agentProfile"u8); + writer.WriteObjectValue(AgentProfile, options); + } + if (options.Format != "W" && Optional.IsDefined(Fqdn)) + { + writer.WritePropertyName("fqdn"u8); + writer.WriteStringValue(Fqdn); + } + if (options.Format != "W" && Optional.IsDefined(KubernetesVersion)) + { + writer.WritePropertyName("kubernetesVersion"u8); + writer.WriteStringValue(KubernetesVersion); + } + if (options.Format != "W" && Optional.IsDefined(PortalFqdn)) + { + writer.WritePropertyName("portalFqdn"u8); + writer.WriteStringValue(PortalFqdn); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + FleetHubProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetHubProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetHubProfile(document.RootElement, options); + } + + internal static FleetHubProfile DeserializeFleetHubProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string dnsPrefix = default; + ContainerServiceFleetAPIServerAccessProfile apiServerAccessProfile = default; + ContainerServiceFleetAgentProfile agentProfile = default; + string fqdn = default; + string kubernetesVersion = default; + string portalFqdn = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("dnsPrefix"u8)) + { + dnsPrefix = property.Value.GetString(); + continue; + } + if (property.NameEquals("apiServerAccessProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + apiServerAccessProfile = ContainerServiceFleetAPIServerAccessProfile.DeserializeContainerServiceFleetAPIServerAccessProfile(property.Value, options); + continue; + } + if (property.NameEquals("agentProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + agentProfile = ContainerServiceFleetAgentProfile.DeserializeContainerServiceFleetAgentProfile(property.Value, options); + continue; + } + if (property.NameEquals("fqdn"u8)) + { + fqdn = property.Value.GetString(); + continue; + } + if (property.NameEquals("kubernetesVersion"u8)) + { + kubernetesVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("portalFqdn"u8)) + { + portalFqdn = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FleetHubProfile( + dnsPrefix, + apiServerAccessProfile, + agentProfile, + fqdn, + kubernetesVersion, + portalFqdn, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FleetHubProfile)} does not support writing '{options.Format}' format."); + } + } + + FleetHubProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeFleetHubProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetHubProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetHubProfile.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetHubProfile.cs new file mode 100644 index 000000000000..09a8a2486f12 --- /dev/null +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/FleetHubProfile.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// The FleetHubProfile configures the fleet hub. + public partial class FleetHubProfile + { + /// + /// 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 FleetHubProfile() + { + } + + /// 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. + /// Keeps track of any properties unknown to the library. + internal FleetHubProfile(string dnsPrefix, ContainerServiceFleetAPIServerAccessProfile apiServerAccessProfile, ContainerServiceFleetAgentProfile agentProfile, string fqdn, string kubernetesVersion, string portalFqdn, IDictionary serializedAdditionalRawData) + { + DnsPrefix = dnsPrefix; + ApiServerAccessProfile = apiServerAccessProfile; + AgentProfile = agentProfile; + Fqdn = fqdn; + KubernetesVersion = kubernetesVersion; + PortalFqdn = portalFqdn; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// DNS prefix used to create the FQDN for the Fleet hub. + public string DnsPrefix { get; set; } + /// The access profile for the Fleet hub API server. + public ContainerServiceFleetAPIServerAccessProfile ApiServerAccessProfile { get; set; } + /// The agent profile for the Fleet hub. + public ContainerServiceFleetAgentProfile AgentProfile { get; set; } + /// The FQDN of the Fleet hub. + public string Fqdn { get; } + /// The Kubernetes version of the Fleet hub. + public string KubernetesVersion { get; } + /// The Azure Portal FQDN of the Fleet hub. + public string PortalFqdn { get; } + } +} diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/NodeImageSelection.Serialization.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/NodeImageSelection.Serialization.cs index 1492f4719f2d..1356f8aa90d1 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/NodeImageSelection.Serialization.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/NodeImageSelection.Serialization.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.ContainerServiceFleet.Models { - internal partial class NodeImageSelection : IUtf8JsonSerializable, IJsonModel + public partial class NodeImageSelection : IUtf8JsonSerializable, IJsonModel { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); @@ -28,6 +28,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit writer.WriteStartObject(); writer.WritePropertyName("type"u8); writer.WriteStringValue(SelectionType.ToString()); + if (Optional.IsCollectionDefined(CustomNodeImageVersions)) + { + writer.WritePropertyName("customNodeImageVersions"u8); + writer.WriteStartArray(); + foreach (var item in CustomNodeImageVersions) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -67,6 +77,7 @@ internal static NodeImageSelection DeserializeNodeImageSelection(JsonElement ele return null; } NodeImageSelectionType type = default; + IList customNodeImageVersions = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -76,13 +87,27 @@ internal static NodeImageSelection DeserializeNodeImageSelection(JsonElement ele type = new NodeImageSelectionType(property.Value.GetString()); continue; } + if (property.NameEquals("customNodeImageVersions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NodeImageVersion.DeserializeNodeImageVersion(item, options)); + } + customNodeImageVersions = array; + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new NodeImageSelection(type, serializedAdditionalRawData); + return new NodeImageSelection(type, customNodeImageVersions ?? new ChangeTrackingList(), serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/NodeImageSelection.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/NodeImageSelection.cs index 1138a95b1d3c..9ae40e07863e 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/NodeImageSelection.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/NodeImageSelection.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.ContainerServiceFleet.Models { /// The node image upgrade to be applied to the target nodes in update run. - internal partial class NodeImageSelection + public partial class NodeImageSelection { /// /// Keeps track of any properties unknown to the library. @@ -50,14 +50,17 @@ internal partial class NodeImageSelection public NodeImageSelection(NodeImageSelectionType selectionType) { SelectionType = selectionType; + CustomNodeImageVersions = new ChangeTrackingList(); } /// Initializes a new instance of . /// The node image upgrade type. + /// Custom node image versions to upgrade the nodes to. This field is required if node image selection type is Custom. Otherwise, it must be empty. For each node image family (e.g., 'AKSUbuntu-1804gen2containerd'), this field can contain at most one version (e.g., only one of 'AKSUbuntu-1804gen2containerd-2023.01.12' or 'AKSUbuntu-1804gen2containerd-2023.02.12', not both). If the nodes belong to a family without a matching image version in this field, they are not upgraded. /// Keeps track of any properties unknown to the library. - internal NodeImageSelection(NodeImageSelectionType selectionType, IDictionary serializedAdditionalRawData) + internal NodeImageSelection(NodeImageSelectionType selectionType, IList customNodeImageVersions, IDictionary serializedAdditionalRawData) { SelectionType = selectionType; + CustomNodeImageVersions = customNodeImageVersions; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -68,5 +71,7 @@ internal NodeImageSelection() /// The node image upgrade type. public NodeImageSelectionType SelectionType { get; set; } + /// Custom node image versions to upgrade the nodes to. This field is required if node image selection type is Custom. Otherwise, it must be empty. For each node image family (e.g., 'AKSUbuntu-1804gen2containerd'), this field can contain at most one version (e.g., only one of 'AKSUbuntu-1804gen2containerd-2023.01.12' or 'AKSUbuntu-1804gen2containerd-2023.02.12', not both). If the nodes belong to a family without a matching image version in this field, they are not upgraded. + public IList CustomNodeImageVersions { get; } } } diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/NodeImageSelectionType.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/NodeImageSelectionType.cs index 2f2606ef50b6..ea1381fe7ee2 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/NodeImageSelectionType.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/NodeImageSelectionType.cs @@ -24,11 +24,14 @@ public NodeImageSelectionType(string value) private const string LatestValue = "Latest"; private const string ConsistentValue = "Consistent"; + private const string CustomValue = "Custom"; /// Use the latest image version when upgrading nodes. Clusters may use different image versions (e.g., 'AKSUbuntu-1804gen2containerd-2021.10.12' and 'AKSUbuntu-1804gen2containerd-2021.10.19') because, for example, the latest available version is different in different regions. public static NodeImageSelectionType Latest { get; } = new NodeImageSelectionType(LatestValue); /// The image versions to upgrade nodes to are selected as described below: for each node pool in managed clusters affected by the update run, the system selects the latest image version such that it is available across all other node pools (in all other clusters) of the same image type. As a result, all node pools of the same image type will be upgraded to the same image version. For example, if the latest image version for image type 'AKSUbuntu-1804gen2containerd' is 'AKSUbuntu-1804gen2containerd-2021.10.12' for a node pool in cluster A in region X, and is 'AKSUbuntu-1804gen2containerd-2021.10.17' for a node pool in cluster B in region Y, the system will upgrade both node pools to image version 'AKSUbuntu-1804gen2containerd-2021.10.12'. public static NodeImageSelectionType Consistent { get; } = new NodeImageSelectionType(ConsistentValue); + /// Upgrade the nodes to the custom image versions. When set, update run will use node image versions provided in customNodeImageVersions to upgrade the nodes. If set, customNodeImageVersions must not be empty. + public static NodeImageSelectionType Custom { get; } = new NodeImageSelectionType(CustomValue); /// Determines if two values are the same. public static bool operator ==(NodeImageSelectionType left, NodeImageSelectionType right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/NodeImageVersion.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/NodeImageVersion.cs index 36ab15959a68..fb3d930628c2 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/NodeImageVersion.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/NodeImageVersion.cs @@ -46,7 +46,7 @@ public partial class NodeImageVersion private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal NodeImageVersion() + public NodeImageVersion() { } diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/SkipProperties.Serialization.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/SkipProperties.Serialization.cs new file mode 100644 index 000000000000..0933fe8937d8 --- /dev/null +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/SkipProperties.Serialization.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + public partial class SkipProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SkipProperties)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("targets"u8); + writer.WriteStartArray(); + foreach (var item in Targets) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + SkipProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SkipProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSkipProperties(document.RootElement, options); + } + + internal static SkipProperties DeserializeSkipProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList targets = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("targets"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SkipTarget.DeserializeSkipTarget(item, options)); + } + targets = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SkipProperties(targets, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SkipProperties)} does not support writing '{options.Format}' format."); + } + } + + SkipProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSkipProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SkipProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/SkipProperties.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/SkipProperties.cs new file mode 100644 index 000000000000..b25f0d78ae10 --- /dev/null +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/SkipProperties.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// The properties of a skip operation containing multiple skip requests. + public partial class SkipProperties + { + /// + /// 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 targets to skip. + /// is null. + public SkipProperties(IEnumerable targets) + { + Argument.AssertNotNull(targets, nameof(targets)); + + Targets = targets.ToList(); + } + + /// Initializes a new instance of . + /// The targets to skip. + /// Keeps track of any properties unknown to the library. + internal SkipProperties(IList targets, IDictionary serializedAdditionalRawData) + { + Targets = targets; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SkipProperties() + { + } + + /// The targets to skip. + public IList Targets { get; } + } +} diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/SkipTarget.Serialization.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/SkipTarget.Serialization.cs new file mode 100644 index 000000000000..5139471eb20d --- /dev/null +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/SkipTarget.Serialization.cs @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + public partial class SkipTarget : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SkipTarget)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + writer.WritePropertyName("type"u8); + writer.WriteStringValue(TargetType.ToString()); + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + SkipTarget IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SkipTarget)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSkipTarget(document.RootElement, options); + } + + internal static SkipTarget DeserializeSkipTarget(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + TargetType type = default; + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = new TargetType(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SkipTarget(type, name, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SkipTarget)} does not support writing '{options.Format}' format."); + } + } + + SkipTarget IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeSkipTarget(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SkipTarget)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/SkipTarget.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/SkipTarget.cs new file mode 100644 index 000000000000..8d7076d22f25 --- /dev/null +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/SkipTarget.cs @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// The definition of a single skip request. + public partial class SkipTarget + { + /// + /// 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 skip target type. + /// + /// The skip target's name. + /// To skip a member/group/stage, use the member/group/stage's name; + /// Tp skip an after stage wait, use the parent stage's name. + /// + /// is null. + public SkipTarget(TargetType targetType, string name) + { + Argument.AssertNotNull(name, nameof(name)); + + TargetType = targetType; + Name = name; + } + + /// Initializes a new instance of . + /// The skip target type. + /// + /// The skip target's name. + /// To skip a member/group/stage, use the member/group/stage's name; + /// Tp skip an after stage wait, use the parent stage's name. + /// + /// Keeps track of any properties unknown to the library. + internal SkipTarget(TargetType targetType, string name, IDictionary serializedAdditionalRawData) + { + TargetType = targetType; + Name = name; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SkipTarget() + { + } + + /// The skip target type. + public TargetType TargetType { get; } + /// + /// The skip target's name. + /// To skip a member/group/stage, use the member/group/stage's name; + /// Tp skip an after stage wait, use the parent stage's name. + /// + public string Name { get; } + } +} diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/TargetType.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/TargetType.cs new file mode 100644 index 000000000000..22b1ad8d169c --- /dev/null +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/TargetType.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// The target type of a skip request. + public readonly partial struct TargetType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public TargetType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string MemberValue = "Member"; + private const string GroupValue = "Group"; + private const string StageValue = "Stage"; + private const string AfterStageWaitValue = "AfterStageWait"; + + /// Skip the update of a member. + public static TargetType Member { get; } = new TargetType(MemberValue); + /// Skip the update of a group. + public static TargetType Group { get; } = new TargetType(GroupValue); + /// Skip the update of an entire stage including the after stage wait. + public static TargetType Stage { get; } = new TargetType(StageValue); + /// Skip the update of the after stage wait of a certain stage. + public static TargetType AfterStageWait { get; } = new TargetType(AfterStageWaitValue); + /// Determines if two values are the same. + public static bool operator ==(TargetType left, TargetType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(TargetType left, TargetType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator TargetType(string value) => new TargetType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is TargetType other && Equals(other); + /// + public bool Equals(TargetType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpgradeChannel.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpgradeChannel.cs new file mode 100644 index 000000000000..3ec3fa494c26 --- /dev/null +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/Models/UpgradeChannel.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ContainerServiceFleet.Models +{ + /// Configuration of how auto upgrade will be run. + public readonly partial struct UpgradeChannel : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public UpgradeChannel(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string StableValue = "Stable"; + private const string RapidValue = "Rapid"; + private const string NodeImageValue = "NodeImage"; + + /// + /// Upgrades the clusters kubernetes version to the latest supported patch release on minor version N-1, where N is the latest supported minor version. + /// For example, if a cluster runs version 1.17.7 and versions 1.17.9, 1.18.4, 1.18.6, and 1.19.1 are available, the cluster upgrades to 1.18.6. + /// + public static UpgradeChannel Stable { get; } = new UpgradeChannel(StableValue); + /// Upgrades the clusters kubernetes version to the latest supported patch release on the latest supported minor version. + public static UpgradeChannel Rapid { get; } = new UpgradeChannel(RapidValue); + /// Upgrade node image version of the clusters. + public static UpgradeChannel NodeImage { get; } = new UpgradeChannel(NodeImageValue); + /// Determines if two values are the same. + public static bool operator ==(UpgradeChannel left, UpgradeChannel right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(UpgradeChannel left, UpgradeChannel right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator UpgradeChannel(string value) => new UpgradeChannel(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is UpgradeChannel other && Equals(other); + /// + public bool Equals(UpgradeChannel other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/AutoUpgradeProfilesRestOperations.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/AutoUpgradeProfilesRestOperations.cs new file mode 100644 index 000000000000..969033b5ed7c --- /dev/null +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/AutoUpgradeProfilesRestOperations.cs @@ -0,0 +1,531 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ContainerServiceFleet.Models; + +namespace Azure.ResourceManager.ContainerServiceFleet +{ + internal partial class AutoUpgradeProfilesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of AutoUpgradeProfilesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public AutoUpgradeProfilesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-05-02-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListByFleetRequestUri(string subscriptionId, string resourceGroupName, string fleetName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/autoUpgradeProfiles", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByFleetRequest(string subscriptionId, string resourceGroupName, string fleetName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/autoUpgradeProfiles", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List AutoUpgradeProfile resources by Fleet. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByFleetAsync(string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetRequest(subscriptionId, resourceGroupName, fleetName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AutoUpgradeProfileListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AutoUpgradeProfileListResult.DeserializeAutoUpgradeProfileListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AutoUpgradeProfile resources by Fleet. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByFleet(string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetRequest(subscriptionId, resourceGroupName, fleetName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AutoUpgradeProfileListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AutoUpgradeProfileListResult.DeserializeAutoUpgradeProfileListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string autoUpgradeProfileName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/autoUpgradeProfiles/", false); + uri.AppendPath(autoUpgradeProfileName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string fleetName, string autoUpgradeProfileName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/autoUpgradeProfiles/", false); + uri.AppendPath(autoUpgradeProfileName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a AutoUpgradeProfile. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the AutoUpgradeProfile resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string fleetName, string autoUpgradeProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(autoUpgradeProfileName, nameof(autoUpgradeProfileName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, autoUpgradeProfileName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AutoUpgradeProfileData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AutoUpgradeProfileData.DeserializeAutoUpgradeProfileData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AutoUpgradeProfileData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a AutoUpgradeProfile. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the AutoUpgradeProfile resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string fleetName, string autoUpgradeProfileName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(autoUpgradeProfileName, nameof(autoUpgradeProfileName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, autoUpgradeProfileName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AutoUpgradeProfileData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AutoUpgradeProfileData.DeserializeAutoUpgradeProfileData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((AutoUpgradeProfileData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string autoUpgradeProfileName, AutoUpgradeProfileData data, string ifMatch, string ifNoneMatch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/autoUpgradeProfiles/", false); + uri.AppendPath(autoUpgradeProfileName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string fleetName, string autoUpgradeProfileName, AutoUpgradeProfileData data, string ifMatch, string ifNoneMatch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/autoUpgradeProfiles/", false); + uri.AppendPath(autoUpgradeProfileName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } + if (ifNoneMatch != null) + { + request.Headers.Add("If-None-Match", ifNoneMatch); + } + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a AutoUpgradeProfile. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the AutoUpgradeProfile resource. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string fleetName, string autoUpgradeProfileName, AutoUpgradeProfileData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(autoUpgradeProfileName, nameof(autoUpgradeProfileName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, autoUpgradeProfileName, data, ifMatch, ifNoneMatch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a AutoUpgradeProfile. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the AutoUpgradeProfile resource. + /// Resource create parameters. + /// The request should only proceed if an entity matches this string. + /// The request should only proceed if no entity matches this string. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string fleetName, string autoUpgradeProfileName, AutoUpgradeProfileData data, string ifMatch = null, string ifNoneMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(autoUpgradeProfileName, nameof(autoUpgradeProfileName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, autoUpgradeProfileName, data, ifMatch, ifNoneMatch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string autoUpgradeProfileName, string ifMatch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/autoUpgradeProfiles/", false); + uri.AppendPath(autoUpgradeProfileName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string fleetName, string autoUpgradeProfileName, string ifMatch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/autoUpgradeProfiles/", false); + uri.AppendPath(autoUpgradeProfileName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a AutoUpgradeProfile. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the AutoUpgradeProfile resource. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string fleetName, string autoUpgradeProfileName, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(autoUpgradeProfileName, nameof(autoUpgradeProfileName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, autoUpgradeProfileName, ifMatch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a AutoUpgradeProfile. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the AutoUpgradeProfile resource. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string fleetName, string autoUpgradeProfileName, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(autoUpgradeProfileName, nameof(autoUpgradeProfileName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, autoUpgradeProfileName, ifMatch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByFleetNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string fleetName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByFleetNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string fleetName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List AutoUpgradeProfile resources by Fleet. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByFleetNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AutoUpgradeProfileListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AutoUpgradeProfileListResult.DeserializeAutoUpgradeProfileListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List AutoUpgradeProfile resources by Fleet. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByFleetNextPage(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AutoUpgradeProfileListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AutoUpgradeProfileListResult.DeserializeAutoUpgradeProfileListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/FleetMembersRestOperations.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/FleetMembersRestOperations.cs index 87fbf6a8bf2b..00c7a9bb3f78 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/FleetMembersRestOperations.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/FleetMembersRestOperations.cs @@ -32,7 +32,7 @@ public FleetMembersRestOperations(HttpPipeline pipeline, string applicationId, U { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-10-15"; + _apiVersion = apiVersion ?? "2024-05-02-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/FleetUpdateStrategiesRestOperations.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/FleetUpdateStrategiesRestOperations.cs index 12e25f51db79..83ae88ea9200 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/FleetUpdateStrategiesRestOperations.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/FleetUpdateStrategiesRestOperations.cs @@ -32,7 +32,7 @@ public FleetUpdateStrategiesRestOperations(HttpPipeline pipeline, string applica { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-10-15"; + _apiVersion = apiVersion ?? "2024-05-02-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/FleetsRestOperations.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/FleetsRestOperations.cs index d39cbc5edd77..3fd2e3eb2646 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/FleetsRestOperations.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/FleetsRestOperations.cs @@ -32,7 +32,7 @@ public FleetsRestOperations(HttpPipeline pipeline, string applicationId, Uri end { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-10-15"; + _apiVersion = apiVersion ?? "2024-05-02-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/UpdateRunsRestOperations.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/UpdateRunsRestOperations.cs index 1b7c8e52c902..7b72bdb633fc 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/UpdateRunsRestOperations.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/Generated/RestOperations/UpdateRunsRestOperations.cs @@ -32,7 +32,7 @@ public UpdateRunsRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2023-10-15"; + _apiVersion = apiVersion ?? "2024-05-02-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -446,6 +446,114 @@ public Response Delete(string subscriptionId, string resourceGroupName, string f } } + internal RequestUriBuilder CreateSkipRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, SkipProperties body, string ifMatch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/updateRuns/", false); + uri.AppendPath(updateRunName, true); + uri.AppendPath("/skip", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateSkipRequest(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, SkipProperties body, string ifMatch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ContainerService/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/updateRuns/", false); + uri.AppendPath(updateRunName, true); + uri.AppendPath("/skip", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(body, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Skips one or a combination of member/group/stage/afterStageWait(s) of an update run. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the UpdateRun resource. + /// The content of the action request. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task SkipAsync(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, SkipProperties body, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateSkipRequest(subscriptionId, resourceGroupName, fleetName, updateRunName, body, ifMatch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Skips one or a combination of member/group/stage/afterStageWait(s) of an update run. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Fleet resource. + /// The name of the UpdateRun resource. + /// The content of the action request. + /// The request should only proceed if an entity matches this string. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Skip(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, SkipProperties body, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(updateRunName, nameof(updateRunName)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateSkipRequest(subscriptionId, resourceGroupName, fleetName, updateRunName, body, ifMatch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + internal RequestUriBuilder CreateStartRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string updateRunName, string ifMatch) { var uri = new RawRequestUriBuilder(); diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/autorest.md b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/autorest.md index c60c7c87c5b3..e01420a00d37 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/autorest.md +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/src/autorest.md @@ -7,8 +7,7 @@ azure-arm: true csharp: true library-name: ContainerServiceFleet namespace: Azure.ResourceManager.ContainerServiceFleet -require: https://github.com/Azure/azure-rest-api-specs/blob/9837baba3ca259b4f2a3f736593311f445c35c63/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/readme.md -#tag: package-2023-10 +require: https://github.com/Azure/azure-rest-api-specs/blob/7ec14d22272e95ba23e2dbaa969531448c4d7af6/specification/containerservice/resource-manager/Microsoft.ContainerService/fleet/readme.md output-folder: $(this-folder)/Generated clear-output-folder: true sample-gen: @@ -79,18 +78,6 @@ acronym-mapping: Etag: ETag|etag ETag: ETag|eTag -operations-to-lro-api-version-override: - Fleets_CreateOrUpdate: "2016-03-30" - Fleets_Update: "2016-03-30" - Fleets_Delete: "2016-03-30" - FleetMembers_Create: "2016-03-30" - FleetMembers_Update: "2016-03-30" - FleetMembers_Delete: "2016-03-30" - UpdateRuns_CreateOrUpdate: "2016-03-30" - UpdateRuns_Delete: "2016-03-30" - FleetUpdateStrategies_CreateOrUpdate: "2016-03-30" - FleetUpdateStrategies_Delete: "2016-03-30" - models-to-treat-empty-string-as-null: - SubnetResourceId ``` diff --git a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/tests/Scenario/FleetCRUD.cs b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/tests/Scenario/FleetCRUD.cs index bd0b6f5415c2..8bb50cd63678 100644 --- a/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/tests/Scenario/FleetCRUD.cs +++ b/sdk/fleet/Azure.ResourceManager.ContainerServiceFleet/tests/Scenario/FleetCRUD.cs @@ -19,6 +19,7 @@ using Azure.ResourceManager.Resources; using Azure.ResourceManager.ContainerService.Models; using System.Drawing; +using UpgradeChannel = Azure.ResourceManager.ContainerServiceFleet.Models.UpgradeChannel; namespace Azure.ResourceManager.ContainerServiceFleet.Tests.Scenario { @@ -104,7 +105,7 @@ public async Task FleetCRUDTest() string updateRunName = "run1"; ContainerServiceFleetUpdateRunData updateRunData = new ContainerServiceFleetUpdateRunData(); updateRunData.ManagedClusterUpdate = new ContainerServiceFleetManagedClusterUpdate( - new ContainerServiceFleetManagedClusterUpgradeSpec(ContainerServiceFleetManagedClusterUpgradeType.Full, "1.26.1", null), new NodeImageSelection(NodeImageSelectionType.Latest), null); + new ContainerServiceFleetManagedClusterUpgradeSpec(ContainerServiceFleetManagedClusterUpgradeType.Full, "1.29.8", null), new NodeImageSelection(NodeImageSelectionType.Latest), null); ArmOperation createUpdateRunLRO = await updateRunCollection.CreateOrUpdateAsync(WaitUntil.Completed, updateRunName, updateRunData); ContainerServiceFleetUpdateRunResource updateRunResource = createUpdateRunLRO.Value; @@ -123,6 +124,45 @@ public async Task FleetCRUDTest() ArmOperation stopUpdateRunLRO = await updateRunResource.StopAsync(WaitUntil.Completed); Console.WriteLine($"Succeeded on id: {stopUpdateRunLRO.Value.Data.Id}"); + // Create AutoUpgradeProfile + AutoUpgradeProfileCollection autoUpgradeProfileCollection = fleetResource.GetAutoUpgradeProfiles(); + string autoUpgradeProfileName = "autoupgradeprofile1"; + AutoUpgradeProfileData createAutoUpgradeProfileData = new AutoUpgradeProfileData() + { + Channel = UpgradeChannel.Stable, + }; + ArmOperation createAutoUpgradeProfileLRO = await autoUpgradeProfileCollection.CreateOrUpdateAsync(WaitUntil.Completed, autoUpgradeProfileName, createAutoUpgradeProfileData); + AutoUpgradeProfileResource createAutoUpgradeProfileResult = createAutoUpgradeProfileLRO.Value; + Debug.Assert(createAutoUpgradeProfileResult.HasData, "CreateOrUpdateAsync AutoUpgradeProfile data was not valid"); + + createAutoUpgradeProfileData = createAutoUpgradeProfileResult.Data; + Console.WriteLine($"Succeeded on id: {createAutoUpgradeProfileData.Id}"); + Console.WriteLine($"Created AutoUpgradeProfile was: {createAutoUpgradeProfileData.Id}"); + + // Get AutoUpgradeProfile + AutoUpgradeProfileResource getAutoUpgradeProfileResult = await autoUpgradeProfileCollection.GetAsync(autoUpgradeProfileName); + Debug.Assert(getAutoUpgradeProfileResult.HasData, "GetAsync AutoUpgradeProfile data was not valid"); + AutoUpgradeProfileData getAutoUpgradeProfileData = getAutoUpgradeProfileResult.Data; + Console.WriteLine($"Succeeded on id: {getAutoUpgradeProfileData.Id}"); + Console.WriteLine($"Get AutoUpgradeProfile was: {getAutoUpgradeProfileData.Id}"); + Debug.Assert(getAutoUpgradeProfileData.Name == createAutoUpgradeProfileData.Name, "GetAutoUpgradeProfile did not retrieve the correct data."); + Debug.Assert(getAutoUpgradeProfileData.Id == createAutoUpgradeProfileData.Id, "GetAutoUpgradeProfile did not retrieve the correct data."); + + // Update AutoUpgradeProfile + AutoUpgradeProfileData updateAutoUpgradeProfileData = new AutoUpgradeProfileData() + { + Channel = UpgradeChannel.Rapid, + }; + ArmOperation updateAutoUpgradeProfileLRO = await autoUpgradeProfileCollection.CreateOrUpdateAsync(WaitUntil.Completed, autoUpgradeProfileName, updateAutoUpgradeProfileData); + AutoUpgradeProfileResource updateAutoUpgradeProfileResult = updateAutoUpgradeProfileLRO.Value; + Debug.Assert(updateAutoUpgradeProfileResult.HasData, "CreateOrUpdateAsync AutoUpgradeProfile data was not valid"); + Debug.Assert(updateAutoUpgradeProfileResult.Data.Channel == UpgradeChannel.Rapid, "CreateOrUpdateAsync AutoUpgradeProfile channel was not successfully updated."); + + // Delete AutoUpgradeProfile + await updateAutoUpgradeProfileResult.DeleteAsync(WaitUntil.Completed); + bool doesAutoUpgradeProfileExist = await autoUpgradeProfileCollection.ExistsAsync(autoUpgradeProfileName); + Debug.Assert(doesAutoUpgradeProfileExist == false, "AutoUpgradeProfile was not deleted."); + // Delete UpdateRun await updateRunResource.DeleteAsync(WaitUntil.Completed); bool doesUpdateRunExist = await updateRunCollection.ExistsAsync(updateRunName);