diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/CHANGELOG.md b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/CHANGELOG.md index 7dfa26391018b..fead089700e92 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/CHANGELOG.md +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/CHANGELOG.md @@ -4,11 +4,8 @@ ### Features Added -### Breaking Changes - -### Bugs Fixed - -### Other Changes +- Added install patches for hybrid machine +- Added assess patches for hybrid machine ## 1.0.0-beta.4 (2023-05-30) diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/api/Azure.ResourceManager.HybridCompute.netstandard2.0.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/api/Azure.ResourceManager.HybridCompute.netstandard2.0.cs index faa4ba19cb97f..e66738bbe4ac2 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/api/Azure.ResourceManager.HybridCompute.netstandard2.0.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/api/Azure.ResourceManager.HybridCompute.netstandard2.0.cs @@ -1,7 +1,43 @@ namespace Azure.ResourceManager.HybridCompute { + public partial class ExtensionValueCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ExtensionValueCollection() { } + public virtual Azure.Response Exists(string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ExtensionValueData : Azure.ResourceManager.Models.ResourceData + { + public ExtensionValueData() { } + public string ExtensionType { get { throw null; } } + public string Publisher { get { throw null; } } + public string Version { get { throw null; } } + } + public partial class ExtensionValueResource : Azure.ResourceManager.ArmResource + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ExtensionValueResource() { } + public virtual Azure.ResourceManager.HybridCompute.ExtensionValueData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, Azure.Core.AzureLocation location, string publisher, string extensionType, string version) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public static partial class HybridComputeExtensions { + public static Azure.Response GetExtensionValue(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, string publisher, string extensionType, string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetExtensionValueAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, string publisher, string extensionType, string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.HybridCompute.ExtensionValueResource GetExtensionValueResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.HybridCompute.ExtensionValueCollection GetExtensionValues(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, string publisher, string extensionType) { throw null; } public static Azure.Response GetHybridComputeMachine(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string machineName, Azure.ResourceManager.HybridCompute.Models.InstanceViewType? expand = default(Azure.ResourceManager.HybridCompute.Models.InstanceViewType?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetHybridComputeMachineAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string machineName, Azure.ResourceManager.HybridCompute.Models.InstanceViewType? expand = default(Azure.ResourceManager.HybridCompute.Models.InstanceViewType?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.HybridCompute.HybridComputeMachineExtensionResource GetHybridComputeMachineExtensionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } @@ -40,9 +76,36 @@ protected HybridComputeMachineCollection() { } public partial class HybridComputeMachineData : Azure.ResourceManager.Models.TrackedResourceData { public HybridComputeMachineData(Azure.Core.AzureLocation location) : base (default(Azure.Core.AzureLocation)) { } + public string AdFqdn { get { throw null; } } + public Azure.ResourceManager.HybridCompute.Models.AgentConfiguration AgentConfiguration { get { throw null; } } + public Azure.ResourceManager.HybridCompute.Models.AgentUpgrade AgentUpgrade { get { throw null; } set { } } + public string AgentVersion { get { throw null; } } + public string ClientPublicKey { get { throw null; } set { } } + public string CloudMetadataProvider { get { throw null; } } + public System.Collections.Generic.IReadOnlyDictionary DetectedProperties { get { throw null; } } + public string DisplayName { get { throw null; } } + public string DnsFqdn { get { throw null; } } + public string DomainName { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ErrorDetails { get { throw null; } } + public System.Collections.Generic.IList Extensions { get { throw null; } } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } - public Azure.ResourceManager.HybridCompute.Models.MachineProperties Properties { get { throw null; } set { } } + public System.DateTimeOffset? LastStatusChange { get { throw null; } } + public Azure.ResourceManager.HybridCompute.Models.LocationData LocationData { get { throw null; } set { } } + public string MachineFqdn { get { throw null; } } + public string MssqlDiscovered { get { throw null; } set { } } + public string OSName { get { throw null; } } + public Azure.ResourceManager.HybridCompute.Models.OSProfile OSProfile { get { throw null; } set { } } + public string OSSku { get { throw null; } } + public string OSType { get { throw null; } set { } } + public string OSVersion { get { throw null; } } + public Azure.Core.ResourceIdentifier ParentClusterResourceId { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier PrivateLinkScopeResourceId { get { throw null; } set { } } + public string ProvisioningState { get { throw null; } } public System.Collections.Generic.IReadOnlyList Resources { get { throw null; } } + public Azure.ResourceManager.HybridCompute.Models.HybridComputeServiceStatuses ServiceStatuses { get { throw null; } set { } } + public Azure.ResourceManager.HybridCompute.Models.HybridComputeStatusType? Status { get { throw null; } } + public System.Guid? VmId { get { throw null; } set { } } + public System.Guid? VmUuid { get { throw null; } } } public partial class HybridComputeMachineExtensionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { @@ -64,7 +127,16 @@ protected HybridComputeMachineExtensionCollection() { } public partial class HybridComputeMachineExtensionData : Azure.ResourceManager.Models.TrackedResourceData { public HybridComputeMachineExtensionData(Azure.Core.AzureLocation location) : base (default(Azure.Core.AzureLocation)) { } - public Azure.ResourceManager.HybridCompute.Models.MachineExtensionProperties Properties { get { throw null; } set { } } + public bool? AutoUpgradeMinorVersion { get { throw null; } set { } } + public bool? EnableAutomaticUpgrade { get { throw null; } set { } } + public string ForceUpdateTag { get { throw null; } set { } } + public Azure.ResourceManager.HybridCompute.Models.MachineExtensionInstanceView InstanceView { get { throw null; } set { } } + public System.Collections.Generic.IDictionary ProtectedSettings { get { throw null; } } + public string ProvisioningState { get { throw null; } } + public string Publisher { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Settings { get { throw null; } } + public string TypeHandlerVersion { get { throw null; } set { } } + public string TypePropertiesType { get { throw null; } set { } } } public partial class HybridComputeMachineExtensionResource : Azure.ResourceManager.ArmResource { @@ -94,6 +166,8 @@ protected HybridComputeMachineResource() { } public virtual bool HasData { get { throw null; } } public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation AssessPatches(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AssessPatchesAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string machineName) { throw null; } public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -102,8 +176,12 @@ protected HybridComputeMachineResource() { } public virtual Azure.Response GetHybridComputeMachineExtension(string extensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetHybridComputeMachineExtensionAsync(string extensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.HybridCompute.HybridComputeMachineExtensionCollection GetHybridComputeMachineExtensions() { throw null; } + public virtual Azure.Response GetNetworkProfile(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetNetworkProfileAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetValidationDetailsForMachinePrivateLinkScope(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetValidationDetailsForMachinePrivateLinkScopeAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation InstallPatches(Azure.WaitUntil waitUntil, Azure.ResourceManager.HybridCompute.Models.MachineInstallPatchesContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> InstallPatchesAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.HybridCompute.Models.MachineInstallPatchesContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -260,21 +338,37 @@ internal AgentConfiguration() { } public static bool operator !=(Azure.ResourceManager.HybridCompute.Models.AgentConfigurationMode left, Azure.ResourceManager.HybridCompute.Models.AgentConfigurationMode right) { throw null; } public override string ToString() { throw null; } } + public partial class AgentUpgrade + { + public AgentUpgrade() { } + public System.Guid? CorrelationId { get { throw null; } set { } } + public string DesiredVersion { get { throw null; } set { } } + public bool? EnableAutomaticUpgrade { get { throw null; } set { } } + public string LastAttemptMessage { get { throw null; } } + public Azure.ResourceManager.HybridCompute.Models.LastAttemptStatusEnum? LastAttemptStatus { get { throw null; } } + public System.DateTimeOffset? LastAttemptTimestamp { get { throw null; } } + } public static partial class ArmHybridComputeModelFactory { public static Azure.ResourceManager.HybridCompute.Models.AgentConfiguration AgentConfiguration(System.Uri proxyUri = null, System.Collections.Generic.IEnumerable incomingConnectionsPorts = null, System.Collections.Generic.IEnumerable extensionsAllowList = null, System.Collections.Generic.IEnumerable extensionsBlockList = null, System.Collections.Generic.IEnumerable proxyBypass = null, string extensionsEnabled = null, string guestConfigurationEnabled = null, Azure.ResourceManager.HybridCompute.Models.AgentConfigurationMode? configMode = default(Azure.ResourceManager.HybridCompute.Models.AgentConfigurationMode?)) { throw null; } + public static Azure.ResourceManager.HybridCompute.Models.AgentUpgrade AgentUpgrade(string desiredVersion = null, System.Guid? correlationId = default(System.Guid?), bool? enableAutomaticUpgrade = default(bool?), System.DateTimeOffset? lastAttemptTimestamp = default(System.DateTimeOffset?), Azure.ResourceManager.HybridCompute.Models.LastAttemptStatusEnum? lastAttemptStatus = default(Azure.ResourceManager.HybridCompute.Models.LastAttemptStatusEnum?), string lastAttemptMessage = null) { throw null; } + public static Azure.ResourceManager.HybridCompute.Models.AvailablePatchCountByClassification AvailablePatchCountByClassification(int? security = default(int?), int? critical = default(int?), int? definition = default(int?), int? updateRollup = default(int?), int? featurePack = default(int?), int? servicePack = default(int?), int? tools = default(int?), int? updates = default(int?), int? other = default(int?)) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.ConfigurationExtension ConfigurationExtension(string publisher = null, string configurationExtensionType = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.ConnectionDetail ConnectionDetail(string id = null, string privateIPAddress = null, string linkIdentifier = null, string groupId = null, string memberName = null) { throw null; } - public static Azure.ResourceManager.HybridCompute.HybridComputeMachineData HybridComputeMachineData(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.HybridCompute.Models.MachineProperties properties = null, System.Collections.Generic.IEnumerable resources = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } - public static Azure.ResourceManager.HybridCompute.HybridComputeMachineExtensionData HybridComputeMachineExtensionData(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.HybridCompute.Models.MachineExtensionProperties properties = null) { throw null; } + public static Azure.ResourceManager.HybridCompute.ExtensionValueData ExtensionValueData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string version = null, string extensionType = null, string publisher = null) { throw null; } + public static Azure.ResourceManager.HybridCompute.HybridComputeMachineData HybridComputeMachineData(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), System.Collections.Generic.IEnumerable resources = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.HybridCompute.Models.LocationData locationData = null, Azure.ResourceManager.HybridCompute.Models.AgentConfiguration agentConfiguration = null, Azure.ResourceManager.HybridCompute.Models.HybridComputeServiceStatuses serviceStatuses = null, string cloudMetadataProvider = null, Azure.ResourceManager.HybridCompute.Models.AgentUpgrade agentUpgrade = null, Azure.ResourceManager.HybridCompute.Models.OSProfile osProfile = null, string provisioningState = null, Azure.ResourceManager.HybridCompute.Models.HybridComputeStatusType? status = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeStatusType?), System.DateTimeOffset? lastStatusChange = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable errorDetails = null, string agentVersion = null, System.Guid? vmId = default(System.Guid?), string displayName = null, string machineFqdn = null, string clientPublicKey = null, string osName = null, string osVersion = null, string osType = null, System.Guid? vmUuid = default(System.Guid?), System.Collections.Generic.IEnumerable extensions = null, string osSku = null, string domainName = null, string adFqdn = null, string dnsFqdn = null, Azure.Core.ResourceIdentifier privateLinkScopeResourceId = null, Azure.Core.ResourceIdentifier parentClusterResourceId = null, string mssqlDiscovered = null, System.Collections.Generic.IReadOnlyDictionary detectedProperties = null) { throw null; } + public static Azure.ResourceManager.HybridCompute.HybridComputeMachineExtensionData HybridComputeMachineExtensionData(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), string forceUpdateTag = null, string publisher = null, string typePropertiesType = null, string typeHandlerVersion = null, bool? enableAutomaticUpgrade = default(bool?), bool? autoUpgradeMinorVersion = default(bool?), System.Collections.Generic.IDictionary settings = null, System.Collections.Generic.IDictionary protectedSettings = null, string provisioningState = null, Azure.ResourceManager.HybridCompute.Models.MachineExtensionInstanceView instanceView = null) { throw null; } public static Azure.ResourceManager.HybridCompute.HybridComputePrivateEndpointConnectionData HybridComputePrivateEndpointConnectionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.HybridCompute.Models.PrivateEndpointConnectionProperties properties = null) { throw null; } public static Azure.ResourceManager.HybridCompute.HybridComputePrivateLinkResourceData HybridComputePrivateLinkResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.HybridCompute.Models.HybridComputePrivateLinkResourceProperties properties = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.HybridComputePrivateLinkResourceProperties HybridComputePrivateLinkResourceProperties(string groupId = null, System.Collections.Generic.IEnumerable requiredMembers = null, System.Collections.Generic.IEnumerable requiredZoneNames = null) { throw null; } public static Azure.ResourceManager.HybridCompute.HybridComputePrivateLinkScopeData HybridComputePrivateLinkScopeData(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.HybridCompute.Models.HybridComputePrivateLinkScopeProperties properties = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.HybridComputePrivateLinkScopeProperties HybridComputePrivateLinkScopeProperties(Azure.ResourceManager.HybridCompute.Models.PublicNetworkAccessType? publicNetworkAccess = default(Azure.ResourceManager.HybridCompute.Models.PublicNetworkAccessType?), string provisioningState = null, string privateLinkScopeId = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.HybridComputePrivateLinkServiceConnectionStateProperty HybridComputePrivateLinkServiceConnectionStateProperty(string status = null, string description = null, string actionsRequired = null) { throw null; } - public static Azure.ResourceManager.HybridCompute.Models.MachineExtensionProperties MachineExtensionProperties(string forceUpdateTag = null, string publisher = null, string machineExtensionPropertiesType = null, string typeHandlerVersion = null, bool? enableAutomaticUpgrade = default(bool?), bool? autoUpgradeMinorVersion = default(bool?), System.Collections.Generic.IDictionary settings = null, System.Collections.Generic.IDictionary protectedSettings = null, string provisioningState = null, Azure.ResourceManager.HybridCompute.Models.MachineExtensionInstanceView instanceView = null) { throw null; } - public static Azure.ResourceManager.HybridCompute.Models.MachineProperties MachineProperties(Azure.ResourceManager.HybridCompute.Models.LocationData locationData = null, Azure.ResourceManager.HybridCompute.Models.AgentConfiguration agentConfiguration = null, Azure.ResourceManager.HybridCompute.Models.HybridComputeServiceStatuses serviceStatuses = null, string cloudMetadataProvider = null, Azure.ResourceManager.HybridCompute.Models.OSProfile osProfile = null, string provisioningState = null, Azure.ResourceManager.HybridCompute.Models.HybridComputeStatusType? status = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeStatusType?), System.DateTimeOffset? lastStatusChange = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable errorDetails = null, string agentVersion = null, string vmId = null, string displayName = null, string machineFqdn = null, string clientPublicKey = null, string osName = null, string osVersion = null, string osType = null, string vmUuid = null, string osSku = null, string domainName = null, string adFqdn = null, string dnsFqdn = null, string privateLinkScopeResourceId = null, string parentClusterResourceId = null, string mssqlDiscovered = null, System.Collections.Generic.IReadOnlyDictionary detectedProperties = null) { throw null; } + public static Azure.ResourceManager.HybridCompute.Models.IPAddress IPAddress(string address = null, string ipAddressVersion = null, string subnetAddressPrefix = null) { throw null; } + public static Azure.ResourceManager.HybridCompute.Models.MachineAssessPatchesResult MachineAssessPatchesResult(Azure.ResourceManager.HybridCompute.Models.PatchOperationStatus? status = default(Azure.ResourceManager.HybridCompute.Models.PatchOperationStatus?), System.Guid? assessmentActivityId = default(System.Guid?), bool? rebootPending = default(bool?), Azure.ResourceManager.HybridCompute.Models.AvailablePatchCountByClassification availablePatchCountByClassification = null, System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? lastModifiedOn = default(System.DateTimeOffset?), Azure.ResourceManager.HybridCompute.Models.PatchOperationStartedBy? startedBy = default(Azure.ResourceManager.HybridCompute.Models.PatchOperationStartedBy?), Azure.ResourceManager.HybridCompute.Models.PatchServiceUsed? patchServiceUsed = default(Azure.ResourceManager.HybridCompute.Models.PatchServiceUsed?), Azure.ResourceManager.HybridCompute.Models.OSType? osType = default(Azure.ResourceManager.HybridCompute.Models.OSType?), Azure.ResponseError errorDetails = null) { throw null; } + public static Azure.ResourceManager.HybridCompute.Models.MachineInstallPatchesResult MachineInstallPatchesResult(Azure.ResourceManager.HybridCompute.Models.PatchOperationStatus? status = default(Azure.ResourceManager.HybridCompute.Models.PatchOperationStatus?), string installationActivityId = null, Azure.ResourceManager.HybridCompute.Models.VmGuestPatchRebootStatus? rebootStatus = default(Azure.ResourceManager.HybridCompute.Models.VmGuestPatchRebootStatus?), bool? maintenanceWindowExceeded = default(bool?), int? excludedPatchCount = default(int?), int? notSelectedPatchCount = default(int?), int? pendingPatchCount = default(int?), int? installedPatchCount = default(int?), int? failedPatchCount = default(int?), System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? lastModifiedOn = default(System.DateTimeOffset?), Azure.ResourceManager.HybridCompute.Models.PatchOperationStartedBy? startedBy = default(Azure.ResourceManager.HybridCompute.Models.PatchOperationStartedBy?), Azure.ResourceManager.HybridCompute.Models.PatchServiceUsed? patchServiceUsed = default(Azure.ResourceManager.HybridCompute.Models.PatchServiceUsed?), Azure.ResourceManager.HybridCompute.Models.OSType? osType = default(Azure.ResourceManager.HybridCompute.Models.OSType?), Azure.ResponseError errorDetails = null) { throw null; } + public static Azure.ResourceManager.HybridCompute.Models.NetworkInterface NetworkInterface(System.Collections.Generic.IEnumerable ipAddresses = null) { throw null; } + public static Azure.ResourceManager.HybridCompute.Models.NetworkProfile NetworkProfile(System.Collections.Generic.IEnumerable networkInterfaces = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.OSProfile OSProfile(string computerName = null, Azure.ResourceManager.HybridCompute.Models.OSProfileWindowsConfiguration windowsConfiguration = null, Azure.ResourceManager.HybridCompute.Models.OSProfileLinuxConfiguration linuxConfiguration = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.PrivateEndpointConnectionDataModel PrivateEndpointConnectionDataModel(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.HybridCompute.Models.PrivateEndpointConnectionProperties properties = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.PrivateEndpointConnectionProperties PrivateEndpointConnectionProperties(Azure.Core.ResourceIdentifier privateEndpointId = null, Azure.ResourceManager.HybridCompute.Models.HybridComputePrivateLinkServiceConnectionStateProperty connectionState = null, string provisioningState = null, System.Collections.Generic.IEnumerable groupIds = null) { throw null; } @@ -298,6 +392,19 @@ public static partial class ArmHybridComputeModelFactory public static bool operator !=(Azure.ResourceManager.HybridCompute.Models.AssessmentModeType left, Azure.ResourceManager.HybridCompute.Models.AssessmentModeType right) { throw null; } public override string ToString() { throw null; } } + public partial class AvailablePatchCountByClassification + { + internal AvailablePatchCountByClassification() { } + public int? Critical { get { throw null; } } + public int? Definition { get { throw null; } } + public int? FeaturePack { get { throw null; } } + public int? Other { get { throw null; } } + public int? Security { get { throw null; } } + public int? ServicePack { get { throw null; } } + public int? Tools { get { throw null; } } + public int? UpdateRollup { get { throw null; } } + public int? Updates { get { throw null; } } + } public partial class ConfigurationExtension { internal ConfigurationExtension() { } @@ -321,13 +428,25 @@ public ExtensionTargetProperties() { } public partial class HybridComputeMachineExtensionPatch : Azure.ResourceManager.HybridCompute.Models.HybridComputeResourceUpdate { public HybridComputeMachineExtensionPatch() { } - public Azure.ResourceManager.HybridCompute.Models.MachineExtensionUpdateProperties Properties { get { throw null; } set { } } + public bool? AutoUpgradeMinorVersion { get { throw null; } set { } } + public bool? EnableAutomaticUpgrade { get { throw null; } set { } } + public string ForceUpdateTag { get { throw null; } set { } } + public string MachineExtensionUpdatePropertiesType { get { throw null; } set { } } + public System.Collections.Generic.IDictionary ProtectedSettings { get { throw null; } } + public string Publisher { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Settings { get { throw null; } } + public string TypeHandlerVersion { get { throw null; } set { } } } public partial class HybridComputeMachinePatch : Azure.ResourceManager.HybridCompute.Models.HybridComputeResourceUpdate { public HybridComputeMachinePatch() { } + public Azure.ResourceManager.HybridCompute.Models.AgentUpgrade AgentUpgrade { get { throw null; } set { } } + public string CloudMetadataProvider { get { throw null; } } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } - public Azure.ResourceManager.HybridCompute.Models.MachineUpdateProperties Properties { get { throw null; } set { } } + public Azure.ResourceManager.HybridCompute.Models.LocationData LocationData { get { throw null; } set { } } + public Azure.ResourceManager.HybridCompute.Models.OSProfile OSProfile { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier ParentClusterResourceId { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier PrivateLinkScopeResourceId { get { throw null; } set { } } } public partial class HybridComputePrivateLinkResourceProperties { @@ -428,6 +547,38 @@ public HybridComputeServiceStatuses() { } public static bool operator !=(Azure.ResourceManager.HybridCompute.Models.InstanceViewType left, Azure.ResourceManager.HybridCompute.Models.InstanceViewType right) { throw null; } public override string ToString() { throw null; } } + public partial class IPAddress + { + internal IPAddress() { } + public string Address { get { throw null; } } + public string IPAddressVersion { get { throw null; } } + public string SubnetAddressPrefix { get { throw null; } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct LastAttemptStatusEnum : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public LastAttemptStatusEnum(string value) { throw null; } + public static Azure.ResourceManager.HybridCompute.Models.LastAttemptStatusEnum Failed { get { throw null; } } + public static Azure.ResourceManager.HybridCompute.Models.LastAttemptStatusEnum Success { get { throw null; } } + public bool Equals(Azure.ResourceManager.HybridCompute.Models.LastAttemptStatusEnum 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.HybridCompute.Models.LastAttemptStatusEnum left, Azure.ResourceManager.HybridCompute.Models.LastAttemptStatusEnum right) { throw null; } + public static implicit operator Azure.ResourceManager.HybridCompute.Models.LastAttemptStatusEnum (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.HybridCompute.Models.LastAttemptStatusEnum left, Azure.ResourceManager.HybridCompute.Models.LastAttemptStatusEnum right) { throw null; } + public override string ToString() { throw null; } + } + public partial class LinuxParameters + { + public LinuxParameters() { } + public System.Collections.Generic.IList ClassificationsToInclude { get { throw null; } } + public System.Collections.Generic.IList PackageNameMasksToExclude { get { throw null; } } + public System.Collections.Generic.IList PackageNameMasksToInclude { get { throw null; } } + } public partial class LocationData { public LocationData(string name) { } @@ -436,6 +587,20 @@ public LocationData(string name) { } public string District { get { throw null; } set { } } public string Name { get { throw null; } set { } } } + public partial class MachineAssessPatchesResult + { + internal MachineAssessPatchesResult() { } + public System.Guid? AssessmentActivityId { get { throw null; } } + public Azure.ResourceManager.HybridCompute.Models.AvailablePatchCountByClassification AvailablePatchCountByClassification { get { throw null; } } + public Azure.ResponseError ErrorDetails { get { throw null; } } + public System.DateTimeOffset? LastModifiedOn { get { throw null; } } + public Azure.ResourceManager.HybridCompute.Models.OSType? OSType { get { throw null; } } + public Azure.ResourceManager.HybridCompute.Models.PatchServiceUsed? PatchServiceUsed { get { throw null; } } + public bool? RebootPending { get { throw null; } } + public Azure.ResourceManager.HybridCompute.Models.PatchOperationStartedBy? StartedBy { get { throw null; } } + public System.DateTimeOffset? StartOn { get { throw null; } } + public Azure.ResourceManager.HybridCompute.Models.PatchOperationStatus? Status { get { throw null; } } + } public partial class MachineExtensionInstanceView { public MachineExtensionInstanceView() { } @@ -453,75 +618,47 @@ public MachineExtensionInstanceViewStatus() { } public string Message { get { throw null; } set { } } public System.DateTimeOffset? Time { get { throw null; } set { } } } - public partial class MachineExtensionProperties + public partial class MachineExtensionUpgrade { - public MachineExtensionProperties() { } - public bool? AutoUpgradeMinorVersion { get { throw null; } set { } } - public bool? EnableAutomaticUpgrade { get { throw null; } set { } } - public string ForceUpdateTag { get { throw null; } set { } } - public Azure.ResourceManager.HybridCompute.Models.MachineExtensionInstanceView InstanceView { get { throw null; } set { } } - public string MachineExtensionPropertiesType { get { throw null; } set { } } - public System.Collections.Generic.IDictionary ProtectedSettings { get { throw null; } } - public string ProvisioningState { get { throw null; } } - public string Publisher { get { throw null; } set { } } - public System.Collections.Generic.IDictionary Settings { get { throw null; } } - public string TypeHandlerVersion { get { throw null; } set { } } + public MachineExtensionUpgrade() { } + public System.Collections.Generic.IDictionary ExtensionTargets { get { throw null; } } } - public partial class MachineExtensionUpdateProperties + public partial class MachineInstallPatchesContent { - public MachineExtensionUpdateProperties() { } - public bool? AutoUpgradeMinorVersion { get { throw null; } set { } } - public bool? EnableAutomaticUpgrade { get { throw null; } set { } } - public string ForceUpdateTag { get { throw null; } set { } } - public string MachineExtensionUpdatePropertiesType { get { throw null; } set { } } - public System.Collections.Generic.IDictionary ProtectedSettings { get { throw null; } } - public string Publisher { get { throw null; } set { } } - public System.Collections.Generic.IDictionary Settings { get { throw null; } } - public string TypeHandlerVersion { get { throw null; } set { } } + public MachineInstallPatchesContent(System.TimeSpan maximumDuration, Azure.ResourceManager.HybridCompute.Models.VmGuestPatchRebootSetting rebootSetting) { } + public Azure.ResourceManager.HybridCompute.Models.LinuxParameters LinuxParameters { get { throw null; } set { } } + public System.TimeSpan MaximumDuration { get { throw null; } } + public Azure.ResourceManager.HybridCompute.Models.VmGuestPatchRebootSetting RebootSetting { get { throw null; } } + public Azure.ResourceManager.HybridCompute.Models.WindowsParameters WindowsParameters { get { throw null; } set { } } } - public partial class MachineExtensionUpgrade + public partial class MachineInstallPatchesResult { - public MachineExtensionUpgrade() { } - public System.Collections.Generic.IDictionary ExtensionTargets { get { throw null; } } + internal MachineInstallPatchesResult() { } + public Azure.ResponseError ErrorDetails { get { throw null; } } + public int? ExcludedPatchCount { get { throw null; } } + public int? FailedPatchCount { get { throw null; } } + public string InstallationActivityId { get { throw null; } } + public int? InstalledPatchCount { get { throw null; } } + public System.DateTimeOffset? LastModifiedOn { get { throw null; } } + public bool? MaintenanceWindowExceeded { get { throw null; } } + public int? NotSelectedPatchCount { get { throw null; } } + public Azure.ResourceManager.HybridCompute.Models.OSType? OSType { get { throw null; } } + public Azure.ResourceManager.HybridCompute.Models.PatchServiceUsed? PatchServiceUsed { get { throw null; } } + public int? PendingPatchCount { get { throw null; } } + public Azure.ResourceManager.HybridCompute.Models.VmGuestPatchRebootStatus? RebootStatus { get { throw null; } } + public Azure.ResourceManager.HybridCompute.Models.PatchOperationStartedBy? StartedBy { get { throw null; } } + public System.DateTimeOffset? StartOn { get { throw null; } } + public Azure.ResourceManager.HybridCompute.Models.PatchOperationStatus? Status { get { throw null; } } } - public partial class MachineProperties + public partial class NetworkInterface { - public MachineProperties() { } - public string AdFqdn { get { throw null; } } - public Azure.ResourceManager.HybridCompute.Models.AgentConfiguration AgentConfiguration { get { throw null; } } - public string AgentVersion { get { throw null; } } - public string ClientPublicKey { get { throw null; } set { } } - public string CloudMetadataProvider { get { throw null; } } - public System.Collections.Generic.IReadOnlyDictionary DetectedProperties { get { throw null; } } - public string DisplayName { get { throw null; } } - public string DnsFqdn { get { throw null; } } - public string DomainName { get { throw null; } } - public System.Collections.Generic.IReadOnlyList ErrorDetails { get { throw null; } } - public System.DateTimeOffset? LastStatusChange { get { throw null; } } - public Azure.ResourceManager.HybridCompute.Models.LocationData LocationData { get { throw null; } set { } } - public string MachineFqdn { get { throw null; } } - public string MssqlDiscovered { get { throw null; } set { } } - public string OSName { get { throw null; } } - public Azure.ResourceManager.HybridCompute.Models.OSProfile OSProfile { get { throw null; } set { } } - public string OSSku { get { throw null; } } - public string OSType { get { throw null; } set { } } - public string OSVersion { get { throw null; } } - public string ParentClusterResourceId { get { throw null; } set { } } - public string PrivateLinkScopeResourceId { get { throw null; } set { } } - public string ProvisioningState { get { throw null; } } - public Azure.ResourceManager.HybridCompute.Models.HybridComputeServiceStatuses ServiceStatuses { get { throw null; } set { } } - public Azure.ResourceManager.HybridCompute.Models.HybridComputeStatusType? Status { get { throw null; } } - public string VmId { get { throw null; } set { } } - public string VmUuid { get { throw null; } } + internal NetworkInterface() { } + public System.Collections.Generic.IReadOnlyList IPAddresses { get { throw null; } } } - public partial class MachineUpdateProperties + public partial class NetworkProfile { - public MachineUpdateProperties() { } - public string CloudMetadataProvider { get { throw null; } } - public Azure.ResourceManager.HybridCompute.Models.LocationData LocationData { get { throw null; } set { } } - public Azure.ResourceManager.HybridCompute.Models.OSProfile OSProfile { get { throw null; } set { } } - public string ParentClusterResourceId { get { throw null; } set { } } - public string PrivateLinkScopeResourceId { get { throw null; } set { } } + internal NetworkProfile() { } + public System.Collections.Generic.IReadOnlyList NetworkInterfaces { get { throw null; } } } public partial class OSProfile { @@ -543,6 +680,24 @@ public OSProfileWindowsConfiguration() { } public Azure.ResourceManager.HybridCompute.Models.PatchModeType? PatchMode { get { throw null; } set { } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct OSType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public OSType(string value) { throw null; } + public static Azure.ResourceManager.HybridCompute.Models.OSType Linux { get { throw null; } } + public static Azure.ResourceManager.HybridCompute.Models.OSType Windows { get { throw null; } } + public bool Equals(Azure.ResourceManager.HybridCompute.Models.OSType 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.HybridCompute.Models.OSType left, Azure.ResourceManager.HybridCompute.Models.OSType right) { throw null; } + public static implicit operator Azure.ResourceManager.HybridCompute.Models.OSType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.HybridCompute.Models.OSType left, Azure.ResourceManager.HybridCompute.Models.OSType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct PatchModeType : System.IEquatable { private readonly object _dummy; @@ -562,6 +717,67 @@ public OSProfileWindowsConfiguration() { } public static bool operator !=(Azure.ResourceManager.HybridCompute.Models.PatchModeType left, Azure.ResourceManager.HybridCompute.Models.PatchModeType right) { throw null; } public override string ToString() { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct PatchOperationStartedBy : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PatchOperationStartedBy(string value) { throw null; } + public static Azure.ResourceManager.HybridCompute.Models.PatchOperationStartedBy Platform { get { throw null; } } + public static Azure.ResourceManager.HybridCompute.Models.PatchOperationStartedBy User { get { throw null; } } + public bool Equals(Azure.ResourceManager.HybridCompute.Models.PatchOperationStartedBy 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.HybridCompute.Models.PatchOperationStartedBy left, Azure.ResourceManager.HybridCompute.Models.PatchOperationStartedBy right) { throw null; } + public static implicit operator Azure.ResourceManager.HybridCompute.Models.PatchOperationStartedBy (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.HybridCompute.Models.PatchOperationStartedBy left, Azure.ResourceManager.HybridCompute.Models.PatchOperationStartedBy right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct PatchOperationStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PatchOperationStatus(string value) { throw null; } + public static Azure.ResourceManager.HybridCompute.Models.PatchOperationStatus CompletedWithWarnings { get { throw null; } } + public static Azure.ResourceManager.HybridCompute.Models.PatchOperationStatus Failed { get { throw null; } } + public static Azure.ResourceManager.HybridCompute.Models.PatchOperationStatus InProgress { get { throw null; } } + public static Azure.ResourceManager.HybridCompute.Models.PatchOperationStatus Succeeded { get { throw null; } } + public static Azure.ResourceManager.HybridCompute.Models.PatchOperationStatus Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.HybridCompute.Models.PatchOperationStatus 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.HybridCompute.Models.PatchOperationStatus left, Azure.ResourceManager.HybridCompute.Models.PatchOperationStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.HybridCompute.Models.PatchOperationStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.HybridCompute.Models.PatchOperationStatus left, Azure.ResourceManager.HybridCompute.Models.PatchOperationStatus right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct PatchServiceUsed : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PatchServiceUsed(string value) { throw null; } + public static Azure.ResourceManager.HybridCompute.Models.PatchServiceUsed APT { get { throw null; } } + public static Azure.ResourceManager.HybridCompute.Models.PatchServiceUsed Unknown { get { throw null; } } + public static Azure.ResourceManager.HybridCompute.Models.PatchServiceUsed WU { get { throw null; } } + public static Azure.ResourceManager.HybridCompute.Models.PatchServiceUsed WUWsus { get { throw null; } } + public static Azure.ResourceManager.HybridCompute.Models.PatchServiceUsed YUM { get { throw null; } } + public static Azure.ResourceManager.HybridCompute.Models.PatchServiceUsed Zypper { get { throw null; } } + public bool Equals(Azure.ResourceManager.HybridCompute.Models.PatchServiceUsed 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.HybridCompute.Models.PatchServiceUsed left, Azure.ResourceManager.HybridCompute.Models.PatchServiceUsed right) { throw null; } + public static implicit operator Azure.ResourceManager.HybridCompute.Models.PatchServiceUsed (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.HybridCompute.Models.PatchServiceUsed left, Azure.ResourceManager.HybridCompute.Models.PatchServiceUsed right) { throw null; } + public override string ToString() { throw null; } + } public partial class PrivateEndpointConnectionDataModel : Azure.ResourceManager.Models.ResourceData { internal PrivateEndpointConnectionDataModel() { } @@ -600,4 +816,97 @@ internal PrivateLinkScopeValidationDetails() { } public static bool operator !=(Azure.ResourceManager.HybridCompute.Models.PublicNetworkAccessType left, Azure.ResourceManager.HybridCompute.Models.PublicNetworkAccessType right) { throw null; } public override string ToString() { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct VmGuestPatchClassificationLinux : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public VmGuestPatchClassificationLinux(string value) { throw null; } + public static Azure.ResourceManager.HybridCompute.Models.VmGuestPatchClassificationLinux Critical { get { throw null; } } + public static Azure.ResourceManager.HybridCompute.Models.VmGuestPatchClassificationLinux Other { get { throw null; } } + public static Azure.ResourceManager.HybridCompute.Models.VmGuestPatchClassificationLinux Security { get { throw null; } } + public bool Equals(Azure.ResourceManager.HybridCompute.Models.VmGuestPatchClassificationLinux 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.HybridCompute.Models.VmGuestPatchClassificationLinux left, Azure.ResourceManager.HybridCompute.Models.VmGuestPatchClassificationLinux right) { throw null; } + public static implicit operator Azure.ResourceManager.HybridCompute.Models.VmGuestPatchClassificationLinux (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.HybridCompute.Models.VmGuestPatchClassificationLinux left, Azure.ResourceManager.HybridCompute.Models.VmGuestPatchClassificationLinux right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct VmGuestPatchClassificationWindow : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public VmGuestPatchClassificationWindow(string value) { throw null; } + public static Azure.ResourceManager.HybridCompute.Models.VmGuestPatchClassificationWindow Critical { get { throw null; } } + public static Azure.ResourceManager.HybridCompute.Models.VmGuestPatchClassificationWindow Definition { get { throw null; } } + public static Azure.ResourceManager.HybridCompute.Models.VmGuestPatchClassificationWindow FeaturePack { get { throw null; } } + public static Azure.ResourceManager.HybridCompute.Models.VmGuestPatchClassificationWindow Security { get { throw null; } } + public static Azure.ResourceManager.HybridCompute.Models.VmGuestPatchClassificationWindow ServicePack { get { throw null; } } + public static Azure.ResourceManager.HybridCompute.Models.VmGuestPatchClassificationWindow Tools { get { throw null; } } + public static Azure.ResourceManager.HybridCompute.Models.VmGuestPatchClassificationWindow UpdateRollUp { get { throw null; } } + public static Azure.ResourceManager.HybridCompute.Models.VmGuestPatchClassificationWindow Updates { get { throw null; } } + public bool Equals(Azure.ResourceManager.HybridCompute.Models.VmGuestPatchClassificationWindow 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.HybridCompute.Models.VmGuestPatchClassificationWindow left, Azure.ResourceManager.HybridCompute.Models.VmGuestPatchClassificationWindow right) { throw null; } + public static implicit operator Azure.ResourceManager.HybridCompute.Models.VmGuestPatchClassificationWindow (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.HybridCompute.Models.VmGuestPatchClassificationWindow left, Azure.ResourceManager.HybridCompute.Models.VmGuestPatchClassificationWindow right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct VmGuestPatchRebootSetting : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public VmGuestPatchRebootSetting(string value) { throw null; } + public static Azure.ResourceManager.HybridCompute.Models.VmGuestPatchRebootSetting Always { get { throw null; } } + public static Azure.ResourceManager.HybridCompute.Models.VmGuestPatchRebootSetting IfRequired { get { throw null; } } + public static Azure.ResourceManager.HybridCompute.Models.VmGuestPatchRebootSetting Never { get { throw null; } } + public bool Equals(Azure.ResourceManager.HybridCompute.Models.VmGuestPatchRebootSetting 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.HybridCompute.Models.VmGuestPatchRebootSetting left, Azure.ResourceManager.HybridCompute.Models.VmGuestPatchRebootSetting right) { throw null; } + public static implicit operator Azure.ResourceManager.HybridCompute.Models.VmGuestPatchRebootSetting (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.HybridCompute.Models.VmGuestPatchRebootSetting left, Azure.ResourceManager.HybridCompute.Models.VmGuestPatchRebootSetting right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct VmGuestPatchRebootStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public VmGuestPatchRebootStatus(string value) { throw null; } + public static Azure.ResourceManager.HybridCompute.Models.VmGuestPatchRebootStatus Completed { get { throw null; } } + public static Azure.ResourceManager.HybridCompute.Models.VmGuestPatchRebootStatus Failed { get { throw null; } } + public static Azure.ResourceManager.HybridCompute.Models.VmGuestPatchRebootStatus NotNeeded { get { throw null; } } + public static Azure.ResourceManager.HybridCompute.Models.VmGuestPatchRebootStatus Required { get { throw null; } } + public static Azure.ResourceManager.HybridCompute.Models.VmGuestPatchRebootStatus Started { get { throw null; } } + public static Azure.ResourceManager.HybridCompute.Models.VmGuestPatchRebootStatus Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.HybridCompute.Models.VmGuestPatchRebootStatus 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.HybridCompute.Models.VmGuestPatchRebootStatus left, Azure.ResourceManager.HybridCompute.Models.VmGuestPatchRebootStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.HybridCompute.Models.VmGuestPatchRebootStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.HybridCompute.Models.VmGuestPatchRebootStatus left, Azure.ResourceManager.HybridCompute.Models.VmGuestPatchRebootStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class WindowsParameters + { + public WindowsParameters() { } + public System.Collections.Generic.IList ClassificationsToInclude { get { throw null; } } + public bool? ExcludeKbsRequiringReboot { get { throw null; } set { } } + public System.Collections.Generic.IList KbNumbersToExclude { get { throw null; } } + public System.Collections.Generic.IList KbNumbersToInclude { get { throw null; } } + public System.DateTimeOffset? MaxPatchPublishOn { get { throw null; } set { } } + } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/assets.json b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/assets.json index d2621e65cb272..efaa36bd0bb5c 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/assets.json +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/hybridcompute/Azure.ResourceManager.HybridCompute", - "Tag": "" + "Tag": "net/hybridcompute/Azure.ResourceManager.HybridCompute_3bcbb892fd" } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_ExtensionValueCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_ExtensionValueCollection.cs new file mode 100644 index 0000000000000..ef39e76656d5b --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_ExtensionValueCollection.cs @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.HybridCompute; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.HybridCompute.Samples +{ + public partial class Sample_ExtensionValueCollection + { + // GET an extensions metadata + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GETAnExtensionsMetadata() + { + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/ExtensionMetadata_Get.json + // this example is just showing the usage of "ExtensionMetadata_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this ExtensionValueResource + AzureLocation location = new AzureLocation("EastUS"); + string publisher = "microsoft.azure.monitor"; + string extensionType = "azuremonitorlinuxagent"; + ExtensionValueCollection collection = subscriptionResource.GetExtensionValues(location, publisher, extensionType); + + // invoke the operation + string version = "1.9.1"; + ExtensionValueResource result = await collection.GetAsync(version); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ExtensionValueData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // GET an extensions metadata + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Exists_GETAnExtensionsMetadata() + { + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/ExtensionMetadata_Get.json + // this example is just showing the usage of "ExtensionMetadata_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this ExtensionValueResource + AzureLocation location = new AzureLocation("EastUS"); + string publisher = "microsoft.azure.monitor"; + string extensionType = "azuremonitorlinuxagent"; + ExtensionValueCollection collection = subscriptionResource.GetExtensionValues(location, publisher, extensionType); + + // invoke the operation + string version = "1.9.1"; + bool result = await collection.ExistsAsync(version); + + Console.WriteLine($"Succeeded: {result}"); + } + + // GET an extensions metadata + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetIfExists_GETAnExtensionsMetadata() + { + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/ExtensionMetadata_Get.json + // this example is just showing the usage of "ExtensionMetadata_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this ExtensionValueResource + AzureLocation location = new AzureLocation("EastUS"); + string publisher = "microsoft.azure.monitor"; + string extensionType = "azuremonitorlinuxagent"; + ExtensionValueCollection collection = subscriptionResource.GetExtensionValues(location, publisher, extensionType); + + // invoke the operation + string version = "1.9.1"; + NullableResponse response = await collection.GetIfExistsAsync(version); + ExtensionValueResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine($"Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ExtensionValueData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + + // GET a list of extensions + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetAll_GETAListOfExtensions() + { + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/ExtensionMetadata_List.json + // this example is just showing the usage of "ExtensionMetadata_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this ExtensionValueResource + AzureLocation location = new AzureLocation("EastUS"); + string publisher = "microsoft.azure.monitor"; + string extensionType = "azuremonitorlinuxagent"; + ExtensionValueCollection collection = subscriptionResource.GetExtensionValues(location, publisher, extensionType); + + // invoke the operation and iterate over the result + await foreach (ExtensionValueResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ExtensionValueData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine($"Succeeded"); + } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_ExtensionValueResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_ExtensionValueResource.cs new file mode 100644 index 0000000000000..3a5746bf13a37 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_ExtensionValueResource.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager; +using Azure.ResourceManager.HybridCompute; + +namespace Azure.ResourceManager.HybridCompute.Samples +{ + public partial class Sample_ExtensionValueResource + { + // GET an extensions metadata + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GETAnExtensionsMetadata() + { + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/ExtensionMetadata_Get.json + // this example is just showing the usage of "ExtensionMetadata_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ExtensionValueResource created on azure + // for more information of creating ExtensionValueResource, please refer to the document of ExtensionValueResource + string subscriptionId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"; + AzureLocation location = new AzureLocation("EastUS"); + string publisher = "microsoft.azure.monitor"; + string extensionType = "azuremonitorlinuxagent"; + string version = "1.9.1"; + ResourceIdentifier extensionValueResourceId = ExtensionValueResource.CreateResourceIdentifier(subscriptionId, location, publisher, extensionType, version); + ExtensionValueResource extensionValue = client.GetExtensionValueResource(extensionValueResourceId); + + // invoke the operation + ExtensionValueResource result = await extensionValue.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + ExtensionValueData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeMachineCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeMachineCollection.cs index 91dc8dc34c08f..8ebbea4efdd7c 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeMachineCollection.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeMachineCollection.cs @@ -25,7 +25,7 @@ public partial class Sample_HybridComputeMachineCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateAMachine() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-05-10-preview/examples/Machines_CreateOrUpdate.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/Machines_CreateOrUpdate.json // this example is just showing the usage of "Machines_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 @@ -47,15 +47,12 @@ public async Task CreateOrUpdate_CreateOrUpdateAMachine() string machineName = "myMachine"; HybridComputeMachineData data = new HybridComputeMachineData(new AzureLocation("eastus2euap")) { - Properties = new MachineProperties() - { - LocationData = new LocationData("Redmond"), - VmId = "b7a098cc-b0b8-46e8-a205-62f301a62a8f", - ClientPublicKey = "string", - PrivateLinkScopeResourceId = "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName", - ParentClusterResourceId = "{AzureStackHCIResourceId}", - }, Identity = new ManagedServiceIdentity("SystemAssigned"), + LocationData = new LocationData("Redmond"), + VmId = Guid.Parse("b7a098cc-b0b8-46e8-a205-62f301a62a8f"), + ClientPublicKey = "string", + PrivateLinkScopeResourceId = new ResourceIdentifier("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName"), + ParentClusterResourceId = new ResourceIdentifier("{AzureStackHCIResourceId}"), }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, machineName, data); HybridComputeMachineResource result = lro.Value; @@ -72,7 +69,7 @@ public async Task CreateOrUpdate_CreateOrUpdateAMachine() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetMachine() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-05-10-preview/examples/Machines_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/Machines_Get.json // this example is just showing the usage of "Machines_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 @@ -106,7 +103,7 @@ public async Task Get_GetMachine() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetMachine() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-05-10-preview/examples/Machines_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/Machines_Get.json // this example is just showing the usage of "Machines_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 @@ -136,7 +133,7 @@ public async Task Exists_GetMachine() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetMachine() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-05-10-preview/examples/Machines_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/Machines_Get.json // this example is just showing the usage of "Machines_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 @@ -178,7 +175,7 @@ public async Task GetIfExists_GetMachine() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListMachinesByResourceGroup() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-05-10-preview/examples/Machines_ListByResourceGroup.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/Machines_ListByResourceGroup.json // this example is just showing the usage of "Machines_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/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeMachineExtensionCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeMachineExtensionCollection.cs index 4e2ea1222bba6..083dc001ea876 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeMachineExtensionCollection.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeMachineExtensionCollection.cs @@ -12,7 +12,6 @@ using Azure.Identity; using Azure.ResourceManager; using Azure.ResourceManager.HybridCompute; -using Azure.ResourceManager.HybridCompute.Models; namespace Azure.ResourceManager.HybridCompute.Samples { @@ -23,7 +22,7 @@ public partial class Sample_HybridComputeMachineExtensionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateAMachineExtension() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-05-10-preview/examples/PUTExtension.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/PUTExtension.json // this example is just showing the usage of "MachineExtensions_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 @@ -46,16 +45,13 @@ public async Task CreateOrUpdate_CreateOrUpdateAMachineExtension() string extensionName = "CustomScriptExtension"; HybridComputeMachineExtensionData data = new HybridComputeMachineExtensionData(new AzureLocation("eastus2euap")) { - Properties = new MachineExtensionProperties() - { - Publisher = "Microsoft.Compute", - MachineExtensionPropertiesType = "CustomScriptExtension", - TypeHandlerVersion = "1.10", - Settings = + Publisher = "Microsoft.Compute", + TypePropertiesType = "CustomScriptExtension", + TypeHandlerVersion = "1.10", + Settings = { ["commandToExecute"] = BinaryData.FromString("powershell.exe -c \"Get-Process | Where-Object { $_.CPU -gt 10000 }\""), }, - }, }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, extensionName, data); HybridComputeMachineExtensionResource result = lro.Value; @@ -72,7 +68,7 @@ public async Task CreateOrUpdate_CreateOrUpdateAMachineExtension() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GETMachineExtension() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-05-10-preview/examples/GETExtension.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/GETExtension.json // this example is just showing the usage of "MachineExtensions_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 @@ -107,7 +103,7 @@ public async Task Get_GETMachineExtension() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GETMachineExtension() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-05-10-preview/examples/GETExtension.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/GETExtension.json // this example is just showing the usage of "MachineExtensions_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 @@ -138,7 +134,7 @@ public async Task Exists_GETMachineExtension() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GETMachineExtension() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-05-10-preview/examples/GETExtension.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/GETExtension.json // this example is just showing the usage of "MachineExtensions_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 @@ -181,7 +177,7 @@ public async Task GetIfExists_GETMachineExtension() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_GETAllMachineExtensions() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-05-10-preview/examples/LISTExtension.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/LISTExtension.json // this example is just showing the usage of "MachineExtensions_List" 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/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeMachineExtensionResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeMachineExtensionResource.cs index c39660f13a3ec..9a04cafd0aaf6 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeMachineExtensionResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeMachineExtensionResource.cs @@ -23,7 +23,7 @@ public partial class Sample_HybridComputeMachineExtensionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateAMachineExtension() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-05-10-preview/examples/UpdateExtension.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/UpdateExtension.json // this example is just showing the usage of "MachineExtensions_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 @@ -43,17 +43,14 @@ public async Task Update_CreateOrUpdateAMachineExtension() // invoke the operation HybridComputeMachineExtensionPatch patch = new HybridComputeMachineExtensionPatch() { - Properties = new MachineExtensionUpdateProperties() - { - Publisher = "Microsoft.Compute", - MachineExtensionUpdatePropertiesType = "CustomScriptExtension", - TypeHandlerVersion = "1.10", - EnableAutomaticUpgrade = true, - Settings = + Publisher = "Microsoft.Compute", + MachineExtensionUpdatePropertiesType = "CustomScriptExtension", + TypeHandlerVersion = "1.10", + EnableAutomaticUpgrade = true, + Settings = { ["commandToExecute"] = BinaryData.FromString("powershell.exe -c \"Get-Process | Where-Object { $_.CPU -lt 100 }\""), }, - }, }; ArmOperation lro = await hybridComputeMachineExtension.UpdateAsync(WaitUntil.Completed, patch); HybridComputeMachineExtensionResource result = lro.Value; @@ -70,7 +67,7 @@ public async Task Update_CreateOrUpdateAMachineExtension() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteAMachineExtension() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-05-10-preview/examples/DELETEExtension.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/DELETEExtension.json // this example is just showing the usage of "MachineExtensions_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 @@ -98,7 +95,7 @@ public async Task Delete_DeleteAMachineExtension() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GETMachineExtension() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-05-10-preview/examples/GETExtension.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/GETExtension.json // this example is just showing the usage of "MachineExtensions_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 diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeMachineResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeMachineResource.cs index 37e1f5f256c23..7664947b98588 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeMachineResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeMachineResource.cs @@ -7,6 +7,7 @@ using System; using System.Threading.Tasks; +using System.Xml; using Azure; using Azure.Core; using Azure.Identity; @@ -25,7 +26,7 @@ public partial class Sample_HybridComputeMachineResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateAMachine() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-05-10-preview/examples/Machines_Update.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/Machines_Update.json // this example is just showing the usage of "Machines_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 @@ -45,25 +46,22 @@ public async Task Update_UpdateAMachine() HybridComputeMachinePatch patch = new HybridComputeMachinePatch() { Identity = new ManagedServiceIdentity("SystemAssigned"), - Properties = new MachineUpdateProperties() + LocationData = new LocationData("Redmond"), + OSProfile = new OSProfile() { - LocationData = new LocationData("Redmond"), - OSProfile = new OSProfile() + WindowsConfiguration = new OSProfileWindowsConfiguration() { - WindowsConfiguration = new OSProfileWindowsConfiguration() - { - AssessmentMode = AssessmentModeType.ImageDefault, - PatchMode = PatchModeType.Manual, - }, - LinuxConfiguration = new OSProfileLinuxConfiguration() - { - AssessmentMode = AssessmentModeType.ImageDefault, - PatchMode = PatchModeType.Manual, - }, + AssessmentMode = AssessmentModeType.ImageDefault, + PatchMode = PatchModeType.Manual, + }, + LinuxConfiguration = new OSProfileLinuxConfiguration() + { + AssessmentMode = AssessmentModeType.ImageDefault, + PatchMode = PatchModeType.Manual, }, - ParentClusterResourceId = "{AzureStackHCIResourceId}", - PrivateLinkScopeResourceId = "/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName", }, + ParentClusterResourceId = new ResourceIdentifier("{AzureStackHCIResourceId}"), + PrivateLinkScopeResourceId = new ResourceIdentifier("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName"), }; HybridComputeMachineResource result = await hybridComputeMachine.UpdateAsync(patch); @@ -79,7 +77,7 @@ public async Task Update_UpdateAMachine() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteAMachine() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-05-10-preview/examples/Machines_Delete.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/Machines_Delete.json // this example is just showing the usage of "Machines_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 @@ -106,7 +104,7 @@ public async Task Delete_DeleteAMachine() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetMachine() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-05-10-preview/examples/Machines_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/Machines_Get.json // this example is just showing the usage of "Machines_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 @@ -132,12 +130,79 @@ public async Task Get_GetMachine() Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + // Assess patch state of a machine. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task AssessPatches_AssessPatchStateOfAMachine() + { + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/MachineAssessPatches.json + // this example is just showing the usage of "Machines_AssessPatches" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this HybridComputeMachineResource created on azure + // for more information of creating HybridComputeMachineResource, please refer to the document of HybridComputeMachineResource + string subscriptionId = "{subscription-id}"; + string resourceGroupName = "myResourceGroupName"; + string name = "myMachineName"; + ResourceIdentifier hybridComputeMachineResourceId = HybridComputeMachineResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + HybridComputeMachineResource hybridComputeMachine = client.GetHybridComputeMachineResource(hybridComputeMachineResourceId); + + // invoke the operation + ArmOperation lro = await hybridComputeMachine.AssessPatchesAsync(WaitUntil.Completed); + MachineAssessPatchesResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + // Install patch state of a machine. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task InstallPatches_InstallPatchStateOfAMachine() + { + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/MachineInstallPatches.json + // this example is just showing the usage of "Machines_InstallPatches" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this HybridComputeMachineResource created on azure + // for more information of creating HybridComputeMachineResource, please refer to the document of HybridComputeMachineResource + string subscriptionId = "{subscription-id}"; + string resourceGroupName = "myResourceGroupName"; + string name = "myMachineName"; + ResourceIdentifier hybridComputeMachineResourceId = HybridComputeMachineResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, name); + HybridComputeMachineResource hybridComputeMachine = client.GetHybridComputeMachineResource(hybridComputeMachineResourceId); + + // invoke the operation + MachineInstallPatchesContent content = new MachineInstallPatchesContent(XmlConvert.ToTimeSpan("PT4H"), VmGuestPatchRebootSetting.IfRequired) + { + WindowsParameters = new WindowsParameters() + { + ClassificationsToInclude = +{ +VmGuestPatchClassificationWindow.Critical,VmGuestPatchClassificationWindow.Security +}, + MaxPatchPublishOn = DateTimeOffset.Parse("2021-08-19T02:36:43.0539904+00:00"), + }, + }; + ArmOperation lro = await hybridComputeMachine.InstallPatchesAsync(WaitUntil.Completed, content); + MachineInstallPatchesResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + // List Machines by resource group [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetHybridComputeMachines_ListMachinesByResourceGroup() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-05-10-preview/examples/Machines_ListBySubscription.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/Machines_ListBySubscription.json // this example is just showing the usage of "Machines_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 @@ -169,7 +234,7 @@ public async Task GetHybridComputeMachines_ListMachinesByResourceGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task UpgradeExtensions_UpgradeMachineExtensions() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-05-10-preview/examples/Extensions_Upgrade.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/Extensions_Upgrade.json // this example is just showing the usage of "UpgradeExtensions" 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 @@ -205,12 +270,39 @@ public async Task UpgradeExtensions_UpgradeMachineExtensions() Console.WriteLine($"Succeeded"); } + // GET Network Profile + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task GetNetworkProfile_GETNetworkProfile() + { + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/GETNetworkProfile.json + // this example is just showing the usage of "NetworkProfile_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this HybridComputeMachineResource created on azure + // for more information of creating HybridComputeMachineResource, please refer to the document of HybridComputeMachineResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "myResourceGroup"; + string machineName = "myMachine"; + ResourceIdentifier hybridComputeMachineResourceId = HybridComputeMachineResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, machineName); + HybridComputeMachineResource hybridComputeMachine = client.GetHybridComputeMachineResource(hybridComputeMachineResourceId); + + // invoke the operation + NetworkProfile result = await hybridComputeMachine.GetNetworkProfileAsync(); + + Console.WriteLine($"Succeeded: {result}"); + } + // PrivateLinkScopeGet [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetValidationDetailsForMachinePrivateLinkScope_PrivateLinkScopeGet() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-05-10-preview/examples/PrivateLinkScopesGetValidationForMachine.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/PrivateLinkScopesGetValidationForMachine.json // this example is just showing the usage of "PrivateLinkScopes_GetValidationDetailsForMachine" 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/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateEndpointConnectionCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateEndpointConnectionCollection.cs index 78023d75bce15..55613489d063e 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateEndpointConnectionCollection.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateEndpointConnectionCollection.cs @@ -23,7 +23,7 @@ public partial class Sample_HybridComputePrivateEndpointConnectionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-05-10-preview/examples/PrivateEndpointConnectionGet.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/PrivateEndpointConnectionGet.json // this example is just showing the usage of "PrivateEndpointConnections_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 @@ -58,7 +58,7 @@ public async Task Get_GetsPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-05-10-preview/examples/PrivateEndpointConnectionGet.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/PrivateEndpointConnectionGet.json // this example is just showing the usage of "PrivateEndpointConnections_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 @@ -89,7 +89,7 @@ public async Task Exists_GetsPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-05-10-preview/examples/PrivateEndpointConnectionGet.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/PrivateEndpointConnectionGet.json // this example is just showing the usage of "PrivateEndpointConnections_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 @@ -132,7 +132,7 @@ public async Task GetIfExists_GetsPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_ApproveOrRejectAPrivateEndpointConnectionWithAGivenName() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-05-10-preview/examples/PrivateEndpointConnectionUpdate.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/PrivateEndpointConnectionUpdate.json // this example is just showing the usage of "PrivateEndpointConnections_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 @@ -175,7 +175,7 @@ public async Task CreateOrUpdate_ApproveOrRejectAPrivateEndpointConnectionWithAG [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_GetsListOfPrivateEndpointConnectionsOnAPrivateLinkScope() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-05-10-preview/examples/PrivateEndpointConnectionList.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/PrivateEndpointConnectionList.json // this example is just showing the usage of "PrivateEndpointConnections_ListByPrivateLinkScope" 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/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateEndpointConnectionResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateEndpointConnectionResource.cs index 2d4e0f037e1b4..eedb0b001fb73 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateEndpointConnectionResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateEndpointConnectionResource.cs @@ -23,7 +23,7 @@ public partial class Sample_HybridComputePrivateEndpointConnectionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-05-10-preview/examples/PrivateEndpointConnectionGet.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/PrivateEndpointConnectionGet.json // this example is just showing the usage of "PrivateEndpointConnections_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 @@ -55,7 +55,7 @@ public async Task Get_GetsPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_ApproveOrRejectAPrivateEndpointConnectionWithAGivenName() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-05-10-preview/examples/PrivateEndpointConnectionUpdate.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/PrivateEndpointConnectionUpdate.json // this example is just showing the usage of "PrivateEndpointConnections_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 @@ -95,7 +95,7 @@ public async Task Update_ApproveOrRejectAPrivateEndpointConnectionWithAGivenName [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeletesAPrivateEndpointConnectionWithAGivenName() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-05-10-preview/examples/PrivateEndpointConnectionDelete.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/PrivateEndpointConnectionDelete.json // this example is just showing the usage of "PrivateEndpointConnections_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateLinkResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateLinkResource.cs index 03cb4eafc4fd7..17a7799c367f4 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateLinkResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateLinkResource.cs @@ -21,7 +21,7 @@ public partial class Sample_HybridComputePrivateLinkResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-05-10-preview/examples/PrivateLinkScopePrivateLinkResourceGet.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/PrivateLinkScopePrivateLinkResourceGet.json // this example is just showing the usage of "PrivateLinkResources_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 diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateLinkResourceCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateLinkResourceCollection.cs index 34a575c059a0a..e35b79d6b28a1 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateLinkResourceCollection.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateLinkResourceCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_HybridComputePrivateLinkResourceCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-05-10-preview/examples/PrivateLinkScopePrivateLinkResourceListGet.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/PrivateLinkScopePrivateLinkResourceListGet.json // this example is just showing the usage of "PrivateLinkResources_ListByPrivateLinkScope" 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 @@ -59,7 +59,7 @@ public async Task GetAll_GetsPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-05-10-preview/examples/PrivateLinkScopePrivateLinkResourceGet.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/PrivateLinkScopePrivateLinkResourceGet.json // this example is just showing the usage of "PrivateLinkResources_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 @@ -94,7 +94,7 @@ public async Task Get_GetsPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-05-10-preview/examples/PrivateLinkScopePrivateLinkResourceGet.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/PrivateLinkScopePrivateLinkResourceGet.json // this example is just showing the usage of "PrivateLinkResources_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 @@ -125,7 +125,7 @@ public async Task Exists_GetsPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-05-10-preview/examples/PrivateLinkScopePrivateLinkResourceGet.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/PrivateLinkScopePrivateLinkResourceGet.json // this example is just showing the usage of "PrivateLinkResources_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 diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateLinkScopeCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateLinkScopeCollection.cs index dc8b56c60a76b..362d00ee4a6ba 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateLinkScopeCollection.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateLinkScopeCollection.cs @@ -23,7 +23,7 @@ public partial class Sample_HybridComputePrivateLinkScopeCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_PrivateLinkScopeListByResourceGroup() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-05-10-preview/examples/PrivateLinkScopesListByResourceGroup.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/PrivateLinkScopesListByResourceGroup.json // this example is just showing the usage of "PrivateLinkScopes_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 @@ -59,7 +59,7 @@ public async Task GetAll_PrivateLinkScopeListByResourceGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_PrivateLinkScopeGet() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-05-10-preview/examples/PrivateLinkScopesGet.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/PrivateLinkScopesGet.json // this example is just showing the usage of "PrivateLinkScopes_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 @@ -93,7 +93,7 @@ public async Task Get_PrivateLinkScopeGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_PrivateLinkScopeGet() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-05-10-preview/examples/PrivateLinkScopesGet.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/PrivateLinkScopesGet.json // this example is just showing the usage of "PrivateLinkScopes_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -123,7 +123,7 @@ public async Task Exists_PrivateLinkScopeGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_PrivateLinkScopeGet() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-05-10-preview/examples/PrivateLinkScopesGet.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/PrivateLinkScopesGet.json // this example is just showing the usage of "PrivateLinkScopes_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -165,7 +165,7 @@ public async Task GetIfExists_PrivateLinkScopeGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_PrivateLinkScopeCreate() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-05-10-preview/examples/PrivateLinkScopesCreate.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/PrivateLinkScopesCreate.json // this example is just showing the usage of "PrivateLinkScopes_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 @@ -201,7 +201,7 @@ public async Task CreateOrUpdate_PrivateLinkScopeCreate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_PrivateLinkScopeUpdate() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-05-10-preview/examples/PrivateLinkScopesUpdate.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/PrivateLinkScopesUpdate.json // this example is just showing the usage of "PrivateLinkScopes_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateLinkScopeResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateLinkScopeResource.cs index a2f4425461a03..4db3071a19d47 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateLinkScopeResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateLinkScopeResource.cs @@ -24,7 +24,7 @@ public partial class Sample_HybridComputePrivateLinkScopeResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetHybridComputePrivateLinkScopes_PrivateLinkScopesListJson() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-05-10-preview/examples/PrivateLinkScopesList.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/PrivateLinkScopesList.json // this example is just showing the usage of "PrivateLinkScopes_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -56,7 +56,7 @@ public async Task GetHybridComputePrivateLinkScopes_PrivateLinkScopesListJson() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_PrivateLinkScopesDelete() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-05-10-preview/examples/PrivateLinkScopesDelete.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/PrivateLinkScopesDelete.json // this example is just showing the usage of "PrivateLinkScopes_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 @@ -83,7 +83,7 @@ public async Task Delete_PrivateLinkScopesDelete() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_PrivateLinkScopeGet() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-05-10-preview/examples/PrivateLinkScopesGet.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/PrivateLinkScopesGet.json // this example is just showing the usage of "PrivateLinkScopes_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 @@ -114,7 +114,7 @@ public async Task Get_PrivateLinkScopeGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_PrivateLinkScopeUpdateTagsOnly() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-05-10-preview/examples/PrivateLinkScopesUpdateTagsOnly.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/PrivateLinkScopesUpdateTagsOnly.json // this example is just showing the usage of "PrivateLinkScopes_UpdateTags" 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 @@ -153,7 +153,7 @@ public async Task Update_PrivateLinkScopeUpdateTagsOnly() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetValidationDetailsPrivateLinkScope_PrivateLinkScopeGet() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2022-05-10-preview/examples/PrivateLinkScopesGetValidation.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2022-12-27/examples/PrivateLinkScopesGetValidation.json // this example is just showing the usage of "PrivateLinkScopes_GetValidationDetails" 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/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ArmHybridComputeModelFactory.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ArmHybridComputeModelFactory.cs index 1bb361f71ce14..2525e20c0db0d 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ArmHybridComputeModelFactory.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ArmHybridComputeModelFactory.cs @@ -25,23 +25,13 @@ public static partial class ArmHybridComputeModelFactory /// The systemData. /// The tags. /// The location. - /// Hybrid Compute Machine properties. /// The list of extensions affiliated to the machine. /// Identity for the resource. Current supported identity types: SystemAssigned. - /// A new instance for mocking. - public static HybridComputeMachineData HybridComputeMachineData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, MachineProperties properties = null, IEnumerable resources = null, ManagedServiceIdentity identity = null) - { - tags ??= new Dictionary(); - resources ??= new List(); - - return new HybridComputeMachineData(id, name, resourceType, systemData, tags, location, properties, resources?.ToList(), identity); - } - - /// Initializes a new instance of MachineProperties. /// Metadata pertaining to the geographic location of the resource. /// Configurable properties that the user can set locally via the azcmagent config command, or remotely via ARM. /// Statuses of dependent services that are reported back to ARM. /// The metadata of the cloud environment (Azure/GCP/AWS/OCI...). + /// The info of the machine w.r.t Agent Upgrade. /// Specifies the operating system settings for the hybrid machine. /// The provisioning state, which only appears in the response. /// The status of the hybrid machine agent. @@ -56,6 +46,7 @@ public static HybridComputeMachineData HybridComputeMachineData(ResourceIdentifi /// The version of Operating System running on the hybrid machine. /// The type of Operating System (windows/linux). /// Specifies the Arc Machine's unique SMBIOS ID. + /// Machine Extensions information (deprecated field). /// Specifies the Operating System product SKU. /// Specifies the Windows domain name. /// Specifies the AD fully qualified display name. @@ -64,13 +55,16 @@ public static HybridComputeMachineData HybridComputeMachineData(ResourceIdentifi /// The resource id of the parent cluster (Azure HCI) this machine is assigned to, if any. /// Specifies whether any MS SQL instance is discovered on the machine. /// Detected properties from the machine. - /// A new instance for mocking. - public static MachineProperties MachineProperties(LocationData locationData = null, AgentConfiguration agentConfiguration = null, HybridComputeServiceStatuses serviceStatuses = null, string cloudMetadataProvider = null, OSProfile osProfile = null, string provisioningState = null, HybridComputeStatusType? status = null, DateTimeOffset? lastStatusChange = null, IEnumerable errorDetails = null, string agentVersion = null, string vmId = null, string displayName = null, string machineFqdn = null, string clientPublicKey = null, string osName = null, string osVersion = null, string osType = null, string vmUuid = null, string osSku = null, string domainName = null, string adFqdn = null, string dnsFqdn = null, string privateLinkScopeResourceId = null, string parentClusterResourceId = null, string mssqlDiscovered = null, IReadOnlyDictionary detectedProperties = null) + /// A new instance for mocking. + public static HybridComputeMachineData HybridComputeMachineData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, IEnumerable resources = null, ManagedServiceIdentity identity = null, LocationData locationData = null, AgentConfiguration agentConfiguration = null, HybridComputeServiceStatuses serviceStatuses = null, string cloudMetadataProvider = null, AgentUpgrade agentUpgrade = null, OSProfile osProfile = null, string provisioningState = null, HybridComputeStatusType? status = null, DateTimeOffset? lastStatusChange = null, IEnumerable errorDetails = null, string agentVersion = null, Guid? vmId = null, string displayName = null, string machineFqdn = null, string clientPublicKey = null, string osName = null, string osVersion = null, string osType = null, Guid? vmUuid = null, IEnumerable extensions = null, string osSku = null, string domainName = null, string adFqdn = null, string dnsFqdn = null, ResourceIdentifier privateLinkScopeResourceId = null, ResourceIdentifier parentClusterResourceId = null, string mssqlDiscovered = null, IReadOnlyDictionary detectedProperties = null) { + tags ??= new Dictionary(); + resources ??= new List(); errorDetails ??= new List(); + extensions ??= new List(); detectedProperties ??= new Dictionary(); - return new MachineProperties(locationData, agentConfiguration, serviceStatuses, cloudMetadataProvider != null ? new CloudMetadata(cloudMetadataProvider) : null, osProfile, provisioningState, status, lastStatusChange, errorDetails?.ToList(), agentVersion, vmId, displayName, machineFqdn, clientPublicKey, osName, osVersion, osType, vmUuid, osSku, domainName, adFqdn, dnsFqdn, privateLinkScopeResourceId, parentClusterResourceId, mssqlDiscovered, detectedProperties); + return new HybridComputeMachineData(id, name, resourceType, systemData, tags, location, resources?.ToList(), identity, locationData, agentConfiguration, serviceStatuses, cloudMetadataProvider != null ? new CloudMetadata(cloudMetadataProvider) : null, agentUpgrade, osProfile, provisioningState, status, lastStatusChange, errorDetails?.ToList(), agentVersion, vmId, displayName, machineFqdn, clientPublicKey, osName, osVersion, osType, vmUuid, extensions?.ToList(), osSku, domainName, adFqdn, dnsFqdn, privateLinkScopeResourceId, parentClusterResourceId, mssqlDiscovered, detectedProperties); } /// Initializes a new instance of AgentConfiguration. @@ -102,6 +96,19 @@ public static ConfigurationExtension ConfigurationExtension(string publisher = n return new ConfigurationExtension(publisher, configurationExtensionType); } + /// Initializes a new instance of AgentUpgrade. + /// Specifies the version info w.r.t AgentUpgrade for the machine. + /// The correlation ID passed in from RSM per upgrade. + /// Specifies if RSM should try to upgrade this machine. + /// Timestamp of last upgrade attempt. + /// Specifies the status of Agent Upgrade. + /// Failure message of last upgrade attempt if any. + /// A new instance for mocking. + public static AgentUpgrade AgentUpgrade(string desiredVersion = null, Guid? correlationId = null, bool? enableAutomaticUpgrade = null, DateTimeOffset? lastAttemptTimestamp = null, LastAttemptStatusEnum? lastAttemptStatus = null, string lastAttemptMessage = null) + { + return new AgentUpgrade(desiredVersion, correlationId, enableAutomaticUpgrade, lastAttemptTimestamp, lastAttemptStatus, lastAttemptMessage); + } + /// Initializes a new instance of OSProfile. /// Specifies the host OS name of the hybrid machine. /// Specifies the windows configuration for update management. @@ -119,19 +126,9 @@ public static OSProfile OSProfile(string computerName = null, OSProfileWindowsCo /// The systemData. /// The tags. /// The location. - /// Describes Machine Extension Properties. - /// A new instance for mocking. - public static HybridComputeMachineExtensionData HybridComputeMachineExtensionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, MachineExtensionProperties properties = null) - { - tags ??= new Dictionary(); - - return new HybridComputeMachineExtensionData(id, name, resourceType, systemData, tags, location, properties); - } - - /// Initializes a new instance of MachineExtensionProperties. /// How the extension handler should be forced to update even if the extension configuration has not changed. /// The name of the extension handler publisher. - /// Specifies the type of the extension; an example is "CustomScriptExtension". + /// Specifies the type of the extension; an example is "CustomScriptExtension". /// Specifies the version of the script handler. /// Indicates whether the extension should be automatically upgraded by the platform if there is a newer version available. /// Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. @@ -139,13 +136,113 @@ public static HybridComputeMachineExtensionData HybridComputeMachineExtensionDat /// The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. /// The provisioning state, which only appears in the response. /// The machine extension instance view. - /// A new instance for mocking. - public static MachineExtensionProperties MachineExtensionProperties(string forceUpdateTag = null, string publisher = null, string machineExtensionPropertiesType = null, string typeHandlerVersion = null, bool? enableAutomaticUpgrade = null, bool? autoUpgradeMinorVersion = null, IDictionary settings = null, IDictionary protectedSettings = null, string provisioningState = null, MachineExtensionInstanceView instanceView = null) + /// A new instance for mocking. + public static HybridComputeMachineExtensionData HybridComputeMachineExtensionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string forceUpdateTag = null, string publisher = null, string typePropertiesType = null, string typeHandlerVersion = null, bool? enableAutomaticUpgrade = null, bool? autoUpgradeMinorVersion = null, IDictionary settings = null, IDictionary protectedSettings = null, string provisioningState = null, MachineExtensionInstanceView instanceView = null) { + tags ??= new Dictionary(); settings ??= new Dictionary(); protectedSettings ??= new Dictionary(); - return new MachineExtensionProperties(forceUpdateTag, publisher, machineExtensionPropertiesType, typeHandlerVersion, enableAutomaticUpgrade, autoUpgradeMinorVersion, settings, protectedSettings, provisioningState, instanceView); + return new HybridComputeMachineExtensionData(id, name, resourceType, systemData, tags, location, forceUpdateTag, publisher, typePropertiesType, typeHandlerVersion, enableAutomaticUpgrade, autoUpgradeMinorVersion, settings, protectedSettings, provisioningState, instanceView); + } + + /// Initializes a new instance of MachineAssessPatchesResult. + /// The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Unknown", "Failed", "Succeeded", or "CompletedWithWarnings.". + /// The activity ID of the operation that produced this result. + /// The overall reboot status of the VM. It will be true when partially installed patches require a reboot to complete installation but the reboot has not yet occurred. + /// Summarization of patches available for installation on the machine by classification. + /// The UTC timestamp when the operation began. + /// The UTC timestamp when the operation finished. + /// Indicates if operation was triggered by user or by platform. + /// Specifies the patch service used for the operation. + /// The operating system type of the machine. + /// The errors that were encountered during execution of the operation. The details array contains the list of them. + /// A new instance for mocking. + public static MachineAssessPatchesResult MachineAssessPatchesResult(PatchOperationStatus? status = null, Guid? assessmentActivityId = null, bool? rebootPending = null, AvailablePatchCountByClassification availablePatchCountByClassification = null, DateTimeOffset? startOn = null, DateTimeOffset? lastModifiedOn = null, PatchOperationStartedBy? startedBy = null, PatchServiceUsed? patchServiceUsed = null, OSType? osType = null, ResponseError errorDetails = null) + { + return new MachineAssessPatchesResult(status, assessmentActivityId, rebootPending, availablePatchCountByClassification, startOn, lastModifiedOn, startedBy, patchServiceUsed, osType, errorDetails); + } + + /// Initializes a new instance of AvailablePatchCountByClassification. + /// Number of security patches available for installation. + /// Number of critical patches available for installation. + /// Number of definition patches available for installation. + /// Number of update Rollup patches available for installation. + /// Number of feature pack patches available for installation. + /// Number of service pack patches available for installation. + /// Number of tools patches available for installation. + /// Number of updates category patches available for installation. + /// Number of other patches available for installation. + /// A new instance for mocking. + public static AvailablePatchCountByClassification AvailablePatchCountByClassification(int? security = null, int? critical = null, int? definition = null, int? updateRollup = null, int? featurePack = null, int? servicePack = null, int? tools = null, int? updates = null, int? other = null) + { + return new AvailablePatchCountByClassification(security, critical, definition, updateRollup, featurePack, servicePack, tools, updates, other); + } + + /// Initializes a new instance of MachineInstallPatchesResult. + /// The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Failed", "Succeeded", "Unknown" or "CompletedWithWarnings.". + /// The activity ID of the operation that produced this result. + /// The reboot state of the VM following completion of the operation. + /// Whether the operation ran out of time before it completed all its intended actions. + /// The number of patches that were not installed due to the user blocking their installation. + /// The number of patches that were detected as available for install, but did not meet the operation's criteria. + /// The number of patches that were identified as meeting the installation criteria, but were not able to be installed. Typically this happens when maintenanceWindowExceeded == true. + /// The number of patches successfully installed. + /// The number of patches that could not be installed due to some issue. See errors for details. + /// The UTC timestamp when the operation began. + /// The UTC timestamp when the operation finished. + /// Indicates if operation was triggered by user or by platform. + /// Specifies the patch service used for the operation. + /// The operating system type of the machine. + /// The errors that were encountered during execution of the operation. The details array contains the list of them. + /// A new instance for mocking. + public static MachineInstallPatchesResult MachineInstallPatchesResult(PatchOperationStatus? status = null, string installationActivityId = null, VmGuestPatchRebootStatus? rebootStatus = null, bool? maintenanceWindowExceeded = null, int? excludedPatchCount = null, int? notSelectedPatchCount = null, int? pendingPatchCount = null, int? installedPatchCount = null, int? failedPatchCount = null, DateTimeOffset? startOn = null, DateTimeOffset? lastModifiedOn = null, PatchOperationStartedBy? startedBy = null, PatchServiceUsed? patchServiceUsed = null, OSType? osType = null, ResponseError errorDetails = null) + { + return new MachineInstallPatchesResult(status, installationActivityId, rebootStatus, maintenanceWindowExceeded, excludedPatchCount, notSelectedPatchCount, pendingPatchCount, installedPatchCount, failedPatchCount, startOn, lastModifiedOn, startedBy, patchServiceUsed, osType, errorDetails); + } + + /// Initializes a new instance of ExtensionValueData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The version of the Extension being received. + /// The type of the Extension being received. + /// The publisher of the Extension being received. + /// A new instance for mocking. + public static ExtensionValueData ExtensionValueData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string version = null, string extensionType = null, string publisher = null) + { + return new ExtensionValueData(id, name, resourceType, systemData, version, extensionType, publisher); + } + + /// Initializes a new instance of NetworkProfile. + /// The list of network interfaces. + /// A new instance for mocking. + public static NetworkProfile NetworkProfile(IEnumerable networkInterfaces = null) + { + networkInterfaces ??= new List(); + + return new NetworkProfile(networkInterfaces?.ToList()); + } + + /// Initializes a new instance of NetworkInterface. + /// The list of IP addresses in this interface. + /// A new instance for mocking. + public static NetworkInterface NetworkInterface(IEnumerable ipAddresses = null) + { + ipAddresses ??= new List(); + + return new NetworkInterface(ipAddresses?.ToList()); + } + + /// Initializes a new instance of IPAddress. + /// Represents the IP Address. + /// Represents the Ip Address Version. + /// The subnet to which this IP address belongs. + /// A new instance for mocking. + public static IPAddress IPAddress(string address = null, string ipAddressVersion = null, string subnetAddressPrefix = null) + { + return new IPAddress(address, ipAddressVersion, subnetAddressPrefix != null ? new Subnet(subnetAddressPrefix) : null); } /// Initializes a new instance of HybridComputePrivateLinkScopeData. diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ExtensionValueCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ExtensionValueCollection.cs new file mode 100644 index 0000000000000..b7015af7c19e0 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ExtensionValueCollection.cs @@ -0,0 +1,343 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.HybridCompute +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get an instance call the GetExtensionValues method from an instance of . + /// + public partial class ExtensionValueCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _extensionValueExtensionMetadataClientDiagnostics; + private readonly ExtensionMetadataRestOperations _extensionValueExtensionMetadataRestClient; + private readonly AzureLocation _location; + private readonly string _publisher; + private readonly string _extensionType; + + /// Initializes a new instance of the class for mocking. + protected ExtensionValueCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + /// The location of the Extension being received. + /// The publisher of the Extension being received. + /// The extensionType of the Extension being received. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + internal ExtensionValueCollection(ArmClient client, ResourceIdentifier id, AzureLocation location, string publisher, string extensionType) : base(client, id) + { + _location = location; + _publisher = publisher; + _extensionType = extensionType; + _extensionValueExtensionMetadataClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HybridCompute", ExtensionValueResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ExtensionValueResource.ResourceType, out string extensionValueExtensionMetadataApiVersion); + _extensionValueExtensionMetadataRestClient = new ExtensionMetadataRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, extensionValueExtensionMetadataApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != SubscriptionResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SubscriptionResource.ResourceType), nameof(id)); + } + + /// + /// Gets an Extension Metadata based on location, publisher, extensionType and version + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions/{version} + /// + /// + /// Operation Id + /// ExtensionMetadata_Get + /// + /// + /// + /// The version of the Extension being received. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string version, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(version, nameof(version)); + + using var scope = _extensionValueExtensionMetadataClientDiagnostics.CreateScope("ExtensionValueCollection.Get"); + scope.Start(); + try + { + var response = await _extensionValueExtensionMetadataRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(_location), _publisher, _extensionType, version, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ExtensionValueResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets an Extension Metadata based on location, publisher, extensionType and version + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions/{version} + /// + /// + /// Operation Id + /// ExtensionMetadata_Get + /// + /// + /// + /// The version of the Extension being received. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string version, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(version, nameof(version)); + + using var scope = _extensionValueExtensionMetadataClientDiagnostics.CreateScope("ExtensionValueCollection.Get"); + scope.Start(); + try + { + var response = _extensionValueExtensionMetadataRestClient.Get(Id.SubscriptionId, new AzureLocation(_location), _publisher, _extensionType, version, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ExtensionValueResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets all Extension versions based on location, publisher, extensionType + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions + /// + /// + /// Operation Id + /// ExtensionMetadata_List + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _extensionValueExtensionMetadataRestClient.CreateListRequest(Id.SubscriptionId, new AzureLocation(_location), _publisher, _extensionType); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => new ExtensionValueResource(Client, ExtensionValueData.DeserializeExtensionValueData(e)), _extensionValueExtensionMetadataClientDiagnostics, Pipeline, "ExtensionValueCollection.GetAll", "value", null, cancellationToken); + } + + /// + /// Gets all Extension versions based on location, publisher, extensionType + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions + /// + /// + /// Operation Id + /// ExtensionMetadata_List + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _extensionValueExtensionMetadataRestClient.CreateListRequest(Id.SubscriptionId, new AzureLocation(_location), _publisher, _extensionType); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => new ExtensionValueResource(Client, ExtensionValueData.DeserializeExtensionValueData(e)), _extensionValueExtensionMetadataClientDiagnostics, Pipeline, "ExtensionValueCollection.GetAll", "value", null, cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions/{version} + /// + /// + /// Operation Id + /// ExtensionMetadata_Get + /// + /// + /// + /// The version of the Extension being received. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string version, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(version, nameof(version)); + + using var scope = _extensionValueExtensionMetadataClientDiagnostics.CreateScope("ExtensionValueCollection.Exists"); + scope.Start(); + try + { + var response = await _extensionValueExtensionMetadataRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(_location), _publisher, _extensionType, version, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions/{version} + /// + /// + /// Operation Id + /// ExtensionMetadata_Get + /// + /// + /// + /// The version of the Extension being received. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string version, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(version, nameof(version)); + + using var scope = _extensionValueExtensionMetadataClientDiagnostics.CreateScope("ExtensionValueCollection.Exists"); + scope.Start(); + try + { + var response = _extensionValueExtensionMetadataRestClient.Get(Id.SubscriptionId, new AzureLocation(_location), _publisher, _extensionType, version, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions/{version} + /// + /// + /// Operation Id + /// ExtensionMetadata_Get + /// + /// + /// + /// The version of the Extension being received. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string version, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(version, nameof(version)); + + using var scope = _extensionValueExtensionMetadataClientDiagnostics.CreateScope("ExtensionValueCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _extensionValueExtensionMetadataRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(_location), _publisher, _extensionType, version, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ExtensionValueResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions/{version} + /// + /// + /// Operation Id + /// ExtensionMetadata_Get + /// + /// + /// + /// The version of the Extension being received. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string version, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(version, nameof(version)); + + using var scope = _extensionValueExtensionMetadataClientDiagnostics.CreateScope("ExtensionValueCollection.GetIfExists"); + scope.Start(); + try + { + var response = _extensionValueExtensionMetadataRestClient.Get(Id.SubscriptionId, new AzureLocation(_location), _publisher, _extensionType, version, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ExtensionValueResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ExtensionValueData.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ExtensionValueData.cs new file mode 100644 index 0000000000000..bcfeef62727a2 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ExtensionValueData.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.HybridCompute +{ + /// + /// A class representing the ExtensionValue data model. + /// Describes a Extension Metadata + /// + public partial class ExtensionValueData : ResourceData + { + /// Initializes a new instance of ExtensionValueData. + public ExtensionValueData() + { + } + + /// Initializes a new instance of ExtensionValueData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The version of the Extension being received. + /// The type of the Extension being received. + /// The publisher of the Extension being received. + internal ExtensionValueData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string version, string extensionType, string publisher) : base(id, name, resourceType, systemData) + { + Version = version; + ExtensionType = extensionType; + Publisher = publisher; + } + + /// The version of the Extension being received. + public string Version { get; } + /// The type of the Extension being received. + public string ExtensionType { get; } + /// The publisher of the Extension being received. + public string Publisher { get; } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ExtensionValueResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ExtensionValueResource.cs new file mode 100644 index 0000000000000..9a7151c5e4995 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ExtensionValueResource.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.HybridCompute +{ + /// + /// A Class representing an ExtensionValue along with the instance operations that can be performed on it. + /// If you have a you can construct an + /// from an instance of using the GetExtensionValueResource method. + /// Otherwise you can get one from its parent resource using the GetExtensionValue method. + /// + public partial class ExtensionValueResource : ArmResource + { + /// Generate the resource identifier of a instance. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, AzureLocation location, string publisher, string extensionType, string version) + { + var resourceId = $"/subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions/{version}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _extensionValueExtensionMetadataClientDiagnostics; + private readonly ExtensionMetadataRestOperations _extensionValueExtensionMetadataRestClient; + private readonly ExtensionValueData _data; + + /// Initializes a new instance of the class for mocking. + protected ExtensionValueResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ExtensionValueResource(ArmClient client, ExtensionValueData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal ExtensionValueResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _extensionValueExtensionMetadataClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HybridCompute", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string extensionValueExtensionMetadataApiVersion); + _extensionValueExtensionMetadataRestClient = new ExtensionMetadataRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, extensionValueExtensionMetadataApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.HybridCompute/locations/publishers/extensionTypes/versions"; + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual ExtensionValueData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets an Extension Metadata based on location, publisher, extensionType and version + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions/{version} + /// + /// + /// Operation Id + /// ExtensionMetadata_Get + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _extensionValueExtensionMetadataClientDiagnostics.CreateScope("ExtensionValueResource.Get"); + scope.Start(); + try + { + var response = await _extensionValueExtensionMetadataRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ExtensionValueResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets an Extension Metadata based on location, publisher, extensionType and version + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions/{version} + /// + /// + /// Operation Id + /// ExtensionMetadata_Get + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _extensionValueExtensionMetadataClientDiagnostics.CreateScope("ExtensionValueResource.Get"); + scope.Start(); + try + { + var response = _extensionValueExtensionMetadataRestClient.Get(Id.SubscriptionId, new AzureLocation(Id.Parent.Parent.Parent.Name), Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ExtensionValueResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/HybridComputeExtensions.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/HybridComputeExtensions.cs index da189e14b0c1a..005ca6aae8ccf 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/HybridComputeExtensions.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/HybridComputeExtensions.cs @@ -88,6 +88,25 @@ public static HybridComputeMachineExtensionResource GetHybridComputeMachineExten } #endregion + #region ExtensionValueResource + /// + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static ExtensionValueResource GetExtensionValueResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + ExtensionValueResource.ValidateResourceId(id); + return new ExtensionValueResource(client, id); + } + ); + } + #endregion + #region HybridComputePrivateLinkScopeResource /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. @@ -259,6 +278,76 @@ public static Response GetHybridComputePr return resourceGroupResource.GetHybridComputePrivateLinkScopes().Get(scopeName, cancellationToken); } + /// Gets a collection of ExtensionValueResources in the SubscriptionResource. + /// The instance the method will execute against. + /// The location of the Extension being received. + /// The publisher of the Extension being received. + /// The extensionType of the Extension being received. + /// or is an empty string, and was expected to be non-empty. + /// or is null. + /// An object representing collection of ExtensionValueResources and their operations over a ExtensionValueResource. + public static ExtensionValueCollection GetExtensionValues(this SubscriptionResource subscriptionResource, AzureLocation location, string publisher, string extensionType) + { + Argument.AssertNotNullOrEmpty(publisher, nameof(publisher)); + Argument.AssertNotNullOrEmpty(extensionType, nameof(extensionType)); + + return GetSubscriptionResourceExtensionClient(subscriptionResource).GetExtensionValues(location, publisher, extensionType); + } + + /// + /// Gets an Extension Metadata based on location, publisher, extensionType and version + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions/{version} + /// + /// + /// Operation Id + /// ExtensionMetadata_Get + /// + /// + /// + /// The instance the method will execute against. + /// The location of the Extension being received. + /// The publisher of the Extension being received. + /// The extensionType of the Extension being received. + /// The version of the Extension being received. + /// The cancellation token to use. + /// , or is an empty string, and was expected to be non-empty. + /// , or is null. + [ForwardsClientCalls] + public static async Task> GetExtensionValueAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string publisher, string extensionType, string version, CancellationToken cancellationToken = default) + { + return await subscriptionResource.GetExtensionValues(location, publisher, extensionType).GetAsync(version, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets an Extension Metadata based on location, publisher, extensionType and version + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/locations/{location}/publishers/{publisher}/extensionTypes/{extensionType}/versions/{version} + /// + /// + /// Operation Id + /// ExtensionMetadata_Get + /// + /// + /// + /// The instance the method will execute against. + /// The location of the Extension being received. + /// The publisher of the Extension being received. + /// The extensionType of the Extension being received. + /// The version of the Extension being received. + /// The cancellation token to use. + /// , or is an empty string, and was expected to be non-empty. + /// , or is null. + [ForwardsClientCalls] + public static Response GetExtensionValue(this SubscriptionResource subscriptionResource, AzureLocation location, string publisher, string extensionType, string version, CancellationToken cancellationToken = default) + { + return subscriptionResource.GetExtensionValues(location, publisher, extensionType).Get(version, cancellationToken); + } + /// /// Lists all the hybrid machines in the specified subscription. Use the nextLink property in the response to get the next page of hybrid machines. /// diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs index 76da99d4ec7c0..12001559f25b6 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs @@ -48,6 +48,16 @@ private string GetApiVersionOrNull(ResourceType resourceType) return apiVersion; } + /// Gets a collection of ExtensionValueResources in the SubscriptionResource. + /// The location of the Extension being received. + /// The publisher of the Extension being received. + /// The extensionType of the Extension being received. + /// An object representing collection of ExtensionValueResources and their operations over a ExtensionValueResource. + public virtual ExtensionValueCollection GetExtensionValues(AzureLocation location, string publisher, string extensionType) + { + return new ExtensionValueCollection(Client, Id, location, publisher, extensionType); + } + /// /// Lists all the hybrid machines in the specified subscription. Use the nextLink property in the response to get the next page of hybrid machines. /// diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineData.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineData.cs index 18fd1e91d00e8..25339bb6e7e8e 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineData.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineData.cs @@ -5,7 +5,9 @@ #nullable disable +using System; using System.Collections.Generic; +using Azure; using Azure.Core; using Azure.ResourceManager.HybridCompute.Models; using Azure.ResourceManager.Models; @@ -23,6 +25,9 @@ public partial class HybridComputeMachineData : TrackedResourceData public HybridComputeMachineData(AzureLocation location) : base(location) { Resources = new ChangeTrackingList(); + ErrorDetails = new ChangeTrackingList(); + Extensions = new ChangeTrackingList(); + DetectedProperties = new ChangeTrackingDictionary(); } /// Initializes a new instance of HybridComputeMachineData. @@ -32,21 +37,135 @@ public HybridComputeMachineData(AzureLocation location) : base(location) /// The systemData. /// The tags. /// The location. - /// Hybrid Compute Machine properties. /// The list of extensions affiliated to the machine. /// Identity for the resource. Current supported identity types: SystemAssigned. - internal HybridComputeMachineData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, MachineProperties properties, IReadOnlyList resources, ManagedServiceIdentity identity) : base(id, name, resourceType, systemData, tags, location) + /// Metadata pertaining to the geographic location of the resource. + /// Configurable properties that the user can set locally via the azcmagent config command, or remotely via ARM. + /// Statuses of dependent services that are reported back to ARM. + /// The metadata of the cloud environment (Azure/GCP/AWS/OCI...). + /// The info of the machine w.r.t Agent Upgrade. + /// Specifies the operating system settings for the hybrid machine. + /// The provisioning state, which only appears in the response. + /// The status of the hybrid machine agent. + /// The time of the last status change. + /// Details about the error state. + /// The hybrid machine agent full version. + /// Specifies the hybrid machine unique ID. + /// Specifies the hybrid machine display name. + /// Specifies the hybrid machine FQDN. + /// Public Key that the client provides to be used during initial resource onboarding. + /// The Operating System running on the hybrid machine. + /// The version of Operating System running on the hybrid machine. + /// The type of Operating System (windows/linux). + /// Specifies the Arc Machine's unique SMBIOS ID. + /// Machine Extensions information (deprecated field). + /// Specifies the Operating System product SKU. + /// Specifies the Windows domain name. + /// Specifies the AD fully qualified display name. + /// Specifies the DNS fully qualified display name. + /// The resource id of the private link scope this machine is assigned to, if any. + /// The resource id of the parent cluster (Azure HCI) this machine is assigned to, if any. + /// Specifies whether any MS SQL instance is discovered on the machine. + /// Detected properties from the machine. + internal HybridComputeMachineData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, IReadOnlyList resources, ManagedServiceIdentity identity, LocationData locationData, AgentConfiguration agentConfiguration, HybridComputeServiceStatuses serviceStatuses, CloudMetadata cloudMetadata, AgentUpgrade agentUpgrade, OSProfile osProfile, string provisioningState, HybridComputeStatusType? status, DateTimeOffset? lastStatusChange, IReadOnlyList errorDetails, string agentVersion, Guid? vmId, string displayName, string machineFqdn, string clientPublicKey, string osName, string osVersion, string osType, Guid? vmUuid, IList extensions, string osSku, string domainName, string adFqdn, string dnsFqdn, ResourceIdentifier privateLinkScopeResourceId, ResourceIdentifier parentClusterResourceId, string mssqlDiscovered, IReadOnlyDictionary detectedProperties) : base(id, name, resourceType, systemData, tags, location) { - Properties = properties; Resources = resources; Identity = identity; + LocationData = locationData; + AgentConfiguration = agentConfiguration; + ServiceStatuses = serviceStatuses; + CloudMetadata = cloudMetadata; + AgentUpgrade = agentUpgrade; + OSProfile = osProfile; + ProvisioningState = provisioningState; + Status = status; + LastStatusChange = lastStatusChange; + ErrorDetails = errorDetails; + AgentVersion = agentVersion; + VmId = vmId; + DisplayName = displayName; + MachineFqdn = machineFqdn; + ClientPublicKey = clientPublicKey; + OSName = osName; + OSVersion = osVersion; + OSType = osType; + VmUuid = vmUuid; + Extensions = extensions; + OSSku = osSku; + DomainName = domainName; + AdFqdn = adFqdn; + DnsFqdn = dnsFqdn; + PrivateLinkScopeResourceId = privateLinkScopeResourceId; + ParentClusterResourceId = parentClusterResourceId; + MssqlDiscovered = mssqlDiscovered; + DetectedProperties = detectedProperties; } - /// Hybrid Compute Machine properties. - public MachineProperties Properties { get; set; } /// The list of extensions affiliated to the machine. public IReadOnlyList Resources { get; } /// Identity for the resource. Current supported identity types: SystemAssigned. public ManagedServiceIdentity Identity { get; set; } + /// Metadata pertaining to the geographic location of the resource. + public LocationData LocationData { get; set; } + /// Configurable properties that the user can set locally via the azcmagent config command, or remotely via ARM. + public AgentConfiguration AgentConfiguration { get; } + /// Statuses of dependent services that are reported back to ARM. + public HybridComputeServiceStatuses ServiceStatuses { get; set; } + /// The metadata of the cloud environment (Azure/GCP/AWS/OCI...). + internal CloudMetadata CloudMetadata { get; set; } + /// Specifies the cloud provider (Azure/AWS/GCP...). + public string CloudMetadataProvider + { + get => CloudMetadata is null ? default : CloudMetadata.Provider; + } + + /// The info of the machine w.r.t Agent Upgrade. + public AgentUpgrade AgentUpgrade { get; set; } + /// Specifies the operating system settings for the hybrid machine. + public OSProfile OSProfile { get; set; } + /// The provisioning state, which only appears in the response. + public string ProvisioningState { get; } + /// The status of the hybrid machine agent. + public HybridComputeStatusType? Status { get; } + /// The time of the last status change. + public DateTimeOffset? LastStatusChange { get; } + /// Details about the error state. + public IReadOnlyList ErrorDetails { get; } + /// The hybrid machine agent full version. + public string AgentVersion { get; } + /// Specifies the hybrid machine unique ID. + public Guid? VmId { get; set; } + /// Specifies the hybrid machine display name. + public string DisplayName { get; } + /// Specifies the hybrid machine FQDN. + public string MachineFqdn { get; } + /// Public Key that the client provides to be used during initial resource onboarding. + public string ClientPublicKey { get; set; } + /// The Operating System running on the hybrid machine. + public string OSName { get; } + /// The version of Operating System running on the hybrid machine. + public string OSVersion { get; } + /// The type of Operating System (windows/linux). + public string OSType { get; set; } + /// Specifies the Arc Machine's unique SMBIOS ID. + public Guid? VmUuid { get; } + /// Machine Extensions information (deprecated field). + public IList Extensions { get; } + /// Specifies the Operating System product SKU. + public string OSSku { get; } + /// Specifies the Windows domain name. + public string DomainName { get; } + /// Specifies the AD fully qualified display name. + public string AdFqdn { get; } + /// Specifies the DNS fully qualified display name. + public string DnsFqdn { get; } + /// The resource id of the private link scope this machine is assigned to, if any. + public ResourceIdentifier PrivateLinkScopeResourceId { get; set; } + /// The resource id of the parent cluster (Azure HCI) this machine is assigned to, if any. + public ResourceIdentifier ParentClusterResourceId { get; set; } + /// Specifies whether any MS SQL instance is discovered on the machine. + public string MssqlDiscovered { get; set; } + /// Detected properties from the machine. + public IReadOnlyDictionary DetectedProperties { get; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineExtensionData.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineExtensionData.cs index 9474c85aa2194..52a1575b5356c 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineExtensionData.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineExtensionData.cs @@ -5,6 +5,7 @@ #nullable disable +using System; using System.Collections.Generic; using Azure.Core; using Azure.ResourceManager.HybridCompute.Models; @@ -22,6 +23,8 @@ public partial class HybridComputeMachineExtensionData : TrackedResourceData /// The location. public HybridComputeMachineExtensionData(AzureLocation location) : base(location) { + Settings = new ChangeTrackingDictionary(); + ProtectedSettings = new ChangeTrackingDictionary(); } /// Initializes a new instance of HybridComputeMachineExtensionData. @@ -31,13 +34,107 @@ public HybridComputeMachineExtensionData(AzureLocation location) : base(location /// The systemData. /// The tags. /// The location. - /// Describes Machine Extension Properties. - internal HybridComputeMachineExtensionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, MachineExtensionProperties properties) : base(id, name, resourceType, systemData, tags, location) + /// How the extension handler should be forced to update even if the extension configuration has not changed. + /// The name of the extension handler publisher. + /// Specifies the type of the extension; an example is "CustomScriptExtension". + /// Specifies the version of the script handler. + /// Indicates whether the extension should be automatically upgraded by the platform if there is a newer version available. + /// Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. + /// Json formatted public settings for the extension. + /// The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. + /// The provisioning state, which only appears in the response. + /// The machine extension instance view. + internal HybridComputeMachineExtensionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string forceUpdateTag, string publisher, string typePropertiesType, string typeHandlerVersion, bool? enableAutomaticUpgrade, bool? autoUpgradeMinorVersion, IDictionary settings, IDictionary protectedSettings, string provisioningState, MachineExtensionInstanceView instanceView) : base(id, name, resourceType, systemData, tags, location) { - Properties = properties; + ForceUpdateTag = forceUpdateTag; + Publisher = publisher; + TypePropertiesType = typePropertiesType; + TypeHandlerVersion = typeHandlerVersion; + EnableAutomaticUpgrade = enableAutomaticUpgrade; + AutoUpgradeMinorVersion = autoUpgradeMinorVersion; + Settings = settings; + ProtectedSettings = protectedSettings; + ProvisioningState = provisioningState; + InstanceView = instanceView; } - /// Describes Machine Extension Properties. - public MachineExtensionProperties Properties { get; set; } + /// How the extension handler should be forced to update even if the extension configuration has not changed. + public string ForceUpdateTag { get; set; } + /// The name of the extension handler publisher. + public string Publisher { get; set; } + /// Specifies the type of the extension; an example is "CustomScriptExtension". + public string TypePropertiesType { get; set; } + /// Specifies the version of the script handler. + public string TypeHandlerVersion { get; set; } + /// Indicates whether the extension should be automatically upgraded by the platform if there is a newer version available. + public bool? EnableAutomaticUpgrade { get; set; } + /// Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. + public bool? AutoUpgradeMinorVersion { get; set; } + /// + /// Json formatted public settings for the extension. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formated 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" }. + /// + /// + /// + /// + public IDictionary Settings { get; } + /// + /// The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formated 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" }. + /// + /// + /// + /// + public IDictionary ProtectedSettings { get; } + /// The provisioning state, which only appears in the response. + public string ProvisioningState { get; } + /// The machine extension instance view. + public MachineExtensionInstanceView InstanceView { get; set; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineResource.cs index 89ac4f8d079d4..3c929770b020c 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineResource.cs @@ -38,6 +38,8 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, private readonly MachinesRestOperations _hybridComputeMachineMachinesRestClient; private readonly ClientDiagnostics _defaultClientDiagnostics; private readonly HybridComputeManagementRestOperations _defaultRestClient; + private readonly ClientDiagnostics _networkProfileClientDiagnostics; + private readonly NetworkProfileRestOperations _networkProfileRestClient; private readonly ClientDiagnostics _hybridComputePrivateLinkScopePrivateLinkScopesClientDiagnostics; private readonly PrivateLinkScopesRestOperations _hybridComputePrivateLinkScopePrivateLinkScopesRestClient; private readonly HybridComputeMachineData _data; @@ -66,6 +68,8 @@ internal HybridComputeMachineResource(ArmClient client, ResourceIdentifier id) : _hybridComputeMachineMachinesRestClient = new MachinesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, hybridComputeMachineMachinesApiVersion); _defaultClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HybridCompute", ProviderConstants.DefaultProviderNamespace, Diagnostics); _defaultRestClient = new HybridComputeManagementRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + _networkProfileClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HybridCompute", ProviderConstants.DefaultProviderNamespace, Diagnostics); + _networkProfileRestClient = new NetworkProfileRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); _hybridComputePrivateLinkScopePrivateLinkScopesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HybridCompute", HybridComputePrivateLinkScopeResource.ResourceType.Namespace, Diagnostics); TryGetApiVersion(HybridComputePrivateLinkScopeResource.ResourceType, out string hybridComputePrivateLinkScopePrivateLinkScopesApiVersion); _hybridComputePrivateLinkScopePrivateLinkScopesRestClient = new PrivateLinkScopesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, hybridComputePrivateLinkScopePrivateLinkScopesApiVersion); @@ -353,6 +357,150 @@ public virtual Response Update(HybridComputeMachin } } + /// + /// The operation to assess patches on a hybrid machine identity in Azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/assessPatches + /// + /// + /// Operation Id + /// Machines_AssessPatches + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task> AssessPatchesAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _hybridComputeMachineMachinesClientDiagnostics.CreateScope("HybridComputeMachineResource.AssessPatches"); + scope.Start(); + try + { + var response = await _hybridComputeMachineMachinesRestClient.AssessPatchesAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new HybridComputeArmOperation(new MachineAssessPatchesResultOperationSource(), _hybridComputeMachineMachinesClientDiagnostics, Pipeline, _hybridComputeMachineMachinesRestClient.CreateAssessPatchesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// The operation to assess patches on a hybrid machine identity in Azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/assessPatches + /// + /// + /// Operation Id + /// Machines_AssessPatches + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation AssessPatches(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _hybridComputeMachineMachinesClientDiagnostics.CreateScope("HybridComputeMachineResource.AssessPatches"); + scope.Start(); + try + { + var response = _hybridComputeMachineMachinesRestClient.AssessPatches(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new HybridComputeArmOperation(new MachineAssessPatchesResultOperationSource(), _hybridComputeMachineMachinesClientDiagnostics, Pipeline, _hybridComputeMachineMachinesRestClient.CreateAssessPatchesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// The operation to install patches on a hybrid machine identity in Azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/installPatches + /// + /// + /// Operation Id + /// Machines_InstallPatches + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Input for InstallPatches as directly received by the API. + /// The cancellation token to use. + /// is null. + public virtual async Task> InstallPatchesAsync(WaitUntil waitUntil, MachineInstallPatchesContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _hybridComputeMachineMachinesClientDiagnostics.CreateScope("HybridComputeMachineResource.InstallPatches"); + scope.Start(); + try + { + var response = await _hybridComputeMachineMachinesRestClient.InstallPatchesAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new HybridComputeArmOperation(new MachineInstallPatchesResultOperationSource(), _hybridComputeMachineMachinesClientDiagnostics, Pipeline, _hybridComputeMachineMachinesRestClient.CreateInstallPatchesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// The operation to install patches on a hybrid machine identity in Azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{name}/installPatches + /// + /// + /// Operation Id + /// Machines_InstallPatches + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Input for InstallPatches as directly received by the API. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation InstallPatches(WaitUntil waitUntil, MachineInstallPatchesContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _hybridComputeMachineMachinesClientDiagnostics.CreateScope("HybridComputeMachineResource.InstallPatches"); + scope.Start(); + try + { + var response = _hybridComputeMachineMachinesRestClient.InstallPatches(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); + var operation = new HybridComputeArmOperation(new MachineInstallPatchesResultOperationSource(), _hybridComputeMachineMachinesClientDiagnostics, Pipeline, _hybridComputeMachineMachinesRestClient.CreateInstallPatchesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + /// /// The operation to Upgrade Machine Extensions. /// @@ -429,6 +577,66 @@ public virtual ArmOperation UpgradeExtensions(WaitUntil waitUntil, MachineExtens } } + /// + /// The operation to get network information of hybrid machine + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/networkProfile + /// + /// + /// Operation Id + /// NetworkProfile_Get + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetNetworkProfileAsync(CancellationToken cancellationToken = default) + { + using var scope = _networkProfileClientDiagnostics.CreateScope("HybridComputeMachineResource.GetNetworkProfile"); + scope.Start(); + try + { + var response = await _networkProfileRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// The operation to get network information of hybrid machine + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/networkProfile + /// + /// + /// Operation Id + /// NetworkProfile_Get + /// + /// + /// + /// The cancellation token to use. + public virtual Response GetNetworkProfile(CancellationToken cancellationToken = default) + { + using var scope = _networkProfileClientDiagnostics.CreateScope("HybridComputeMachineResource.GetNetworkProfile"); + scope.Start(); + try + { + var response = _networkProfileRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + /// /// Returns a Azure Arc PrivateLinkScope's validation details for a given machine. /// diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LongRunningOperation/MachineAssessPatchesResultOperationSource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LongRunningOperation/MachineAssessPatchesResultOperationSource.cs new file mode 100644 index 0000000000000..2e2a10ca48464 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LongRunningOperation/MachineAssessPatchesResultOperationSource.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.ResourceManager.HybridCompute.Models; + +namespace Azure.ResourceManager.HybridCompute +{ + internal class MachineAssessPatchesResultOperationSource : IOperationSource + { + MachineAssessPatchesResult IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + return MachineAssessPatchesResult.DeserializeMachineAssessPatchesResult(document.RootElement); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + return MachineAssessPatchesResult.DeserializeMachineAssessPatchesResult(document.RootElement); + } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LongRunningOperation/MachineInstallPatchesResultOperationSource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LongRunningOperation/MachineInstallPatchesResultOperationSource.cs new file mode 100644 index 0000000000000..d5815af0c6313 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LongRunningOperation/MachineInstallPatchesResultOperationSource.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.ResourceManager.HybridCompute.Models; + +namespace Azure.ResourceManager.HybridCompute +{ + internal class MachineInstallPatchesResultOperationSource : IOperationSource + { + MachineInstallPatchesResult IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + return MachineInstallPatchesResult.DeserializeMachineInstallPatchesResult(document.RootElement); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + return MachineInstallPatchesResult.DeserializeMachineInstallPatchesResult(document.RootElement); + } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/AgentUpgrade.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/AgentUpgrade.Serialization.cs new file mode 100644 index 0000000000000..d26a371c7da82 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/AgentUpgrade.Serialization.cs @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + public partial class AgentUpgrade : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(DesiredVersion)) + { + writer.WritePropertyName("desiredVersion"u8); + writer.WriteStringValue(DesiredVersion); + } + if (Optional.IsDefined(CorrelationId)) + { + writer.WritePropertyName("correlationId"u8); + writer.WriteStringValue(CorrelationId.Value); + } + if (Optional.IsDefined(EnableAutomaticUpgrade)) + { + writer.WritePropertyName("enableAutomaticUpgrade"u8); + writer.WriteBooleanValue(EnableAutomaticUpgrade.Value); + } + writer.WriteEndObject(); + } + + internal static AgentUpgrade DeserializeAgentUpgrade(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional desiredVersion = default; + Optional correlationId = default; + Optional enableAutomaticUpgrade = default; + Optional lastAttemptTimestamp = default; + Optional lastAttemptStatus = default; + Optional lastAttemptMessage = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("desiredVersion"u8)) + { + desiredVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("correlationId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + correlationId = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("enableAutomaticUpgrade"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableAutomaticUpgrade = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("lastAttemptTimestamp"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastAttemptTimestamp = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastAttemptStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastAttemptStatus = new LastAttemptStatusEnum(property.Value.GetString()); + continue; + } + if (property.NameEquals("lastAttemptMessage"u8)) + { + lastAttemptMessage = property.Value.GetString(); + continue; + } + } + return new AgentUpgrade(desiredVersion.Value, Optional.ToNullable(correlationId), Optional.ToNullable(enableAutomaticUpgrade), Optional.ToNullable(lastAttemptTimestamp), Optional.ToNullable(lastAttemptStatus), lastAttemptMessage.Value); + } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/AgentUpgrade.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/AgentUpgrade.cs new file mode 100644 index 0000000000000..7d5a2420a132f --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/AgentUpgrade.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + /// The info w.r.t Agent Upgrade. + public partial class AgentUpgrade + { + /// Initializes a new instance of AgentUpgrade. + public AgentUpgrade() + { + } + + /// Initializes a new instance of AgentUpgrade. + /// Specifies the version info w.r.t AgentUpgrade for the machine. + /// The correlation ID passed in from RSM per upgrade. + /// Specifies if RSM should try to upgrade this machine. + /// Timestamp of last upgrade attempt. + /// Specifies the status of Agent Upgrade. + /// Failure message of last upgrade attempt if any. + internal AgentUpgrade(string desiredVersion, Guid? correlationId, bool? enableAutomaticUpgrade, DateTimeOffset? lastAttemptTimestamp, LastAttemptStatusEnum? lastAttemptStatus, string lastAttemptMessage) + { + DesiredVersion = desiredVersion; + CorrelationId = correlationId; + EnableAutomaticUpgrade = enableAutomaticUpgrade; + LastAttemptTimestamp = lastAttemptTimestamp; + LastAttemptStatus = lastAttemptStatus; + LastAttemptMessage = lastAttemptMessage; + } + + /// Specifies the version info w.r.t AgentUpgrade for the machine. + public string DesiredVersion { get; set; } + /// The correlation ID passed in from RSM per upgrade. + public Guid? CorrelationId { get; set; } + /// Specifies if RSM should try to upgrade this machine. + public bool? EnableAutomaticUpgrade { get; set; } + /// Timestamp of last upgrade attempt. + public DateTimeOffset? LastAttemptTimestamp { get; } + /// Specifies the status of Agent Upgrade. + public LastAttemptStatusEnum? LastAttemptStatus { get; } + /// Failure message of last upgrade attempt if any. + public string LastAttemptMessage { get; } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/AvailablePatchCountByClassification.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/AvailablePatchCountByClassification.Serialization.cs new file mode 100644 index 0000000000000..1030cc7474a47 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/AvailablePatchCountByClassification.Serialization.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + public partial class AvailablePatchCountByClassification + { + internal static AvailablePatchCountByClassification DeserializeAvailablePatchCountByClassification(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional security = default; + Optional critical = default; + Optional definition = default; + Optional updateRollup = default; + Optional featurePack = default; + Optional servicePack = default; + Optional tools = default; + Optional updates = default; + Optional other = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("security"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + security = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("critical"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + critical = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("definition"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + definition = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("updateRollup"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + updateRollup = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("featurePack"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + featurePack = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("servicePack"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + servicePack = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("tools"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + tools = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("updates"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + updates = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("other"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + other = property.Value.GetInt32(); + continue; + } + } + return new AvailablePatchCountByClassification(Optional.ToNullable(security), Optional.ToNullable(critical), Optional.ToNullable(definition), Optional.ToNullable(updateRollup), Optional.ToNullable(featurePack), Optional.ToNullable(servicePack), Optional.ToNullable(tools), Optional.ToNullable(updates), Optional.ToNullable(other)); + } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/AvailablePatchCountByClassification.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/AvailablePatchCountByClassification.cs new file mode 100644 index 0000000000000..814c10e29687c --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/AvailablePatchCountByClassification.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.HybridCompute.Models +{ + /// Summarization of patches available for installation on the machine by classification. + public partial class AvailablePatchCountByClassification + { + /// Initializes a new instance of AvailablePatchCountByClassification. + internal AvailablePatchCountByClassification() + { + } + + /// Initializes a new instance of AvailablePatchCountByClassification. + /// Number of security patches available for installation. + /// Number of critical patches available for installation. + /// Number of definition patches available for installation. + /// Number of update Rollup patches available for installation. + /// Number of feature pack patches available for installation. + /// Number of service pack patches available for installation. + /// Number of tools patches available for installation. + /// Number of updates category patches available for installation. + /// Number of other patches available for installation. + internal AvailablePatchCountByClassification(int? security, int? critical, int? definition, int? updateRollup, int? featurePack, int? servicePack, int? tools, int? updates, int? other) + { + Security = security; + Critical = critical; + Definition = definition; + UpdateRollup = updateRollup; + FeaturePack = featurePack; + ServicePack = servicePack; + Tools = tools; + Updates = updates; + Other = other; + } + + /// Number of security patches available for installation. + public int? Security { get; } + /// Number of critical patches available for installation. + public int? Critical { get; } + /// Number of definition patches available for installation. + public int? Definition { get; } + /// Number of update Rollup patches available for installation. + public int? UpdateRollup { get; } + /// Number of feature pack patches available for installation. + public int? FeaturePack { get; } + /// Number of service pack patches available for installation. + public int? ServicePack { get; } + /// Number of tools patches available for installation. + public int? Tools { get; } + /// Number of updates category patches available for installation. + public int? Updates { get; } + /// Number of other patches available for installation. + public int? Other { get; } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionValueData.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionValueData.Serialization.cs new file mode 100644 index 0000000000000..7b0e4a283ac66 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionValueData.Serialization.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.HybridCompute +{ + public partial class ExtensionValueData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static ExtensionValueData DeserializeExtensionValueData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + Optional version = default; + Optional extensionType = default; + Optional publisher = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("version"u8)) + { + version = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("extensionType"u8)) + { + extensionType = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("publisher"u8)) + { + publisher = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new ExtensionValueData(id, name, type, systemData.Value, version.Value, extensionType.Value, publisher.Value); + } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionValueListResult.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionValueListResult.Serialization.cs new file mode 100644 index 0000000000000..3d8bc6afebccb --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionValueListResult.Serialization.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.HybridCompute; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + internal partial class ExtensionValueListResult + { + internal static ExtensionValueListResult DeserializeExtensionValueListResult(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> value = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ExtensionValueData.DeserializeExtensionValueData(item)); + } + value = array; + continue; + } + } + return new ExtensionValueListResult(Optional.ToList(value)); + } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionValueListResult.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionValueListResult.cs new file mode 100644 index 0000000000000..4ea9b991b8850 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionValueListResult.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.HybridCompute; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + /// The List Extension Metadata response. + internal partial class ExtensionValueListResult + { + /// Initializes a new instance of ExtensionValueListResult. + internal ExtensionValueListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of ExtensionValueListResult. + /// The list of extension metadata. + internal ExtensionValueListResult(IReadOnlyList value) + { + Value = value; + } + + /// The list of extension metadata. + public IReadOnlyList Value { get; } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachineData.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachineData.Serialization.cs index a9162129a844a..d024c85b05d00 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachineData.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachineData.Serialization.cs @@ -5,8 +5,10 @@ #nullable disable +using System; using System.Collections.Generic; using System.Text.Json; +using Azure; using Azure.Core; using Azure.ResourceManager.HybridCompute.Models; using Azure.ResourceManager.Models; @@ -18,11 +20,6 @@ public partial class HybridComputeMachineData : IUtf8JsonSerializable void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); - if (Optional.IsDefined(Properties)) - { - writer.WritePropertyName("properties"u8); - writer.WriteObjectValue(Properties); - } if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); @@ -41,6 +38,74 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) } writer.WritePropertyName("location"u8); writer.WriteStringValue(Location); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(LocationData)) + { + writer.WritePropertyName("locationData"u8); + writer.WriteObjectValue(LocationData); + } + if (Optional.IsDefined(ServiceStatuses)) + { + writer.WritePropertyName("serviceStatuses"u8); + writer.WriteObjectValue(ServiceStatuses); + } + if (Optional.IsDefined(CloudMetadata)) + { + writer.WritePropertyName("cloudMetadata"u8); + writer.WriteObjectValue(CloudMetadata); + } + if (Optional.IsDefined(AgentUpgrade)) + { + writer.WritePropertyName("agentUpgrade"u8); + writer.WriteObjectValue(AgentUpgrade); + } + if (Optional.IsDefined(OSProfile)) + { + writer.WritePropertyName("osProfile"u8); + writer.WriteObjectValue(OSProfile); + } + if (Optional.IsDefined(VmId)) + { + writer.WritePropertyName("vmId"u8); + writer.WriteStringValue(VmId.Value); + } + if (Optional.IsDefined(ClientPublicKey)) + { + writer.WritePropertyName("clientPublicKey"u8); + writer.WriteStringValue(ClientPublicKey); + } + if (Optional.IsDefined(OSType)) + { + writer.WritePropertyName("osType"u8); + writer.WriteStringValue(OSType); + } + if (Optional.IsCollectionDefined(Extensions)) + { + writer.WritePropertyName("extensions"u8); + writer.WriteStartArray(); + foreach (var item in Extensions) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(PrivateLinkScopeResourceId)) + { + writer.WritePropertyName("privateLinkScopeResourceId"u8); + writer.WriteStringValue(PrivateLinkScopeResourceId); + } + if (Optional.IsDefined(ParentClusterResourceId)) + { + writer.WritePropertyName("parentClusterResourceId"u8); + writer.WriteStringValue(ParentClusterResourceId); + } + if (Optional.IsDefined(MssqlDiscovered)) + { + writer.WritePropertyName("mssqlDiscovered"u8); + writer.WriteStringValue(MssqlDiscovered); + } + writer.WriteEndObject(); writer.WriteEndObject(); } @@ -50,7 +115,6 @@ internal static HybridComputeMachineData DeserializeHybridComputeMachineData(Jso { return null; } - Optional properties = default; Optional> resources = default; Optional identity = default; Optional> tags = default; @@ -59,17 +123,36 @@ internal static HybridComputeMachineData DeserializeHybridComputeMachineData(Jso string name = default; ResourceType type = default; Optional systemData = default; + Optional locationData = default; + Optional agentConfiguration = default; + Optional serviceStatuses = default; + Optional cloudMetadata = default; + Optional agentUpgrade = default; + Optional osProfile = default; + Optional provisioningState = default; + Optional status = default; + Optional lastStatusChange = default; + Optional> errorDetails = default; + Optional agentVersion = default; + Optional vmId = default; + Optional displayName = default; + Optional machineFqdn = default; + Optional clientPublicKey = default; + Optional osName = default; + Optional osVersion = default; + Optional osType = default; + Optional vmUuid = default; + Optional> extensions = default; + Optional osSku = default; + Optional domainName = default; + Optional adFqdn = default; + Optional dnsFqdn = default; + Optional privateLinkScopeResourceId = default; + Optional parentClusterResourceId = default; + Optional mssqlDiscovered = default; + Optional> detectedProperties = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - properties = MachineProperties.DeserializeMachineProperties(property.Value); - continue; - } if (property.NameEquals("resources"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -136,8 +219,235 @@ internal static HybridComputeMachineData DeserializeHybridComputeMachineData(Jso systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); continue; } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("locationData"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + locationData = LocationData.DeserializeLocationData(property0.Value); + continue; + } + if (property0.NameEquals("agentConfiguration"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + agentConfiguration = AgentConfiguration.DeserializeAgentConfiguration(property0.Value); + continue; + } + if (property0.NameEquals("serviceStatuses"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serviceStatuses = HybridComputeServiceStatuses.DeserializeHybridComputeServiceStatuses(property0.Value); + continue; + } + if (property0.NameEquals("cloudMetadata"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cloudMetadata = CloudMetadata.DeserializeCloudMetadata(property0.Value); + continue; + } + if (property0.NameEquals("agentUpgrade"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + agentUpgrade = AgentUpgrade.DeserializeAgentUpgrade(property0.Value); + continue; + } + if (property0.NameEquals("osProfile"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + osProfile = OSProfile.DeserializeOSProfile(property0.Value); + continue; + } + if (property0.NameEquals("provisioningState"u8)) + { + provisioningState = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("status"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new HybridComputeStatusType(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("lastStatusChange"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastStatusChange = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("errorDetails"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(JsonSerializer.Deserialize(item.GetRawText())); + } + errorDetails = array; + continue; + } + if (property0.NameEquals("agentVersion"u8)) + { + agentVersion = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("vmId"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + vmId = property0.Value.GetGuid(); + continue; + } + if (property0.NameEquals("displayName"u8)) + { + displayName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("machineFqdn"u8)) + { + machineFqdn = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("clientPublicKey"u8)) + { + clientPublicKey = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("osName"u8)) + { + osName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("osVersion"u8)) + { + osVersion = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("osType"u8)) + { + osType = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("vmUuid"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + vmUuid = property0.Value.GetGuid(); + continue; + } + if (property0.NameEquals("extensions"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(MachineExtensionInstanceView.DeserializeMachineExtensionInstanceView(item)); + } + extensions = array; + continue; + } + if (property0.NameEquals("osSku"u8)) + { + osSku = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("domainName"u8)) + { + domainName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("adFqdn"u8)) + { + adFqdn = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("dnsFqdn"u8)) + { + dnsFqdn = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("privateLinkScopeResourceId"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + privateLinkScopeResourceId = new ResourceIdentifier(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("parentClusterResourceId"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + parentClusterResourceId = new ResourceIdentifier(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("mssqlDiscovered"u8)) + { + mssqlDiscovered = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("detectedProperties"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + dictionary.Add(property1.Name, property1.Value.GetString()); + } + detectedProperties = dictionary; + continue; + } + } + continue; + } } - return new HybridComputeMachineData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, properties.Value, Optional.ToList(resources), identity); + return new HybridComputeMachineData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, Optional.ToList(resources), identity, locationData.Value, agentConfiguration.Value, serviceStatuses.Value, cloudMetadata.Value, agentUpgrade.Value, osProfile.Value, provisioningState.Value, Optional.ToNullable(status), Optional.ToNullable(lastStatusChange), Optional.ToList(errorDetails), agentVersion.Value, Optional.ToNullable(vmId), displayName.Value, machineFqdn.Value, clientPublicKey.Value, osName.Value, osVersion.Value, osType.Value, Optional.ToNullable(vmUuid), Optional.ToList(extensions), osSku.Value, domainName.Value, adFqdn.Value, dnsFqdn.Value, privateLinkScopeResourceId.Value, parentClusterResourceId.Value, mssqlDiscovered.Value, Optional.ToDictionary(detectedProperties)); } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachineExtensionData.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachineExtensionData.Serialization.cs index 22b55c5691567..92f404fd88d2c 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachineExtensionData.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachineExtensionData.Serialization.cs @@ -5,6 +5,7 @@ #nullable disable +using System; using System.Collections.Generic; using System.Text.Json; using Azure.Core; @@ -18,11 +19,6 @@ public partial class HybridComputeMachineExtensionData : IUtf8JsonSerializable void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); - if (Optional.IsDefined(Properties)) - { - writer.WritePropertyName("properties"u8); - writer.WriteObjectValue(Properties); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -36,6 +32,84 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) } writer.WritePropertyName("location"u8); writer.WriteStringValue(Location); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(ForceUpdateTag)) + { + writer.WritePropertyName("forceUpdateTag"u8); + writer.WriteStringValue(ForceUpdateTag); + } + if (Optional.IsDefined(Publisher)) + { + writer.WritePropertyName("publisher"u8); + writer.WriteStringValue(Publisher); + } + if (Optional.IsDefined(TypePropertiesType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(TypePropertiesType); + } + if (Optional.IsDefined(TypeHandlerVersion)) + { + writer.WritePropertyName("typeHandlerVersion"u8); + writer.WriteStringValue(TypeHandlerVersion); + } + if (Optional.IsDefined(EnableAutomaticUpgrade)) + { + writer.WritePropertyName("enableAutomaticUpgrade"u8); + writer.WriteBooleanValue(EnableAutomaticUpgrade.Value); + } + if (Optional.IsDefined(AutoUpgradeMinorVersion)) + { + writer.WritePropertyName("autoUpgradeMinorVersion"u8); + writer.WriteBooleanValue(AutoUpgradeMinorVersion.Value); + } + if (Optional.IsCollectionDefined(Settings)) + { + writer.WritePropertyName("settings"u8); + writer.WriteStartObject(); + foreach (var item in Settings) + { + writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + JsonSerializer.Serialize(writer, JsonDocument.Parse(item.Value.ToString()).RootElement); +#endif + } + writer.WriteEndObject(); + } + if (Optional.IsCollectionDefined(ProtectedSettings)) + { + writer.WritePropertyName("protectedSettings"u8); + writer.WriteStartObject(); + foreach (var item in ProtectedSettings) + { + writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + JsonSerializer.Serialize(writer, JsonDocument.Parse(item.Value.ToString()).RootElement); +#endif + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(InstanceView)) + { + writer.WritePropertyName("instanceView"u8); + writer.WriteObjectValue(InstanceView); + } + writer.WriteEndObject(); writer.WriteEndObject(); } @@ -45,24 +119,24 @@ internal static HybridComputeMachineExtensionData DeserializeHybridComputeMachin { return null; } - Optional properties = default; Optional> tags = default; AzureLocation location = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; Optional systemData = default; + Optional forceUpdateTag = default; + Optional publisher = default; + Optional type0 = default; + Optional typeHandlerVersion = default; + Optional enableAutomaticUpgrade = default; + Optional autoUpgradeMinorVersion = default; + Optional> settings = default; + Optional> protectedSettings = default; + Optional provisioningState = default; + Optional instanceView = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - properties = MachineExtensionProperties.DeserializeMachineExtensionProperties(property.Value); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -106,8 +180,114 @@ internal static HybridComputeMachineExtensionData DeserializeHybridComputeMachin systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); continue; } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("forceUpdateTag"u8)) + { + forceUpdateTag = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("publisher"u8)) + { + publisher = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("type"u8)) + { + type0 = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("typeHandlerVersion"u8)) + { + typeHandlerVersion = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("enableAutomaticUpgrade"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableAutomaticUpgrade = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("autoUpgradeMinorVersion"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + autoUpgradeMinorVersion = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("settings"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + if (property1.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(property1.Name, null); + } + else + { + dictionary.Add(property1.Name, BinaryData.FromString(property1.Value.GetRawText())); + } + } + settings = dictionary; + continue; + } + if (property0.NameEquals("protectedSettings"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property1 in property0.Value.EnumerateObject()) + { + if (property1.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(property1.Name, null); + } + else + { + dictionary.Add(property1.Name, BinaryData.FromString(property1.Value.GetRawText())); + } + } + protectedSettings = dictionary; + continue; + } + if (property0.NameEquals("provisioningState"u8)) + { + provisioningState = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("instanceView"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + instanceView = MachineExtensionInstanceView.DeserializeMachineExtensionInstanceView(property0.Value); + continue; + } + } + continue; + } } - return new HybridComputeMachineExtensionData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, properties.Value); + return new HybridComputeMachineExtensionData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, forceUpdateTag.Value, publisher.Value, type0.Value, typeHandlerVersion.Value, Optional.ToNullable(enableAutomaticUpgrade), Optional.ToNullable(autoUpgradeMinorVersion), Optional.ToDictionary(settings), Optional.ToDictionary(protectedSettings), provisioningState.Value, instanceView.Value); } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachineExtensionPatch.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachineExtensionPatch.Serialization.cs index 34aedbf365fb7..4ed4874b2f77c 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachineExtensionPatch.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachineExtensionPatch.Serialization.cs @@ -15,11 +15,6 @@ public partial class HybridComputeMachineExtensionPatch : IUtf8JsonSerializable void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); - if (Optional.IsDefined(Properties)) - { - writer.WritePropertyName("properties"u8); - writer.WriteObjectValue(Properties); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -31,6 +26,79 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) } writer.WriteEndObject(); } + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(ForceUpdateTag)) + { + writer.WritePropertyName("forceUpdateTag"u8); + writer.WriteStringValue(ForceUpdateTag); + } + if (Optional.IsDefined(Publisher)) + { + writer.WritePropertyName("publisher"u8); + writer.WriteStringValue(Publisher); + } + if (Optional.IsDefined(MachineExtensionUpdatePropertiesType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(MachineExtensionUpdatePropertiesType); + } + if (Optional.IsDefined(TypeHandlerVersion)) + { + writer.WritePropertyName("typeHandlerVersion"u8); + writer.WriteStringValue(TypeHandlerVersion); + } + if (Optional.IsDefined(EnableAutomaticUpgrade)) + { + writer.WritePropertyName("enableAutomaticUpgrade"u8); + writer.WriteBooleanValue(EnableAutomaticUpgrade.Value); + } + if (Optional.IsDefined(AutoUpgradeMinorVersion)) + { + writer.WritePropertyName("autoUpgradeMinorVersion"u8); + writer.WriteBooleanValue(AutoUpgradeMinorVersion.Value); + } + if (Optional.IsCollectionDefined(Settings)) + { + writer.WritePropertyName("settings"u8); + writer.WriteStartObject(); + foreach (var item in Settings) + { + writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + JsonSerializer.Serialize(writer, JsonDocument.Parse(item.Value.ToString()).RootElement); +#endif + } + writer.WriteEndObject(); + } + if (Optional.IsCollectionDefined(ProtectedSettings)) + { + writer.WritePropertyName("protectedSettings"u8); + writer.WriteStartObject(); + foreach (var item in ProtectedSettings) + { + writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + JsonSerializer.Serialize(writer, JsonDocument.Parse(item.Value.ToString()).RootElement); +#endif + } + writer.WriteEndObject(); + } + writer.WriteEndObject(); writer.WriteEndObject(); } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachineExtensionPatch.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachineExtensionPatch.cs index f3d23d3fd4a2c..90b66cf515c8a 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachineExtensionPatch.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachineExtensionPatch.cs @@ -5,6 +5,10 @@ #nullable disable +using System; +using System.Collections.Generic; +using Azure.Core; + namespace Azure.ResourceManager.HybridCompute.Models { /// Describes a Machine Extension Update. @@ -13,9 +17,83 @@ public partial class HybridComputeMachineExtensionPatch : HybridComputeResourceU /// Initializes a new instance of HybridComputeMachineExtensionPatch. public HybridComputeMachineExtensionPatch() { + Settings = new ChangeTrackingDictionary(); + ProtectedSettings = new ChangeTrackingDictionary(); } - /// Describes Machine Extension Update Properties. - public MachineExtensionUpdateProperties Properties { get; set; } + /// How the extension handler should be forced to update even if the extension configuration has not changed. + public string ForceUpdateTag { get; set; } + /// The name of the extension handler publisher. + public string Publisher { get; set; } + /// Specifies the type of the extension; an example is "CustomScriptExtension". + public string MachineExtensionUpdatePropertiesType { get; set; } + /// Specifies the version of the script handler. + public string TypeHandlerVersion { get; set; } + /// Indicates whether the extension should be automatically upgraded by the platform if there is a newer version available. + public bool? EnableAutomaticUpgrade { get; set; } + /// Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. + public bool? AutoUpgradeMinorVersion { get; set; } + /// + /// Json formatted public settings for the extension. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formated 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" }. + /// + /// + /// + /// + public IDictionary Settings { get; } + /// + /// The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formated 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" }. + /// + /// + /// + /// + public IDictionary ProtectedSettings { get; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachinePatch.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachinePatch.Serialization.cs index e0d4c3b2a72e8..e282d154c8dac 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachinePatch.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachinePatch.Serialization.cs @@ -20,11 +20,6 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("identity"u8); JsonSerializer.Serialize(writer, Identity); } - if (Optional.IsDefined(Properties)) - { - writer.WritePropertyName("properties"u8); - writer.WriteObjectValue(Properties); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -36,6 +31,39 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) } writer.WriteEndObject(); } + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(LocationData)) + { + writer.WritePropertyName("locationData"u8); + writer.WriteObjectValue(LocationData); + } + if (Optional.IsDefined(OSProfile)) + { + writer.WritePropertyName("osProfile"u8); + writer.WriteObjectValue(OSProfile); + } + if (Optional.IsDefined(CloudMetadata)) + { + writer.WritePropertyName("cloudMetadata"u8); + writer.WriteObjectValue(CloudMetadata); + } + if (Optional.IsDefined(AgentUpgrade)) + { + writer.WritePropertyName("agentUpgrade"u8); + writer.WriteObjectValue(AgentUpgrade); + } + if (Optional.IsDefined(ParentClusterResourceId)) + { + writer.WritePropertyName("parentClusterResourceId"u8); + writer.WriteStringValue(ParentClusterResourceId); + } + if (Optional.IsDefined(PrivateLinkScopeResourceId)) + { + writer.WritePropertyName("privateLinkScopeResourceId"u8); + writer.WriteStringValue(PrivateLinkScopeResourceId); + } + writer.WriteEndObject(); writer.WriteEndObject(); } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachinePatch.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachinePatch.cs index 8b1d767c7d6d1..bff0129309031 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachinePatch.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachinePatch.cs @@ -5,6 +5,7 @@ #nullable disable +using Azure.Core; using Azure.ResourceManager.Models; namespace Azure.ResourceManager.HybridCompute.Models @@ -19,7 +20,23 @@ public HybridComputeMachinePatch() /// Identity for the resource. Current supported identity types: SystemAssigned. public ManagedServiceIdentity Identity { get; set; } - /// Hybrid Compute Machine properties. - public MachineUpdateProperties Properties { get; set; } + /// Metadata pertaining to the geographic location of the resource. + public LocationData LocationData { get; set; } + /// Specifies the operating system settings for the hybrid machine. + public OSProfile OSProfile { get; set; } + /// The metadata of the cloud environment (Azure/GCP/AWS/OCI...). + internal CloudMetadata CloudMetadata { get; set; } + /// Specifies the cloud provider (Azure/AWS/GCP...). + public string CloudMetadataProvider + { + get => CloudMetadata is null ? default : CloudMetadata.Provider; + } + + /// The info of the machine w.r.t Agent Upgrade. + public AgentUpgrade AgentUpgrade { get; set; } + /// The resource id of the parent cluster (Azure HCI) this machine is assigned to, if any. + public ResourceIdentifier ParentClusterResourceId { get; set; } + /// The resource id of the private link scope this machine is assigned to, if any. + public ResourceIdentifier PrivateLinkScopeResourceId { get; set; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/IPAddress.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/IPAddress.Serialization.cs new file mode 100644 index 0000000000000..1e7bdee71fea9 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/IPAddress.Serialization.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + public partial class IPAddress + { + internal static IPAddress DeserializeIPAddress(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional address = default; + Optional ipAddressVersion = default; + Optional subnet = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("address"u8)) + { + address = property.Value.GetString(); + continue; + } + if (property.NameEquals("ipAddressVersion"u8)) + { + ipAddressVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("subnet"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + subnet = Subnet.DeserializeSubnet(property.Value); + continue; + } + } + return new IPAddress(address.Value, ipAddressVersion.Value, subnet.Value); + } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/IPAddress.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/IPAddress.cs new file mode 100644 index 0000000000000..dc5dab2d96c06 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/IPAddress.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.HybridCompute.Models +{ + /// Describes properties of the IP address. + public partial class IPAddress + { + /// Initializes a new instance of IPAddress. + internal IPAddress() + { + } + + /// Initializes a new instance of IPAddress. + /// Represents the IP Address. + /// Represents the Ip Address Version. + /// The subnet to which this IP address belongs. + internal IPAddress(string address, string ipAddressVersion, Subnet subnet) + { + Address = address; + IPAddressVersion = ipAddressVersion; + Subnet = subnet; + } + + /// Represents the IP Address. + public string Address { get; } + /// Represents the Ip Address Version. + public string IPAddressVersion { get; } + /// The subnet to which this IP address belongs. + internal Subnet Subnet { get; } + /// Represents address prefix. + public string SubnetAddressPrefix + { + get => Subnet?.AddressPrefix; + } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LastAttemptStatusEnum.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LastAttemptStatusEnum.cs new file mode 100644 index 0000000000000..4d119562eb4da --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LastAttemptStatusEnum.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.HybridCompute.Models +{ + /// Specifies the status of Agent Upgrade. + public readonly partial struct LastAttemptStatusEnum : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public LastAttemptStatusEnum(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SuccessValue = "Success"; + private const string FailedValue = "Failed"; + + /// Success. + public static LastAttemptStatusEnum Success { get; } = new LastAttemptStatusEnum(SuccessValue); + /// Failed. + public static LastAttemptStatusEnum Failed { get; } = new LastAttemptStatusEnum(FailedValue); + /// Determines if two values are the same. + public static bool operator ==(LastAttemptStatusEnum left, LastAttemptStatusEnum right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(LastAttemptStatusEnum left, LastAttemptStatusEnum right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator LastAttemptStatusEnum(string value) => new LastAttemptStatusEnum(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is LastAttemptStatusEnum other && Equals(other); + /// + public bool Equals(LastAttemptStatusEnum other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LinuxParameters.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LinuxParameters.Serialization.cs new file mode 100644 index 0000000000000..60fd8da19303f --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LinuxParameters.Serialization.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + public partial class LinuxParameters : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(ClassificationsToInclude)) + { + writer.WritePropertyName("classificationsToInclude"u8); + writer.WriteStartArray(); + foreach (var item in ClassificationsToInclude) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(PackageNameMasksToInclude)) + { + writer.WritePropertyName("packageNameMasksToInclude"u8); + writer.WriteStartArray(); + foreach (var item in PackageNameMasksToInclude) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(PackageNameMasksToExclude)) + { + writer.WritePropertyName("packageNameMasksToExclude"u8); + writer.WriteStartArray(); + foreach (var item in PackageNameMasksToExclude) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LinuxParameters.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LinuxParameters.cs new file mode 100644 index 0000000000000..2046069e14e62 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LinuxParameters.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + /// Input for InstallPatches on a Linux VM, as directly received by the API. + public partial class LinuxParameters + { + /// Initializes a new instance of LinuxParameters. + public LinuxParameters() + { + ClassificationsToInclude = new ChangeTrackingList(); + PackageNameMasksToInclude = new ChangeTrackingList(); + PackageNameMasksToExclude = new ChangeTrackingList(); + } + + /// The update classifications to select when installing patches for Linux. + public IList ClassificationsToInclude { get; } + /// packages to include in the patch operation. Format: packageName_packageVersion. + public IList PackageNameMasksToInclude { get; } + /// packages to exclude in the patch operation. Format: packageName_packageVersion. + public IList PackageNameMasksToExclude { get; } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineAssessPatchesResult.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineAssessPatchesResult.Serialization.cs new file mode 100644 index 0000000000000..15531d3f96c2b --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineAssessPatchesResult.Serialization.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + public partial class MachineAssessPatchesResult + { + internal static MachineAssessPatchesResult DeserializeMachineAssessPatchesResult(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional status = default; + Optional assessmentActivityId = default; + Optional rebootPending = default; + Optional availablePatchCountByClassification = default; + Optional startDateTime = default; + Optional lastModifiedDateTime = default; + Optional startedBy = default; + Optional patchServiceUsed = default; + Optional osType = default; + Optional errorDetails = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new PatchOperationStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("assessmentActivityId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + assessmentActivityId = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("rebootPending"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + rebootPending = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("availablePatchCountByClassification"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + availablePatchCountByClassification = AvailablePatchCountByClassification.DeserializeAvailablePatchCountByClassification(property.Value); + continue; + } + if (property.NameEquals("startDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastModifiedDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastModifiedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("startedBy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startedBy = new PatchOperationStartedBy(property.Value.GetString()); + continue; + } + if (property.NameEquals("patchServiceUsed"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + patchServiceUsed = new PatchServiceUsed(property.Value.GetString()); + continue; + } + if (property.NameEquals("osType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + osType = new OSType(property.Value.GetString()); + continue; + } + if (property.NameEquals("errorDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + errorDetails = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + } + return new MachineAssessPatchesResult(Optional.ToNullable(status), Optional.ToNullable(assessmentActivityId), Optional.ToNullable(rebootPending), availablePatchCountByClassification.Value, Optional.ToNullable(startDateTime), Optional.ToNullable(lastModifiedDateTime), Optional.ToNullable(startedBy), Optional.ToNullable(patchServiceUsed), Optional.ToNullable(osType), errorDetails.Value); + } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineAssessPatchesResult.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineAssessPatchesResult.cs new file mode 100644 index 0000000000000..02667fc628256 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineAssessPatchesResult.cs @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + /// Describes the properties of an AssessPatches result. + public partial class MachineAssessPatchesResult + { + /// Initializes a new instance of MachineAssessPatchesResult. + internal MachineAssessPatchesResult() + { + } + + /// Initializes a new instance of MachineAssessPatchesResult. + /// The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Unknown", "Failed", "Succeeded", or "CompletedWithWarnings.". + /// The activity ID of the operation that produced this result. + /// The overall reboot status of the VM. It will be true when partially installed patches require a reboot to complete installation but the reboot has not yet occurred. + /// Summarization of patches available for installation on the machine by classification. + /// The UTC timestamp when the operation began. + /// The UTC timestamp when the operation finished. + /// Indicates if operation was triggered by user or by platform. + /// Specifies the patch service used for the operation. + /// The operating system type of the machine. + /// The errors that were encountered during execution of the operation. The details array contains the list of them. + internal MachineAssessPatchesResult(PatchOperationStatus? status, Guid? assessmentActivityId, bool? rebootPending, AvailablePatchCountByClassification availablePatchCountByClassification, DateTimeOffset? startOn, DateTimeOffset? lastModifiedOn, PatchOperationStartedBy? startedBy, PatchServiceUsed? patchServiceUsed, OSType? osType, ResponseError errorDetails) + { + Status = status; + AssessmentActivityId = assessmentActivityId; + RebootPending = rebootPending; + AvailablePatchCountByClassification = availablePatchCountByClassification; + StartOn = startOn; + LastModifiedOn = lastModifiedOn; + StartedBy = startedBy; + PatchServiceUsed = patchServiceUsed; + OSType = osType; + ErrorDetails = errorDetails; + } + + /// The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Unknown", "Failed", "Succeeded", or "CompletedWithWarnings.". + public PatchOperationStatus? Status { get; } + /// The activity ID of the operation that produced this result. + public Guid? AssessmentActivityId { get; } + /// The overall reboot status of the VM. It will be true when partially installed patches require a reboot to complete installation but the reboot has not yet occurred. + public bool? RebootPending { get; } + /// Summarization of patches available for installation on the machine by classification. + public AvailablePatchCountByClassification AvailablePatchCountByClassification { get; } + /// The UTC timestamp when the operation began. + public DateTimeOffset? StartOn { get; } + /// The UTC timestamp when the operation finished. + public DateTimeOffset? LastModifiedOn { get; } + /// Indicates if operation was triggered by user or by platform. + public PatchOperationStartedBy? StartedBy { get; } + /// Specifies the patch service used for the operation. + public PatchServiceUsed? PatchServiceUsed { get; } + /// The operating system type of the machine. + public OSType? OSType { get; } + /// The errors that were encountered during execution of the operation. The details array contains the list of them. + public ResponseError ErrorDetails { get; } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionProperties.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionProperties.Serialization.cs deleted file mode 100644 index de9e363ca93a4..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionProperties.Serialization.cs +++ /dev/null @@ -1,214 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.HybridCompute.Models -{ - public partial class MachineExtensionProperties : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(ForceUpdateTag)) - { - writer.WritePropertyName("forceUpdateTag"u8); - writer.WriteStringValue(ForceUpdateTag); - } - if (Optional.IsDefined(Publisher)) - { - writer.WritePropertyName("publisher"u8); - writer.WriteStringValue(Publisher); - } - if (Optional.IsDefined(MachineExtensionPropertiesType)) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(MachineExtensionPropertiesType); - } - if (Optional.IsDefined(TypeHandlerVersion)) - { - writer.WritePropertyName("typeHandlerVersion"u8); - writer.WriteStringValue(TypeHandlerVersion); - } - if (Optional.IsDefined(EnableAutomaticUpgrade)) - { - writer.WritePropertyName("enableAutomaticUpgrade"u8); - writer.WriteBooleanValue(EnableAutomaticUpgrade.Value); - } - if (Optional.IsDefined(AutoUpgradeMinorVersion)) - { - writer.WritePropertyName("autoUpgradeMinorVersion"u8); - writer.WriteBooleanValue(AutoUpgradeMinorVersion.Value); - } - if (Optional.IsCollectionDefined(Settings)) - { - writer.WritePropertyName("settings"u8); - writer.WriteStartObject(); - foreach (var item in Settings) - { - writer.WritePropertyName(item.Key); - if (item.Value == null) - { - writer.WriteNullValue(); - continue; - } -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - JsonSerializer.Serialize(writer, JsonDocument.Parse(item.Value.ToString()).RootElement); -#endif - } - writer.WriteEndObject(); - } - if (Optional.IsCollectionDefined(ProtectedSettings)) - { - writer.WritePropertyName("protectedSettings"u8); - writer.WriteStartObject(); - foreach (var item in ProtectedSettings) - { - writer.WritePropertyName(item.Key); - if (item.Value == null) - { - writer.WriteNullValue(); - continue; - } -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - JsonSerializer.Serialize(writer, JsonDocument.Parse(item.Value.ToString()).RootElement); -#endif - } - writer.WriteEndObject(); - } - if (Optional.IsDefined(InstanceView)) - { - writer.WritePropertyName("instanceView"u8); - writer.WriteObjectValue(InstanceView); - } - writer.WriteEndObject(); - } - - internal static MachineExtensionProperties DeserializeMachineExtensionProperties(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional forceUpdateTag = default; - Optional publisher = default; - Optional type = default; - Optional typeHandlerVersion = default; - Optional enableAutomaticUpgrade = default; - Optional autoUpgradeMinorVersion = default; - Optional> settings = default; - Optional> protectedSettings = default; - Optional provisioningState = default; - Optional instanceView = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("forceUpdateTag"u8)) - { - forceUpdateTag = property.Value.GetString(); - continue; - } - if (property.NameEquals("publisher"u8)) - { - publisher = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = property.Value.GetString(); - continue; - } - if (property.NameEquals("typeHandlerVersion"u8)) - { - typeHandlerVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("enableAutomaticUpgrade"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - enableAutomaticUpgrade = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("autoUpgradeMinorVersion"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - autoUpgradeMinorVersion = property.Value.GetBoolean(); - continue; - } - if (property.NameEquals("settings"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - dictionary.Add(property0.Name, null); - } - else - { - dictionary.Add(property0.Name, BinaryData.FromString(property0.Value.GetRawText())); - } - } - settings = dictionary; - continue; - } - if (property.NameEquals("protectedSettings"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - dictionary.Add(property0.Name, null); - } - else - { - dictionary.Add(property0.Name, BinaryData.FromString(property0.Value.GetRawText())); - } - } - protectedSettings = dictionary; - continue; - } - if (property.NameEquals("provisioningState"u8)) - { - provisioningState = property.Value.GetString(); - continue; - } - if (property.NameEquals("instanceView"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - instanceView = MachineExtensionInstanceView.DeserializeMachineExtensionInstanceView(property.Value); - continue; - } - } - return new MachineExtensionProperties(forceUpdateTag.Value, publisher.Value, type.Value, typeHandlerVersion.Value, Optional.ToNullable(enableAutomaticUpgrade), Optional.ToNullable(autoUpgradeMinorVersion), Optional.ToDictionary(settings), Optional.ToDictionary(protectedSettings), provisioningState.Value, instanceView.Value); - } - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionProperties.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionProperties.cs deleted file mode 100644 index 24f70ff99c8a2..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionProperties.cs +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.HybridCompute.Models -{ - /// Describes the properties of a Machine Extension. - public partial class MachineExtensionProperties - { - /// Initializes a new instance of MachineExtensionProperties. - public MachineExtensionProperties() - { - Settings = new ChangeTrackingDictionary(); - ProtectedSettings = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of MachineExtensionProperties. - /// How the extension handler should be forced to update even if the extension configuration has not changed. - /// The name of the extension handler publisher. - /// Specifies the type of the extension; an example is "CustomScriptExtension". - /// Specifies the version of the script handler. - /// Indicates whether the extension should be automatically upgraded by the platform if there is a newer version available. - /// Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. - /// Json formatted public settings for the extension. - /// The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. - /// The provisioning state, which only appears in the response. - /// The machine extension instance view. - internal MachineExtensionProperties(string forceUpdateTag, string publisher, string machineExtensionPropertiesType, string typeHandlerVersion, bool? enableAutomaticUpgrade, bool? autoUpgradeMinorVersion, IDictionary settings, IDictionary protectedSettings, string provisioningState, MachineExtensionInstanceView instanceView) - { - ForceUpdateTag = forceUpdateTag; - Publisher = publisher; - MachineExtensionPropertiesType = machineExtensionPropertiesType; - TypeHandlerVersion = typeHandlerVersion; - EnableAutomaticUpgrade = enableAutomaticUpgrade; - AutoUpgradeMinorVersion = autoUpgradeMinorVersion; - Settings = settings; - ProtectedSettings = protectedSettings; - ProvisioningState = provisioningState; - InstanceView = instanceView; - } - - /// How the extension handler should be forced to update even if the extension configuration has not changed. - public string ForceUpdateTag { get; set; } - /// The name of the extension handler publisher. - public string Publisher { get; set; } - /// Specifies the type of the extension; an example is "CustomScriptExtension". - public string MachineExtensionPropertiesType { get; set; } - /// Specifies the version of the script handler. - public string TypeHandlerVersion { get; set; } - /// Indicates whether the extension should be automatically upgraded by the platform if there is a newer version available. - public bool? EnableAutomaticUpgrade { get; set; } - /// Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. - public bool? AutoUpgradeMinorVersion { get; set; } - /// - /// Json formatted public settings for the extension. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formated 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" }. - /// - /// - /// - /// - public IDictionary Settings { get; } - /// - /// The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formated 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" }. - /// - /// - /// - /// - public IDictionary ProtectedSettings { get; } - /// The provisioning state, which only appears in the response. - public string ProvisioningState { get; } - /// The machine extension instance view. - public MachineExtensionInstanceView InstanceView { get; set; } - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionUpdateProperties.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionUpdateProperties.Serialization.cs deleted file mode 100644 index 43b65d1b04884..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionUpdateProperties.Serialization.cs +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.HybridCompute.Models -{ - public partial class MachineExtensionUpdateProperties : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(ForceUpdateTag)) - { - writer.WritePropertyName("forceUpdateTag"u8); - writer.WriteStringValue(ForceUpdateTag); - } - if (Optional.IsDefined(Publisher)) - { - writer.WritePropertyName("publisher"u8); - writer.WriteStringValue(Publisher); - } - if (Optional.IsDefined(MachineExtensionUpdatePropertiesType)) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(MachineExtensionUpdatePropertiesType); - } - if (Optional.IsDefined(TypeHandlerVersion)) - { - writer.WritePropertyName("typeHandlerVersion"u8); - writer.WriteStringValue(TypeHandlerVersion); - } - if (Optional.IsDefined(EnableAutomaticUpgrade)) - { - writer.WritePropertyName("enableAutomaticUpgrade"u8); - writer.WriteBooleanValue(EnableAutomaticUpgrade.Value); - } - if (Optional.IsDefined(AutoUpgradeMinorVersion)) - { - writer.WritePropertyName("autoUpgradeMinorVersion"u8); - writer.WriteBooleanValue(AutoUpgradeMinorVersion.Value); - } - if (Optional.IsCollectionDefined(Settings)) - { - writer.WritePropertyName("settings"u8); - writer.WriteStartObject(); - foreach (var item in Settings) - { - writer.WritePropertyName(item.Key); - if (item.Value == null) - { - writer.WriteNullValue(); - continue; - } -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - JsonSerializer.Serialize(writer, JsonDocument.Parse(item.Value.ToString()).RootElement); -#endif - } - writer.WriteEndObject(); - } - if (Optional.IsCollectionDefined(ProtectedSettings)) - { - writer.WritePropertyName("protectedSettings"u8); - writer.WriteStartObject(); - foreach (var item in ProtectedSettings) - { - writer.WritePropertyName(item.Key); - if (item.Value == null) - { - writer.WriteNullValue(); - continue; - } -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - JsonSerializer.Serialize(writer, JsonDocument.Parse(item.Value.ToString()).RootElement); -#endif - } - writer.WriteEndObject(); - } - writer.WriteEndObject(); - } - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionUpdateProperties.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionUpdateProperties.cs deleted file mode 100644 index 1d20c47a9cc3e..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionUpdateProperties.cs +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; - -namespace Azure.ResourceManager.HybridCompute.Models -{ - /// Describes the properties of a Machine Extension. - public partial class MachineExtensionUpdateProperties - { - /// Initializes a new instance of MachineExtensionUpdateProperties. - public MachineExtensionUpdateProperties() - { - Settings = new ChangeTrackingDictionary(); - ProtectedSettings = new ChangeTrackingDictionary(); - } - - /// How the extension handler should be forced to update even if the extension configuration has not changed. - public string ForceUpdateTag { get; set; } - /// The name of the extension handler publisher. - public string Publisher { get; set; } - /// Specifies the type of the extension; an example is "CustomScriptExtension". - public string MachineExtensionUpdatePropertiesType { get; set; } - /// Specifies the version of the script handler. - public string TypeHandlerVersion { get; set; } - /// Indicates whether the extension should be automatically upgraded by the platform if there is a newer version available. - public bool? EnableAutomaticUpgrade { get; set; } - /// Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. - public bool? AutoUpgradeMinorVersion { get; set; } - /// - /// Json formatted public settings for the extension. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formated 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" }. - /// - /// - /// - /// - public IDictionary Settings { get; } - /// - /// The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formated 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" }. - /// - /// - /// - /// - public IDictionary ProtectedSettings { get; } - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineInstallPatchesContent.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineInstallPatchesContent.Serialization.cs new file mode 100644 index 0000000000000..420904bfc70c5 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineInstallPatchesContent.Serialization.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + public partial class MachineInstallPatchesContent : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("maximumDuration"u8); + writer.WriteStringValue(MaximumDuration, "P"); + writer.WritePropertyName("rebootSetting"u8); + writer.WriteStringValue(RebootSetting.ToString()); + if (Optional.IsDefined(WindowsParameters)) + { + writer.WritePropertyName("windowsParameters"u8); + writer.WriteObjectValue(WindowsParameters); + } + if (Optional.IsDefined(LinuxParameters)) + { + writer.WritePropertyName("linuxParameters"u8); + writer.WriteObjectValue(LinuxParameters); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineInstallPatchesContent.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineInstallPatchesContent.cs new file mode 100644 index 0000000000000..48140e2c2ce06 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineInstallPatchesContent.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + /// Input for InstallPatches as directly received by the API. + public partial class MachineInstallPatchesContent + { + /// Initializes a new instance of MachineInstallPatchesContent. + /// Specifies the maximum amount of time that the operation will run. It must be an ISO 8601-compliant duration string such as PT4H (4 hours). + /// Defines when it is acceptable to reboot a VM during a software update operation. + public MachineInstallPatchesContent(TimeSpan maximumDuration, VmGuestPatchRebootSetting rebootSetting) + { + MaximumDuration = maximumDuration; + RebootSetting = rebootSetting; + } + + /// Specifies the maximum amount of time that the operation will run. It must be an ISO 8601-compliant duration string such as PT4H (4 hours). + public TimeSpan MaximumDuration { get; } + /// Defines when it is acceptable to reboot a VM during a software update operation. + public VmGuestPatchRebootSetting RebootSetting { get; } + /// Input for InstallPatches on a Windows VM, as directly received by the API. + public WindowsParameters WindowsParameters { get; set; } + /// Input for InstallPatches on a Linux VM, as directly received by the API. + public LinuxParameters LinuxParameters { get; set; } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineInstallPatchesResult.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineInstallPatchesResult.Serialization.cs new file mode 100644 index 0000000000000..394a8905e7d78 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineInstallPatchesResult.Serialization.cs @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure; +using Azure.Core; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + public partial class MachineInstallPatchesResult + { + internal static MachineInstallPatchesResult DeserializeMachineInstallPatchesResult(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional status = default; + Optional installationActivityId = default; + Optional rebootStatus = default; + Optional maintenanceWindowExceeded = default; + Optional excludedPatchCount = default; + Optional notSelectedPatchCount = default; + Optional pendingPatchCount = default; + Optional installedPatchCount = default; + Optional failedPatchCount = default; + Optional startDateTime = default; + Optional lastModifiedDateTime = default; + Optional startedBy = default; + Optional patchServiceUsed = default; + Optional osType = default; + Optional errorDetails = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new PatchOperationStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("installationActivityId"u8)) + { + installationActivityId = property.Value.GetString(); + continue; + } + if (property.NameEquals("rebootStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + rebootStatus = new VmGuestPatchRebootStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("maintenanceWindowExceeded"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maintenanceWindowExceeded = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("excludedPatchCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + excludedPatchCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("notSelectedPatchCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + notSelectedPatchCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("pendingPatchCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + pendingPatchCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("installedPatchCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + installedPatchCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("failedPatchCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + failedPatchCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("startDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastModifiedDateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastModifiedDateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("startedBy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startedBy = new PatchOperationStartedBy(property.Value.GetString()); + continue; + } + if (property.NameEquals("patchServiceUsed"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + patchServiceUsed = new PatchServiceUsed(property.Value.GetString()); + continue; + } + if (property.NameEquals("osType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + osType = new OSType(property.Value.GetString()); + continue; + } + if (property.NameEquals("errorDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + errorDetails = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + } + return new MachineInstallPatchesResult(Optional.ToNullable(status), installationActivityId.Value, Optional.ToNullable(rebootStatus), Optional.ToNullable(maintenanceWindowExceeded), Optional.ToNullable(excludedPatchCount), Optional.ToNullable(notSelectedPatchCount), Optional.ToNullable(pendingPatchCount), Optional.ToNullable(installedPatchCount), Optional.ToNullable(failedPatchCount), Optional.ToNullable(startDateTime), Optional.ToNullable(lastModifiedDateTime), Optional.ToNullable(startedBy), Optional.ToNullable(patchServiceUsed), Optional.ToNullable(osType), errorDetails.Value); + } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineInstallPatchesResult.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineInstallPatchesResult.cs new file mode 100644 index 0000000000000..e5273c6255bf8 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineInstallPatchesResult.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + /// The result summary of an installation operation. + public partial class MachineInstallPatchesResult + { + /// Initializes a new instance of MachineInstallPatchesResult. + internal MachineInstallPatchesResult() + { + } + + /// Initializes a new instance of MachineInstallPatchesResult. + /// The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Failed", "Succeeded", "Unknown" or "CompletedWithWarnings.". + /// The activity ID of the operation that produced this result. + /// The reboot state of the VM following completion of the operation. + /// Whether the operation ran out of time before it completed all its intended actions. + /// The number of patches that were not installed due to the user blocking their installation. + /// The number of patches that were detected as available for install, but did not meet the operation's criteria. + /// The number of patches that were identified as meeting the installation criteria, but were not able to be installed. Typically this happens when maintenanceWindowExceeded == true. + /// The number of patches successfully installed. + /// The number of patches that could not be installed due to some issue. See errors for details. + /// The UTC timestamp when the operation began. + /// The UTC timestamp when the operation finished. + /// Indicates if operation was triggered by user or by platform. + /// Specifies the patch service used for the operation. + /// The operating system type of the machine. + /// The errors that were encountered during execution of the operation. The details array contains the list of them. + internal MachineInstallPatchesResult(PatchOperationStatus? status, string installationActivityId, VmGuestPatchRebootStatus? rebootStatus, bool? maintenanceWindowExceeded, int? excludedPatchCount, int? notSelectedPatchCount, int? pendingPatchCount, int? installedPatchCount, int? failedPatchCount, DateTimeOffset? startOn, DateTimeOffset? lastModifiedOn, PatchOperationStartedBy? startedBy, PatchServiceUsed? patchServiceUsed, OSType? osType, ResponseError errorDetails) + { + Status = status; + InstallationActivityId = installationActivityId; + RebootStatus = rebootStatus; + MaintenanceWindowExceeded = maintenanceWindowExceeded; + ExcludedPatchCount = excludedPatchCount; + NotSelectedPatchCount = notSelectedPatchCount; + PendingPatchCount = pendingPatchCount; + InstalledPatchCount = installedPatchCount; + FailedPatchCount = failedPatchCount; + StartOn = startOn; + LastModifiedOn = lastModifiedOn; + StartedBy = startedBy; + PatchServiceUsed = patchServiceUsed; + OSType = osType; + ErrorDetails = errorDetails; + } + + /// The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Failed", "Succeeded", "Unknown" or "CompletedWithWarnings.". + public PatchOperationStatus? Status { get; } + /// The activity ID of the operation that produced this result. + public string InstallationActivityId { get; } + /// The reboot state of the VM following completion of the operation. + public VmGuestPatchRebootStatus? RebootStatus { get; } + /// Whether the operation ran out of time before it completed all its intended actions. + public bool? MaintenanceWindowExceeded { get; } + /// The number of patches that were not installed due to the user blocking their installation. + public int? ExcludedPatchCount { get; } + /// The number of patches that were detected as available for install, but did not meet the operation's criteria. + public int? NotSelectedPatchCount { get; } + /// The number of patches that were identified as meeting the installation criteria, but were not able to be installed. Typically this happens when maintenanceWindowExceeded == true. + public int? PendingPatchCount { get; } + /// The number of patches successfully installed. + public int? InstalledPatchCount { get; } + /// The number of patches that could not be installed due to some issue. See errors for details. + public int? FailedPatchCount { get; } + /// The UTC timestamp when the operation began. + public DateTimeOffset? StartOn { get; } + /// The UTC timestamp when the operation finished. + public DateTimeOffset? LastModifiedOn { get; } + /// Indicates if operation was triggered by user or by platform. + public PatchOperationStartedBy? StartedBy { get; } + /// Specifies the patch service used for the operation. + public PatchServiceUsed? PatchServiceUsed { get; } + /// The operating system type of the machine. + public OSType? OSType { get; } + /// The errors that were encountered during execution of the operation. The details array contains the list of them. + public ResponseError ErrorDetails { get; } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineProperties.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineProperties.Serialization.cs deleted file mode 100644 index b3682511d4712..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineProperties.Serialization.cs +++ /dev/null @@ -1,288 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Text.Json; -using Azure; -using Azure.Core; - -namespace Azure.ResourceManager.HybridCompute.Models -{ - public partial class MachineProperties : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(LocationData)) - { - writer.WritePropertyName("locationData"u8); - writer.WriteObjectValue(LocationData); - } - if (Optional.IsDefined(ServiceStatuses)) - { - writer.WritePropertyName("serviceStatuses"u8); - writer.WriteObjectValue(ServiceStatuses); - } - if (Optional.IsDefined(CloudMetadata)) - { - writer.WritePropertyName("cloudMetadata"u8); - writer.WriteObjectValue(CloudMetadata); - } - if (Optional.IsDefined(OSProfile)) - { - writer.WritePropertyName("osProfile"u8); - writer.WriteObjectValue(OSProfile); - } - if (Optional.IsDefined(VmId)) - { - writer.WritePropertyName("vmId"u8); - writer.WriteStringValue(VmId); - } - if (Optional.IsDefined(ClientPublicKey)) - { - writer.WritePropertyName("clientPublicKey"u8); - writer.WriteStringValue(ClientPublicKey); - } - if (Optional.IsDefined(OSType)) - { - writer.WritePropertyName("osType"u8); - writer.WriteStringValue(OSType); - } - if (Optional.IsDefined(PrivateLinkScopeResourceId)) - { - writer.WritePropertyName("privateLinkScopeResourceId"u8); - writer.WriteStringValue(PrivateLinkScopeResourceId); - } - if (Optional.IsDefined(ParentClusterResourceId)) - { - writer.WritePropertyName("parentClusterResourceId"u8); - writer.WriteStringValue(ParentClusterResourceId); - } - if (Optional.IsDefined(MssqlDiscovered)) - { - writer.WritePropertyName("mssqlDiscovered"u8); - writer.WriteStringValue(MssqlDiscovered); - } - writer.WriteEndObject(); - } - - internal static MachineProperties DeserializeMachineProperties(JsonElement element) - { - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - Optional locationData = default; - Optional agentConfiguration = default; - Optional serviceStatuses = default; - Optional cloudMetadata = default; - Optional osProfile = default; - Optional provisioningState = default; - Optional status = default; - Optional lastStatusChange = default; - Optional> errorDetails = default; - Optional agentVersion = default; - Optional vmId = default; - Optional displayName = default; - Optional machineFqdn = default; - Optional clientPublicKey = default; - Optional osName = default; - Optional osVersion = default; - Optional osType = default; - Optional vmUuid = default; - Optional osSku = default; - Optional domainName = default; - Optional adFqdn = default; - Optional dnsFqdn = default; - Optional privateLinkScopeResourceId = default; - Optional parentClusterResourceId = default; - Optional mssqlDiscovered = default; - Optional> detectedProperties = default; - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("locationData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - locationData = LocationData.DeserializeLocationData(property.Value); - continue; - } - if (property.NameEquals("agentConfiguration"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - agentConfiguration = AgentConfiguration.DeserializeAgentConfiguration(property.Value); - continue; - } - if (property.NameEquals("serviceStatuses"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - serviceStatuses = HybridComputeServiceStatuses.DeserializeHybridComputeServiceStatuses(property.Value); - continue; - } - if (property.NameEquals("cloudMetadata"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - cloudMetadata = CloudMetadata.DeserializeCloudMetadata(property.Value); - continue; - } - if (property.NameEquals("osProfile"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - osProfile = OSProfile.DeserializeOSProfile(property.Value); - continue; - } - if (property.NameEquals("provisioningState"u8)) - { - provisioningState = property.Value.GetString(); - continue; - } - if (property.NameEquals("status"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - status = new HybridComputeStatusType(property.Value.GetString()); - continue; - } - if (property.NameEquals("lastStatusChange"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - lastStatusChange = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("errorDetails"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(JsonSerializer.Deserialize(item.GetRawText())); - } - errorDetails = array; - continue; - } - if (property.NameEquals("agentVersion"u8)) - { - agentVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("vmId"u8)) - { - vmId = property.Value.GetString(); - continue; - } - if (property.NameEquals("displayName"u8)) - { - displayName = property.Value.GetString(); - continue; - } - if (property.NameEquals("machineFqdn"u8)) - { - machineFqdn = property.Value.GetString(); - continue; - } - if (property.NameEquals("clientPublicKey"u8)) - { - clientPublicKey = property.Value.GetString(); - continue; - } - if (property.NameEquals("osName"u8)) - { - osName = property.Value.GetString(); - continue; - } - if (property.NameEquals("osVersion"u8)) - { - osVersion = property.Value.GetString(); - continue; - } - if (property.NameEquals("osType"u8)) - { - osType = property.Value.GetString(); - continue; - } - if (property.NameEquals("vmUuid"u8)) - { - vmUuid = property.Value.GetString(); - continue; - } - if (property.NameEquals("osSku"u8)) - { - osSku = property.Value.GetString(); - continue; - } - if (property.NameEquals("domainName"u8)) - { - domainName = property.Value.GetString(); - continue; - } - if (property.NameEquals("adFqdn"u8)) - { - adFqdn = property.Value.GetString(); - continue; - } - if (property.NameEquals("dnsFqdn"u8)) - { - dnsFqdn = property.Value.GetString(); - continue; - } - if (property.NameEquals("privateLinkScopeResourceId"u8)) - { - privateLinkScopeResourceId = property.Value.GetString(); - continue; - } - if (property.NameEquals("parentClusterResourceId"u8)) - { - parentClusterResourceId = property.Value.GetString(); - continue; - } - if (property.NameEquals("mssqlDiscovered"u8)) - { - mssqlDiscovered = property.Value.GetString(); - continue; - } - if (property.NameEquals("detectedProperties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - detectedProperties = dictionary; - continue; - } - } - return new MachineProperties(locationData.Value, agentConfiguration.Value, serviceStatuses.Value, cloudMetadata.Value, osProfile.Value, provisioningState.Value, Optional.ToNullable(status), Optional.ToNullable(lastStatusChange), Optional.ToList(errorDetails), agentVersion.Value, vmId.Value, displayName.Value, machineFqdn.Value, clientPublicKey.Value, osName.Value, osVersion.Value, osType.Value, vmUuid.Value, osSku.Value, domainName.Value, adFqdn.Value, dnsFqdn.Value, privateLinkScopeResourceId.Value, parentClusterResourceId.Value, mssqlDiscovered.Value, Optional.ToDictionary(detectedProperties)); - } - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineProperties.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineProperties.cs deleted file mode 100644 index 6ff11eeb0c6b5..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineProperties.cs +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure; -using Azure.Core; - -namespace Azure.ResourceManager.HybridCompute.Models -{ - /// Describes the properties of a hybrid machine. - public partial class MachineProperties - { - /// Initializes a new instance of MachineProperties. - public MachineProperties() - { - ErrorDetails = new ChangeTrackingList(); - DetectedProperties = new ChangeTrackingDictionary(); - } - - /// Initializes a new instance of MachineProperties. - /// Metadata pertaining to the geographic location of the resource. - /// Configurable properties that the user can set locally via the azcmagent config command, or remotely via ARM. - /// Statuses of dependent services that are reported back to ARM. - /// The metadata of the cloud environment (Azure/GCP/AWS/OCI...). - /// Specifies the operating system settings for the hybrid machine. - /// The provisioning state, which only appears in the response. - /// The status of the hybrid machine agent. - /// The time of the last status change. - /// Details about the error state. - /// The hybrid machine agent full version. - /// Specifies the hybrid machine unique ID. - /// Specifies the hybrid machine display name. - /// Specifies the hybrid machine FQDN. - /// Public Key that the client provides to be used during initial resource onboarding. - /// The Operating System running on the hybrid machine. - /// The version of Operating System running on the hybrid machine. - /// The type of Operating System (windows/linux). - /// Specifies the Arc Machine's unique SMBIOS ID. - /// Specifies the Operating System product SKU. - /// Specifies the Windows domain name. - /// Specifies the AD fully qualified display name. - /// Specifies the DNS fully qualified display name. - /// The resource id of the private link scope this machine is assigned to, if any. - /// The resource id of the parent cluster (Azure HCI) this machine is assigned to, if any. - /// Specifies whether any MS SQL instance is discovered on the machine. - /// Detected properties from the machine. - internal MachineProperties(LocationData locationData, AgentConfiguration agentConfiguration, HybridComputeServiceStatuses serviceStatuses, CloudMetadata cloudMetadata, OSProfile osProfile, string provisioningState, HybridComputeStatusType? status, DateTimeOffset? lastStatusChange, IReadOnlyList errorDetails, string agentVersion, string vmId, string displayName, string machineFqdn, string clientPublicKey, string osName, string osVersion, string osType, string vmUuid, string osSku, string domainName, string adFqdn, string dnsFqdn, string privateLinkScopeResourceId, string parentClusterResourceId, string mssqlDiscovered, IReadOnlyDictionary detectedProperties) - { - LocationData = locationData; - AgentConfiguration = agentConfiguration; - ServiceStatuses = serviceStatuses; - CloudMetadata = cloudMetadata; - OSProfile = osProfile; - ProvisioningState = provisioningState; - Status = status; - LastStatusChange = lastStatusChange; - ErrorDetails = errorDetails; - AgentVersion = agentVersion; - VmId = vmId; - DisplayName = displayName; - MachineFqdn = machineFqdn; - ClientPublicKey = clientPublicKey; - OSName = osName; - OSVersion = osVersion; - OSType = osType; - VmUuid = vmUuid; - OSSku = osSku; - DomainName = domainName; - AdFqdn = adFqdn; - DnsFqdn = dnsFqdn; - PrivateLinkScopeResourceId = privateLinkScopeResourceId; - ParentClusterResourceId = parentClusterResourceId; - MssqlDiscovered = mssqlDiscovered; - DetectedProperties = detectedProperties; - } - - /// Metadata pertaining to the geographic location of the resource. - public LocationData LocationData { get; set; } - /// Configurable properties that the user can set locally via the azcmagent config command, or remotely via ARM. - public AgentConfiguration AgentConfiguration { get; } - /// Statuses of dependent services that are reported back to ARM. - public HybridComputeServiceStatuses ServiceStatuses { get; set; } - /// The metadata of the cloud environment (Azure/GCP/AWS/OCI...). - internal CloudMetadata CloudMetadata { get; set; } - /// Specifies the cloud provider (Azure/AWS/GCP...). - public string CloudMetadataProvider - { - get => CloudMetadata is null ? default : CloudMetadata.Provider; - } - - /// Specifies the operating system settings for the hybrid machine. - public OSProfile OSProfile { get; set; } - /// The provisioning state, which only appears in the response. - public string ProvisioningState { get; } - /// The status of the hybrid machine agent. - public HybridComputeStatusType? Status { get; } - /// The time of the last status change. - public DateTimeOffset? LastStatusChange { get; } - /// Details about the error state. - public IReadOnlyList ErrorDetails { get; } - /// The hybrid machine agent full version. - public string AgentVersion { get; } - /// Specifies the hybrid machine unique ID. - public string VmId { get; set; } - /// Specifies the hybrid machine display name. - public string DisplayName { get; } - /// Specifies the hybrid machine FQDN. - public string MachineFqdn { get; } - /// Public Key that the client provides to be used during initial resource onboarding. - public string ClientPublicKey { get; set; } - /// The Operating System running on the hybrid machine. - public string OSName { get; } - /// The version of Operating System running on the hybrid machine. - public string OSVersion { get; } - /// The type of Operating System (windows/linux). - public string OSType { get; set; } - /// Specifies the Arc Machine's unique SMBIOS ID. - public string VmUuid { get; } - /// Specifies the Operating System product SKU. - public string OSSku { get; } - /// Specifies the Windows domain name. - public string DomainName { get; } - /// Specifies the AD fully qualified display name. - public string AdFqdn { get; } - /// Specifies the DNS fully qualified display name. - public string DnsFqdn { get; } - /// The resource id of the private link scope this machine is assigned to, if any. - public string PrivateLinkScopeResourceId { get; set; } - /// The resource id of the parent cluster (Azure HCI) this machine is assigned to, if any. - public string ParentClusterResourceId { get; set; } - /// Specifies whether any MS SQL instance is discovered on the machine. - public string MssqlDiscovered { get; set; } - /// Detected properties from the machine. - public IReadOnlyDictionary DetectedProperties { get; } - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineUpdateProperties.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineUpdateProperties.Serialization.cs deleted file mode 100644 index c8e4b7815044e..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineUpdateProperties.Serialization.cs +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.HybridCompute.Models -{ - public partial class MachineUpdateProperties : IUtf8JsonSerializable - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) - { - writer.WriteStartObject(); - if (Optional.IsDefined(LocationData)) - { - writer.WritePropertyName("locationData"u8); - writer.WriteObjectValue(LocationData); - } - if (Optional.IsDefined(OSProfile)) - { - writer.WritePropertyName("osProfile"u8); - writer.WriteObjectValue(OSProfile); - } - if (Optional.IsDefined(CloudMetadata)) - { - writer.WritePropertyName("cloudMetadata"u8); - writer.WriteObjectValue(CloudMetadata); - } - if (Optional.IsDefined(ParentClusterResourceId)) - { - writer.WritePropertyName("parentClusterResourceId"u8); - writer.WriteStringValue(ParentClusterResourceId); - } - if (Optional.IsDefined(PrivateLinkScopeResourceId)) - { - writer.WritePropertyName("privateLinkScopeResourceId"u8); - writer.WriteStringValue(PrivateLinkScopeResourceId); - } - writer.WriteEndObject(); - } - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineUpdateProperties.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineUpdateProperties.cs deleted file mode 100644 index 8c38cd08e689a..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineUpdateProperties.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.HybridCompute.Models -{ - /// Describes the ARM updatable properties of a hybrid machine. - public partial class MachineUpdateProperties - { - /// Initializes a new instance of MachineUpdateProperties. - public MachineUpdateProperties() - { - } - - /// Metadata pertaining to the geographic location of the resource. - public LocationData LocationData { get; set; } - /// Specifies the operating system settings for the hybrid machine. - public OSProfile OSProfile { get; set; } - /// The metadata of the cloud environment (Azure/GCP/AWS/OCI...). - internal CloudMetadata CloudMetadata { get; set; } - /// Specifies the cloud provider (Azure/AWS/GCP...). - public string CloudMetadataProvider - { - get => CloudMetadata is null ? default : CloudMetadata.Provider; - } - - /// The resource id of the parent cluster (Azure HCI) this machine is assigned to, if any. - public string ParentClusterResourceId { get; set; } - /// The resource id of the private link scope this machine is assigned to, if any. - public string PrivateLinkScopeResourceId { get; set; } - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/NetworkInterface.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/NetworkInterface.Serialization.cs new file mode 100644 index 0000000000000..7eb9920929f91 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/NetworkInterface.Serialization.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + public partial class NetworkInterface + { + internal static NetworkInterface DeserializeNetworkInterface(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> ipAddresses = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("ipAddresses"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(IPAddress.DeserializeIPAddress(item)); + } + ipAddresses = array; + continue; + } + } + return new NetworkInterface(Optional.ToList(ipAddresses)); + } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/NetworkInterface.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/NetworkInterface.cs new file mode 100644 index 0000000000000..6ac4154d26ab1 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/NetworkInterface.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + /// Describes a network interface. + public partial class NetworkInterface + { + /// Initializes a new instance of NetworkInterface. + internal NetworkInterface() + { + IPAddresses = new ChangeTrackingList(); + } + + /// Initializes a new instance of NetworkInterface. + /// The list of IP addresses in this interface. + internal NetworkInterface(IReadOnlyList ipAddresses) + { + IPAddresses = ipAddresses; + } + + /// The list of IP addresses in this interface. + public IReadOnlyList IPAddresses { get; } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/NetworkProfile.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/NetworkProfile.Serialization.cs new file mode 100644 index 0000000000000..16757555bb7c2 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/NetworkProfile.Serialization.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + public partial class NetworkProfile + { + internal static NetworkProfile DeserializeNetworkProfile(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> networkInterfaces = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("networkInterfaces"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NetworkInterface.DeserializeNetworkInterface(item)); + } + networkInterfaces = array; + continue; + } + } + return new NetworkProfile(Optional.ToList(networkInterfaces)); + } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/NetworkProfile.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/NetworkProfile.cs new file mode 100644 index 0000000000000..3b0a48132420e --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/NetworkProfile.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + /// Describes the network information on this machine. + public partial class NetworkProfile + { + /// Initializes a new instance of NetworkProfile. + internal NetworkProfile() + { + NetworkInterfaces = new ChangeTrackingList(); + } + + /// Initializes a new instance of NetworkProfile. + /// The list of network interfaces. + internal NetworkProfile(IReadOnlyList networkInterfaces) + { + NetworkInterfaces = networkInterfaces; + } + + /// The list of network interfaces. + public IReadOnlyList NetworkInterfaces { get; } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/OSType.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/OSType.cs new file mode 100644 index 0000000000000..6efc0fc00e42d --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/OSType.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.HybridCompute.Models +{ + /// The operating system type of the machine. + public readonly partial struct OSType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public OSType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string WindowsValue = "Windows"; + private const string LinuxValue = "Linux"; + + /// Windows. + public static OSType Windows { get; } = new OSType(WindowsValue); + /// Linux. + public static OSType Linux { get; } = new OSType(LinuxValue); + /// Determines if two values are the same. + public static bool operator ==(OSType left, OSType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(OSType left, OSType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator OSType(string value) => new OSType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is OSType other && Equals(other); + /// + public bool Equals(OSType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/PatchOperationStartedBy.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/PatchOperationStartedBy.cs new file mode 100644 index 0000000000000..f72d5a9de1e5b --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/PatchOperationStartedBy.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.HybridCompute.Models +{ + /// Indicates if operation was triggered by user or by platform. + public readonly partial struct PatchOperationStartedBy : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PatchOperationStartedBy(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UserValue = "User"; + private const string PlatformValue = "Platform"; + + /// User. + public static PatchOperationStartedBy User { get; } = new PatchOperationStartedBy(UserValue); + /// Platform. + public static PatchOperationStartedBy Platform { get; } = new PatchOperationStartedBy(PlatformValue); + /// Determines if two values are the same. + public static bool operator ==(PatchOperationStartedBy left, PatchOperationStartedBy right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PatchOperationStartedBy left, PatchOperationStartedBy right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator PatchOperationStartedBy(string value) => new PatchOperationStartedBy(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PatchOperationStartedBy other && Equals(other); + /// + public bool Equals(PatchOperationStartedBy other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/PatchOperationStatus.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/PatchOperationStatus.cs new file mode 100644 index 0000000000000..4a6465c0ae2c4 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/PatchOperationStatus.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + /// The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Unknown", "Failed", "Succeeded", or "CompletedWithWarnings.". + public readonly partial struct PatchOperationStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PatchOperationStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string InProgressValue = "InProgress"; + private const string FailedValue = "Failed"; + private const string SucceededValue = "Succeeded"; + private const string CompletedWithWarningsValue = "CompletedWithWarnings"; + + /// Unknown. + public static PatchOperationStatus Unknown { get; } = new PatchOperationStatus(UnknownValue); + /// InProgress. + public static PatchOperationStatus InProgress { get; } = new PatchOperationStatus(InProgressValue); + /// Failed. + public static PatchOperationStatus Failed { get; } = new PatchOperationStatus(FailedValue); + /// Succeeded. + public static PatchOperationStatus Succeeded { get; } = new PatchOperationStatus(SucceededValue); + /// CompletedWithWarnings. + public static PatchOperationStatus CompletedWithWarnings { get; } = new PatchOperationStatus(CompletedWithWarningsValue); + /// Determines if two values are the same. + public static bool operator ==(PatchOperationStatus left, PatchOperationStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PatchOperationStatus left, PatchOperationStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator PatchOperationStatus(string value) => new PatchOperationStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PatchOperationStatus other && Equals(other); + /// + public bool Equals(PatchOperationStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/PatchServiceUsed.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/PatchServiceUsed.cs new file mode 100644 index 0000000000000..f0ab0b7afddc2 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/PatchServiceUsed.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + /// Specifies the patch service used for the operation. + public readonly partial struct PatchServiceUsed : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PatchServiceUsed(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string WUValue = "WU"; + private const string WUWsusValue = "WU_WSUS"; + private const string YUMValue = "YUM"; + private const string APTValue = "APT"; + private const string ZypperValue = "Zypper"; + + /// Unknown. + public static PatchServiceUsed Unknown { get; } = new PatchServiceUsed(UnknownValue); + /// WU. + public static PatchServiceUsed WU { get; } = new PatchServiceUsed(WUValue); + /// WU_WSUS. + public static PatchServiceUsed WUWsus { get; } = new PatchServiceUsed(WUWsusValue); + /// YUM. + public static PatchServiceUsed YUM { get; } = new PatchServiceUsed(YUMValue); + /// APT. + public static PatchServiceUsed APT { get; } = new PatchServiceUsed(APTValue); + /// Zypper. + public static PatchServiceUsed Zypper { get; } = new PatchServiceUsed(ZypperValue); + /// Determines if two values are the same. + public static bool operator ==(PatchServiceUsed left, PatchServiceUsed right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PatchServiceUsed left, PatchServiceUsed right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator PatchServiceUsed(string value) => new PatchServiceUsed(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PatchServiceUsed other && Equals(other); + /// + public bool Equals(PatchServiceUsed other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/Subnet.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/Subnet.Serialization.cs new file mode 100644 index 0000000000000..09b0ee5fc5d7b --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/Subnet.Serialization.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + internal partial class Subnet + { + internal static Subnet DeserializeSubnet(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional addressPrefix = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("addressPrefix"u8)) + { + addressPrefix = property.Value.GetString(); + continue; + } + } + return new Subnet(addressPrefix.Value); + } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/Subnet.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/Subnet.cs new file mode 100644 index 0000000000000..d30b538a2ff98 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/Subnet.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.HybridCompute.Models +{ + /// Describes the subnet. + internal partial class Subnet + { + /// Initializes a new instance of Subnet. + internal Subnet() + { + } + + /// Initializes a new instance of Subnet. + /// Represents address prefix. + internal Subnet(string addressPrefix) + { + AddressPrefix = addressPrefix; + } + + /// Represents address prefix. + public string AddressPrefix { get; } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/VmGuestPatchClassificationLinux.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/VmGuestPatchClassificationLinux.cs new file mode 100644 index 0000000000000..9c9d1ee981490 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/VmGuestPatchClassificationLinux.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.HybridCompute.Models +{ + /// The VmGuestPatchClassificationLinux. + public readonly partial struct VmGuestPatchClassificationLinux : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public VmGuestPatchClassificationLinux(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CriticalValue = "Critical"; + private const string SecurityValue = "Security"; + private const string OtherValue = "Other"; + + /// Critical. + public static VmGuestPatchClassificationLinux Critical { get; } = new VmGuestPatchClassificationLinux(CriticalValue); + /// Security. + public static VmGuestPatchClassificationLinux Security { get; } = new VmGuestPatchClassificationLinux(SecurityValue); + /// Other. + public static VmGuestPatchClassificationLinux Other { get; } = new VmGuestPatchClassificationLinux(OtherValue); + /// Determines if two values are the same. + public static bool operator ==(VmGuestPatchClassificationLinux left, VmGuestPatchClassificationLinux right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(VmGuestPatchClassificationLinux left, VmGuestPatchClassificationLinux right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator VmGuestPatchClassificationLinux(string value) => new VmGuestPatchClassificationLinux(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is VmGuestPatchClassificationLinux other && Equals(other); + /// + public bool Equals(VmGuestPatchClassificationLinux other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/VmGuestPatchClassificationWindow.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/VmGuestPatchClassificationWindow.cs new file mode 100644 index 0000000000000..52fb32f2a71e8 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/VmGuestPatchClassificationWindow.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + /// The VmGuestPatchClassificationWindow. + public readonly partial struct VmGuestPatchClassificationWindow : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public VmGuestPatchClassificationWindow(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CriticalValue = "Critical"; + private const string SecurityValue = "Security"; + private const string UpdateRollUpValue = "UpdateRollUp"; + private const string FeaturePackValue = "FeaturePack"; + private const string ServicePackValue = "ServicePack"; + private const string DefinitionValue = "Definition"; + private const string ToolsValue = "Tools"; + private const string UpdatesValue = "Updates"; + + /// Critical. + public static VmGuestPatchClassificationWindow Critical { get; } = new VmGuestPatchClassificationWindow(CriticalValue); + /// Security. + public static VmGuestPatchClassificationWindow Security { get; } = new VmGuestPatchClassificationWindow(SecurityValue); + /// UpdateRollUp. + public static VmGuestPatchClassificationWindow UpdateRollUp { get; } = new VmGuestPatchClassificationWindow(UpdateRollUpValue); + /// FeaturePack. + public static VmGuestPatchClassificationWindow FeaturePack { get; } = new VmGuestPatchClassificationWindow(FeaturePackValue); + /// ServicePack. + public static VmGuestPatchClassificationWindow ServicePack { get; } = new VmGuestPatchClassificationWindow(ServicePackValue); + /// Definition. + public static VmGuestPatchClassificationWindow Definition { get; } = new VmGuestPatchClassificationWindow(DefinitionValue); + /// Tools. + public static VmGuestPatchClassificationWindow Tools { get; } = new VmGuestPatchClassificationWindow(ToolsValue); + /// Updates. + public static VmGuestPatchClassificationWindow Updates { get; } = new VmGuestPatchClassificationWindow(UpdatesValue); + /// Determines if two values are the same. + public static bool operator ==(VmGuestPatchClassificationWindow left, VmGuestPatchClassificationWindow right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(VmGuestPatchClassificationWindow left, VmGuestPatchClassificationWindow right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator VmGuestPatchClassificationWindow(string value) => new VmGuestPatchClassificationWindow(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is VmGuestPatchClassificationWindow other && Equals(other); + /// + public bool Equals(VmGuestPatchClassificationWindow other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/VmGuestPatchRebootSetting.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/VmGuestPatchRebootSetting.cs new file mode 100644 index 0000000000000..8905360d79c67 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/VmGuestPatchRebootSetting.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.HybridCompute.Models +{ + /// Defines when it is acceptable to reboot a VM during a software update operation. + public readonly partial struct VmGuestPatchRebootSetting : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public VmGuestPatchRebootSetting(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string IfRequiredValue = "IfRequired"; + private const string NeverValue = "Never"; + private const string AlwaysValue = "Always"; + + /// IfRequired. + public static VmGuestPatchRebootSetting IfRequired { get; } = new VmGuestPatchRebootSetting(IfRequiredValue); + /// Never. + public static VmGuestPatchRebootSetting Never { get; } = new VmGuestPatchRebootSetting(NeverValue); + /// Always. + public static VmGuestPatchRebootSetting Always { get; } = new VmGuestPatchRebootSetting(AlwaysValue); + /// Determines if two values are the same. + public static bool operator ==(VmGuestPatchRebootSetting left, VmGuestPatchRebootSetting right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(VmGuestPatchRebootSetting left, VmGuestPatchRebootSetting right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator VmGuestPatchRebootSetting(string value) => new VmGuestPatchRebootSetting(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is VmGuestPatchRebootSetting other && Equals(other); + /// + public bool Equals(VmGuestPatchRebootSetting other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/VmGuestPatchRebootStatus.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/VmGuestPatchRebootStatus.cs new file mode 100644 index 0000000000000..63aec80242dd3 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/VmGuestPatchRebootStatus.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + /// The reboot state of the VM following completion of the operation. + public readonly partial struct VmGuestPatchRebootStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public VmGuestPatchRebootStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string NotNeededValue = "NotNeeded"; + private const string RequiredValue = "Required"; + private const string StartedValue = "Started"; + private const string FailedValue = "Failed"; + private const string CompletedValue = "Completed"; + + /// Unknown. + public static VmGuestPatchRebootStatus Unknown { get; } = new VmGuestPatchRebootStatus(UnknownValue); + /// NotNeeded. + public static VmGuestPatchRebootStatus NotNeeded { get; } = new VmGuestPatchRebootStatus(NotNeededValue); + /// Required. + public static VmGuestPatchRebootStatus Required { get; } = new VmGuestPatchRebootStatus(RequiredValue); + /// Started. + public static VmGuestPatchRebootStatus Started { get; } = new VmGuestPatchRebootStatus(StartedValue); + /// Failed. + public static VmGuestPatchRebootStatus Failed { get; } = new VmGuestPatchRebootStatus(FailedValue); + /// Completed. + public static VmGuestPatchRebootStatus Completed { get; } = new VmGuestPatchRebootStatus(CompletedValue); + /// Determines if two values are the same. + public static bool operator ==(VmGuestPatchRebootStatus left, VmGuestPatchRebootStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(VmGuestPatchRebootStatus left, VmGuestPatchRebootStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator VmGuestPatchRebootStatus(string value) => new VmGuestPatchRebootStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is VmGuestPatchRebootStatus other && Equals(other); + /// + public bool Equals(VmGuestPatchRebootStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/WindowsParameters.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/WindowsParameters.Serialization.cs new file mode 100644 index 0000000000000..b1ae9f01b0cc3 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/WindowsParameters.Serialization.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + public partial class WindowsParameters : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(ClassificationsToInclude)) + { + writer.WritePropertyName("classificationsToInclude"u8); + writer.WriteStartArray(); + foreach (var item in ClassificationsToInclude) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(KbNumbersToInclude)) + { + writer.WritePropertyName("kbNumbersToInclude"u8); + writer.WriteStartArray(); + foreach (var item in KbNumbersToInclude) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(KbNumbersToExclude)) + { + writer.WritePropertyName("kbNumbersToExclude"u8); + writer.WriteStartArray(); + foreach (var item in KbNumbersToExclude) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(ExcludeKbsRequiringReboot)) + { + writer.WritePropertyName("excludeKbsRequiringReboot"u8); + writer.WriteBooleanValue(ExcludeKbsRequiringReboot.Value); + } + if (Optional.IsDefined(MaxPatchPublishOn)) + { + writer.WritePropertyName("maxPatchPublishDate"u8); + writer.WriteStringValue(MaxPatchPublishOn.Value, "O"); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/WindowsParameters.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/WindowsParameters.cs new file mode 100644 index 0000000000000..d8519e6423900 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/WindowsParameters.cs @@ -0,0 +1,36 @@ +// 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.HybridCompute.Models +{ + /// Input for InstallPatches on a Windows VM, as directly received by the API. + public partial class WindowsParameters + { + /// Initializes a new instance of WindowsParameters. + public WindowsParameters() + { + ClassificationsToInclude = new ChangeTrackingList(); + KbNumbersToInclude = new ChangeTrackingList(); + KbNumbersToExclude = new ChangeTrackingList(); + } + + /// The update classifications to select when installing patches for Windows. + public IList ClassificationsToInclude { get; } + /// Kbs to include in the patch operation. + public IList KbNumbersToInclude { get; } + /// Kbs to exclude in the patch operation. + public IList KbNumbersToExclude { get; } + /// Filters out Kbs that don't have an InstallationRebootBehavior of 'NeverReboots' when this is set to true. + public bool? ExcludeKbsRequiringReboot { get; set; } + /// This is used to install patches that were published on or before this given max published date. + public DateTimeOffset? MaxPatchPublishOn { get; set; } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/ExtensionMetadataRestOperations.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/ExtensionMetadataRestOperations.cs new file mode 100644 index 0000000000000..14c297f4642f5 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/ExtensionMetadataRestOperations.cs @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.HybridCompute.Models; + +namespace Azure.ResourceManager.HybridCompute +{ + internal partial class ExtensionMetadataRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ExtensionMetadataRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ExtensionMetadataRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2022-12-27"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateGetRequest(string subscriptionId, AzureLocation location, string publisher, string extensionType, string version) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.HybridCompute/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/publishers/", false); + uri.AppendPath(publisher, true); + uri.AppendPath("/extensionTypes/", false); + uri.AppendPath(extensionType, true); + uri.AppendPath("/versions/", false); + uri.AppendPath(version, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets an Extension Metadata based on location, publisher, extensionType and version. + /// The ID of the target subscription. + /// The location of the Extension being received. + /// The publisher of the Extension being received. + /// The extensionType of the Extension being received. + /// The version of the Extension being received. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, AzureLocation location, string publisher, string extensionType, string version, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(publisher, nameof(publisher)); + Argument.AssertNotNullOrEmpty(extensionType, nameof(extensionType)); + Argument.AssertNotNullOrEmpty(version, nameof(version)); + + using var message = CreateGetRequest(subscriptionId, location, publisher, extensionType, version); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ExtensionValueData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ExtensionValueData.DeserializeExtensionValueData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ExtensionValueData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets an Extension Metadata based on location, publisher, extensionType and version. + /// The ID of the target subscription. + /// The location of the Extension being received. + /// The publisher of the Extension being received. + /// The extensionType of the Extension being received. + /// The version of the Extension being received. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, AzureLocation location, string publisher, string extensionType, string version, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(publisher, nameof(publisher)); + Argument.AssertNotNullOrEmpty(extensionType, nameof(extensionType)); + Argument.AssertNotNullOrEmpty(version, nameof(version)); + + using var message = CreateGetRequest(subscriptionId, location, publisher, extensionType, version); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ExtensionValueData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ExtensionValueData.DeserializeExtensionValueData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ExtensionValueData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListRequest(string subscriptionId, AzureLocation location, string publisher, string extensionType) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.HybridCompute/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/publishers/", false); + uri.AppendPath(publisher, true); + uri.AppendPath("/extensionTypes/", false); + uri.AppendPath(extensionType, true); + uri.AppendPath("/versions", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets all Extension versions based on location, publisher, extensionType. + /// The ID of the target subscription. + /// The location of the Extension being received. + /// The publisher of the Extension being received. + /// The extensionType of the Extension being received. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, AzureLocation location, string publisher, string extensionType, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(publisher, nameof(publisher)); + Argument.AssertNotNullOrEmpty(extensionType, nameof(extensionType)); + + using var message = CreateListRequest(subscriptionId, location, publisher, extensionType); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ExtensionValueListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ExtensionValueListResult.DeserializeExtensionValueListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets all Extension versions based on location, publisher, extensionType. + /// The ID of the target subscription. + /// The location of the Extension being received. + /// The publisher of the Extension being received. + /// The extensionType of the Extension being received. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, AzureLocation location, string publisher, string extensionType, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(publisher, nameof(publisher)); + Argument.AssertNotNullOrEmpty(extensionType, nameof(extensionType)); + + using var message = CreateListRequest(subscriptionId, location, publisher, extensionType); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ExtensionValueListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ExtensionValueListResult.DeserializeExtensionValueListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/HybridComputeManagementRestOperations.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/HybridComputeManagementRestOperations.cs index 7462041fe54d4..c615e8a2a006c 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/HybridComputeManagementRestOperations.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/HybridComputeManagementRestOperations.cs @@ -32,7 +32,7 @@ public HybridComputeManagementRestOperations(HttpPipeline pipeline, string appli { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-05-10-preview"; + _apiVersion = apiVersion ?? "2022-12-27"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/MachineExtensionsRestOperations.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/MachineExtensionsRestOperations.cs index 6039ca77bbdd5..62ad44735ceb8 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/MachineExtensionsRestOperations.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/MachineExtensionsRestOperations.cs @@ -33,7 +33,7 @@ public MachineExtensionsRestOperations(HttpPipeline pipeline, string application { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-05-10-preview"; + _apiVersion = apiVersion ?? "2022-12-27"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/MachinesRestOperations.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/MachinesRestOperations.cs index 6b770e4671e4a..d1850afc7a75d 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/MachinesRestOperations.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/MachinesRestOperations.cs @@ -33,7 +33,7 @@ public MachinesRestOperations(HttpPipeline pipeline, string applicationId, Uri e { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-05-10-preview"; + _apiVersion = apiVersion ?? "2022-12-27"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -367,6 +367,156 @@ public Response Get(string subscriptionId, string reso } } + internal HttpMessage CreateAssessPatchesRequest(string subscriptionId, string resourceGroupName, string name) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.HybridCompute/machines/", false); + uri.AppendPath(name, true); + uri.AppendPath("/assessPatches", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// The operation to assess patches on a hybrid machine identity in Azure. + /// The ID of the target subscription. + /// The name of the resource group. + /// The name of the hybrid machine. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task AssessPatchesAsync(string subscriptionId, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var message = CreateAssessPatchesRequest(subscriptionId, resourceGroupName, name); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// The operation to assess patches on a hybrid machine identity in Azure. + /// The ID of the target subscription. + /// The name of the resource group. + /// The name of the hybrid machine. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response AssessPatches(string subscriptionId, string resourceGroupName, string name, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + + using var message = CreateAssessPatchesRequest(subscriptionId, resourceGroupName, name); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateInstallPatchesRequest(string subscriptionId, string resourceGroupName, string name, MachineInstallPatchesContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.HybridCompute/machines/", false); + uri.AppendPath(name, true); + uri.AppendPath("/installPatches", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content); + request.Content = content0; + _userAgent.Apply(message); + return message; + } + + /// The operation to install patches on a hybrid machine identity in Azure. + /// The ID of the target subscription. + /// The name of the resource group. + /// The name of the hybrid machine. + /// Input for InstallPatches as directly received by the API. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task InstallPatchesAsync(string subscriptionId, string resourceGroupName, string name, MachineInstallPatchesContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateInstallPatchesRequest(subscriptionId, resourceGroupName, name, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// The operation to install patches on a hybrid machine identity in Azure. + /// The ID of the target subscription. + /// The name of the resource group. + /// The name of the hybrid machine. + /// Input for InstallPatches as directly received by the API. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response InstallPatches(string subscriptionId, string resourceGroupName, string name, MachineInstallPatchesContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(name, nameof(name)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateInstallPatchesRequest(subscriptionId, resourceGroupName, name, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) { var message = _pipeline.CreateMessage(); diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/NetworkProfileRestOperations.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/NetworkProfileRestOperations.cs new file mode 100644 index 0000000000000..9cab776f4bab6 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/NetworkProfileRestOperations.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.HybridCompute.Models; + +namespace Azure.ResourceManager.HybridCompute +{ + internal partial class NetworkProfileRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of NetworkProfileRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public NetworkProfileRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2022-12-27"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string machineName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.HybridCompute/machines/", false); + uri.AppendPath(machineName, true); + uri.AppendPath("/networkProfile", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// The operation to get network information of hybrid machine. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the hybrid machine. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string machineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, machineName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + NetworkProfile value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = NetworkProfile.DeserializeNetworkProfile(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// The operation to get network information of hybrid machine. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the hybrid machine. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string machineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, machineName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + NetworkProfile value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = NetworkProfile.DeserializeNetworkProfile(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs index 620220a5e0f07..82cea9fcbae8f 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs @@ -33,7 +33,7 @@ public PrivateEndpointConnectionsRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-05-10-preview"; + _apiVersion = apiVersion ?? "2022-12-27"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs index 7d89ee1507074..80ad042234b65 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs @@ -33,7 +33,7 @@ public PrivateLinkResourcesRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-05-10-preview"; + _apiVersion = apiVersion ?? "2022-12-27"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/PrivateLinkScopesRestOperations.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/PrivateLinkScopesRestOperations.cs index c2686fcd05794..9c7fbae5bc294 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/PrivateLinkScopesRestOperations.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/PrivateLinkScopesRestOperations.cs @@ -33,7 +33,7 @@ public PrivateLinkScopesRestOperations(HttpPipeline pipeline, string application { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-05-10-preview"; + _apiVersion = apiVersion ?? "2022-12-27"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/autorest.md b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/autorest.md index 833e9f084c3b4..7a107462bd09e 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/autorest.md +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/autorest.md @@ -8,8 +8,8 @@ azure-arm: true csharp: true library-name: HybridCompute namespace: Azure.ResourceManager.HybridCompute -# default tag is a preview version -require: https://github.com/Azure/azure-rest-api-specs/blob/7d5d1db0c45d6fe0934c97b6a6f9bb34112d42d1/specification/hybridcompute/resource-manager/readme.md +require: https://github.com/Azure/azure-rest-api-specs/blob/a29126ca8200a6c981a4e908e41fe55730df4cad/specification/hybridcompute/resource-manager/readme.md +tag: package-2022-12 output-folder: $(this-folder)/Generated clear-output-folder: true sample-gen: @@ -18,6 +18,8 @@ sample-gen: skip-csproj: true modelerfour: flatten-payloads: false + # Mitigate the duplication schema named 'ErrorDetail' + lenient-model-deduplication: true prepend-rp-prefix: - Location @@ -64,4 +66,45 @@ acronym-mapping: models-to-treat-empty-string-as-null: - AgentConfiguration +directive: + - from: HybridCompute.json + where: $.definitions.MachineInstallPatchesParameters.properties.maximumDuration + transform: $['format'] = 'duration' + + - from: HybridCompute.json + where: $.definitions.MachineUpdateProperties.properties.privateLinkScopeResourceId + transform: $['format'] = 'arm-id' + + - from: HybridCompute.json + where: $.definitions.MachineProperties.properties.privateLinkScopeResourceId + transform: $['format'] = 'arm-id' + + - from: HybridCompute.json + where: $.definitions.AgentUpgrade.properties.correlationId + transform: $['format'] = 'uuid' + + - from: HybridCompute.json + where: $.definitions.AgentUpgrade.properties.lastAttemptTimestamp + transform: $['format'] = 'date-time' + + - from: HybridCompute.json + where: $.definitions.MachineProperties.properties.vmUuid + transform: $['format'] = 'uuid' + + - from: HybridCompute.json + where: $.definitions.MachineProperties.properties.vmId + transform: $['format'] = 'uuid' + + - from: HybridCompute.json + where: $.definitions.MachineUpdateProperties.properties.parentClusterResourceId + transform: $['format'] = 'arm-id' + + - from: HybridCompute.json + where: $.definitions.MachineProperties.properties.parentClusterResourceId + transform: $['format'] = 'arm-id' + + - from: HybridCompute.json + where: $.definitions.MachineAssessPatchesResult.properties.assessmentActivityId + transform: $['format'] = 'uuid' + ``` diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/HybridComputeManagementTestBase.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/HybridComputeManagementTestBase.cs index a31cfaee23884..48ca1cbcceb0e 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/HybridComputeManagementTestBase.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/HybridComputeManagementTestBase.cs @@ -7,12 +7,30 @@ using Azure.ResourceManager.TestFramework; using NUnit.Framework; using System.Threading.Tasks; +using System; +using Azure.Identity; +using Azure.ResourceManager.HybridCompute.Models; +using Azure.ResourceManager.Models; +using System.Collections.Generic; +using System.Xml; namespace Azure.ResourceManager.HybridCompute.Tests { public class HybridComputeManagementTestBase : ManagementRecordedTestBase { - protected ArmClient Client { get; private set; } + public ArmClient ArmClient { get; private set; } + public ResourceIdentifier resourceGroupResourceId { get; set; } + public ResourceGroupResource resourceGroupResource { get; set; } + public HybridComputeMachineCollection collection { get; set; } + public SubscriptionResource Subscription { get; set; } + public HybridComputePrivateLinkScopeCollection scopeCollection { get; set; } + public string subscriptionId = "e6fe6705-4c9c-4b54-81d2-e455780e20b8"; + public string resourceGroupName = "az-sdk-test"; + public string scopeName = "myPrivateLinkScope"; + public string machineName = "testmachine"; + public string extensionName = "CustomScriptExtension"; + // need to run private-endpoint-connection list and obtain from the 'name' property + public string privateEndpointConnectionName = "pe-test.2a976c30-2ae8-48a4-9f25-d13236dfe849"; protected HybridComputeManagementTestBase(bool isAsync, RecordedTestMode mode) : base(isAsync, mode) @@ -27,15 +45,311 @@ protected HybridComputeManagementTestBase(bool isAsync) [SetUp] public void CreateCommonClient() { - Client = GetArmClient(); + ArmClient = GetArmClient(); } - protected async Task CreateResourceGroup(SubscriptionResource subscription, string rgNamePrefix, AzureLocation location) + protected async Task InitializeClients() { - string rgName = Recording.GenerateAssetName(rgNamePrefix); - ResourceGroupData input = new ResourceGroupData(location); - var lro = await subscription.GetResourceGroups().CreateOrUpdateAsync(WaitUntil.Completed, rgName, input); + Subscription = await ArmClient.GetDefaultSubscriptionAsync(); + resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + resourceGroupResource = ArmClient.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this HybridComputeMachineResource + collection = resourceGroupResource.GetHybridComputeMachines(); + } + + protected async Task getMachineCollection() + { + // invoke the operation and iterate over the result + await foreach (HybridComputeMachineResource item in collection.GetAllAsync()) + { + HybridComputeMachineData resourceData = item.Data; + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + return collection; + } + + protected async Task getMachine() + { + HybridComputeMachineResource result = await collection.GetAsync(machineName); + return result.Data; + } + + protected async Task updateMachine() + { + HybridComputeMachineData data = new HybridComputeMachineData(new AzureLocation("eastus2euap")) + { + Identity = new ManagedServiceIdentity("SystemAssigned"), + LocationData = new LocationData("Redmond"), + VmId = new Guid("b7a098cc-b0b8-46e8-a205-62f301a62a8f"), + ClientPublicKey = "string", + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, machineName, data); + HybridComputeMachineResource result = lro.Value; + + return result.Data; + } + + protected async Task installPatch() + { + HybridComputeMachineResource hybridComputeMachine = await collection.GetAsync(machineName); + + MachineInstallPatchesContent content = new MachineInstallPatchesContent(XmlConvert.ToTimeSpan("PT4H"), VmGuestPatchRebootSetting.IfRequired) + { + WindowsParameters = new WindowsParameters() + { + ClassificationsToInclude = { + VmGuestPatchClassificationWindow.Critical,VmGuestPatchClassificationWindow.Security + }, + // The maximum published date for patches must be a DateTime value between last patch Tuesday and a week from today + MaxPatchPublishOn = DateTimeOffset.Parse("2023-10-13T02:36:43.0539904+00:00"), + }, + }; + ArmOperation lro = await hybridComputeMachine.InstallPatchesAsync(WaitUntil.Completed, content); + + return lro.Value; + } + + protected async Task assessPatch() + { + HybridComputeMachineResource hybridComputeMachine = await collection.GetAsync(machineName); + + // invoke the operation + ArmOperation lro = await hybridComputeMachine.AssessPatchesAsync(WaitUntil.Completed); + return lro.Value; } + + protected async Task createMachineExtension() + { + System.Text.UTF8Encoding encoding=new System.Text.UTF8Encoding(); + HybridComputeMachineResource hybridComputeMachine = await collection.GetAsync(machineName); + HybridComputeMachineExtensionCollection extensionCollection = hybridComputeMachine.GetHybridComputeMachineExtensions(); + + HybridComputeMachineExtensionData data = new HybridComputeMachineExtensionData(new AzureLocation("eastus2euap")) + { + Publisher = "Microsoft.Compute", + TypePropertiesType = "CustomScriptExtension", + TypeHandlerVersion = "1.10", + Settings = + { + ["commandToExecute"] = new BinaryData("\"hostname\""), + }, + }; + ArmOperation lro = await extensionCollection.CreateOrUpdateAsync(WaitUntil.Completed, extensionName, data); + HybridComputeMachineExtensionResource result = lro.Value; + + return result.Data; + } + + protected async Task updateMachineExtension() + { + ResourceIdentifier hybridComputeMachineExtensionResourceId = HybridComputeMachineExtensionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, machineName, extensionName); + HybridComputeMachineExtensionResource hybridComputeMachineExtension = ArmClient.GetHybridComputeMachineExtensionResource(hybridComputeMachineExtensionResourceId); + + HybridComputeMachineExtensionPatch patch = new HybridComputeMachineExtensionPatch() + { + Publisher = "Microsoft.Compute", + MachineExtensionUpdatePropertiesType = "CustomScriptExtension", + TypeHandlerVersion = "1.10", + EnableAutomaticUpgrade = true, + Settings = + { + ["commandToExecute"] = new BinaryData("\"hostname\""), + }, + }; + ArmOperation lro = await hybridComputeMachineExtension.UpdateAsync(WaitUntil.Completed, patch); + HybridComputeMachineExtensionResource result = lro.Value; + + return result.Data; + } + + protected async Task getMachineExtension() + { + HybridComputeMachineResource hybridComputeMachine = await collection.GetAsync(machineName); + HybridComputeMachineExtensionCollection extensionCollection = hybridComputeMachine.GetHybridComputeMachineExtensions(); + + HybridComputeMachineExtensionResource result = await extensionCollection.GetAsync(extensionName); + + return result.Data; + } + + protected async Task getMachineExtensionCollection() + { + HybridComputeMachineResource hybridComputeMachine = await collection.GetAsync(machineName); + HybridComputeMachineExtensionCollection extensionCollection = hybridComputeMachine.GetHybridComputeMachineExtensions(); + + await foreach (HybridComputeMachineExtensionResource item in extensionCollection.GetAllAsync()) + { + HybridComputeMachineExtensionData resourceData = item.Data; + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + return extensionCollection; + } + + protected async Task createPrivateLinkScope() + { + HybridComputePrivateLinkScopeCollection scopeCollection = resourceGroupResource.GetHybridComputePrivateLinkScopes(); + + HybridComputePrivateLinkScopeData data = new HybridComputePrivateLinkScopeData(new AzureLocation("eastus2euap")) + { + Properties = new HybridComputePrivateLinkScopeProperties() + { + PublicNetworkAccess = "Disabled", + }, + }; + + ArmOperation lro = await scopeCollection.CreateOrUpdateAsync(WaitUntil.Completed, scopeName, data); + HybridComputePrivateLinkScopeResource result = lro.Value; + + return result.Data; + } + + protected async Task updatePrivateLinkScope() + { + ResourceIdentifier hybridComputePrivateLinkScopeResourceId = HybridComputePrivateLinkScopeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, scopeName); + HybridComputePrivateLinkScopeResource hybridComputePrivateLinkScope = ArmClient.GetHybridComputePrivateLinkScopeResource(hybridComputePrivateLinkScopeResourceId); + + // invoke the operation + HybridComputePrivateLinkScopePatch patch = new HybridComputePrivateLinkScopePatch() + { + Tags = + { + ["Tag1"] = "Value1", + ["Tag2"] = "Value2", + }, + }; + HybridComputePrivateLinkScopeResource result = await hybridComputePrivateLinkScope.UpdateAsync(patch); + return result.Data; + } + + protected async Task getPrivateLinkScope() + { + scopeCollection = resourceGroupResource.GetHybridComputePrivateLinkScopes(); + HybridComputePrivateLinkScopeResource result = await scopeCollection.GetAsync(scopeName); + + return result.Data; + } + + protected async Task getPrivateLinkScopeCollection() + { + scopeCollection = resourceGroupResource.GetHybridComputePrivateLinkScopes(); + + await foreach (HybridComputePrivateLinkScopeResource item in scopeCollection.GetAllAsync()) + { + HybridComputePrivateLinkScopeData resourceData = item.Data; + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + return scopeCollection; + } + + protected async Task getPrivateLinkResource() + { + ResourceIdentifier hybridComputePrivateLinkScopeResourceId = HybridComputePrivateLinkScopeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, scopeName); + HybridComputePrivateLinkScopeResource hybridComputePrivateLinkScope = ArmClient.GetHybridComputePrivateLinkScopeResource(hybridComputePrivateLinkScopeResourceId); + + HybridComputePrivateLinkResourceCollection collection = hybridComputePrivateLinkScope.GetHybridComputePrivateLinkResources(); + + string groupName = "hybridcompute"; + HybridComputePrivateLinkResource result = await collection.GetAsync(groupName); + + return result.Data; + } + + protected async Task getPrivateLinkResourceCollection() + { + ResourceIdentifier hybridComputePrivateLinkScopeResourceId = HybridComputePrivateLinkScopeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, scopeName); + HybridComputePrivateLinkScopeResource hybridComputePrivateLinkScope = ArmClient.GetHybridComputePrivateLinkScopeResource(hybridComputePrivateLinkScopeResourceId); + + HybridComputePrivateLinkResourceCollection privateLinkResourcecollection = hybridComputePrivateLinkScope.GetHybridComputePrivateLinkResources(); + + await foreach (HybridComputePrivateLinkResource item in privateLinkResourcecollection.GetAllAsync()) + { + HybridComputePrivateLinkResourceData resourceData = item.Data; + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + return privateLinkResourcecollection; + } + + protected async Task updatePrivateEndpointConnection() + { + ResourceIdentifier hybridComputePrivateEndpointConnectionResourceId = HybridComputePrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, scopeName, privateEndpointConnectionName); + HybridComputePrivateEndpointConnectionResource hybridComputePrivateEndpointConnection = ArmClient.GetHybridComputePrivateEndpointConnectionResource(hybridComputePrivateEndpointConnectionResourceId); + + HybridComputePrivateEndpointConnectionData data = new HybridComputePrivateEndpointConnectionData() + { + Properties = new PrivateEndpointConnectionProperties() + { + ConnectionState = new HybridComputePrivateLinkServiceConnectionStateProperty("Approved", "Approved by johndoe@contoso.com"), + }, + }; + ArmOperation lro = await hybridComputePrivateEndpointConnection.UpdateAsync(WaitUntil.Completed, data); + HybridComputePrivateEndpointConnectionResource result = lro.Value; + + return result.Data; + } + + protected async Task getPrivateEndpointConnection() + { + ResourceIdentifier hybridComputePrivateLinkScopeResourceId = HybridComputePrivateLinkScopeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, scopeName); + HybridComputePrivateLinkScopeResource hybridComputePrivateLinkScope = ArmClient.GetHybridComputePrivateLinkScopeResource(hybridComputePrivateLinkScopeResourceId); + + HybridComputePrivateEndpointConnectionCollection connectionCollection = hybridComputePrivateLinkScope.GetHybridComputePrivateEndpointConnections(); + HybridComputePrivateEndpointConnectionResource result = await connectionCollection.GetAsync(privateEndpointConnectionName); + + return result.Data; + } + + protected async Task getPrivateEndpointConnectionCollection() + { + ResourceIdentifier hybridComputePrivateLinkScopeResourceId = HybridComputePrivateLinkScopeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, scopeName); + HybridComputePrivateLinkScopeResource hybridComputePrivateLinkScope = ArmClient.GetHybridComputePrivateLinkScopeResource(hybridComputePrivateLinkScopeResourceId); + + HybridComputePrivateEndpointConnectionCollection connectionCollection = hybridComputePrivateLinkScope.GetHybridComputePrivateEndpointConnections(); + + await foreach (HybridComputePrivateEndpointConnectionResource item in connectionCollection.GetAllAsync()) + { + HybridComputePrivateEndpointConnectionData resourceData = item.Data; + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + return connectionCollection; + } + + protected async Task deletePrivateLinkScope() + { + ResourceIdentifier hybridComputePrivateLinkScopeResourceId = HybridComputePrivateLinkScopeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, scopeName); + HybridComputePrivateLinkScopeResource hybridComputePrivateLinkScope = ArmClient.GetHybridComputePrivateLinkScopeResource(hybridComputePrivateLinkScopeResourceId); + + await hybridComputePrivateLinkScope.DeleteAsync(WaitUntil.Completed); + } + + protected async Task deletePrivateEndpointConnection() + { + ResourceIdentifier hybridComputePrivateEndpointConnectionResourceId = HybridComputePrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, scopeName, privateEndpointConnectionName); + HybridComputePrivateEndpointConnectionResource hybridComputePrivateEndpointConnection = ArmClient.GetHybridComputePrivateEndpointConnectionResource(hybridComputePrivateEndpointConnectionResourceId); + + await hybridComputePrivateEndpointConnection.DeleteAsync(WaitUntil.Completed); + } + + protected async Task deleteMachineExtension() + { + HybridComputeMachineResource hybridComputeMachine = await collection.GetAsync(machineName); + HybridComputeMachineExtensionCollection extensionCollection = hybridComputeMachine.GetHybridComputeMachineExtensions(); + + HybridComputeMachineExtensionResource result = await extensionCollection.GetAsync(extensionName); + + await result.DeleteAsync(WaitUntil.Completed); + Console.WriteLine($"Delete Machine Extension Succeeded"); + } + protected async Task deleteMachine() + { + HybridComputeMachineResource hybridComputeMachine = await collection.GetAsync(machineName); + await hybridComputeMachine.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Delete Machine Succeeded"); + } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/Scenario/HybridComputeManagementMachineExtensionTest.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/Scenario/HybridComputeManagementMachineExtensionTest.cs new file mode 100644 index 0000000000000..55586f51ec503 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/Scenario/HybridComputeManagementMachineExtensionTest.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Threading.Tasks; +using Azure.Core.TestFramework; +using Azure.ResourceManager.HybridCompute; +using NUnit.Framework; +using Azure.Core; +using Azure.ResourceManager.HybridCompute.Models; +using System.Diagnostics; + +namespace Azure.ResourceManager.HybridCompute.Tests.Scenario +{ + public class HybridComputeManagementMachineExtensionTest : HybridComputeManagementTestBase + { + public HybridComputeManagementMachineExtensionTest(bool isAsync) : base(isAsync) + { + } + + [SetUp] + public async Task ClearAndInitialize() + { + if (Mode == RecordedTestMode.Record || Mode == RecordedTestMode.Playback) + { + await InitializeClients(); + } + } + + [TestCase] + [RecordedTest] + public async Task CanCreateMachineExtension() + { + HybridComputeMachineExtensionData resourceData = await createMachineExtension(); + Assert.AreEqual(extensionName, resourceData.Name); + } + + [TestCase] + [RecordedTest] + public async Task CanUpdateMachineExtension() + { + HybridComputeMachineExtensionData resourceData = await createMachineExtension(); + Assert.AreEqual(extensionName, resourceData.Name); + } + + [TestCase] + [RecordedTest] + public async Task CanGetMachineExtension() + { + HybridComputeMachineExtensionData resourceData = await getMachineExtension(); + Assert.AreEqual(extensionName, resourceData.Name); + } + + [TestCase] + [RecordedTest] + public async Task CanGetMachineExtensionCollection() + { + HybridComputeMachineExtensionCollection resourceCollection = await getMachineExtensionCollection(); + string collectionId = "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName + "/providers/Microsoft.HybridCompute/machines/" + machineName; + Assert.AreEqual(collectionId, resourceCollection.Id.ToString()); + } + + [TestCase] + [RecordedTest] + public async Task CanCreatePrivateLinkScope() + { + HybridComputePrivateLinkScopeData resourceData = await createPrivateLinkScope(); + Assert.AreEqual(scopeName, resourceData.Name); + } + + [TestCase] + [RecordedTest] + public async Task CanUpdatePrivateLinkScope() + { + HybridComputePrivateLinkScopeData resourceData = await updatePrivateLinkScope(); + Assert.AreEqual(scopeName, resourceData.Name); + } + + [TestCase] + [RecordedTest] + public async Task CanGetPrivateLinkScope() + { + HybridComputePrivateLinkScopeData resourceData = await getPrivateLinkScope(); + Assert.AreEqual(scopeName, resourceData.Name); + } + + [TestCase] + [RecordedTest] + public async Task CanGetPrivateLinkScopeCollection() + { + HybridComputePrivateLinkScopeCollection resourceCollection = await getPrivateLinkScopeCollection(); + string collectionId = "/subscriptions/" + subscriptionId + "/resourcegroups/" + resourceGroupName; + Assert.AreEqual(collectionId, resourceCollection.Id.ToString()); + } + + [TestCase] + [RecordedTest] + public async Task CanGetPrivateLinkResource() + { + HybridComputePrivateLinkResourceData resourceData = await getPrivateLinkResource(); + Assert.AreEqual("hybridcompute", resourceData.Name); + } + + [TestCase] + [RecordedTest] + public async Task CanGetPrivateLinkResourceCollection() + { + HybridComputePrivateLinkResourceCollection resourceCollection = await getPrivateLinkResourceCollection(); + string collectionId = "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName + "/providers/Microsoft.HybridCompute/privateLinkScopes/" + scopeName; + Assert.AreEqual(collectionId, resourceCollection.Id.ToString()); + } + + [TestCase] + [RecordedTest] + public async Task CanUpdatePrivateEndpointConnection() + { + HybridComputePrivateEndpointConnectionData endpointData = await updatePrivateEndpointConnection(); + Assert.AreEqual(privateEndpointConnectionName, endpointData.Name); + } + + [TestCase] + [RecordedTest] + public async Task CanGetPrivateEndpointConnection() + { + HybridComputePrivateEndpointConnectionData endpointData = await getPrivateEndpointConnection(); + Assert.NotNull(endpointData.Name); + } + + [TestCase] + [RecordedTest] + public async Task CanGetPrivateEndpointConnectionCollection() + { + HybridComputePrivateEndpointConnectionCollection resourceCollection = await getPrivateEndpointConnectionCollection(); + string collectionId = "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName + "/providers/Microsoft.HybridCompute/privateLinkScopes/" + scopeName; + Assert.AreEqual(collectionId, resourceCollection.Id.ToString()); + } + + [TestCase] + [RecordedTest] + public async Task CanDeletePrivateEndpointConnection(){ + await deletePrivateEndpointConnection(); + } + + [TestCase] + [RecordedTest] + public async Task CanDeletePrivateLinkScope(){ + await deletePrivateLinkScope(); + } + + [TestCase] + [RecordedTest] + public async Task CanDeleteMachineExtension(){ + await deleteMachineExtension(); + } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/Scenario/HybridComputeManagementMachineTest.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/Scenario/HybridComputeManagementMachineTest.cs new file mode 100644 index 0000000000000..e78a794ec6175 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/Scenario/HybridComputeManagementMachineTest.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Threading.Tasks; +using Azure.Core.TestFramework; +using Azure.ResourceManager.HybridCompute; +using NUnit.Framework; +using Azure.Core; +using Azure.ResourceManager.HybridCompute.Models; +using System.Diagnostics; + +namespace Azure.ResourceManager.HybridCompute.Tests.Scenario +{ + public class HybridComputeManagementMachineTest : HybridComputeManagementTestBase + { + public HybridComputeManagementMachineTest(bool isAsync) : base(isAsync) + { + } + + [SetUp] + public async Task ClearAndInitialize() + { + if (Mode == RecordedTestMode.Record || Mode == RecordedTestMode.Playback) + { + await InitializeClients(); + } + } + + [TestCase] + [RecordedTest] + public async Task CanGetMachine() + { + HybridComputeMachineData resourceData = await getMachine(); + + Debug.WriteLine($"Succeeded on id: {resourceData.Id}"); + Debug.WriteLine($"Succeeded on name: {resourceData.Name}"); + Assert.AreEqual(machineName, resourceData.Name); + } + + [TestCase] + [RecordedTest] + public async Task CanGetMachineCollection() + { + HybridComputeMachineCollection resourceCollection = await getMachineCollection(); + + Debug.WriteLine($"Succeeded on id: {resourceCollection.Id}"); + string collectionId = "/subscriptions/" + subscriptionId + "/resourcegroups/" + resourceGroupName; + Assert.AreEqual(collectionId, resourceCollection.Id.ToString()); + } + + [TestCase] + [RecordedTest] + public async Task CanUpdateMachine() + { + HybridComputeMachineData resourceData = await updateMachine(); + + Debug.WriteLine($"Succeeded on id: {resourceData.Id}"); + Assert.AreEqual(machineName, resourceData.Name.ToString()); + } + + [TestCase] + [RecordedTest] + public async Task CanInstallPatch(){ + MachineInstallPatchesResult resourceData = await installPatch(); + + Assert.NotNull(resourceData.Status.ToString()); + } + + [TestCase] + [RecordedTest] + public async Task CanAssessPatch(){ + MachineAssessPatchesResult resourceData = await assessPatch(); + + Assert.AreEqual("Succeeded", resourceData.Status.ToString()); + } + + [TestCase] + [RecordedTest] + public async Task CanDeleteMachine(){ + await deleteMachine(); + } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/azure/az.json b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/azure/az.json new file mode 100644 index 0000000000000..22fdca1b2686f --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/azure/az.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/azure/az.sess b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/azure/az.sess new file mode 100644 index 0000000000000..22fdca1b2686f --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/azure/az.sess @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/azure/az_survey.json b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/azure/az_survey.json new file mode 100644 index 0000000000000..3a52a7e06800b --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/azure/az_survey.json @@ -0,0 +1 @@ +{"last_prompt_time": "", "next_prompt_time": "2023-11-22T00:15:55"} \ No newline at end of file diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/azure/azureProfile.json b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/azure/azureProfile.json new file mode 100644 index 0000000000000..392c00604aee4 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/azure/azureProfile.json @@ -0,0 +1 @@ +{"subscriptions": [{"id": "e6fe6705-4c9c-4b54-81d2-e455780e20b8", "name": "HRP-UX-TestAutomation", "state": "Enabled", "user": {"name": "e12b4a0a-e8ef-432a-aec8-b891f38c17a2", "type": "servicePrincipal"}, "isDefault": true, "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", "environmentName": "AzureCloud", "homeTenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47", "managedByTenants": []}], "installationId": "8305f20d-6894-11ee-9fa5-7c70db1b2c26"} \ No newline at end of file diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/azure/clouds.config b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/azure/clouds.config new file mode 100644 index 0000000000000..ed9f2e4284ccd --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/azure/clouds.config @@ -0,0 +1,3 @@ +[AzureCloud] +subscription = e6fe6705-4c9c-4b54-81d2-e455780e20b8 + diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/azure/commandIndex.json b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/azure/commandIndex.json new file mode 100644 index 0000000000000..c785af1d2ef06 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/azure/commandIndex.json @@ -0,0 +1 @@ +{"version": "2.52.0", "cloudProfile": "latest", "commandIndex": {"acr": ["azure.cli.command_modules.acr"], "aks": ["azure.cli.command_modules.acs"], "advisor": ["azure.cli.command_modules.advisor"], "ams": ["azure.cli.command_modules.ams"], "apim": ["azure.cli.command_modules.apim"], "appconfig": ["azure.cli.command_modules.appconfig"], "webapp": ["azure.cli.command_modules.appservice", "azure.cli.command_modules.serviceconnector"], "functionapp": ["azure.cli.command_modules.appservice", "azure.cli.command_modules.serviceconnector"], "appservice": ["azure.cli.command_modules.appservice"], "staticwebapp": ["azure.cli.command_modules.appservice"], "logicapp": ["azure.cli.command_modules.appservice"], "aro": ["azure.cli.command_modules.aro"], "backup": ["azure.cli.command_modules.backup"], "batch": ["azure.cli.command_modules.batch"], "batchai": ["azure.cli.command_modules.batchai"], "billing": ["azure.cli.command_modules.billing"], "bot": ["azure.cli.command_modules.botservice"], "cdn": ["azure.cli.command_modules.cdn"], "afd": ["azure.cli.command_modules.cdn"], "cloud": ["azure.cli.command_modules.cloud"], "cognitiveservices": ["azure.cli.command_modules.cognitiveservices"], "config": ["azure.cli.command_modules.config"], "configure": ["azure.cli.command_modules.configure"], "cache": ["azure.cli.command_modules.configure"], "consumption": ["azure.cli.command_modules.consumption"], "container": ["azure.cli.command_modules.container"], "cosmosdb": ["azure.cli.command_modules.cosmosdb"], "managed-cassandra": ["azure.cli.command_modules.cosmosdb"], "databoxedge": ["azure.cli.command_modules.databoxedge"], "dla": ["azure.cli.command_modules.dla"], "dls": ["azure.cli.command_modules.dls"], "dms": ["azure.cli.command_modules.dms"], "eventgrid": ["azure.cli.command_modules.eventgrid"], "eventhubs": ["azure.cli.command_modules.eventhubs"], "extension": ["azure.cli.command_modules.extension"], "feedback": ["azure.cli.command_modules.feedback"], "survey": ["azure.cli.command_modules.feedback"], "find": ["azure.cli.command_modules.find"], "hdinsight": ["azure.cli.command_modules.hdinsight"], "identity": ["azure.cli.command_modules.identity"], "interactive": ["azure.cli.command_modules.interactive"], "iot": ["azure.cli.command_modules.iot"], "keyvault": ["azure.cli.command_modules.keyvault"], "kusto": ["azure.cli.command_modules.kusto"], "lab": ["azure.cli.command_modules.lab"], "managedservices": ["azure.cli.command_modules.managedservices"], "maps": ["azure.cli.command_modules.maps"], "term": ["azure.cli.command_modules.marketplaceordering"], "monitor": ["azure.cli.command_modules.monitor"], "mysql": ["azure.cli.command_modules.mysql", "azure.cli.command_modules.rdbms"], "netappfiles": ["azure.cli.command_modules.netappfiles"], "network": ["azure.cli.command_modules.network", "azure.cli.command_modules.privatedns"], "policy": ["azure.cli.command_modules.policyinsights", "azure.cli.command_modules.resource"], "login": ["azure.cli.command_modules.profile"], "logout": ["azure.cli.command_modules.profile"], "self-test": ["azure.cli.command_modules.profile"], "account": ["azure.cli.command_modules.profile", "azure.cli.command_modules.resource"], "mariadb": ["azure.cli.command_modules.rdbms"], "postgres": ["azure.cli.command_modules.rdbms"], "redis": ["azure.cli.command_modules.redis"], "relay": ["azure.cli.command_modules.relay"], "group": ["azure.cli.command_modules.resource"], "resource": ["azure.cli.command_modules.resource"], "provider": ["azure.cli.command_modules.resource"], "feature": ["azure.cli.command_modules.resource"], "tag": ["azure.cli.command_modules.resource"], "deployment": ["azure.cli.command_modules.resource"], "deployment-scripts": ["azure.cli.command_modules.resource"], "ts": ["azure.cli.command_modules.resource"], "stack": ["azure.cli.command_modules.resource"], "lock": ["azure.cli.command_modules.resource"], "managedapp": ["azure.cli.command_modules.resource"], "bicep": ["azure.cli.command_modules.resource"], "resourcemanagement": ["azure.cli.command_modules.resource"], "private-link": ["azure.cli.command_modules.resource"], "role": ["azure.cli.command_modules.role"], "ad": ["azure.cli.command_modules.role"], "search": ["azure.cli.command_modules.search"], "security": ["azure.cli.command_modules.security"], "servicebus": ["azure.cli.command_modules.servicebus"], "connection": ["azure.cli.command_modules.serviceconnector"], "sf": ["azure.cli.command_modules.servicefabric"], "signalr": ["azure.cli.command_modules.signalr"], "sql": ["azure.cli.command_modules.sql", "azure.cli.command_modules.sqlvm"], "storage": ["azure.cli.command_modules.storage"], "synapse": ["azure.cli.command_modules.synapse"], "rest": ["azure.cli.command_modules.util"], "version": ["azure.cli.command_modules.util"], "upgrade": ["azure.cli.command_modules.util"], "demo": ["azure.cli.command_modules.util"], "capacity": ["azure.cli.command_modules.vm"], "disk": ["azure.cli.command_modules.vm"], "disk-access": ["azure.cli.command_modules.vm"], "disk-encryption-set": ["azure.cli.command_modules.vm"], "image": ["azure.cli.command_modules.vm"], "ppg": ["azure.cli.command_modules.vm"], "restore-point": ["azure.cli.command_modules.vm"], "sig": ["azure.cli.command_modules.vm"], "snapshot": ["azure.cli.command_modules.vm"], "vm": ["azure.cli.command_modules.vm"], "vmss": ["azure.cli.command_modules.vm"], "sshkey": ["azure.cli.command_modules.vm"]}} \ No newline at end of file diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/azure/config b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/azure/config new file mode 100644 index 0000000000000..0ed7f34d6cb2b --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/azure/config @@ -0,0 +1,3 @@ +[cloud] +name = AzureCloud + diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/azure/msal_http_cache.bin b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/azure/msal_http_cache.bin new file mode 100644 index 0000000000000..f2a6947ece3bf Binary files /dev/null and b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/azure/msal_http_cache.bin differ diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/azure/msal_token_cache.bin b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/azure/msal_token_cache.bin new file mode 100644 index 0000000000000..8f3876ee9859d Binary files /dev/null and b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/azure/msal_token_cache.bin differ diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/azure/service_principal_entries.bin b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/azure/service_principal_entries.bin new file mode 100644 index 0000000000000..b6e7a48d13402 Binary files /dev/null and b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/azure/service_principal_entries.bin differ diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/azure/telemetry.txt b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/azure/telemetry.txt new file mode 100644 index 0000000000000..c51c7caa9a3e3 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/azure/telemetry.txt @@ -0,0 +1 @@ +2023-10-11T17:15:55 \ No newline at end of file diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/azure/versionCheck.json b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/azure/versionCheck.json new file mode 100644 index 0000000000000..9dc0feedc2f0e --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/azure/versionCheck.json @@ -0,0 +1 @@ +{"versions": {"azure-cli": {"local": "2.52.0", "pypi": "2.53.0"}, "core": {"local": "2.52.0", "pypi": "2.53.0"}, "telemetry": {"local": "1.1.0", "pypi": "1.1.0"}}, "update_time": "2023-10-11 17:15:53.204243"} \ No newline at end of file