diff --git a/.vscode/cspell.json b/.vscode/cspell.json index 095b11dac48d8..d4dbf858e8fbc 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -254,6 +254,12 @@ "Drtm", "Hvci" ] + }, + { + "filename": "**/sdk/computefleet/**/*.cs", + "words": [ + "Rdma" + ] }, { "filename": "**/sdk/batch/**/*.cs", diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/CHANGELOG.md b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/CHANGELOG.md index 89ec9680b3174..cb2b5053b30f3 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/CHANGELOG.md +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/CHANGELOG.md @@ -1,14 +1,16 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0 (2024-10-22) ### Features Added -### Breaking Changes - -### Bugs Fixed +This package follows the [new Azure SDK guidelines](https://azure.github.io/azure-sdk/general_introduction.html), and provides many core capabilities: -### Other Changes + - Support MSAL.NET, Azure.Identity is out of box for supporting MSAL.NET. + - Support [OpenTelemetry](https://opentelemetry.io/) for distributed tracing. + - HTTP pipeline with custom policies. + - Better error-handling. + - Support uniform telemetry across all languages. ## 1.0.0-beta.1 (2024-08-28) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/README.md b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/README.md index 2225489198000..b48223d635310 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/README.md +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/README.md @@ -17,7 +17,7 @@ This library follows the [new Azure SDK guidelines](https://azure.github.io/azur Install the Microsoft Azure Compute Fleet management library for .NET with [NuGet](https://www.nuget.org/): ```dotnetcli -dotnet add package Azure.ResourceManager.ComputeFleet --prerelease +dotnet add package Azure.ResourceManager.ComputeFleet ``` ### Prerequisites diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/api/Azure.ResourceManager.ComputeFleet.netstandard2.0.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/api/Azure.ResourceManager.ComputeFleet.netstandard2.0.cs index 7968f3f304d63..9bb47397d0fe7 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/api/Azure.ResourceManager.ComputeFleet.netstandard2.0.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/api/Azure.ResourceManager.ComputeFleet.netstandard2.0.cs @@ -91,6 +91,55 @@ protected MockableComputeFleetSubscriptionResource() { } } namespace Azure.ResourceManager.ComputeFleet.Models { + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AcceleratorManufacturer : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AcceleratorManufacturer(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.AcceleratorManufacturer AMD { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.AcceleratorManufacturer Nvidia { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.AcceleratorManufacturer Xilinx { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.AcceleratorManufacturer 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.ComputeFleet.Models.AcceleratorManufacturer left, Azure.ResourceManager.ComputeFleet.Models.AcceleratorManufacturer right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.AcceleratorManufacturer (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.AcceleratorManufacturer left, Azure.ResourceManager.ComputeFleet.Models.AcceleratorManufacturer right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AcceleratorType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AcceleratorType(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.AcceleratorType FPGA { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.AcceleratorType GPU { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.AcceleratorType 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.ComputeFleet.Models.AcceleratorType left, Azure.ResourceManager.ComputeFleet.Models.AcceleratorType right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.AcceleratorType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.AcceleratorType left, Azure.ResourceManager.ComputeFleet.Models.AcceleratorType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class AdditionalCapabilities : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AdditionalCapabilities() { } + public bool? IsHibernationEnabled { get { throw null; } set { } } + public bool? IsUltraSSDEnabled { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.AdditionalCapabilities 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.ComputeFleet.Models.AdditionalCapabilities 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 AdditionalInformationSettingName : System.IEquatable { @@ -109,6 +158,24 @@ namespace Azure.ResourceManager.ComputeFleet.Models public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.AdditionalInformationSettingName left, Azure.ResourceManager.ComputeFleet.Models.AdditionalInformationSettingName right) { throw null; } public override string ToString() { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ArchitectureType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ArchitectureType(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ArchitectureType ARM64 { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ArchitectureType X64 { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ArchitectureType 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.ComputeFleet.Models.ArchitectureType left, Azure.ResourceManager.ComputeFleet.Models.ArchitectureType right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ArchitectureType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ArchitectureType left, Azure.ResourceManager.ComputeFleet.Models.ArchitectureType right) { throw null; } + public override string ToString() { throw null; } + } public static partial class ArmComputeFleetModelFactory { public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetApiError ComputeFleetApiError(string code = null, string target = null, string message = null, System.Collections.Generic.IEnumerable details = null, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetInnerError innererror = null) { throw null; } @@ -116,9 +183,9 @@ public static partial class ArmComputeFleetModelFactory public static Azure.ResourceManager.ComputeFleet.ComputeFleetData ComputeFleetData(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.ResourceManager.ComputeFleet.Models.ComputeFleetProperties properties = null, System.Collections.Generic.IEnumerable zones = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.Models.ArmPlan plan = null) { throw null; } public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetImageReference ComputeFleetImageReference(Azure.Core.ResourceIdentifier id = null, string publisher = null, string offer = null, string sku = null, string version = null, string exactVersion = null, string sharedGalleryImageId = null, string communityGalleryImageId = null) { throw null; } public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetInnerError ComputeFleetInnerError(string exceptionType = null, string errorDetail = null) { throw null; } - public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProperties ComputeFleetProperties(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProvisioningState? provisioningState = default(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProvisioningState?), Azure.ResourceManager.ComputeFleet.Models.SpotPriorityProfile spotPriorityProfile = null, Azure.ResourceManager.ComputeFleet.Models.RegularPriorityProfile regularPriorityProfile = null, System.Collections.Generic.IEnumerable vmSizesProfile = null, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetComputeProfile computeProfile = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), string uniqueId = null) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProperties ComputeFleetProperties(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProvisioningState? provisioningState = default(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProvisioningState?), Azure.ResourceManager.ComputeFleet.Models.SpotPriorityProfile spotPriorityProfile = null, Azure.ResourceManager.ComputeFleet.Models.RegularPriorityProfile regularPriorityProfile = null, System.Collections.Generic.IEnumerable vmSizesProfile = null, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmAttributes vmAttributes = null, System.Collections.Generic.IEnumerable additionalLocationsLocationProfiles = null, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetComputeProfile computeProfile = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), string uniqueId = null) { throw null; } public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmProfile ComputeFleetVmProfile(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssOSProfile osProfile = null, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssStorageProfile storageProfile = null, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssNetworkProfile networkProfile = null, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityProfile securityProfile = null, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetBootDiagnostics bootDiagnostics = null, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssExtensionProfile extensionProfile = null, string licenseType = null, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetScheduledEventsProfile scheduledEventsProfile = null, string userData = null, Azure.Core.ResourceIdentifier capacityReservationGroupId = null, System.Collections.Generic.IEnumerable galleryApplications = null, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmSizeProperties hardwareVmSizeProperties = null, Azure.Core.ResourceIdentifier serviceArtifactReferenceId = null, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetSecurityPostureReference securityPostureReference = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?)) { throw null; } - public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmss ComputeFleetVmss(string id = null, string type = null, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProvisioningState operationStatus = default(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProvisioningState), Azure.ResourceManager.ComputeFleet.Models.ComputeFleetApiError error = null) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmss ComputeFleetVmss(Azure.Core.ResourceIdentifier id = null, string type = null, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProvisioningState operationStatus = default(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProvisioningState), Azure.ResourceManager.ComputeFleet.Models.ComputeFleetApiError error = null) { throw null; } public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssExtension ComputeFleetVmssExtension(Azure.Core.ResourceIdentifier id = null, string name = null, string extensionType = null, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssExtensionProperties properties = null) { throw null; } public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmssExtensionProperties ComputeFleetVmssExtensionProperties(string forceUpdateTag = null, string publisher = null, string extensionType = null, string typeHandlerVersion = null, bool? shouldAutoUpgradeMinorVersion = default(bool?), bool? isAutomaticUpgradeEnabled = default(bool?), System.Collections.Generic.IDictionary settings = null, System.Collections.Generic.IDictionary protectedSettings = null, string provisioningState = null, System.Collections.Generic.IEnumerable provisionAfterExtensions = null, bool? isSuppressFailuresEnabled = default(bool?), Azure.ResourceManager.ComputeFleet.Models.ComputeFleetKeyVaultSecretReference protectedSettingsFromKeyVault = null) { throw null; } } @@ -184,6 +251,7 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class ComputeFleetComputeProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ComputeFleetComputeProfile(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmProfile baseVirtualMachineProfile) { } + public Azure.ResourceManager.ComputeFleet.Models.AdditionalCapabilities AdditionalVirtualMachineCapabilities { get { throw null; } set { } } public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmProfile BaseVirtualMachineProfile { get { throw null; } set { } } public string ComputeApiVersion { get { throw null; } set { } } public int? PlatformFaultDomainCount { get { throw null; } set { } } @@ -597,12 +665,14 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public partial class ComputeFleetProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ComputeFleetProperties(System.Collections.Generic.IEnumerable vmSizesProfile, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetComputeProfile computeProfile) { } + public System.Collections.Generic.IList AdditionalLocationsLocationProfiles { get { throw null; } set { } } public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetComputeProfile ComputeProfile { get { throw null; } set { } } public System.DateTimeOffset? CreatedOn { get { throw null; } } public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProvisioningState? ProvisioningState { get { throw null; } } public Azure.ResourceManager.ComputeFleet.Models.RegularPriorityProfile RegularPriorityProfile { get { throw null; } set { } } public Azure.ResourceManager.ComputeFleet.Models.SpotPriorityProfile SpotPriorityProfile { get { throw null; } set { } } public string UniqueId { get { throw null; } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmAttributes VmAttributes { get { throw null; } set { } } public System.Collections.Generic.IList VmSizesProfile { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -873,6 +943,102 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer 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 ComputeFleetVmAttributeMinMaxDouble : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVmAttributeMinMaxDouble() { } + public double? Max { get { throw null; } set { } } + public double? Min { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmAttributeMinMaxDouble 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.ComputeFleet.Models.ComputeFleetVmAttributeMinMaxDouble 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 ComputeFleetVmAttributeMinMaxInteger : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVmAttributeMinMaxInteger() { } + public int? Max { get { throw null; } set { } } + public int? Min { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmAttributeMinMaxInteger 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.ComputeFleet.Models.ComputeFleetVmAttributeMinMaxInteger 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 ComputeFleetVmAttributes : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeFleetVmAttributes(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmAttributeMinMaxInteger vCpuCount, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmAttributeMinMaxDouble memoryInGiB) { } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmAttributeMinMaxInteger AcceleratorCount { get { throw null; } set { } } + public System.Collections.Generic.IList AcceleratorManufacturers { get { throw null; } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmAttributeSupport? AcceleratorSupport { get { throw null; } set { } } + public System.Collections.Generic.IList AcceleratorTypes { get { throw null; } } + public System.Collections.Generic.IList ArchitectureTypes { get { throw null; } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmAttributeSupport? BurstableSupport { get { throw null; } set { } } + public System.Collections.Generic.IList CpuManufacturers { get { throw null; } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmAttributeMinMaxInteger DataDiskCount { get { throw null; } set { } } + public System.Collections.Generic.IList ExcludedVmSizes { get { throw null; } } + public System.Collections.Generic.IList LocalStorageDiskTypes { get { throw null; } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmAttributeMinMaxDouble LocalStorageInGiB { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmAttributeSupport? LocalStorageSupport { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmAttributeMinMaxDouble MemoryInGiB { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmAttributeMinMaxDouble MemoryInGiBPerVCpu { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmAttributeMinMaxDouble NetworkBandwidthInMbps { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmAttributeMinMaxInteger NetworkInterfaceCount { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmAttributeMinMaxInteger RdmaNetworkInterfaceCount { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmAttributeSupport? RdmaSupport { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmAttributeMinMaxInteger VCpuCount { get { throw null; } set { } } + public System.Collections.Generic.IList VmCategories { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmAttributes 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.ComputeFleet.Models.ComputeFleetVmAttributes 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 ComputeFleetVmAttributeSupport : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetVmAttributeSupport(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmAttributeSupport Excluded { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmAttributeSupport Included { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmAttributeSupport Required { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmAttributeSupport 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.ComputeFleet.Models.ComputeFleetVmAttributeSupport left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmAttributeSupport right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmAttributeSupport (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmAttributeSupport left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmAttributeSupport right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ComputeFleetVmCategory : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ComputeFleetVmCategory(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmCategory ComputeOptimized { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmCategory FpgaAccelerated { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmCategory GeneralPurpose { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmCategory GpuAccelerated { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmCategory HighPerformanceCompute { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmCategory MemoryOptimized { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmCategory StorageOptimized { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmCategory 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.ComputeFleet.Models.ComputeFleetVmCategory left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmCategory right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmCategory (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmCategory left, Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmCategory right) { throw null; } + public override string ToString() { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct ComputeFleetVmDeleteOption : System.IEquatable { @@ -986,7 +1152,7 @@ public partial class ComputeFleetVmss : System.ClientModel.Primitives.IJsonModel { internal ComputeFleetVmss() { } public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetApiError Error { get { throw null; } } - public string Id { get { throw null; } } + public Azure.Core.ResourceIdentifier Id { get { throw null; } } public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetProvisioningState OperationStatus { get { throw null; } } public string Type { get { throw null; } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -1359,6 +1525,56 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer 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 CpuManufacturer : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CpuManufacturer(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.CpuManufacturer AMD { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.CpuManufacturer Ampere { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.CpuManufacturer Intel { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.CpuManufacturer Microsoft { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.CpuManufacturer 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.ComputeFleet.Models.CpuManufacturer left, Azure.ResourceManager.ComputeFleet.Models.CpuManufacturer right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.CpuManufacturer (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.CpuManufacturer left, Azure.ResourceManager.ComputeFleet.Models.CpuManufacturer right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct LocalStorageDiskType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public LocalStorageDiskType(string value) { throw null; } + public static Azure.ResourceManager.ComputeFleet.Models.LocalStorageDiskType HDD { get { throw null; } } + public static Azure.ResourceManager.ComputeFleet.Models.LocalStorageDiskType SSD { get { throw null; } } + public bool Equals(Azure.ResourceManager.ComputeFleet.Models.LocalStorageDiskType 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.ComputeFleet.Models.LocalStorageDiskType left, Azure.ResourceManager.ComputeFleet.Models.LocalStorageDiskType right) { throw null; } + public static implicit operator Azure.ResourceManager.ComputeFleet.Models.LocalStorageDiskType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.ComputeFleet.Models.LocalStorageDiskType left, Azure.ResourceManager.ComputeFleet.Models.LocalStorageDiskType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class LocationProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public LocationProfile(Azure.Core.AzureLocation location) { } + public Azure.Core.AzureLocation Location { get { throw null; } set { } } + public Azure.ResourceManager.ComputeFleet.Models.ComputeFleetVmProfile VirtualMachineProfileOverride { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.ComputeFleet.Models.LocationProfile 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.ComputeFleet.Models.LocationProfile 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 ProxyAgentExecuteMode : System.IEquatable { private readonly object _dummy; diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/assets.json b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/assets.json index 7940819838d9b..ce6cfb5cf31e5 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/assets.json +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/computefleet/Azure.ResourceManager.ComputeFleet", - "Tag": "net/computefleet/Azure.ResourceManager.ComputeFleet_8c78427dad" + "Tag": "net/computefleet/Azure.ResourceManager.ComputeFleet_f1f5d520b7" } diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/samples/Generated/Samples/Sample_ComputeFleetCollection.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/samples/Generated/Samples/Sample_ComputeFleetCollection.cs index 9c4afb7bcb19b..1f1e0989278f5 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/samples/Generated/Samples/Sample_ComputeFleetCollection.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/samples/Generated/Samples/Sample_ComputeFleetCollection.cs @@ -23,7 +23,7 @@ public partial class Sample_ComputeFleetCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_FleetsGet() { - // Generated from example definition: 2024-05-01-preview/Fleets_Get.json + // Generated from example definition: 2024-11-01/Fleets_Get.json // this example is just showing the usage of "Fleet_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 @@ -57,7 +57,7 @@ public async Task Get_FleetsGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_FleetsGet() { - // Generated from example definition: 2024-05-01-preview/Fleets_Get.json + // Generated from example definition: 2024-11-01/Fleets_Get.json // this example is just showing the usage of "Fleet_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 @@ -87,7 +87,7 @@ public async Task Exists_FleetsGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_FleetsGet() { - // Generated from example definition: 2024-05-01-preview/Fleets_Get.json + // Generated from example definition: 2024-11-01/Fleets_Get.json // this example is just showing the usage of "Fleet_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 @@ -129,7 +129,7 @@ public async Task GetIfExists_FleetsGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_FleetsCreateOrUpdate() { - // Generated from example definition: 2024-05-01-preview/Fleets_CreateOrUpdate.json + // Generated from example definition: 2024-11-01/Fleets_CreateOrUpdate.json // this example is just showing the usage of "Fleet_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 @@ -558,7 +558,7 @@ public async Task CreateOrUpdate_FleetsCreateOrUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_FleetsCreateOrUpdateMinimumSet() { - // Generated from example definition: 2024-05-01-preview/Fleets_CreateOrUpdate_MinimumSet.json + // Generated from example definition: 2024-11-01/Fleets_CreateOrUpdate_MinimumSet.json // this example is just showing the usage of "Fleet_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 @@ -687,7 +687,7 @@ public async Task CreateOrUpdate_FleetsCreateOrUpdateMinimumSet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_FleetsListByResourceGroup() { - // Generated from example definition: 2024-05-01-preview/Fleets_ListByResourceGroup.json + // Generated from example definition: 2024-11-01/Fleets_ListByResourceGroup.json // this example is just showing the usage of "Fleet_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 diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/samples/Generated/Samples/Sample_ComputeFleetResource.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/samples/Generated/Samples/Sample_ComputeFleetResource.cs index 347c4465bb3a3..095e2ec235d22 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/samples/Generated/Samples/Sample_ComputeFleetResource.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/samples/Generated/Samples/Sample_ComputeFleetResource.cs @@ -23,7 +23,7 @@ public partial class Sample_ComputeFleetResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_FleetsGet() { - // Generated from example definition: 2024-05-01-preview/Fleets_Get.json + // Generated from example definition: 2024-11-01/Fleets_Get.json // this example is just showing the usage of "Fleet_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 @@ -54,7 +54,7 @@ public async Task Get_FleetsGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_FleetsUpdate() { - // Generated from example definition: 2024-05-01-preview/Fleets_Update.json + // Generated from example definition: 2024-11-01/Fleets_Update.json // this example is just showing the usage of "Fleet_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 @@ -469,7 +469,7 @@ public async Task Update_FleetsUpdate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_FleetsDelete() { - // Generated from example definition: 2024-05-01-preview/Fleets_Delete.json + // Generated from example definition: 2024-11-01/Fleets_Delete.json // this example is just showing the usage of "Fleet_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 @@ -496,7 +496,7 @@ public async Task Delete_FleetsDelete() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetComputeFleets_FleetsListBySubscription() { - // Generated from example definition: 2024-05-01-preview/Fleets_ListBySubscription.json + // Generated from example definition: 2024-11-01/Fleets_ListBySubscription.json // this example is just showing the usage of "Fleet_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 @@ -528,7 +528,7 @@ public async Task GetComputeFleets_FleetsListBySubscription() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetVirtualMachineScaleSets_FleetsListVirtualMachineScaleSets() { - // Generated from example definition: 2024-05-01-preview/Fleets_ListVirtualMachineScaleSets.json + // Generated from example definition: 2024-11-01/Fleets_ListVirtualMachineScaleSets.json // this example is just showing the usage of "VirtualMachineScaleSet_ListVirtualMachineScaleSets" 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/computefleet/Azure.ResourceManager.ComputeFleet/src/Azure.ResourceManager.ComputeFleet.csproj b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Azure.ResourceManager.ComputeFleet.csproj index e09d0f669209a..811660aa71c71 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Azure.ResourceManager.ComputeFleet.csproj +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Azure.ResourceManager.ComputeFleet.csproj @@ -1,6 +1,6 @@ - 1.0.0-beta.2 + 1.0.0 Azure.ResourceManager.ComputeFleet Azure Resource Manager client SDK for Azure resource provider ComputeFleet. azure;management;arm;resource manager;computefleet diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ArmComputeFleetModelFactory.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ArmComputeFleetModelFactory.cs index 84ec227471d8f..2ba45ef79c6e7 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ArmComputeFleetModelFactory.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ArmComputeFleetModelFactory.cs @@ -52,19 +52,24 @@ public static ComputeFleetData ComputeFleetData(ResourceIdentifier id = null, st /// Configuration Options for Spot instances in Compute Fleet. /// Configuration Options for Regular instances in Compute Fleet. /// List of VM sizes supported for Compute Fleet. + /// Attribute based Fleet. + /// Represents the configuration for additional locations where Fleet resources may be deployed. /// Compute Profile to use for running user's workloads. /// Specifies the time at which the Compute Fleet is created. /// Specifies the ID which uniquely identifies a Compute Fleet. /// A new instance for mocking. - public static ComputeFleetProperties ComputeFleetProperties(ComputeFleetProvisioningState? provisioningState = null, SpotPriorityProfile spotPriorityProfile = null, RegularPriorityProfile regularPriorityProfile = null, IEnumerable vmSizesProfile = null, ComputeFleetComputeProfile computeProfile = null, DateTimeOffset? createdOn = null, string uniqueId = null) + public static ComputeFleetProperties ComputeFleetProperties(ComputeFleetProvisioningState? provisioningState = null, SpotPriorityProfile spotPriorityProfile = null, RegularPriorityProfile regularPriorityProfile = null, IEnumerable vmSizesProfile = null, ComputeFleetVmAttributes vmAttributes = null, IEnumerable additionalLocationsLocationProfiles = null, ComputeFleetComputeProfile computeProfile = null, DateTimeOffset? createdOn = null, string uniqueId = null) { vmSizesProfile ??= new List(); + additionalLocationsLocationProfiles ??= new List(); return new ComputeFleetProperties( provisioningState, spotPriorityProfile, regularPriorityProfile, vmSizesProfile?.ToList(), + vmAttributes, + additionalLocationsLocationProfiles != null ? new AdditionalLocationsProfile(additionalLocationsLocationProfiles?.ToList(), serializedAdditionalRawData: null) : null, computeProfile, createdOn, uniqueId, @@ -284,7 +289,7 @@ public static ComputeFleetVmssExtensionProperties ComputeFleetVmssExtensionPrope /// This represents the operationStatus of the VMSS in response to the last operation that was performed on it by Azure Fleet resource. /// Error Information when `operationStatus` is `Failed`. /// A new instance for mocking. - public static ComputeFleetVmss ComputeFleetVmss(string id = null, string type = null, ComputeFleetProvisioningState operationStatus = default, ComputeFleetApiError error = null) + public static ComputeFleetVmss ComputeFleetVmss(ResourceIdentifier id = null, string type = null, ComputeFleetProvisioningState operationStatus = default, ComputeFleetApiError error = null) { return new ComputeFleetVmss(id, type, operationStatus, error, serializedAdditionalRawData: null); } diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ComputeFleetCollection.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ComputeFleetCollection.cs index a90f61d2c3631..8a22e425510c2 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ComputeFleetCollection.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ComputeFleetCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-01-preview + /// 2024-11-01 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdateAsyn /// /// /// Default Api Version - /// 2024-05-01-preview + /// 2024-11-01 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitU /// /// /// Default Api Version - /// 2024-05-01-preview + /// 2024-11-01 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string fleetN /// /// /// Default Api Version - /// 2024-05-01-preview + /// 2024-11-01 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string fleetName, Cancellation /// /// /// Default Api Version - /// 2024-05-01-preview + /// 2024-11-01 /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(CancellationToken /// /// /// Default Api Version - /// 2024-05-01-preview + /// 2024-11-01 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationToken cancellat /// /// /// Default Api Version - /// 2024-05-01-preview + /// 2024-11-01 /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string fleetName, Cancella /// /// /// Default Api Version - /// 2024-05-01-preview + /// 2024-11-01 /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string fleetName, CancellationToken cancell /// /// /// Default Api Version - /// 2024-05-01-preview + /// 2024-11-01 /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> GetIfExistsAsy /// /// /// Default Api Version - /// 2024-05-01-preview + /// 2024-11-01 /// /// /// Resource diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ComputeFleetResource.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ComputeFleetResource.cs index ef68928de286d..59c19ff9ca4ed 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ComputeFleetResource.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/ComputeFleetResource.cs @@ -104,7 +104,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-01-preview + /// 2024-11-01 /// /// /// Resource @@ -144,7 +144,7 @@ public virtual async Task> GetAsync(CancellationT /// /// /// Default Api Version - /// 2024-05-01-preview + /// 2024-11-01 /// /// /// Resource @@ -184,7 +184,7 @@ public virtual Response Get(CancellationToken cancellation /// /// /// Default Api Version - /// 2024-05-01-preview + /// 2024-11-01 /// /// /// Resource @@ -226,7 +226,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-05-01-preview + /// 2024-11-01 /// /// /// Resource @@ -268,7 +268,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-01-preview + /// 2024-11-01 /// /// /// Resource @@ -314,7 +314,7 @@ public virtual async Task> UpdateAsync(WaitUn /// /// /// Default Api Version - /// 2024-05-01-preview + /// 2024-11-01 /// /// /// Resource @@ -360,7 +360,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, Co /// /// /// Default Api Version - /// 2024-05-01-preview + /// 2024-11-01 /// /// /// Resource @@ -390,7 +390,7 @@ public virtual AsyncPageable GetVirtualMachineScaleSetsAsync(C /// /// /// Default Api Version - /// 2024-05-01-preview + /// 2024-11-01 /// /// /// Resource @@ -420,7 +420,7 @@ public virtual Pageable GetVirtualMachineScaleSets(Cancellatio /// /// /// Default Api Version - /// 2024-05-01-preview + /// 2024-11-01 /// /// /// Resource @@ -482,7 +482,7 @@ public virtual async Task> AddTagAsync(string key /// /// /// Default Api Version - /// 2024-05-01-preview + /// 2024-11-01 /// /// /// Resource @@ -544,7 +544,7 @@ public virtual Response AddTag(string key, string value, C /// /// /// Default Api Version - /// 2024-05-01-preview + /// 2024-11-01 /// /// /// Resource @@ -601,7 +601,7 @@ public virtual async Task> SetTagsAsync(IDictiona /// /// /// Default Api Version - /// 2024-05-01-preview + /// 2024-11-01 /// /// /// Resource @@ -658,7 +658,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-05-01-preview + /// 2024-11-01 /// /// /// Resource @@ -718,7 +718,7 @@ public virtual async Task> RemoveTagAsync(string /// /// /// Default Api Version - /// 2024-05-01-preview + /// 2024-11-01 /// /// /// Resource diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Extensions/ComputeFleetExtensions.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Extensions/ComputeFleetExtensions.cs index 7392c7fd61b3c..9cca4779157ce 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Extensions/ComputeFleetExtensions.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Extensions/ComputeFleetExtensions.cs @@ -81,7 +81,7 @@ public static ComputeFleetCollection GetComputeFleets(this ResourceGroupResource /// /// /// Default Api Version - /// 2024-05-01-preview + /// 2024-11-01 /// /// /// Resource @@ -119,7 +119,7 @@ public static async Task> GetComputeFleetAsync(th /// /// /// Default Api Version - /// 2024-05-01-preview + /// 2024-11-01 /// /// /// Resource @@ -157,7 +157,7 @@ public static Response GetComputeFleet(this ResourceGroupR /// /// /// Default Api Version - /// 2024-05-01-preview + /// 2024-11-01 /// /// /// Resource @@ -193,7 +193,7 @@ public static AsyncPageable GetComputeFleetsAsync(this Sub /// /// /// Default Api Version - /// 2024-05-01-preview + /// 2024-11-01 /// /// /// Resource diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Extensions/MockableComputeFleetResourceGroupResource.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Extensions/MockableComputeFleetResourceGroupResource.cs index ae8842bf28869..764cdb4ece65f 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Extensions/MockableComputeFleetResourceGroupResource.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Extensions/MockableComputeFleetResourceGroupResource.cs @@ -53,7 +53,7 @@ public virtual ComputeFleetCollection GetComputeFleets() /// /// /// Default Api Version - /// 2024-05-01-preview + /// 2024-11-01 /// /// /// Resource @@ -84,7 +84,7 @@ public virtual async Task> GetComputeFleetAsync(s /// /// /// Default Api Version - /// 2024-05-01-preview + /// 2024-11-01 /// /// /// Resource diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Extensions/MockableComputeFleetSubscriptionResource.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Extensions/MockableComputeFleetSubscriptionResource.cs index 76dd9cbeec5dc..9de02268efb17 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Extensions/MockableComputeFleetSubscriptionResource.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Extensions/MockableComputeFleetSubscriptionResource.cs @@ -52,7 +52,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// /// Default Api Version - /// 2024-05-01-preview + /// 2024-11-01 /// /// /// Resource @@ -82,7 +82,7 @@ public virtual AsyncPageable GetComputeFleetsAsync(Cancell /// /// /// Default Api Version - /// 2024-05-01-preview + /// 2024-11-01 /// /// /// Resource diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/AcceleratorManufacturer.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/AcceleratorManufacturer.cs new file mode 100644 index 0000000000000..37b5a090a6d24 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/AcceleratorManufacturer.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.ComputeFleet.Models +{ + /// Accelerator manufacturers supported by Azure VMs. + public readonly partial struct AcceleratorManufacturer : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AcceleratorManufacturer(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AMDValue = "AMD"; + private const string NvidiaValue = "Nvidia"; + private const string XilinxValue = "Xilinx"; + + /// AMD GpuType. + public static AcceleratorManufacturer AMD { get; } = new AcceleratorManufacturer(AMDValue); + /// Nvidia GpuType. + public static AcceleratorManufacturer Nvidia { get; } = new AcceleratorManufacturer(NvidiaValue); + /// Xilinx GpuType. + public static AcceleratorManufacturer Xilinx { get; } = new AcceleratorManufacturer(XilinxValue); + /// Determines if two values are the same. + public static bool operator ==(AcceleratorManufacturer left, AcceleratorManufacturer right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AcceleratorManufacturer left, AcceleratorManufacturer right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AcceleratorManufacturer(string value) => new AcceleratorManufacturer(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AcceleratorManufacturer other && Equals(other); + /// + public bool Equals(AcceleratorManufacturer 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/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/AcceleratorType.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/AcceleratorType.cs new file mode 100644 index 0000000000000..c28c55d1858f8 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/AcceleratorType.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.ComputeFleet.Models +{ + /// Accelerator types supported by Azure VMs. + public readonly partial struct AcceleratorType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AcceleratorType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string GPUValue = "GPU"; + private const string FPGAValue = "FPGA"; + + /// GPU Accelerator. + public static AcceleratorType GPU { get; } = new AcceleratorType(GPUValue); + /// FPGA Accelerator. + public static AcceleratorType FPGA { get; } = new AcceleratorType(FPGAValue); + /// Determines if two values are the same. + public static bool operator ==(AcceleratorType left, AcceleratorType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AcceleratorType left, AcceleratorType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AcceleratorType(string value) => new AcceleratorType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AcceleratorType other && Equals(other); + /// + public bool Equals(AcceleratorType 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/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/AdditionalCapabilities.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/AdditionalCapabilities.Serialization.cs new file mode 100644 index 0000000000000..389daf23d2abf --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/AdditionalCapabilities.Serialization.cs @@ -0,0 +1,148 @@ +// 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.ComputeFleet.Models +{ + public partial class AdditionalCapabilities : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AdditionalCapabilities)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(IsUltraSSDEnabled)) + { + writer.WritePropertyName("ultraSSDEnabled"u8); + writer.WriteBooleanValue(IsUltraSSDEnabled.Value); + } + if (Optional.IsDefined(IsHibernationEnabled)) + { + writer.WritePropertyName("hibernationEnabled"u8); + writer.WriteBooleanValue(IsHibernationEnabled.Value); + } + 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 + } + } + } + + AdditionalCapabilities 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(AdditionalCapabilities)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAdditionalCapabilities(document.RootElement, options); + } + + internal static AdditionalCapabilities DeserializeAdditionalCapabilities(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? ultraSSDEnabled = default; + bool? hibernationEnabled = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("ultraSSDEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ultraSSDEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("hibernationEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + hibernationEnabled = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AdditionalCapabilities(ultraSSDEnabled, hibernationEnabled, 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(AdditionalCapabilities)} does not support writing '{options.Format}' format."); + } + } + + AdditionalCapabilities 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 DeserializeAdditionalCapabilities(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AdditionalCapabilities)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/AdditionalCapabilities.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/AdditionalCapabilities.cs new file mode 100644 index 0000000000000..b1c6607634d3e --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/AdditionalCapabilities.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// AdditionalCapabilities for VM. + public partial class AdditionalCapabilities + { + /// + /// 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 AdditionalCapabilities() + { + } + + /// Initializes a new instance of . + /// + /// The flag that enables or disables a capability to have one or more managed data disks with UltraSSD_LRS storage account type on the VM or VMSS. + /// Managed disks with storage account type UltraSSD_LRS can be added to a virtual machine or virtual machine scale set only if this property is enabled. + /// + /// The flag that enables or disables hibernation capability on the VM. + /// Keeps track of any properties unknown to the library. + internal AdditionalCapabilities(bool? isUltraSSDEnabled, bool? isHibernationEnabled, IDictionary serializedAdditionalRawData) + { + IsUltraSSDEnabled = isUltraSSDEnabled; + IsHibernationEnabled = isHibernationEnabled; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// The flag that enables or disables a capability to have one or more managed data disks with UltraSSD_LRS storage account type on the VM or VMSS. + /// Managed disks with storage account type UltraSSD_LRS can be added to a virtual machine or virtual machine scale set only if this property is enabled. + /// + public bool? IsUltraSSDEnabled { get; set; } + /// The flag that enables or disables hibernation capability on the VM. + public bool? IsHibernationEnabled { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/AdditionalLocationsProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/AdditionalLocationsProfile.Serialization.cs new file mode 100644 index 0000000000000..ea4f5ad7881f0 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/AdditionalLocationsProfile.Serialization.cs @@ -0,0 +1,136 @@ +// 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.ComputeFleet.Models +{ + internal partial class AdditionalLocationsProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AdditionalLocationsProfile)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("locationProfiles"u8); + writer.WriteStartArray(); + foreach (var item in LocationProfiles) + { + 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 + } + } + } + + AdditionalLocationsProfile 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(AdditionalLocationsProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAdditionalLocationsProfile(document.RootElement, options); + } + + internal static AdditionalLocationsProfile DeserializeAdditionalLocationsProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList locationProfiles = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("locationProfiles"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(LocationProfile.DeserializeLocationProfile(item, options)); + } + locationProfiles = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AdditionalLocationsProfile(locationProfiles, 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(AdditionalLocationsProfile)} does not support writing '{options.Format}' format."); + } + } + + AdditionalLocationsProfile 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 DeserializeAdditionalLocationsProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AdditionalLocationsProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/AdditionalLocationsProfile.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/AdditionalLocationsProfile.cs new file mode 100644 index 0000000000000..77482496b7b34 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/AdditionalLocationsProfile.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.ComputeFleet.Models +{ + /// Represents the configuration for additional locations where Fleet resources may be deployed. + internal partial class AdditionalLocationsProfile + { + /// + /// 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 list of location profiles. + /// is null. + public AdditionalLocationsProfile(IEnumerable locationProfiles) + { + Argument.AssertNotNull(locationProfiles, nameof(locationProfiles)); + + LocationProfiles = locationProfiles.ToList(); + } + + /// Initializes a new instance of . + /// The list of location profiles. + /// Keeps track of any properties unknown to the library. + internal AdditionalLocationsProfile(IList locationProfiles, IDictionary serializedAdditionalRawData) + { + LocationProfiles = locationProfiles; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AdditionalLocationsProfile() + { + } + + /// The list of location profiles. + public IList LocationProfiles { get; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ArchitectureType.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ArchitectureType.cs new file mode 100644 index 0000000000000..4ebb1791cff34 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ArchitectureType.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.ComputeFleet.Models +{ + /// Architecture types supported by Azure VMs. + public readonly partial struct ArchitectureType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ArchitectureType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ARM64Value = "ARM64"; + private const string X64Value = "X64"; + + /// ARM64 Architecture. + public static ArchitectureType ARM64 { get; } = new ArchitectureType(ARM64Value); + /// X64 Architecture. + public static ArchitectureType X64 { get; } = new ArchitectureType(X64Value); + /// Determines if two values are the same. + public static bool operator ==(ArchitectureType left, ArchitectureType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ArchitectureType left, ArchitectureType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ArchitectureType(string value) => new ArchitectureType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ArchitectureType other && Equals(other); + /// + public bool Equals(ArchitectureType 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/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetComputeProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetComputeProfile.Serialization.cs index 42537962e2a4a..b982776a1808c 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetComputeProfile.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetComputeProfile.Serialization.cs @@ -46,6 +46,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("platformFaultDomainCount"u8); writer.WriteNumberValue(PlatformFaultDomainCount.Value); } + if (Optional.IsDefined(AdditionalVirtualMachineCapabilities)) + { + writer.WritePropertyName("additionalVirtualMachineCapabilities"u8); + writer.WriteObjectValue(AdditionalVirtualMachineCapabilities, options); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -86,6 +91,7 @@ internal static ComputeFleetComputeProfile DeserializeComputeFleetComputeProfile ComputeFleetVmProfile baseVirtualMachineProfile = default; string computeApiVersion = default; int? platformFaultDomainCount = default; + AdditionalCapabilities additionalVirtualMachineCapabilities = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -109,13 +115,22 @@ internal static ComputeFleetComputeProfile DeserializeComputeFleetComputeProfile platformFaultDomainCount = property.Value.GetInt32(); continue; } + if (property.NameEquals("additionalVirtualMachineCapabilities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + additionalVirtualMachineCapabilities = AdditionalCapabilities.DeserializeAdditionalCapabilities(property.Value, options); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new ComputeFleetComputeProfile(baseVirtualMachineProfile, computeApiVersion, platformFaultDomainCount, serializedAdditionalRawData); + return new ComputeFleetComputeProfile(baseVirtualMachineProfile, computeApiVersion, platformFaultDomainCount, additionalVirtualMachineCapabilities, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetComputeProfile.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetComputeProfile.cs index 149c34e12ef4d..7522cf268571d 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetComputeProfile.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetComputeProfile.cs @@ -68,12 +68,19 @@ public ComputeFleetComputeProfile(ComputeFleetVmProfile baseVirtualMachineProfil /// If not specified, defaults to 1, which represents "Max Spreading" (using as many fault domains as possible). /// This property cannot be updated. /// + /// + /// Specifies VMSS and VM API entity models support two additional capabilities as of today: ultraSSDEnabled and hibernationEnabled. + /// ultraSSDEnabled: Enables UltraSSD_LRS storage account type on the VMSS VMs. + /// hibernationEnabled: Enables the hibernation capability on the VMSS VMs. + /// Default value is null if not specified. This property cannot be updated once set. + /// /// Keeps track of any properties unknown to the library. - internal ComputeFleetComputeProfile(ComputeFleetVmProfile baseVirtualMachineProfile, string computeApiVersion, int? platformFaultDomainCount, IDictionary serializedAdditionalRawData) + internal ComputeFleetComputeProfile(ComputeFleetVmProfile baseVirtualMachineProfile, string computeApiVersion, int? platformFaultDomainCount, AdditionalCapabilities additionalVirtualMachineCapabilities, IDictionary serializedAdditionalRawData) { BaseVirtualMachineProfile = baseVirtualMachineProfile; ComputeApiVersion = computeApiVersion; PlatformFaultDomainCount = platformFaultDomainCount; + AdditionalVirtualMachineCapabilities = additionalVirtualMachineCapabilities; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -97,5 +104,12 @@ internal ComputeFleetComputeProfile() /// This property cannot be updated. /// public int? PlatformFaultDomainCount { get; set; } + /// + /// Specifies VMSS and VM API entity models support two additional capabilities as of today: ultraSSDEnabled and hibernationEnabled. + /// ultraSSDEnabled: Enables UltraSSD_LRS storage account type on the VMSS VMs. + /// hibernationEnabled: Enables the hibernation capability on the VMSS VMs. + /// Default value is null if not specified. This property cannot be updated once set. + /// + public AdditionalCapabilities AdditionalVirtualMachineCapabilities { get; set; } } } diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProperties.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProperties.Serialization.cs index 8d2d9757346ed..e88e59d9158f4 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProperties.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProperties.Serialization.cs @@ -56,6 +56,16 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WriteObjectValue(item, options); } writer.WriteEndArray(); + if (Optional.IsDefined(VmAttributes)) + { + writer.WritePropertyName("vmAttributes"u8); + writer.WriteObjectValue(VmAttributes, options); + } + if (Optional.IsDefined(AdditionalLocationsProfile)) + { + writer.WritePropertyName("additionalLocationsProfile"u8); + writer.WriteObjectValue(AdditionalLocationsProfile, options); + } writer.WritePropertyName("computeProfile"u8); writer.WriteObjectValue(ComputeProfile, options); if (options.Format != "W" && Optional.IsDefined(CreatedOn)) @@ -109,6 +119,8 @@ internal static ComputeFleetProperties DeserializeComputeFleetProperties(JsonEle SpotPriorityProfile spotPriorityProfile = default; RegularPriorityProfile regularPriorityProfile = default; IList vmSizesProfile = default; + ComputeFleetVmAttributes vmAttributes = default; + AdditionalLocationsProfile additionalLocationsProfile = default; ComputeFleetComputeProfile computeProfile = default; DateTimeOffset? timeCreated = default; string uniqueId = default; @@ -153,6 +165,24 @@ internal static ComputeFleetProperties DeserializeComputeFleetProperties(JsonEle vmSizesProfile = array; continue; } + if (property.NameEquals("vmAttributes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + vmAttributes = ComputeFleetVmAttributes.DeserializeComputeFleetVmAttributes(property.Value, options); + continue; + } + if (property.NameEquals("additionalLocationsProfile"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + additionalLocationsProfile = AdditionalLocationsProfile.DeserializeAdditionalLocationsProfile(property.Value, options); + continue; + } if (property.NameEquals("computeProfile"u8)) { computeProfile = ComputeFleetComputeProfile.DeserializeComputeFleetComputeProfile(property.Value, options); @@ -183,6 +213,8 @@ internal static ComputeFleetProperties DeserializeComputeFleetProperties(JsonEle spotPriorityProfile, regularPriorityProfile, vmSizesProfile, + vmAttributes, + additionalLocationsProfile, computeProfile, timeCreated, uniqueId, diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProperties.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProperties.cs index fe9bffc332da6..14da376694a0d 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProperties.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetProperties.cs @@ -64,16 +64,20 @@ public ComputeFleetProperties(IEnumerable vmSizesProf /// Configuration Options for Spot instances in Compute Fleet. /// Configuration Options for Regular instances in Compute Fleet. /// List of VM sizes supported for Compute Fleet. + /// Attribute based Fleet. + /// Represents the configuration for additional locations where Fleet resources may be deployed. /// Compute Profile to use for running user's workloads. /// Specifies the time at which the Compute Fleet is created. /// Specifies the ID which uniquely identifies a Compute Fleet. /// Keeps track of any properties unknown to the library. - internal ComputeFleetProperties(ComputeFleetProvisioningState? provisioningState, SpotPriorityProfile spotPriorityProfile, RegularPriorityProfile regularPriorityProfile, IList vmSizesProfile, ComputeFleetComputeProfile computeProfile, DateTimeOffset? createdOn, string uniqueId, IDictionary serializedAdditionalRawData) + internal ComputeFleetProperties(ComputeFleetProvisioningState? provisioningState, SpotPriorityProfile spotPriorityProfile, RegularPriorityProfile regularPriorityProfile, IList vmSizesProfile, ComputeFleetVmAttributes vmAttributes, AdditionalLocationsProfile additionalLocationsProfile, ComputeFleetComputeProfile computeProfile, DateTimeOffset? createdOn, string uniqueId, IDictionary serializedAdditionalRawData) { ProvisioningState = provisioningState; SpotPriorityProfile = spotPriorityProfile; RegularPriorityProfile = regularPriorityProfile; VmSizesProfile = vmSizesProfile; + VmAttributes = vmAttributes; + AdditionalLocationsProfile = additionalLocationsProfile; ComputeProfile = computeProfile; CreatedOn = createdOn; UniqueId = uniqueId; @@ -93,6 +97,17 @@ internal ComputeFleetProperties() public RegularPriorityProfile RegularPriorityProfile { get; set; } /// List of VM sizes supported for Compute Fleet. public IList VmSizesProfile { get; } + /// Attribute based Fleet. + public ComputeFleetVmAttributes VmAttributes { get; set; } + /// Represents the configuration for additional locations where Fleet resources may be deployed. + internal AdditionalLocationsProfile AdditionalLocationsProfile { get; set; } + /// The list of location profiles. + public IList AdditionalLocationsLocationProfiles + { + get => AdditionalLocationsProfile is null ? default : AdditionalLocationsProfile.LocationProfiles; + set => AdditionalLocationsProfile = new AdditionalLocationsProfile(value); + } + /// Compute Profile to use for running user's workloads. public ComputeFleetComputeProfile ComputeProfile { get; set; } /// Specifies the time at which the Compute Fleet is created. diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmAttributeMinMaxDouble.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmAttributeMinMaxDouble.Serialization.cs new file mode 100644 index 0000000000000..d170e50310470 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmAttributeMinMaxDouble.Serialization.cs @@ -0,0 +1,148 @@ +// 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.ComputeFleet.Models +{ + public partial class ComputeFleetVmAttributeMinMaxDouble : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmAttributeMinMaxDouble)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Min)) + { + writer.WritePropertyName("min"u8); + writer.WriteNumberValue(Min.Value); + } + if (Optional.IsDefined(Max)) + { + writer.WritePropertyName("max"u8); + writer.WriteNumberValue(Max.Value); + } + 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 + } + } + } + + ComputeFleetVmAttributeMinMaxDouble 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(ComputeFleetVmAttributeMinMaxDouble)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmAttributeMinMaxDouble(document.RootElement, options); + } + + internal static ComputeFleetVmAttributeMinMaxDouble DeserializeComputeFleetVmAttributeMinMaxDouble(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + double? min = default; + double? max = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("min"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + min = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("max"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + max = property.Value.GetDouble(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmAttributeMinMaxDouble(min, max, 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(ComputeFleetVmAttributeMinMaxDouble)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmAttributeMinMaxDouble 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 DeserializeComputeFleetVmAttributeMinMaxDouble(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmAttributeMinMaxDouble)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmAttributeMinMaxDouble.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmAttributeMinMaxDouble.cs new file mode 100644 index 0000000000000..58dfab4ed6ffa --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmAttributeMinMaxDouble.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// VMAttributes using double values. + public partial class ComputeFleetVmAttributeMinMaxDouble + { + /// + /// 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 ComputeFleetVmAttributeMinMaxDouble() + { + } + + /// Initializes a new instance of . + /// Minimum value. default 0. Double.MinValue(). + /// Maximum value. Double.MaxValue(1.7976931348623157E+308). + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmAttributeMinMaxDouble(double? min, double? max, IDictionary serializedAdditionalRawData) + { + Min = min; + Max = max; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Minimum value. default 0. Double.MinValue(). + public double? Min { get; set; } + /// Maximum value. Double.MaxValue(1.7976931348623157E+308). + public double? Max { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmAttributeMinMaxInteger.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmAttributeMinMaxInteger.Serialization.cs new file mode 100644 index 0000000000000..9176a94dbdfd3 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmAttributeMinMaxInteger.Serialization.cs @@ -0,0 +1,148 @@ +// 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.ComputeFleet.Models +{ + public partial class ComputeFleetVmAttributeMinMaxInteger : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmAttributeMinMaxInteger)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Min)) + { + writer.WritePropertyName("min"u8); + writer.WriteNumberValue(Min.Value); + } + if (Optional.IsDefined(Max)) + { + writer.WritePropertyName("max"u8); + writer.WriteNumberValue(Max.Value); + } + 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 + } + } + } + + ComputeFleetVmAttributeMinMaxInteger 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(ComputeFleetVmAttributeMinMaxInteger)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmAttributeMinMaxInteger(document.RootElement, options); + } + + internal static ComputeFleetVmAttributeMinMaxInteger DeserializeComputeFleetVmAttributeMinMaxInteger(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? min = default; + int? max = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("min"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + min = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("max"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + max = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmAttributeMinMaxInteger(min, max, 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(ComputeFleetVmAttributeMinMaxInteger)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmAttributeMinMaxInteger 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 DeserializeComputeFleetVmAttributeMinMaxInteger(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmAttributeMinMaxInteger)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmAttributeMinMaxInteger.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmAttributeMinMaxInteger.cs new file mode 100644 index 0000000000000..32e6699582b9f --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmAttributeMinMaxInteger.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// While retrieving VMSizes from CRS, Min = 0 (uint.MinValue) if not specified, Max = 4294967295 (uint.MaxValue) if not specified. This allows to filter VMAttributes on all available VMSizes. + public partial class ComputeFleetVmAttributeMinMaxInteger + { + /// + /// 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 ComputeFleetVmAttributeMinMaxInteger() + { + } + + /// Initializes a new instance of . + /// Min VMSize from CRS, Min = 0 (uint.MinValue) if not specified. + /// Max VMSize from CRS, Max = 4294967295 (uint.MaxValue) if not specified. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmAttributeMinMaxInteger(int? min, int? max, IDictionary serializedAdditionalRawData) + { + Min = min; + Max = max; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Min VMSize from CRS, Min = 0 (uint.MinValue) if not specified. + public int? Min { get; set; } + /// Max VMSize from CRS, Max = 4294967295 (uint.MaxValue) if not specified. + public int? Max { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmAttributeSupport.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmAttributeSupport.cs new file mode 100644 index 0000000000000..0dbeee6fb1fab --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmAttributeSupport.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.ComputeFleet.Models +{ + /// VMSizes supported by Azure VMs. Included is a union of Excluded and Required. + public readonly partial struct ComputeFleetVmAttributeSupport : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetVmAttributeSupport(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ExcludedValue = "Excluded"; + private const string IncludedValue = "Included"; + private const string RequiredValue = "Required"; + + /// All VMSizes having the feature support will be excluded. + public static ComputeFleetVmAttributeSupport Excluded { get; } = new ComputeFleetVmAttributeSupport(ExcludedValue); + /// VMSizes that have the feature support and that do not have the feature support will be used. Included is a union of Excluded and Required. + public static ComputeFleetVmAttributeSupport Included { get; } = new ComputeFleetVmAttributeSupport(IncludedValue); + /// Only the VMSizes having the feature support will be used. + public static ComputeFleetVmAttributeSupport Required { get; } = new ComputeFleetVmAttributeSupport(RequiredValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetVmAttributeSupport left, ComputeFleetVmAttributeSupport right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetVmAttributeSupport left, ComputeFleetVmAttributeSupport right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ComputeFleetVmAttributeSupport(string value) => new ComputeFleetVmAttributeSupport(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetVmAttributeSupport other && Equals(other); + /// + public bool Equals(ComputeFleetVmAttributeSupport 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/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmAttributes.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmAttributes.Serialization.cs new file mode 100644 index 0000000000000..a1d820e4b9861 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmAttributes.Serialization.cs @@ -0,0 +1,495 @@ +// 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.ComputeFleet.Models +{ + public partial class ComputeFleetVmAttributes : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeFleetVmAttributes)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("vCpuCount"u8); + writer.WriteObjectValue(VCpuCount, options); + writer.WritePropertyName("memoryInGiB"u8); + writer.WriteObjectValue(MemoryInGiB, options); + if (Optional.IsDefined(MemoryInGiBPerVCpu)) + { + writer.WritePropertyName("memoryInGiBPerVCpu"u8); + writer.WriteObjectValue(MemoryInGiBPerVCpu, options); + } + if (Optional.IsDefined(LocalStorageSupport)) + { + writer.WritePropertyName("localStorageSupport"u8); + writer.WriteStringValue(LocalStorageSupport.Value.ToString()); + } + if (Optional.IsDefined(LocalStorageInGiB)) + { + writer.WritePropertyName("localStorageInGiB"u8); + writer.WriteObjectValue(LocalStorageInGiB, options); + } + if (Optional.IsCollectionDefined(LocalStorageDiskTypes)) + { + writer.WritePropertyName("localStorageDiskTypes"u8); + writer.WriteStartArray(); + foreach (var item in LocalStorageDiskTypes) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(DataDiskCount)) + { + writer.WritePropertyName("dataDiskCount"u8); + writer.WriteObjectValue(DataDiskCount, options); + } + if (Optional.IsDefined(NetworkInterfaceCount)) + { + writer.WritePropertyName("networkInterfaceCount"u8); + writer.WriteObjectValue(NetworkInterfaceCount, options); + } + if (Optional.IsDefined(NetworkBandwidthInMbps)) + { + writer.WritePropertyName("networkBandwidthInMbps"u8); + writer.WriteObjectValue(NetworkBandwidthInMbps, options); + } + if (Optional.IsDefined(RdmaSupport)) + { + writer.WritePropertyName("rdmaSupport"u8); + writer.WriteStringValue(RdmaSupport.Value.ToString()); + } + if (Optional.IsDefined(RdmaNetworkInterfaceCount)) + { + writer.WritePropertyName("rdmaNetworkInterfaceCount"u8); + writer.WriteObjectValue(RdmaNetworkInterfaceCount, options); + } + if (Optional.IsDefined(AcceleratorSupport)) + { + writer.WritePropertyName("acceleratorSupport"u8); + writer.WriteStringValue(AcceleratorSupport.Value.ToString()); + } + if (Optional.IsCollectionDefined(AcceleratorManufacturers)) + { + writer.WritePropertyName("acceleratorManufacturers"u8); + writer.WriteStartArray(); + foreach (var item in AcceleratorManufacturers) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(AcceleratorTypes)) + { + writer.WritePropertyName("acceleratorTypes"u8); + writer.WriteStartArray(); + foreach (var item in AcceleratorTypes) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(AcceleratorCount)) + { + writer.WritePropertyName("acceleratorCount"u8); + writer.WriteObjectValue(AcceleratorCount, options); + } + if (Optional.IsCollectionDefined(VmCategories)) + { + writer.WritePropertyName("vmCategories"u8); + writer.WriteStartArray(); + foreach (var item in VmCategories) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ArchitectureTypes)) + { + writer.WritePropertyName("architectureTypes"u8); + writer.WriteStartArray(); + foreach (var item in ArchitectureTypes) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(CpuManufacturers)) + { + writer.WritePropertyName("cpuManufacturers"u8); + writer.WriteStartArray(); + foreach (var item in CpuManufacturers) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(BurstableSupport)) + { + writer.WritePropertyName("burstableSupport"u8); + writer.WriteStringValue(BurstableSupport.Value.ToString()); + } + if (Optional.IsCollectionDefined(ExcludedVmSizes)) + { + writer.WritePropertyName("excludedVMSizes"u8); + writer.WriteStartArray(); + foreach (var item in ExcludedVmSizes) + { + writer.WriteStringValue(item); + } + 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 + } + } + } + + ComputeFleetVmAttributes 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(ComputeFleetVmAttributes)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeFleetVmAttributes(document.RootElement, options); + } + + internal static ComputeFleetVmAttributes DeserializeComputeFleetVmAttributes(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ComputeFleetVmAttributeMinMaxInteger vCpuCount = default; + ComputeFleetVmAttributeMinMaxDouble memoryInGiB = default; + ComputeFleetVmAttributeMinMaxDouble memoryInGiBPerVCpu = default; + ComputeFleetVmAttributeSupport? localStorageSupport = default; + ComputeFleetVmAttributeMinMaxDouble localStorageInGiB = default; + IList localStorageDiskTypes = default; + ComputeFleetVmAttributeMinMaxInteger dataDiskCount = default; + ComputeFleetVmAttributeMinMaxInteger networkInterfaceCount = default; + ComputeFleetVmAttributeMinMaxDouble networkBandwidthInMbps = default; + ComputeFleetVmAttributeSupport? rdmaSupport = default; + ComputeFleetVmAttributeMinMaxInteger rdmaNetworkInterfaceCount = default; + ComputeFleetVmAttributeSupport? acceleratorSupport = default; + IList acceleratorManufacturers = default; + IList acceleratorTypes = default; + ComputeFleetVmAttributeMinMaxInteger acceleratorCount = default; + IList vmCategories = default; + IList architectureTypes = default; + IList cpuManufacturers = default; + ComputeFleetVmAttributeSupport? burstableSupport = default; + IList excludedVmSizes = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("vCpuCount"u8)) + { + vCpuCount = ComputeFleetVmAttributeMinMaxInteger.DeserializeComputeFleetVmAttributeMinMaxInteger(property.Value, options); + continue; + } + if (property.NameEquals("memoryInGiB"u8)) + { + memoryInGiB = ComputeFleetVmAttributeMinMaxDouble.DeserializeComputeFleetVmAttributeMinMaxDouble(property.Value, options); + continue; + } + if (property.NameEquals("memoryInGiBPerVCpu"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + memoryInGiBPerVCpu = ComputeFleetVmAttributeMinMaxDouble.DeserializeComputeFleetVmAttributeMinMaxDouble(property.Value, options); + continue; + } + if (property.NameEquals("localStorageSupport"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + localStorageSupport = new ComputeFleetVmAttributeSupport(property.Value.GetString()); + continue; + } + if (property.NameEquals("localStorageInGiB"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + localStorageInGiB = ComputeFleetVmAttributeMinMaxDouble.DeserializeComputeFleetVmAttributeMinMaxDouble(property.Value, options); + continue; + } + if (property.NameEquals("localStorageDiskTypes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new LocalStorageDiskType(item.GetString())); + } + localStorageDiskTypes = array; + continue; + } + if (property.NameEquals("dataDiskCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dataDiskCount = ComputeFleetVmAttributeMinMaxInteger.DeserializeComputeFleetVmAttributeMinMaxInteger(property.Value, options); + continue; + } + if (property.NameEquals("networkInterfaceCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + networkInterfaceCount = ComputeFleetVmAttributeMinMaxInteger.DeserializeComputeFleetVmAttributeMinMaxInteger(property.Value, options); + continue; + } + if (property.NameEquals("networkBandwidthInMbps"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + networkBandwidthInMbps = ComputeFleetVmAttributeMinMaxDouble.DeserializeComputeFleetVmAttributeMinMaxDouble(property.Value, options); + continue; + } + if (property.NameEquals("rdmaSupport"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + rdmaSupport = new ComputeFleetVmAttributeSupport(property.Value.GetString()); + continue; + } + if (property.NameEquals("rdmaNetworkInterfaceCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + rdmaNetworkInterfaceCount = ComputeFleetVmAttributeMinMaxInteger.DeserializeComputeFleetVmAttributeMinMaxInteger(property.Value, options); + continue; + } + if (property.NameEquals("acceleratorSupport"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + acceleratorSupport = new ComputeFleetVmAttributeSupport(property.Value.GetString()); + continue; + } + if (property.NameEquals("acceleratorManufacturers"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new AcceleratorManufacturer(item.GetString())); + } + acceleratorManufacturers = array; + continue; + } + if (property.NameEquals("acceleratorTypes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new AcceleratorType(item.GetString())); + } + acceleratorTypes = array; + continue; + } + if (property.NameEquals("acceleratorCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + acceleratorCount = ComputeFleetVmAttributeMinMaxInteger.DeserializeComputeFleetVmAttributeMinMaxInteger(property.Value, options); + continue; + } + if (property.NameEquals("vmCategories"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new ComputeFleetVmCategory(item.GetString())); + } + vmCategories = array; + continue; + } + if (property.NameEquals("architectureTypes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new ArchitectureType(item.GetString())); + } + architectureTypes = array; + continue; + } + if (property.NameEquals("cpuManufacturers"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(new CpuManufacturer(item.GetString())); + } + cpuManufacturers = array; + continue; + } + if (property.NameEquals("burstableSupport"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + burstableSupport = new ComputeFleetVmAttributeSupport(property.Value.GetString()); + continue; + } + if (property.NameEquals("excludedVMSizes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + excludedVmSizes = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ComputeFleetVmAttributes( + vCpuCount, + memoryInGiB, + memoryInGiBPerVCpu, + localStorageSupport, + localStorageInGiB, + localStorageDiskTypes ?? new ChangeTrackingList(), + dataDiskCount, + networkInterfaceCount, + networkBandwidthInMbps, + rdmaSupport, + rdmaNetworkInterfaceCount, + acceleratorSupport, + acceleratorManufacturers ?? new ChangeTrackingList(), + acceleratorTypes ?? new ChangeTrackingList(), + acceleratorCount, + vmCategories ?? new ChangeTrackingList(), + architectureTypes ?? new ChangeTrackingList(), + cpuManufacturers ?? new ChangeTrackingList(), + burstableSupport, + excludedVmSizes ?? new ChangeTrackingList(), + 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(ComputeFleetVmAttributes)} does not support writing '{options.Format}' format."); + } + } + + ComputeFleetVmAttributes 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 DeserializeComputeFleetVmAttributes(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeFleetVmAttributes)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmAttributes.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmAttributes.cs new file mode 100644 index 0000000000000..1aa7f7b60228d --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmAttributes.cs @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// VMAttributes that will be used to filter VMSizes which will be used to build Fleet. + public partial class ComputeFleetVmAttributes + { + /// + /// 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 range of vCpuCount specified from Min to Max. Must be specified if VMAttributes are specified, either Min or Max is required if specified. + /// The range of memory specified from Min to Max. Must be specified if VMAttributes are specified, either Min or Max is required if specified. + /// or is null. + public ComputeFleetVmAttributes(ComputeFleetVmAttributeMinMaxInteger vCpuCount, ComputeFleetVmAttributeMinMaxDouble memoryInGiB) + { + Argument.AssertNotNull(vCpuCount, nameof(vCpuCount)); + Argument.AssertNotNull(memoryInGiB, nameof(memoryInGiB)); + + VCpuCount = vCpuCount; + MemoryInGiB = memoryInGiB; + LocalStorageDiskTypes = new ChangeTrackingList(); + AcceleratorManufacturers = new ChangeTrackingList(); + AcceleratorTypes = new ChangeTrackingList(); + VmCategories = new ChangeTrackingList(); + ArchitectureTypes = new ChangeTrackingList(); + CpuManufacturers = new ChangeTrackingList(); + ExcludedVmSizes = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The range of vCpuCount specified from Min to Max. Must be specified if VMAttributes are specified, either Min or Max is required if specified. + /// The range of memory specified from Min to Max. Must be specified if VMAttributes are specified, either Min or Max is required if specified. + /// The range of memory in GiB per vCPU specified from min to max. Optional parameter. Either Min or Max is required if specified. + /// Specifies whether the VMSize supporting local storage should be used to build Fleet or not. + /// + /// LocalStorageSupport should be set to "Included" or "Required" to use this VMAttribute. + /// If localStorageSupport is "Excluded", this VMAttribute can not be used. + /// + /// + /// The local storage disk types specified as a list. LocalStorageSupport should be set to "Included" or "Required" to use this VMAttribute. + /// If localStorageSupport is "Excluded", this VMAttribute can not be used. + /// + /// The range of data disk count specified from Min to Max. Optional parameter. Either Min or Max is required if specified. + /// The range of network interface count specified from Min to Max. Optional parameter. Either Min or Max is required if specified. + /// The range of network bandwidth in Mbps specified from Min to Max. Optional parameter. Either Min or Max is required if specified. + /// Specifies whether the VMSize supporting RDMA (Remote Direct Memory Access) should be used to build Fleet or not. + /// + /// The range of RDMA (Remote Direct Memory Access) network interface count specified from Min to Max. Optional parameter. Either Min or Max is required if specified. + /// rdmaSupport should be set to "Included" or "Required" to use this VMAttribute. + /// If rdmaSupport is "Excluded", this VMAttribute can not be used. + /// + /// + /// Specifies whether the VMSize supporting accelerator should be used to build Fleet or not. + /// acceleratorSupport should be set to "Included" or "Required" to use this VMAttribute. + /// If acceleratorSupport is "Excluded", this VMAttribute can not be used. + /// + /// + /// The accelerator manufacturers specified as a list. + /// acceleratorSupport should be set to "Included" or "Required" to use this VMAttribute. + /// If acceleratorSupport is "Excluded", this VMAttribute can not be used. + /// + /// + /// The accelerator types specified as a list. acceleratorSupport should be set to "Included" or "Required" to use this VMAttribute. + /// If acceleratorSupport is "Excluded", this VMAttribute can not be used. + /// + /// + /// The range of accelerator count specified from min to max. Optional parameter. Either Min or Max is required if specified. + /// acceleratorSupport should be set to "Included" or "Required" to use this VMAttribute. + /// If acceleratorSupport is "Excluded", this VMAttribute can not be used. + /// + /// The VM category specified as a list. Optional parameter. + /// The VM architecture types specified as a list. Optional parameter. + /// The VM CPU manufacturers specified as a list. Optional parameter. + /// Specifies whether the VMSize supporting burstable capability should be used to build Fleet or not. + /// Specifies which VMSizes should be excluded while building Fleet. Optional parameter. + /// Keeps track of any properties unknown to the library. + internal ComputeFleetVmAttributes(ComputeFleetVmAttributeMinMaxInteger vCpuCount, ComputeFleetVmAttributeMinMaxDouble memoryInGiB, ComputeFleetVmAttributeMinMaxDouble memoryInGiBPerVCpu, ComputeFleetVmAttributeSupport? localStorageSupport, ComputeFleetVmAttributeMinMaxDouble localStorageInGiB, IList localStorageDiskTypes, ComputeFleetVmAttributeMinMaxInteger dataDiskCount, ComputeFleetVmAttributeMinMaxInteger networkInterfaceCount, ComputeFleetVmAttributeMinMaxDouble networkBandwidthInMbps, ComputeFleetVmAttributeSupport? rdmaSupport, ComputeFleetVmAttributeMinMaxInteger rdmaNetworkInterfaceCount, ComputeFleetVmAttributeSupport? acceleratorSupport, IList acceleratorManufacturers, IList acceleratorTypes, ComputeFleetVmAttributeMinMaxInteger acceleratorCount, IList vmCategories, IList architectureTypes, IList cpuManufacturers, ComputeFleetVmAttributeSupport? burstableSupport, IList excludedVmSizes, IDictionary serializedAdditionalRawData) + { + VCpuCount = vCpuCount; + MemoryInGiB = memoryInGiB; + MemoryInGiBPerVCpu = memoryInGiBPerVCpu; + LocalStorageSupport = localStorageSupport; + LocalStorageInGiB = localStorageInGiB; + LocalStorageDiskTypes = localStorageDiskTypes; + DataDiskCount = dataDiskCount; + NetworkInterfaceCount = networkInterfaceCount; + NetworkBandwidthInMbps = networkBandwidthInMbps; + RdmaSupport = rdmaSupport; + RdmaNetworkInterfaceCount = rdmaNetworkInterfaceCount; + AcceleratorSupport = acceleratorSupport; + AcceleratorManufacturers = acceleratorManufacturers; + AcceleratorTypes = acceleratorTypes; + AcceleratorCount = acceleratorCount; + VmCategories = vmCategories; + ArchitectureTypes = architectureTypes; + CpuManufacturers = cpuManufacturers; + BurstableSupport = burstableSupport; + ExcludedVmSizes = excludedVmSizes; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ComputeFleetVmAttributes() + { + } + + /// The range of vCpuCount specified from Min to Max. Must be specified if VMAttributes are specified, either Min or Max is required if specified. + public ComputeFleetVmAttributeMinMaxInteger VCpuCount { get; set; } + /// The range of memory specified from Min to Max. Must be specified if VMAttributes are specified, either Min or Max is required if specified. + public ComputeFleetVmAttributeMinMaxDouble MemoryInGiB { get; set; } + /// The range of memory in GiB per vCPU specified from min to max. Optional parameter. Either Min or Max is required if specified. + public ComputeFleetVmAttributeMinMaxDouble MemoryInGiBPerVCpu { get; set; } + /// Specifies whether the VMSize supporting local storage should be used to build Fleet or not. + public ComputeFleetVmAttributeSupport? LocalStorageSupport { get; set; } + /// + /// LocalStorageSupport should be set to "Included" or "Required" to use this VMAttribute. + /// If localStorageSupport is "Excluded", this VMAttribute can not be used. + /// + public ComputeFleetVmAttributeMinMaxDouble LocalStorageInGiB { get; set; } + /// + /// The local storage disk types specified as a list. LocalStorageSupport should be set to "Included" or "Required" to use this VMAttribute. + /// If localStorageSupport is "Excluded", this VMAttribute can not be used. + /// + public IList LocalStorageDiskTypes { get; } + /// The range of data disk count specified from Min to Max. Optional parameter. Either Min or Max is required if specified. + public ComputeFleetVmAttributeMinMaxInteger DataDiskCount { get; set; } + /// The range of network interface count specified from Min to Max. Optional parameter. Either Min or Max is required if specified. + public ComputeFleetVmAttributeMinMaxInteger NetworkInterfaceCount { get; set; } + /// The range of network bandwidth in Mbps specified from Min to Max. Optional parameter. Either Min or Max is required if specified. + public ComputeFleetVmAttributeMinMaxDouble NetworkBandwidthInMbps { get; set; } + /// Specifies whether the VMSize supporting RDMA (Remote Direct Memory Access) should be used to build Fleet or not. + public ComputeFleetVmAttributeSupport? RdmaSupport { get; set; } + /// + /// The range of RDMA (Remote Direct Memory Access) network interface count specified from Min to Max. Optional parameter. Either Min or Max is required if specified. + /// rdmaSupport should be set to "Included" or "Required" to use this VMAttribute. + /// If rdmaSupport is "Excluded", this VMAttribute can not be used. + /// + public ComputeFleetVmAttributeMinMaxInteger RdmaNetworkInterfaceCount { get; set; } + /// + /// Specifies whether the VMSize supporting accelerator should be used to build Fleet or not. + /// acceleratorSupport should be set to "Included" or "Required" to use this VMAttribute. + /// If acceleratorSupport is "Excluded", this VMAttribute can not be used. + /// + public ComputeFleetVmAttributeSupport? AcceleratorSupport { get; set; } + /// + /// The accelerator manufacturers specified as a list. + /// acceleratorSupport should be set to "Included" or "Required" to use this VMAttribute. + /// If acceleratorSupport is "Excluded", this VMAttribute can not be used. + /// + public IList AcceleratorManufacturers { get; } + /// + /// The accelerator types specified as a list. acceleratorSupport should be set to "Included" or "Required" to use this VMAttribute. + /// If acceleratorSupport is "Excluded", this VMAttribute can not be used. + /// + public IList AcceleratorTypes { get; } + /// + /// The range of accelerator count specified from min to max. Optional parameter. Either Min or Max is required if specified. + /// acceleratorSupport should be set to "Included" or "Required" to use this VMAttribute. + /// If acceleratorSupport is "Excluded", this VMAttribute can not be used. + /// + public ComputeFleetVmAttributeMinMaxInteger AcceleratorCount { get; set; } + /// The VM category specified as a list. Optional parameter. + public IList VmCategories { get; } + /// The VM architecture types specified as a list. Optional parameter. + public IList ArchitectureTypes { get; } + /// The VM CPU manufacturers specified as a list. Optional parameter. + public IList CpuManufacturers { get; } + /// Specifies whether the VMSize supporting burstable capability should be used to build Fleet or not. + public ComputeFleetVmAttributeSupport? BurstableSupport { get; set; } + /// Specifies which VMSizes should be excluded while building Fleet. Optional parameter. + public IList ExcludedVmSizes { get; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmCategory.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmCategory.cs new file mode 100644 index 0000000000000..5eee9116a4b94 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmCategory.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.ComputeFleet.Models +{ + /// + /// VMCategories defined for Azure VMs. + /// See: https://learn.microsoft.com/en-us/azure/virtual-machines/sizes/overview?tabs=breakdownseries%2Cgeneralsizelist%2Ccomputesizelist%2Cmemorysizelist%2Cstoragesizelist%2Cgpusizelist%2Cfpgasizelist%2Chpcsizelist#general-purpose + /// + public readonly partial struct ComputeFleetVmCategory : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ComputeFleetVmCategory(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string GeneralPurposeValue = "GeneralPurpose"; + private const string ComputeOptimizedValue = "ComputeOptimized"; + private const string MemoryOptimizedValue = "MemoryOptimized"; + private const string StorageOptimizedValue = "StorageOptimized"; + private const string GpuAcceleratedValue = "GpuAccelerated"; + private const string FpgaAcceleratedValue = "FpgaAccelerated"; + private const string HighPerformanceComputeValue = "HighPerformanceCompute"; + + /// General purpose VM sizes provide balanced CPU-to-memory ratio. Ideal for testing and development, small to medium databases, and low to medium traffic web servers. + public static ComputeFleetVmCategory GeneralPurpose { get; } = new ComputeFleetVmCategory(GeneralPurposeValue); + /// Compute optimized VM sizes have a high CPU-to-memory ratio. These sizes are good for medium traffic web servers, network appliances, batch processes, and application servers. + public static ComputeFleetVmCategory ComputeOptimized { get; } = new ComputeFleetVmCategory(ComputeOptimizedValue); + /// Memory optimized VM sizes offer a high memory-to-CPU ratio that is great for relational database servers, medium to large caches, and in-memory analytics. + public static ComputeFleetVmCategory MemoryOptimized { get; } = new ComputeFleetVmCategory(MemoryOptimizedValue); + /// + /// Storage optimized virtual machine (VM) sizes offer high disk throughput and IO, and are ideal for Big Data, SQL, NoSQL databases, data warehousing, and large transactional databases. + /// Examples include Cassandra, MongoDB, Cloudera, and Redis. + /// + public static ComputeFleetVmCategory StorageOptimized { get; } = new ComputeFleetVmCategory(StorageOptimizedValue); + /// + /// GPU optimized VM sizes are specialized virtual machines available with single, multiple, or fractional GPUs. + /// These sizes are designed for compute-intensive, graphics-intensive, and visualization workloads. + /// + public static ComputeFleetVmCategory GpuAccelerated { get; } = new ComputeFleetVmCategory(GpuAcceleratedValue); + /// + /// FPGA optimized VM sizes are specialized virtual machines available with single or multiple FPGA. + /// These sizes are designed for compute-intensive workloads. This article provides information about the number and type of FPGA, vCPUs, data disks, and NICs. + /// Storage throughput and network bandwidth are also included for each size in this grouping. + /// + public static ComputeFleetVmCategory FpgaAccelerated { get; } = new ComputeFleetVmCategory(FpgaAcceleratedValue); + /// + /// Azure High Performance Compute VMs are optimized for various HPC workloads such as computational fluid dynamics, finite element analysis, frontend and backend EDA, + /// rendering, molecular dynamics, computational geo science, weather simulation, and financial risk analysis. + /// + public static ComputeFleetVmCategory HighPerformanceCompute { get; } = new ComputeFleetVmCategory(HighPerformanceComputeValue); + /// Determines if two values are the same. + public static bool operator ==(ComputeFleetVmCategory left, ComputeFleetVmCategory right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ComputeFleetVmCategory left, ComputeFleetVmCategory right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ComputeFleetVmCategory(string value) => new ComputeFleetVmCategory(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ComputeFleetVmCategory other && Equals(other); + /// + public bool Equals(ComputeFleetVmCategory 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/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmss.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmss.Serialization.cs index 4f946ccc687bd..d34a396db9db5 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmss.Serialization.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmss.Serialization.cs @@ -91,7 +91,7 @@ internal static ComputeFleetVmss DeserializeComputeFleetVmss(JsonElement element { return null; } - string id = default; + ResourceIdentifier id = default; string type = default; ComputeFleetProvisioningState operationStatus = default; ComputeFleetApiError error = default; @@ -101,7 +101,7 @@ internal static ComputeFleetVmss DeserializeComputeFleetVmss(JsonElement element { if (property.NameEquals("id"u8)) { - id = property.Value.GetString(); + id = new ResourceIdentifier(property.Value.GetString()); continue; } if (property.NameEquals("type"u8)) diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmss.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmss.cs index 37a95a7c24794..8af98cd80b82d 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmss.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/ComputeFleetVmss.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using Azure.Core; namespace Azure.ResourceManager.ComputeFleet.Models { @@ -51,7 +52,7 @@ public partial class ComputeFleetVmss /// "subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}" /// /// This represents the operationStatus of the VMSS in response to the last operation that was performed on it by Azure Fleet resource. - internal ComputeFleetVmss(string id, ComputeFleetProvisioningState operationStatus) + internal ComputeFleetVmss(ResourceIdentifier id, ComputeFleetProvisioningState operationStatus) { Id = id; OperationStatus = operationStatus; @@ -66,7 +67,7 @@ internal ComputeFleetVmss(string id, ComputeFleetProvisioningState operationStat /// This represents the operationStatus of the VMSS in response to the last operation that was performed on it by Azure Fleet resource. /// Error Information when `operationStatus` is `Failed`. /// Keeps track of any properties unknown to the library. - internal ComputeFleetVmss(string id, string type, ComputeFleetProvisioningState operationStatus, ComputeFleetApiError error, IDictionary serializedAdditionalRawData) + internal ComputeFleetVmss(ResourceIdentifier id, string type, ComputeFleetProvisioningState operationStatus, ComputeFleetApiError error, IDictionary serializedAdditionalRawData) { Id = id; Type = type; @@ -84,7 +85,7 @@ internal ComputeFleetVmss() /// The compute RP resource id of the virtualMachineScaleSet /// "subscriptions/{subId}/resourceGroups/{rgName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}" /// - public string Id { get; } + public ResourceIdentifier Id { get; } /// Type of the virtualMachineScaleSet. public string Type { get; } /// This represents the operationStatus of the VMSS in response to the last operation that was performed on it by Azure Fleet resource. diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/CpuManufacturer.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/CpuManufacturer.cs new file mode 100644 index 0000000000000..e4df71fa76d94 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/CpuManufacturer.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.ComputeFleet.Models +{ + /// Cpu Manufacturers supported by Azure VMs. + public readonly partial struct CpuManufacturer : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CpuManufacturer(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string IntelValue = "Intel"; + private const string AMDValue = "AMD"; + private const string MicrosoftValue = "Microsoft"; + private const string AmpereValue = "Ampere"; + + /// Intel CPU. + public static CpuManufacturer Intel { get; } = new CpuManufacturer(IntelValue); + /// AMD CPU. + public static CpuManufacturer AMD { get; } = new CpuManufacturer(AMDValue); + /// Microsoft CPU. + public static CpuManufacturer Microsoft { get; } = new CpuManufacturer(MicrosoftValue); + /// Ampere CPU. + public static CpuManufacturer Ampere { get; } = new CpuManufacturer(AmpereValue); + /// Determines if two values are the same. + public static bool operator ==(CpuManufacturer left, CpuManufacturer right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CpuManufacturer left, CpuManufacturer right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator CpuManufacturer(string value) => new CpuManufacturer(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CpuManufacturer other && Equals(other); + /// + public bool Equals(CpuManufacturer 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/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/LocalStorageDiskType.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/LocalStorageDiskType.cs new file mode 100644 index 0000000000000..c6b92dc9ce584 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/LocalStorageDiskType.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.ComputeFleet.Models +{ + /// Different kind of Local storage disk types supported by Azure VMs. + public readonly partial struct LocalStorageDiskType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public LocalStorageDiskType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string HDDValue = "HDD"; + private const string SSDValue = "SSD"; + + /// HDD DiskType. + public static LocalStorageDiskType HDD { get; } = new LocalStorageDiskType(HDDValue); + /// SDD DiskType. + public static LocalStorageDiskType SSD { get; } = new LocalStorageDiskType(SSDValue); + /// Determines if two values are the same. + public static bool operator ==(LocalStorageDiskType left, LocalStorageDiskType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(LocalStorageDiskType left, LocalStorageDiskType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator LocalStorageDiskType(string value) => new LocalStorageDiskType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is LocalStorageDiskType other && Equals(other); + /// + public bool Equals(LocalStorageDiskType 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/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/LocationProfile.Serialization.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/LocationProfile.Serialization.cs new file mode 100644 index 0000000000000..792c90531c350 --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/LocationProfile.Serialization.cs @@ -0,0 +1,141 @@ +// 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.ComputeFleet.Models +{ + public partial class LocationProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LocationProfile)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + if (Optional.IsDefined(VirtualMachineProfileOverride)) + { + writer.WritePropertyName("virtualMachineProfileOverride"u8); + writer.WriteObjectValue(VirtualMachineProfileOverride, options); + } + 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 + } + } + } + + LocationProfile 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(LocationProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLocationProfile(document.RootElement, options); + } + + internal static LocationProfile DeserializeLocationProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AzureLocation location = default; + ComputeFleetVmProfile virtualMachineProfileOverride = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("virtualMachineProfileOverride"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + virtualMachineProfileOverride = ComputeFleetVmProfile.DeserializeComputeFleetVmProfile(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new LocationProfile(location, virtualMachineProfileOverride, 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(LocationProfile)} does not support writing '{options.Format}' format."); + } + } + + LocationProfile 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 DeserializeLocationProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(LocationProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/LocationProfile.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/LocationProfile.cs new file mode 100644 index 0000000000000..9b40c1a8a09bd --- /dev/null +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/Models/LocationProfile.cs @@ -0,0 +1,83 @@ +// 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.ComputeFleet.Models +{ + /// Represents the profile for a single additional location in the Fleet. The location and the virtualMachineProfileOverride (optional). + public partial class LocationProfile + { + /// + /// 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 ARM location name of the additional region. If LocationProfile is specified, then location is required. + public LocationProfile(AzureLocation location) + { + Location = location; + } + + /// Initializes a new instance of . + /// The ARM location name of the additional region. If LocationProfile is specified, then location is required. + /// + /// An override for computeProfile.baseVirtualMachineProfile specific to this region. + /// This override is merged with the base virtual machine profile to define the final virtual machine profile for the resources deployed in this location. + /// + /// Keeps track of any properties unknown to the library. + internal LocationProfile(AzureLocation location, ComputeFleetVmProfile virtualMachineProfileOverride, IDictionary serializedAdditionalRawData) + { + Location = location; + VirtualMachineProfileOverride = virtualMachineProfileOverride; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal LocationProfile() + { + } + + /// The ARM location name of the additional region. If LocationProfile is specified, then location is required. + public AzureLocation Location { get; set; } + /// + /// An override for computeProfile.baseVirtualMachineProfile specific to this region. + /// This override is merged with the base virtual machine profile to define the final virtual machine profile for the resources deployed in this location. + /// + public ComputeFleetVmProfile VirtualMachineProfileOverride { get; set; } + } +} diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/RestOperations/FleetsRestOperations.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/RestOperations/FleetsRestOperations.cs index 268911912be0d..19a05a5d396e6 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/src/Generated/RestOperations/FleetsRestOperations.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/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 ?? "2024-05-01-preview"; + _apiVersion = apiVersion ?? "2024-11-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/tests/Scenario/ComputeFleetCRUDTests.cs b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/tests/Scenario/ComputeFleetCRUDTests.cs index 4bd2d4fafa51f..ccb5a45159a4b 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/tests/Scenario/ComputeFleetCRUDTests.cs +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/tests/Scenario/ComputeFleetCRUDTests.cs @@ -1,6 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. +using System; +using System.Linq; using System.Threading.Tasks; using Azure.Core.TestFramework; using NUnit.Framework; @@ -14,7 +16,9 @@ public ComputeFleetCRUDTests(bool isAsync) { } + // To enable record - set AZURE_TEST_MODE=Record to record the test. [TestCase] + [RecordedTest] public async Task TestCreateComputeFleet() { var computeFleetCollection = await GetComputeFleetCollectionAsync(); @@ -31,8 +35,68 @@ public async Task TestCreateComputeFleet() var getComputeFleet = await computeFleetCollection.GetAsync(computeFleetName); Assert.AreEqual(computeFleetName, getComputeFleet.Value.Data.Name); + // Check if Fleet exists. + var isExists = await computeFleetCollection.ExistsAsync(computeFleetName); + Assert.IsTrue(isExists); + // Delete the compute fleet await createFleetResult.Value.DeleteAsync(WaitUntil.Completed); + + // Check if Fleet does not exists. + isExists = await computeFleetCollection.ExistsAsync(computeFleetName); + Assert.IsFalse(isExists); + } + + [TestCase] + [RecordedTest] + public async Task TestCreateMultipleComputeFleetsAndCheck() + { + Console.WriteLine("Stating Test TestCreateMultipleComputeFleetsAndCheck"); + var computeFleetCollection = await GetComputeFleetCollectionAsync(); + var vnet = await CreateVirtualNetwork(); + var computeFleetName = Recording.GenerateAssetName("testFleetViaSDK-"); + var computeFleetData = GetBasicComputeFleetData(DefaultLocation, computeFleetName, GetSubnetId(vnet)); + + // Create the compute fleet + var createFleetResult = await computeFleetCollection.CreateOrUpdateAsync(WaitUntil.Completed, computeFleetName, computeFleetData); + Assert.AreEqual(computeFleetName, createFleetResult.Value.Data.Name); + Assert.AreEqual(DefaultLocation, createFleetResult.Value.Data.Location); + + // Get the compute fleet + var getComputeFleet = await computeFleetCollection.GetAsync(computeFleetName); + Assert.AreEqual(computeFleetName, getComputeFleet.Value.Data.Name); + + // Check if Fleet exists. + var isExists = await computeFleetCollection.ExistsAsync(computeFleetName); + Assert.IsTrue(isExists); + + // Create 2nd Fleet + var computeFleetName2nd = Recording.GenerateAssetName("testFleetViaSDK-", "multi"); + var computeFleetData2nd = GetBasicComputeFleetData(DefaultLocation, computeFleetName2nd, GetSubnetId(vnet)); + var createFleetResult2nd = await computeFleetCollection.CreateOrUpdateAsync(WaitUntil.Completed, computeFleetName2nd, computeFleetData2nd); + Assert.AreEqual(computeFleetName2nd, createFleetResult2nd.Value.Data.Name); + Assert.AreEqual(DefaultLocation, createFleetResult2nd.Value.Data.Location); + + // Check if 2nd Fleet exists. + isExists = await computeFleetCollection.ExistsAsync(computeFleetName2nd); + Assert.IsTrue(isExists); + + var fleet2nd = await computeFleetCollection.GetIfExistsAsync(computeFleetName2nd); + Assert.NotNull(fleet2nd); + + // Delete the 1st compute fleet + await createFleetResult.Value.DeleteAsync(WaitUntil.Completed); + + // Check if 1st Fleet does not exists. + isExists = await computeFleetCollection.ExistsAsync(computeFleetName); + Assert.IsFalse(isExists); + + // Delete the 2nd compute fleet + await createFleetResult2nd.Value.DeleteAsync(WaitUntil.Completed); + + // Check if 2nd Fleet does not exists. + isExists = await computeFleetCollection.ExistsAsync(computeFleetName2nd); + Assert.IsFalse(isExists); } } } diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/tsp-location.yaml b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/tsp-location.yaml index b5e602272d0c1..9cb62246a668e 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/tsp-location.yaml +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/tsp-location.yaml @@ -1,3 +1,4 @@ directory: specification/azurefleet/AzureFleet.Management -commit: c0a15f4623eb11f745f890089f3d46d8a538524f -repo: Azure/azure-rest-api-specs \ No newline at end of file +commit: 8ad58020cfafc5ace71d85b31272acf4d6b694d3 +repo: Azure/azure-rest-api-specs +